OTA guide for ESP32

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
ltmerlin
Posts: 39
Joined: Fri Jun 28, 2019 12:34 pm

OTA guide for ESP32

Post by ltmerlin » Mon May 25, 2020 8:11 am

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?

User avatar
tve
Posts: 216
Joined: Wed Jan 01, 2020 10:12 pm
Location: Santa Barbara, CA
Contact:

Re: OTA guide for ESP32

Post by tve » Mon May 25, 2020 10:55 pm

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.

ltmerlin
Posts: 39
Joined: Fri Jun 28, 2019 12:34 pm

Re: OTA guide for ESP32

Post by ltmerlin » Mon Jun 01, 2020 4:38 pm

thanks tve!
I'll give it a go soon.
Keep you posted!

BetterAutomations
Posts: 83
Joined: Mon Mar 20, 2017 10:22 pm

Re: OTA guide for ESP32

Post by BetterAutomations » Sun May 09, 2021 11:45 am

Tested, works great, thanks!

BetterAutomations
Posts: 83
Joined: Mon Mar 20, 2017 10:22 pm

Re: OTA guide for ESP32

Post by BetterAutomations » Sat May 29, 2021 11:13 pm

How did you decide on 4096 for the block size, can that be increased?

Post Reply