Attempt to deal with serial losing sync in DIY handling
authorjweigele <jweigele@local>
Fri, 16 Dec 2022 07:15:31 +0000 (23:15 -0800)
committerjweigele <jweigele@local>
Fri, 16 Dec 2022 07:15:31 +0000 (23:15 -0800)
commit84c02953a03eb77231feaea142dddbb7e5576567
treeb570a8aca7684e6a11d1193d737be02923ceaf02
parent8fd5fa10b398784f4790f1175bfe48d0e36c4f94
Attempt to deal with serial losing sync in DIY handling

 * Every so often the zigbee messages from a pico will drop a letter
 * My GUESS is this is due to the zigbee hardware not resyncing on each
    new byte (inherent to the protocol, but prolly not in this homegrown
    firmware)

Anyway, have the sending pico calc a crc32 and put it on the end of the json.
If anything up to the action map doesn't decode properly, well,
something's obviously wrong and we can just ignore that transmission.
If it all decodes properly but something's still off, we
can index into the crc32 value and compare (and then reject).  Since we
debug messages don't use action at all, they're already ignored, and on
send we'll just try again later if anything was garbled.
helper/helper.go
lights/main.go