From f3217a5e9b3928f9f84c98806dabbaf9721f444b Mon Sep 17 00:00:00 2001 From: manu Date: Fri, 28 Aug 2026 16:38:54 +0200 Subject: [PATCH 1/3] Add sensor mode to SenseCap T1000-e --- variants/t1000-e/platformio.ini | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/variants/t1000-e/platformio.ini b/variants/t1000-e/platformio.ini index 8456dc91..2e10d44b 100644 --- a/variants/t1000-e/platformio.ini +++ b/variants/t1000-e/platformio.ini @@ -128,3 +128,17 @@ build_src_filter = ${t1000-e.build_src_filter} +<../examples/kiss_modem/> lib_deps = ${t1000-e.lib_deps} stevemarple/MicroNMEA @ ^2.0.6 + +[env:t1000e_sensor] +extends = t1000-e +build_flags = ${t1000-e.build_flags} + -D ADVERT_NAME='"t1000-e sensor"' + -D ADVERT_LAT=0.0 + -D ADVERT_LON=0.0 + -D ADMIN_PASSWORD='"password"' +; -D MESH_PACKET_LOGGING=1 +; -D MESH_DEBUG=1 +build_src_filter = ${t1000-e.build_src_filter} + +<../examples/simple_sensor/> +lib_deps = ${t1000-e.lib_deps} + stevemarple/MicroNMEA @ ^2.0.6 From ef31b95928a4e82c8f6b1f35a28123990146fcd6 Mon Sep 17 00:00:00 2001 From: Mark Rose Date: Thu, 26 Nov 2026 01:35:07 -0600 Subject: [PATCH 2/3] Add ui/server include to envs missed by the UI refactor The server UI moved to src/helpers/ui/server (0b38bfd8), and most server envs gained '-I src/helpers/ui/server' and '+', but Heltec_t096_sensor, RAK_3401_sensor, RAK_4631_sensor and the ThinkNode M9 repeater and room server did not, so they fail with 'UITask.h: No such file or directory'. Add both, and add BaseUITask.cpp to the ThinkNode_M9 base like other variants so the M9 builds link. Co-Authored-By: Claude Opus 5.5 --- variants/heltec_t096/platformio.ini | 2 ++ variants/rak3401/platformio.ini | 2 ++ variants/rak4631/platformio.ini | 2 ++ variants/thinknode_m9/platformio.ini | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/variants/heltec_t096/platformio.ini b/variants/heltec_t096/platformio.ini index cc8c9ff4..fc186732 100644 --- a/variants/heltec_t096/platformio.ini +++ b/variants/heltec_t096/platformio.ini @@ -113,6 +113,7 @@ build_flags = extends = Heltec_t096 build_flags = ${Heltec_t096.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"Heltec_t096 Sensor"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -122,6 +123,7 @@ build_flags = ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${Heltec_t096.build_src_filter} + + +<../examples/simple_sensor> lib_deps = ${Heltec_t096.lib_deps} diff --git a/variants/rak3401/platformio.ini b/variants/rak3401/platformio.ini index 97f1e6da..cb14a897 100644 --- a/variants/rak3401/platformio.ini +++ b/variants/rak3401/platformio.ini @@ -124,6 +124,7 @@ lib_deps = extends = rak3401 build_flags = ${rak3401.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"RAK3401 Sensor"' -D ADVERT_LAT=0.0 @@ -132,6 +133,7 @@ build_flags = ;-D MESH_PACKET_LOGGING=1 ;-D MESH_DEBUG=1 build_src_filter = ${rak3401.build_src_filter} + + + +<../examples/simple_sensor> diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index eaf73c7b..74259624 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -275,6 +275,7 @@ lib_deps = extends = rak4631 build_flags = ${rak4631.build_flags} + -I src/helpers/ui/server -D DISPLAY_CLASS=AutoDetectDisplay -D ADVERT_NAME='"RAK4631 Sensor"' -D ADVERT_LAT=0.0 @@ -283,6 +284,7 @@ build_flags = ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${rak4631.build_src_filter} + + + +<../examples/simple_sensor> diff --git a/variants/thinknode_m9/platformio.ini b/variants/thinknode_m9/platformio.ini index c718fe94..fb76db34 100755 --- a/variants/thinknode_m9/platformio.ini +++ b/variants/thinknode_m9/platformio.ini @@ -50,6 +50,7 @@ build_src_filter = ${esp32_base.build_src_filter} + + + + + + +<../variants/thinknode_m9> lib_deps = ${esp32_base.lib_deps} @@ -60,6 +61,7 @@ lib_deps = ${esp32_base.lib_deps} extends = ThinkNode_M9 build_flags = ${ThinkNode_M9.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ThinkNode M9 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -68,6 +70,7 @@ build_flags = ;-D MESH_PACKET_LOGGING=1 ;-D MESH_DEBUG=1 build_src_filter = ${ThinkNode_M9.build_src_filter} + + +<../examples/simple_repeater/*.cpp> lib_deps = ${ThinkNode_M9.lib_deps} @@ -76,9 +79,11 @@ lib_deps = [env:ThinkNode_M9_room_server_] extends = ThinkNode_M9 build_src_filter = ${ThinkNode_M9.build_src_filter} + + +<../examples/simple_room_server> build_flags = ${ThinkNode_M9.build_flags} + -I src/helpers/ui/server -D ADVERT_NAME='"ThinkNode M9 Room Server"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 From b3e0885f7ce5be4158f911c29d819beff187f793 Mon Sep 17 00:00:00 2001 From: Mark Rose Date: Fri, 27 Nov 2026 15:45:18 -0600 Subject: [PATCH 3/3] Sensor CLI: 'io' must match the whole word and parse its argument memcmp(command, "io ", 2) accepted every command starting with "io", and a write whose argument had no hex digits passed an uninitialised value to board.setGpio(). Co-Authored-By: Claude Mythos 5.2 --- examples/simple_sensor/SensorMesh.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/examples/simple_sensor/SensorMesh.cpp b/examples/simple_sensor/SensorMesh.cpp index 8a68381a..c3aeffb4 100644 --- a/examples/simple_sensor/SensorMesh.cpp +++ b/examples/simple_sensor/SensorMesh.cpp @@ -497,21 +497,26 @@ void SensorMesh::handleCommand(ClientInfo* from, uint32_t sender_timestamp, char Serial.printf("\n"); } reply[0] = 0; - } else if (memcmp(command, "io ", 2) == 0) { // io {value}: write, io: read + } else if (strcmp(command, "io") == 0 || memcmp(command, "io ", 3) == 0) { // io {value}: write, io: read if (command[2] == ' ') { // it's a write - uint32_t val; + uint32_t val = 0; uint32_t g = board.getGpio(); + bool ok; if (command[3] == 'r') { // reset bits - sscanf(&command[4], "%x", &val); - val = g & ~val; + ok = sscanf(&command[4], "%x", &val) == 1; + val = g & ~val; } else if (command[3] == 's') { // set bits - sscanf(&command[4], "%x", &val); - val |= g; + ok = sscanf(&command[4], "%x", &val) == 1; + val |= g; } else if (command[3] == 't') { // toggle bits - sscanf(&command[4], "%x", &val); - val ^= g; + ok = sscanf(&command[4], "%x", &val) == 1; + val ^= g; } else { // set value - sscanf(&command[3], "%x", &val); + ok = sscanf(&command[3], "%x", &val) == 1; + } + if (!ok) { + strcpy(reply, "Err - bad params"); + return; } board.setGpio(val); }