This repository contains a minimal working example of an over-the-air (OTA) firmware updater where the ESP32 receives the update while acting as an HTTP server in SoftAP mode. It is meant to be used with esp-idf, though it can also be integrated into arduino-esp32 projects.
It is particularly suitable for applications where you would like to deploy an ESP32 in a setting where it is not connected to the internet (i.e. automatically downloading updates is not applicable), yet the ESP32's UART interface is also not easily accessible. In that case, firmware updates can be performed from any device with a WiFi interface and a web browser in the ESP32's range.
This project is based on esp-idf's included OTA update mechanism, i.e. it uses a factory
partition, a ota_0
partition and a ota_1
partition and updates are rolled back unless the updated firmware marks itself as valid (by calling esp_ota_mark_app_valid_cancel_rollback()
).
ESP32 OTA Update
. Connect to it and open http://192.168.4.1 in your web browser.Browse...
, select a firmware file (e.g. esp32-softap-ota.bin
) and click Upload
. curl --progress-bar -X POST --data-binary @build/esp32-softap-ota.bin http://192.168.4.1/update | tee /dev/null
Make sure you have a recent esp-idf version with support for cmake-based projects installed and configured properly. Then compile and flash this project as usual using the following steps:
idf.py all
to compile everythingidf.py -p /dev/ttyUSBX flash
to flash everythingThis project is licensed under the MIT license. See LICENSE
for details.