Repository navigation
Apply and persist the selected firmware channel - #1280
Merged
Merged
Conversation
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]>
🔧 PR Build ArtifactsVersion: All environments built successfully. Download the zip files:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users on the Release Candidate channel were not told about 2.6.0-rc1.
Fixes
AmsFirmwareUpdaterstarts withfirmwareChannel = 0, andsysChangedstarts asfalse, sohandleSystem()only callssetFirmwareChannel()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 insetup().fwchannel()calledsetSystemConfig()withoutconfig->save(), so the choice stayed in the EEPROM RAM buffer and was lost on reboot unless another save happened first.handleUpdater(),upinfo.errorCode == AMS_UPDATE_ERR_SUCCESS_CONFIRMED;was a comparison, not an assignment, and the upgrade info was not committed beforeESP.restart().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 callsconfig.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 esp32andpio run -e esp8266build..../<chip>/rc/next.🤖 Generated with Claude Code