OTA firmware updates for ESP32 #2

Open
opened 2026-06-19 11:32:36 +00:00 by GKaszewski · 0 comments
Owner

Over-the-air firmware updates so ESP32 clients can be updated without physical reflash.

Scope

ESP32 side:

  • Switch partition table from SINGLE_APP_LARGE to TWO_OTA (binary currently 1.1MB, OTA slot is 1.5MB — fits)
  • Use esp_ota_ops APIs to download firmware, write to inactive slot, verify, swap
  • Rollback if new firmware fails to boot (ESP-IDF boot verification)
  • Version tracking — firmware embeds its version, compares with server
  • Trigger: check on boot + periodic + server-pushed command

Server side:

  • Firmware binary upload API endpoint
  • Storage for firmware files + version metadata
  • New ServerMessage::FirmwareUpdateAvailable { version, url } wire message
  • Version comparison logic

SPA:

  • Firmware upload page
  • Current version display per connected client
  • Update trigger button

Considerations

  • Partition table change wipes flash — existing devices need one final manual reflash
  • Binary must stay under ~1.5MB per OTA slot (currently 1.1MB, 73%)
  • WiFi provisioning config (NVS) survives OTA — no re-setup needed
  • Need HTTPS or at minimum checksum verification for firmware integrity

Estimate

~4-5 days of work

Over-the-air firmware updates so ESP32 clients can be updated without physical reflash. ### Scope **ESP32 side:** - Switch partition table from `SINGLE_APP_LARGE` to `TWO_OTA` (binary currently 1.1MB, OTA slot is 1.5MB — fits) - Use `esp_ota_ops` APIs to download firmware, write to inactive slot, verify, swap - Rollback if new firmware fails to boot (ESP-IDF boot verification) - Version tracking — firmware embeds its version, compares with server - Trigger: check on boot + periodic + server-pushed command **Server side:** - Firmware binary upload API endpoint - Storage for firmware files + version metadata - New `ServerMessage::FirmwareUpdateAvailable { version, url }` wire message - Version comparison logic **SPA:** - Firmware upload page - Current version display per connected client - Update trigger button ### Considerations - Partition table change wipes flash — existing devices need one final manual reflash - Binary must stay under ~1.5MB per OTA slot (currently 1.1MB, 73%) - WiFi provisioning config (NVS) survives OTA — no re-setup needed - Need HTTPS or at minimum checksum verification for firmware integrity ### Estimate ~4-5 days of work
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GKaszewski/k-frame#2