From 5a34bd54604a62384f7a51418b25785b60821f81 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sat, 30 Aug 2025 21:54:46 +1200 Subject: [PATCH 1/5] turn off tx led when powering off --- src/helpers/nrf52/ThinkNodeM1Board.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/helpers/nrf52/ThinkNodeM1Board.h b/src/helpers/nrf52/ThinkNodeM1Board.h index c1ffcbbf..fc752223 100644 --- a/src/helpers/nrf52/ThinkNodeM1Board.h +++ b/src/helpers/nrf52/ThinkNodeM1Board.h @@ -57,6 +57,14 @@ public: } void powerOff() override { + + // turn off all leds, sd_power_system_off will not do this for us + #ifdef P_LORA_TX_LED + digitalWrite(P_LORA_TX_LED, LOW); + #endif + + // power off board sd_power_system_off(); + } }; From 6172537459ce99dbc7a6988f559d58144298ebeb Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sat, 30 Aug 2025 21:56:00 +1200 Subject: [PATCH 2/5] auto shutdown thinknode m1 at 3.3v --- variants/thinknode_m1/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/thinknode_m1/platformio.ini b/variants/thinknode_m1/platformio.ini index fa8cd55b..590f2100 100644 --- a/variants/thinknode_m1/platformio.ini +++ b/variants/thinknode_m1/platformio.ini @@ -77,6 +77,7 @@ build_flags = -D DISPLAY_CLASS=GxEPDDisplay -D OFFLINE_QUEUE_SIZE=256 -D PIN_BUZZER=6 + -D AUTO_SHUTDOWN_MILLIVOLTS=3300 ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${ThinkNode_M1.build_src_filter} From 18ef1ba804862aec15c1ab4617dd7cc007ff0cf8 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sat, 30 Aug 2025 23:09:01 +1200 Subject: [PATCH 3/5] add low battery shutdown alert for thinknode m1 --- examples/companion_radio/ui-new/UITask.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 1920dd26..22f394e7 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -551,7 +551,22 @@ void UITask::loop() { if (millis() > next_batt_chck) { uint16_t milliVolts = getBattMilliVolts(); if (milliVolts > 0 && milliVolts < AUTO_SHUTDOWN_MILLIVOLTS) { + + // show low battery shutdown alert + // we should only do this for eink displays, which will persist after power loss + #ifdef THINKNODE_M1 + if (_display != NULL) { + _display->startFrame(); + _display->setTextSize(2); + _display->setColor(DisplayDriver::RED); + _display->drawTextCentered(_display->width() / 2, 20, "Low Battery."); + _display->drawTextCentered(_display->width() / 2, 40, "Shutting Down!"); + _display->endFrame(); + } + #endif + shutdown(); + } next_batt_chck = millis() + 8000; } From 0f23c0120a616d3fae6669dbe1feb0f864eefc4e Mon Sep 17 00:00:00 2001 From: recrof Date: Sun, 31 Aug 2025 12:09:04 +0200 Subject: [PATCH 4/5] fix: migrate meshadventurer to new ui --- variants/meshadventurer/platformio.ini | 10 ++++++++++ variants/meshadventurer/target.cpp | 4 ---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/variants/meshadventurer/platformio.ini b/variants/meshadventurer/platformio.ini index 60cc55eb..3ea09ba7 100644 --- a/variants/meshadventurer/platformio.ini +++ b/variants/meshadventurer/platformio.ini @@ -82,6 +82,7 @@ build_src_filter = ${Meshadventurer.build_src_filter} + build_flags = ${Meshadventurer.build_flags} + -I examples/companion_radio/ui-new -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper -D LORA_TX_POWER=22 @@ -99,8 +100,11 @@ build_src_filter = ${Meshadventurer.build_src_filter} +<../examples/companion_radio/*.cpp> + + + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> build_flags = ${Meshadventurer.build_flags} + -I examples/companion_radio/ui-new -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper -D LORA_TX_POWER=22 @@ -159,8 +163,11 @@ extends = Meshadventurer build_src_filter = ${Meshadventurer.build_src_filter} +<../examples/companion_radio/*.cpp> + + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> build_flags = ${Meshadventurer.build_flags} + -I examples/companion_radio/ui-new -D RADIO_CLASS=CustomSX1268 -D WRAPPER_CLASS=CustomSX1268Wrapper -D LORA_TX_POWER=22 @@ -178,8 +185,11 @@ build_src_filter = ${Meshadventurer.build_src_filter} +<../examples/companion_radio/*.cpp> + + + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> build_flags = ${Meshadventurer.build_flags} + -I examples/companion_radio/ui-new -D RADIO_CLASS=CustomSX1268 -D WRAPPER_CLASS=CustomSX1268Wrapper -D LORA_TX_POWER=22 diff --git a/variants/meshadventurer/target.cpp b/variants/meshadventurer/target.cpp index a1d6dcad..cabcee58 100644 --- a/variants/meshadventurer/target.cpp +++ b/variants/meshadventurer/target.cpp @@ -18,10 +18,6 @@ MASensorManager sensors = MASensorManager(nmea); DISPLAY_CLASS display; #endif -#ifndef LORA_CR - #define LORA_CR 5 -#endif - bool radio_init() { fallback_clock.begin(); rtc_clock.begin(Wire); From 7854244026d712dc4014e2a93fe0abe8bd1c29e9 Mon Sep 17 00:00:00 2001 From: recrof Date: Sun, 31 Aug 2025 12:11:07 +0200 Subject: [PATCH 5/5] fix: add xiao s3 wio serial companion to new ui --- variants/xiao_s3_wio/platformio.ini | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/variants/xiao_s3_wio/platformio.ini b/variants/xiao_s3_wio/platformio.ini index fe4670b5..6288dded 100644 --- a/variants/xiao_s3_wio/platformio.ini +++ b/variants/xiao_s3_wio/platformio.ini @@ -103,15 +103,21 @@ lib_deps = extends = Xiao_S3_WIO build_flags = ${Xiao_S3_WIO.build_flags} + -I examples/companion_radio/ui-new -D MAX_CONTACTS=100 -D MAX_GROUP_CHANNELS=8 + -D DISPLAY_CLASS=SSD1306Display -D SERIAL_TX=D6 -D SERIAL_RX=D7 ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${Xiao_S3_WIO.build_src_filter} + + + + + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> lib_deps = ${Xiao_S3_WIO.lib_deps} densaugeo/base64 @ ~1.4.0 + adafruit/Adafruit SSD1306 @ ^2.5.13