From e1db1034704ae989b640c7d8f3933236e238d654 Mon Sep 17 00:00:00 2001 From: Alexander D <51386995+neonll@users.noreply.github.com> Date: Fri, 23 Oct 2026 19:39:06 +0000 Subject: [PATCH] fix: give ESP32-C6 valid default GPIOs on first start 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 --- CHANGELOG_LATEST.md | 1 + src/web/WebSettingsService.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 8cf8686fd..d0a33ea2e 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -31,6 +31,7 @@ This release is based on the latest Espressif/Arduino core version 3. It brings ## Fixed +- ESP32-C6 boards without a board profile got invalid GPIOs (99), so on every start the settings were rejected and fell back to empty values (blank Board Profile, EMS Tx Mode and Bus ID), and saving any Application setting failed with a 400 error. A new C6 now starts with the CUSTOM profile and pins for the Seeed XIAO ESP32-C6: Rx GPIO20 (D9), Tx GPIO19 (D8), button GPIO9 - heat-pump operating state (`hpoperatingstate`: heating/off/cooling) is published for every heating circuit. On BC400/UI800 it was only filled for hc1, because hc2 never answers telegram 0x472 while the state is still broadcast in 0x2A6 offset 20 [#3097](https://github.com/emsesp/EMS-ESP32/issues/3097) - restart from the WebUI (Restart button, firmware/settings upload) only happened while the browser tab stayed open. If the tab was closed the restart was silently dropped after 5 minutes, leaving a new firmware uninstalled. EMS-ESP now restarts on its own if the WebUI hasn't picked up the pending restart within 10 seconds - a firmware upload from a script or `curl` was accepted (`md5_ok`) but EMS-ESP didn't restart into it: the client closing the connection after the upload was treated as an aborted upload, which cancelled the pending restart diff --git a/src/web/WebSettingsService.cpp b/src/web/WebSettingsService.cpp index b0e07af77..e6b7429bf 100644 --- a/src/web/WebSettingsService.cpp +++ b/src/web/WebSettingsService.cpp @@ -525,7 +525,12 @@ void WebSettings::set_board_profile(WebSettings & settings) { #elif CONFIG_IDF_TARGET_ESP32S3 settings.board_profile = "S32S3"; // BBQKees Gateway S3 #elif CONFIG_IDF_TARGET_ESP32C6 + // there is no C6 board profile, so start as CUSTOM with pins that suit the Seeed XIAO ESP32-C6 (the c6_xiao_4M build). + // load_board_profile() has no entry for CUSTOM, so without these the GPIOs stay at 99, every settings update + // fails the GPIO check and the settings fall back to empty values. + // Rx D9 (GPIO20), Tx D8 (GPIO19), button BOOT (GPIO9), no LED (the onboard LED on GPIO15 is active low), no Dallas settings.board_profile = "CUSTOM"; + data = {0, 0, 20, 19, 9, PHY_type::PHY_TYPE_NONE, 0, 0, 0, 0}; #endif // apply the new board profile setting System::load_board_profile(data, settings.board_profile.c_str());