From ff081a8d44c601ba471e5fbdbce5c68144f8f4a9 Mon Sep 17 00:00:00 2001 From: Ollo Date: Mon, 1 Apr 2024 12:10:22 +0200 Subject: [PATCH] Increase deepsleep time --- esp32/src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index e25961e..f9d7d5a 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -204,7 +204,7 @@ void espDeepSleep(bool afterPump = false) esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); - long secondsToSleep = -1; + unsigned long secondsToSleep = -1; if (afterPump) { @@ -215,7 +215,6 @@ void espDeepSleep(bool afterPump = false) { if (mBatteryVoltage < VOLT_MIN_BATT) { - log(LOG_LEVEL_INFO, String(String(mBatteryVoltage) + "V! Almost empty -> deepSleepNight " + String(LOWVOLT_SLEEP_FACTOR)) + " times", LOG_SLEEP_LOWVOLTAGE); /* use the largest sleeping duration */ if (deepSleepNightTime.get() > deepSleepTime.get()) { secondsToSleep = (deepSleepNightTime.get() * LOWVOLT_SLEEP_FACTOR); @@ -226,6 +225,7 @@ void espDeepSleep(bool afterPump = false) if (secondsToSleep < LOWVOLT_SLEEP_MINIMUM) { secondsToSleep = LOWVOLT_SLEEP_MINIMUM; } + log(LOG_LEVEL_INFO, String(String(mBatteryVoltage) + "V! Almost empty -> deepSleepNight " + String(LOWVOLT_SLEEP_FACTOR)) + " times (" + secondsToSleep + "s)", LOG_SLEEP_LOWVOLTAGE); } else if (mSolarVoltage < SOLAR_CHARGE_MIN_VOLTAGE) {