Skip to content

fix: give ESP32-C6 valid default GPIOs on first start - #3316

Merged
proddy merged 1 commit into
emsesp:devfrom
neonll:fix/c6-default-board-pins
Oct 24, 2026
Merged

proddy merged 1 commit into
emsesp:devfrom
neonll:fix/c6-default-board-pins

Conversation

@neonll

@neonll neonll commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Problem

On an ESP32-C6 (c6_xiao_4M) with no stored board profile, WebSettings::set_board_profile() autodetects CUSTOM, but System::load_board_profile() has no entry for CUSTOM. Rx, Tx and the button therefore stay at the placeholder value 99.

What happens after that:

  • At startup, WebSettings::update() fails the GPIO check, so the settings are rolled back to the empty original_settings. In the WebUI, Board Profile, EMS Tx Mode and EMS Bus ID show blank.
  • Every save on the Application Settings page returns 400, including turning on Developer Mode. Developer Mode is what reveals the "Custom…" option, so the user can't get out of this state from the WebUI.
  • The only way out was to POST 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 CUSTOM and pins that suit the Seeed XIAO ESP32-C6, which is the board the c6_xiao_4M env targets:

GPIO XIAO pin
Rx 20 D9
Tx 19 D8
Button 9 BOOT
LED 0 (disabled) the onboard LED on GPIO15 is active low
Dallas 0 (disabled)

Boards that already have a stored profile are not affected, since CUSTOM returns early in set_board_profile().

Testing

  • pio run -e c6_xiao_4M builds.
  • clang-format --dry-run -Werror on the changed file is clean.
  • On the device, Rx 20 / Tx 19 with an EMS interface reads the bus: boiler (GB192i), UI800/BC400 and RC220 were all detected.

I accept the CLA in CONTRIBUTING.md.

🤖 Generated with Claude Code

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>
@proddy
proddy merged commit 8f7049b into emsesp:dev Oct 24, 2026
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.

2 participants