chiefwigms / picobrew_pico

MIT License
149 stars 63 forks source link

Random fixes - New Device Firmware Failing to Loading #336

Closed tmack8001 closed 2 years ago

tmack8001 commented 2 years ago

There was a thread between Diane, Kevin and myself on Facebook that a factory reset C was failing to load firmware.

In this situation here are the only requests made to the server from the device:

192.168.72.183 - - [25/Jan/2021:14:43:31 -0500] "GET /API/pico/error?uid=<uid>&code=17 HTTP/1.0" 499 0 "-" "-"
192.168.72.183 - - [25/Jan/2021:14:43:53 -0500] "GET /API/pico/register?uid=<uid> HTTP/1.0" 200 5 "-" "-"
192.168.72.183 - - [25/Jan/2021:14:44:00 -0500] "GET /API/pico/getFirmware?uid=<uid> HTTP/1.0" 500 290 "-" "-"

without the proceeding request to GET /API/pico/checkFirmware?uid=<uid> which has been seen before in practice. This is likely due to the firmware being factory reset to knowing somehow that the firmware already needs to be updated? Only happens when the machine_type isn't known to the server. Upon adding an alias via the UI I noticed that the mtype wasn't being modified if there was previous active sessions against the specific uid being aliased. Here I'm persisting whichever mtype the user selected in the UI (which is where the alias is added to the config.yaml and will be loaded from upon server restart().