OTA updation completes but ESP does not switch to new firmware

Hello,
I am using ESP32 with mdash library on Arduino platform. Recently I have encountered a problem while doing OTA. One of my esp32 device is operational remotely and I have to update it’s firmware via mdash portal. When I try to update via OTA (Arduino IDE export .bin) I see that after OTA process completes , the ESP restarts but it does not run the new version but reboots and runs the same old version that it was running before the update. As ESP32 is on remote location , my debugging options are limited. I have tried resetting the ESP before updating but it didn’t work. Any suggestions ?

If your device reboots and the new image doesn’t take hold, there may be an an issue with your .bin file.

Since your target is remote, get another ESP32 locally on your bench, hook up a serial port and then do the mDash OTA while watching the console. You can also flash the local device directly via the serial port (no OTA) with your .bin and see if it works.

The steps above should enable you to confirm if the .bin is valid or not.

The mDash OTA mechanism generally works quite well. On rare occasions (maybe 1 in 30 attempts) the OTA process will complete with a known-good .bin file but it will not take hold after reboot (much like the symptoms you’ve described). When this happens a retry resolves the problem.

-AD

1 Like

Thank you for the reply @Autodog . I have tried the method of locally hooking up an ESP32 to my computer for debugging and tried out OTA , it updates properly. I don’t think there is any issue with the bin file as I have used the same bin file to update other remote ESPs. It happens rarely that a particular ESP does not loads up new firmware. I have encountered this 2-3 times. Is there any other way to do the OTA or any workaround when this happens to a remote ESP?

Looks like your .bin file is validated and other devices are OK, that’s a good step. It sounds like your issue is unique to one specific device. Potential issues could be:

  1. Poor WiFi/network connectivity during the OTA process (I’ve seen this cause OTA failures)
  2. Something defective with this device and/or its environment (e.g. power supply)

Beyond that, I would defer to Cesanta for further ideas for remote OTA debugging.

-AD