Go to file
muhammad.faique 4d487d3c58 Install downloaded firmware during OTA update
check_for_update() wrote the download to main_ota_temp.py, stamped the new
version in NVS and reset, but never replaced main.py. Devices therefore kept
running the old program while reporting the newest version, so no OTA release
ever reached the field.

The routine now validates the download (HTTP 200, minimum size, setup/loop
present, compiles), keeps the running program as main_prev.py for manual
rollback, renames the download to main.py, and records the version only after
the swap succeeds. A rejected download or failed swap leaves the old program
and version in place so the next boot retries.

CLAUDE.md describes the new flow and the field caveat: devices on the old
build need one manual USB copy first, and the next version.txt must exceed any
number already published because their NVS may claim a version they never ran.

.gitignore drops the __pycache__ left by PC-side syntax checks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 16:42:07 +05:00
.gitignore Install downloaded firmware during OTA update 2026-09-11 16:42:07 +05:00
CLAUDE.md Install downloaded firmware during OTA update 2026-09-11 16:42:07 +05:00
M5-Stack Code for Uimetrix.txt Install downloaded firmware during OTA update 2026-09-11 16:42:07 +05:00