Jeija / esp32-softap-ota

Minimal esp-idf example of HTTP portal to perform OTA updates of ESP32 in SoftAP mode
MIT License
57 stars 16 forks source link

ESP32 Over-the-Air Updates in SoftAP mode

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()).

Usage

Initial Build and Flash

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:

License

This project is licensed under the MIT license. See LICENSE for details.