How to improve reliability of OTA Firmware Upgrades?
Keep esp_rainmaker up to date and use these options, added across releases:
-
v1.6.0 — OTA retry on failure: If OTA fails, the component retries multiple times (
CONFIG_ESP_RMAKER_OTA_MAX_RETRIES, default 3) and schedules another OTA fetch after all retries fail (CONFIG_ESP_RMAKER_OTA_RETRY_DELAY_MINUTES). OTA fetch also monitors publish acknowledgement and retries if the otafetch message fails. -
v1.6.4 — MQTT OTA: Use
CONFIG_ESP_RMAKER_OTA_USE_MQTT=yto fetch the OTA image over MQTT instead of HTTPS, saving RAM and avoiding extra TLS connections. May be slightly slower but improves reliability on memory-constrained devices. -
v1.7.2 — OTA resumption: Resume download from the last position instead of restarting. Requires backend v3.0.0+ and ESP-IDF v5.5+. The device checks MD5 of consecutive chunks; if the same, download continues; if different, it restarts.
-
v1.9.0 — Rollback status reporting: Enable
CONFIG_ESP_RMAKER_OTA_ROLLBACK_REPORT_FAILEDso that when a rollback occurs due to MQTT timeout, the rolled-back firmware reportsfailedinstead ofrejected, giving the cloud accurate status. Use with caution—see the changelog for caveats.
For full details, see the esp_rainmaker changelog.