From c7d04491811b935599e4999a25affe5f2434149e Mon Sep 17 00:00:00 2001 From: pelgraine <140762863+pelgraine@users.noreply.github.com> Date: Mon, 30 Mar 2026 13:20:31 +1100 Subject: [PATCH] remove sleep for remote repeater --- examples/simple_repeater/main.cpp | 14 ++++++++------ variants/lilygo_tdeck_pro/TDeckBoard.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/simple_repeater/main.cpp b/examples/simple_repeater/main.cpp index c1557053..7bcefb70 100644 --- a/examples/simple_repeater/main.cpp +++ b/examples/simple_repeater/main.cpp @@ -245,14 +245,16 @@ void loop() { #endif rtc_clock.tick(); - if (the_mesh.getNodePrefs()->powersaving_enabled && // To check if power saving is enabled - the_mesh.millisHasNowPassed(lastActive + nextSleepinSecs * 1000)) { // To check if it is time to sleep - if (!the_mesh.hasPendingWork()) { // No pending work. Safe to sleep - board.sleep(1800); // To sleep. Wake up after 30 minutes or when receiving a LoRa packet +#ifndef HAS_4G_MODEM + if (the_mesh.getNodePrefs()->powersaving_enabled && + the_mesh.millisHasNowPassed(lastActive + nextSleepinSecs * 1000)) { + if (!the_mesh.hasPendingWork()) { + board.sleep(1800); lastActive = millis(); - nextSleepinSecs = 5; // Default: To work for 5s and sleep again + nextSleepinSecs = 5; } else { - nextSleepinSecs += 5; // When there is pending work, to work another 5s + nextSleepinSecs += 5; } } +#endif } \ No newline at end of file diff --git a/variants/lilygo_tdeck_pro/TDeckBoard.h b/variants/lilygo_tdeck_pro/TDeckBoard.h index f7bee9f7..c9a09b29 100644 --- a/variants/lilygo_tdeck_pro/TDeckBoard.h +++ b/variants/lilygo_tdeck_pro/TDeckBoard.h @@ -22,7 +22,7 @@ // T-Deck Pro battery capacity (all variants use 1400 mAh cell) #ifndef BQ27220_DESIGN_CAPACITY_MAH -#define BQ27220_DESIGN_CAPACITY_MAH 2000 +#define BQ27220_DESIGN_CAPACITY_MAH 1400 #endif class TDeckBoard : public ESP32Board {