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(); }