Skip to main content

How to improve reliability of OTA Firmware Upgrades?

Keep esp_rainmaker up to date and use these options, added across releases:

  • v1.6.0OTA 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.4MQTT OTA: Use CONFIG_ESP_RMAKER_OTA_USE_MQTT=y to 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.2OTA 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.0Rollback status reporting: Enable CONFIG_ESP_RMAKER_OTA_ROLLBACK_REPORT_FAILED so that when a rollback occurs due to MQTT timeout, the rolled-back firmware reports failed instead of rejected, giving the cloud accurate status. Use with caution—see the changelog for caveats.

For full details, see the esp_rainmaker changelog.