knowit / snappysense

3 stars 1 forks source link

OTA firmware update #26

Open lars-t-hansen opened 1 year ago

lars-t-hansen commented 1 year ago

Title says it all. Provided that the device has USB power and is connected to wifi, how can the firmware be updated from the device itself?

lars-t-hansen commented 1 year ago

Arduino has an OTA system (https://github.com/espressif/arduino-esp32/tree/master/libraries/ArduinoOTA) but this looks like it requires the device to advertise itself on the local net and for some agent on that net to connect to it and upload the OTA update. This is not what we want; we want the device to learn about an update and then download it from a designated location. The information about the update might arrive by MQTT, and the device could just open a socket to the update server and download the code. No doubt the ArduinoOTA library contains many ideas we could reuse.