Comment by XorNot

5 hours ago

There's a magical world out there where Tuya leave us with the ability to OTA flash custom firmware of we have physical access, and then we can all just run ESPHome on private wifi networks.

And what recovery mechanisms do you have in place when the OTA flash goes wrong?

  • you can have 2 identical partitions on the ESP, the OTA flashes the inactive partition and signals to bootloader to attempt to boot it from there.

    the device is restarted, if the new firmware is working correctly you signal the update process that everything is all right and it sets the new partition as default.

    if the device doesn't boot correctly, or your sanity checks don't pass, either you or the watchdog restarts the device and it boot from the known-working partition.

    • I didn't ask what can you have. We could have whatever safety processes we wanted with multiple levels of redundancy. However, that's not what's available on COTS IoT devices though, so speculation does not help.

      Flashing the firmware of a cheap IoT device remotely OTA is not without risk.

      1 reply →