From 74b3e01556c54db0186b0b5353228e03108080a5 Mon Sep 17 00:00:00 2001 From: Patedam Date: Sat, 4 Apr 2026 15:48:26 -0400 Subject: [PATCH] Added deep sleep at the end with a 1 minute timer --- Client/main/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Client/main/main.cpp b/Client/main/main.cpp index 7dc21da..0c6d56c 100644 --- a/Client/main/main.cpp +++ b/Client/main/main.cpp @@ -1,6 +1,8 @@ #include #include +#include "sdkconfig.h" + #include "esp_event.h" #include "esp_log.h" #include "esp_system.h" @@ -8,8 +10,7 @@ #include "freertos/task.h" #include "nvs.h" #include "nvs_flash.h" -#include "sdkconfig.h" - +#include "esp_sleep.h" #include "epd.hpp" #include "led.hpp" #include "network.hpp" @@ -88,4 +89,11 @@ extern "C" void app_main() disconnect_wifi(); shutdown_network(); } + + ESP_LOGI(TAG, "Waiting 5 seconds before deep sleep..."); + vTaskDelay(pdMS_TO_TICKS(5000)); + + ESP_LOGI(TAG, "Entering Deep Sleep for 60 seconds..."); + esp_sleep_enable_timer_wakeup(60ULL * 1000000ULL); + esp_deep_sleep_start(); }