From d2e95488344a31c4603a7669d15e7ba0d95acf35 Mon Sep 17 00:00:00 2001 From: isaka1022 <28589716+isaka1022@users.noreply.github.com> Date: Sun, 30 Aug 2026 17:59:05 +0200 Subject: [PATCH 1/3] fix(firmware): reject setWifi messages without an ssid or password ArduinoJson returns nullptr for a missing key, and handle_set_wifi() passed both values straight into std::string parameters, so a setWifi message missing either field aborted the device instead of reporting a failure. Reply wifiConnectFailed and keep running. --- firmware/main/hal/hal_ble.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/firmware/main/hal/hal_ble.cpp b/firmware/main/hal/hal_ble.cpp index 57df760b..73e2ae04 100644 --- a/firmware/main/hal/hal_ble.cpp +++ b/firmware/main/hal/hal_ble.cpp @@ -464,6 +464,12 @@ class WifiConfigServer { const char* ssid = data["ssid"]; const char* password = data["password"]; + if (ssid == nullptr || password == nullptr) { + mclog::tagWarn(_tag, "setWifi is missing ssid or password"); + notify_state(2, "wifiConnectFailed"); + return; + } + mclog::tagInfo(_tag, "get wifi config: {} / {}", ssid, password); // Notify state: connecting From febcfdbc9d1a56c48105b3c29c4ee5fc22e9cadf Mon Sep 17 00:00:00 2001 From: isaka1022 <28589716+isaka1022@users.noreply.github.com> Date: Sun, 30 Aug 2026 17:59:14 +0200 Subject: [PATCH 2/3] fix(firmware): stop logging the WiFi password The password arrives over BLE and was written to the serial console in clear text, where anyone with the USB port can read it. --- firmware/main/hal/hal_ble.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/main/hal/hal_ble.cpp b/firmware/main/hal/hal_ble.cpp index 73e2ae04..12dc2c26 100644 --- a/firmware/main/hal/hal_ble.cpp +++ b/firmware/main/hal/hal_ble.cpp @@ -470,7 +470,7 @@ class WifiConfigServer { return; } - mclog::tagInfo(_tag, "get wifi config: {} / {}", ssid, password); + mclog::tagInfo(_tag, "get wifi config for ssid: {}", ssid); // Notify state: connecting notify_state(0, "wifiConnecting"); From 036eade2c207349127e2a3fdd12a48d8c079f778 Mon Sep 17 00:00:00 2001 From: isaka1022 <28589716+isaka1022@users.noreply.github.com> Date: Sun, 30 Aug 2026 17:59:14 +0200 Subject: [PATCH 3/3] chore(firmware): ignore sdkconfig.defaults.local CMakeLists.txt loads this overlay automatically when present, so it is the natural place for deployment settings and credentials, but it was tracked. --- firmware/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/.gitignore b/firmware/.gitignore index 5c0083c0..cef82bc2 100644 --- a/firmware/.gitignore +++ b/firmware/.gitignore @@ -63,5 +63,6 @@ obj/ sdkconfig sdkconfig.old +sdkconfig.defaults.local xiaozhi-esp32/