Skip to content

Apply and persist the selected firmware channel - #1280

Merged
gskjold merged 2 commits into
mainfrom
fix/firmware-channel-persistence
Oct 15, 2026
Merged

gskjold merged 2 commits into
mainfrom
fix/firmware-channel-persistence

Conversation

@gskjold

@gskjold gskjold commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Users on the Release Candidate channel were not told about 2.6.0-rc1.

Fixes

  • Stored channel ignored after reboot. AmsFirmwareUpdater starts with firmwareChannel = 0, and sysChanged starts as false, so handleSystem() only calls setFirmwareChannel() after a config change at runtime. After a reboot the device checked .../stable/next, while the UI (which reads the channel from config) showed the selected channel. The stored channel is now applied in setup().
  • Channel not committed. fwchannel() called setSystemConfig() without config->save(), so the choice stayed in the EEPROM RAM buffer and was lost on reboot unless another save happened first.
  • Upgrade success status not stored. In handleUpdater(), upinfo.errorCode == AMS_UPDATE_ERR_SUCCESS_CONFIRMED; was a comparison, not an assignment, and the upgrade info was not committed before ESP.restart().
  • Upgrade progress not committed. handleUpdater() stored every status change from the updater (download progress, error codes, resume after reboot) without committing it, so an interrupted download restarted from zero. It now calls config.save() after each change. When saves happen is unchanged: at most once per 33 blocks, and only when the voltage dips or a chunk download fails. That works out to at most about 12 writes on esp32 and 9 on esp8266 per upgrade. Usually it is 2: the success status is committed once, then again as confirmed before the restart.

Testing

  • pio run -e esp32 and pio run -e esp8266 build.
  • Not yet tested on a device. To check: select RC, reboot, and confirm the next-version request about 30 s after boot goes to .../<chip>/rc/next.

🤖 Generated with Claude Code

gskjold and others added 2 commits October 15, 2026 11:56
The updater starts out on the stable channel, and the stored channel only
reached it when the system config changed at runtime. After a reboot the
device kept checking the stable channel while the UI showed the selected
one. Apply the stored channel at boot.

fwchannel() also stored the channel without committing the EEPROM, so it
was lost on reboot unless something else saved the config.

After a successful download, the success status was compared instead of
assigned and never committed before the restart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Progress and error updates from the updater were stored with
setUpgradeInformation() but never committed, so resuming an interrupted
download after a reboot started from scratch. Commit whenever the updater
reports a change; when that happens is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

🔧 PR Build Artifacts

Version: 198187f

All environments built successfully. Download the zip files:

Artifacts expire after 7 days. View workflow run

@gskjold
gskjold merged commit fd3b4b9 into main Oct 15, 2026
8 checks passed
@gskjold
gskjold deleted the fix/firmware-channel-persistence branch October 15, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant