Repository navigation
fix: give ESP32-C6 valid default GPIOs on first start - #3316
Merged
Merged
Conversation
The C6 autodetect picked the CUSTOM profile, but load_board_profile() has no entry for it, so Rx, Tx and the button stayed at the placeholder 99. The startup settings load then failed the GPIO check and fell back to an empty settings object (blank Board Profile, Tx Mode and Bus ID), and every Application settings save returned 400 until valid pins were sent together with CUSTOM through the API. Start a C6 without a profile as CUSTOM with pins for the Seeed XIAO ESP32-C6 (the c6_xiao_4M build): Rx GPIO20 (D9), Tx GPIO19 (D8), button GPIO9 (BOOT), no LED, no Dallas sensor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
On an ESP32-C6 (
c6_xiao_4M) with no stored board profile,WebSettings::set_board_profile()autodetectsCUSTOM, butSystem::load_board_profile()has no entry forCUSTOM. Rx, Tx and the button therefore stay at the placeholder value99.What happens after that:
WebSettings::update()fails the GPIO check, so the settings are rolled back to the emptyoriginal_settings. In the WebUI, Board Profile, EMS Tx Mode and EMS Bus ID show blank.board_profile: "CUSTOM"together with valid pins directly to/rest/settings.Found on a fresh Seeed XIAO ESP32-C6 running 3.9.0-dev.20.
Fix
When autodetect lands on a C6, start with
CUSTOMand pins that suit the Seeed XIAO ESP32-C6, which is the board thec6_xiao_4Menv targets:Boards that already have a stored profile are not affected, since
CUSTOMreturns early inset_board_profile().Testing
pio run -e c6_xiao_4Mbuilds.clang-format --dry-run -Werroron the changed file is clean.I accept the CLA in CONTRIBUTING.md.
🤖 Generated with Claude Code