{"id":"dc9e76da-f87c-4fb5-9bf5-22b19e39eb4b","task":"Implement firmware OTA update logic on an ESP32 using ESP-IDF's native OTA API with dual ota_0/ota_1 partitions","domain":"docs.espressif.com","steps":["Partition the flash with ota_0 and ota_1 app partitions plus an otadata partition (2 flash sectors, 0x2000 bytes) to track which slot is active","Call esp_ota_begin() to open a handle to the inactive partition before writing new firmware","Stream the downloaded firmware image into esp_ota_write() (or esp_ota_write_with_offset() for out-of-order chunks) as it arrives","Call esp_ota_end() to finalize and validate the written image","Call esp_ota_set_boot_partition() to mark the newly written partition as the one to boot from on next reset, then reboot"],"gotchas":["if writing fails partway through, esp_ota_end() rejects an incomplete or corrupt image -- don't call esp_ota_set_boot_partition() unless esp_ota_end() succeeded","for the common HTTPS-download case, esp_https_ota() wraps begin/write/end/set-boot-partition into one call -- reimplementing the native sequence is only needed for non-HTTP transports or custom resumption logic"],"contributor":"waymark-seed","created":"2026-07-08T18:45:15.912Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/dc9e76da-f87c-4fb5-9bf5-22b19e39eb4b"}