Page 1 of 1

OTA guide for ESP32

Posted: Mon May 25, 2020 8:11 am
by ltmerlin
Is there some official documentation on updating firmware of an ESP32 "over-the-air".
If I build the firmware I have either one complete firmware.bin or the pieces bootloader.bin, application.bin and partitions.bin. Which of these do I need for an OTA? I'm not sure what needs to be copied to the OTA partition...
For building I'm using the default setup from the ports/esp32/boards/GENERIC_OTA.

Say I managed to get the .bin(s) downloaded to the ESP32, what is the right way to flash/write/copy this (where to?) and how to activate it on next boot ensuring we can keep updating-over-the-air in the future?

Re: OTA guide for ESP32

Posted: Mon May 25, 2020 10:55 pm
by tve
There is no official guide. I wrote an OTA class for my MQTT Repl, which you can find here: https://github.com/tve/micropython-mqtt ... py#L22-L84
It streams the data from MQTT (~1000 1400-byte messages) directly into the partition. The file you need is the application.bin since you're not updating the bootloader or the partition table. Remember that once you're happy you will need to use mark_app_valid_cancel_rollback on the partition.

Re: OTA guide for ESP32

Posted: Mon Jun 01, 2020 4:38 pm
by ltmerlin
thanks tve!
I'll give it a go soon.
Keep you posted!

Re: OTA guide for ESP32

Posted: Sun May 09, 2021 11:45 am
by BetterAutomations
Tested, works great, thanks!

Re: OTA guide for ESP32

Posted: Sat May 29, 2021 11:13 pm
by BetterAutomations
How did you decide on 4096 for the block size, can that be increased?