Open maximiliani opened 3 years ago
OTA updates should be done without the need of an internet access for the mqtt-devices. This could be implemented like this: The Privatehome Server checks on a regular basis (e.g. daily) for firmware updates. If one is present, it sends the mqtt-devices over mqtt an request to download the new firmware from the Privatehome Server. The devices are only allowed to download the firmware from the same server as they use for the mqtt-connection (to prevend man-in-the-middle attacks). Then the devices download the firmware over http and install it themselves. For this it is necessary, that the private keys are stored in the ESP EEPROM, so that they aren't lost after the update. For some extra security the server could also send the checksum of the binary in the same mqtt request, and the ESP could compare it after downloading with the actual checksum.
As already mentioned in MQTT, firmware updates should happen over OTA. In this topic it is necessary to implement OTA and OTA configuration via MQTT.