From d32ae30014635865db7a5b2e5caaf08f8e930203 Mon Sep 17 00:00:00 2001 From: acidburns Date: Mon, 2 Feb 2026 00:23:52 +0100 Subject: [PATCH] Move AP credentials to config and clarify STA UI access --- README.md | 5 +++-- include/config.h | 2 ++ src/main.cpp | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3565a94..9f6f3bb 100644 --- a/README.md +++ b/README.md @@ -249,13 +249,14 @@ inline constexpr uint16_t EXPECTED_SENDER_IDS[NUM_SENDERS] = { 0xF19C }; - Uses deep sleep between cycles (`SENDER_WAKE_INTERVAL_SEC`). ## Web UI -- AP SSID: `DD3-Bridge-` -- AP password: `changeme123` +- AP SSID: `DD3-Bridge-` (prefix configurable) +- AP password: `changeme123` (configurable) - Endpoints: - `/`: status overview - `/wifi`: WiFi/MQTT/NTP config (AP and STA) - `/sender/`: per-sender details - Sender IDs on `/` are clickable (open sender page in a new tab). +- In STA mode, the UI is also available via the board’s IP/hostname on your WiFi network. ## MQTT - Topic: `smartmeter//state` diff --git a/include/config.h b/include/config.h index a3bab78..7da81f1 100644 --- a/include/config.h +++ b/include/config.h @@ -78,6 +78,8 @@ constexpr bool SERIAL_DEBUG_DUMP_JSON = false; constexpr bool LORA_SEND_BYPASS = false; constexpr bool ENABLE_SD_LOGGING = false; constexpr uint8_t PIN_SD_CS = 25; +constexpr const char *AP_SSID_PREFIX = "DD3-Bridge-"; +constexpr const char *AP_PASSWORD = "changeme123"; constexpr uint8_t NUM_SENDERS = 1; inline constexpr uint16_t EXPECTED_SENDER_IDS[NUM_SENDERS] = { diff --git a/src/main.cpp b/src/main.cpp index 9dc364f..488fa37 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -642,8 +642,8 @@ void setup() { } else { g_ap_mode = true; char ap_ssid[32]; - snprintf(ap_ssid, sizeof(ap_ssid), "DD3-Bridge-%04X", g_short_id); - wifi_start_ap(ap_ssid, "changeme123"); + snprintf(ap_ssid, sizeof(ap_ssid), "%s%04X", AP_SSID_PREFIX, g_short_id); + wifi_start_ap(ap_ssid, AP_PASSWORD); if (g_cfg.ntp_server_1.isEmpty()) { g_cfg.ntp_server_1 = "pool.ntp.org"; }