Hi everyone,
I'm currently working on a IoT project. The board is ESP32-based, from WaveShare displays. I'm using Arduino 1.8 as IDE.
The issue I'm having is about the DeepSleep feature. I'm able to send the device to sleep for a little over 3 hours maximum, but if I insert a higher amount of time (expressed in microseconds) it causes an overflow. Even though I'm using Arduino as the IDE, I'm still using the 2 functions provided by espressif libraries, which are:
esp_err_t esp_sleep_enable_timer_wakeup(uint64_t time_in_us);
esp_err_t esp_deep_sleep_start();
The type "uint64_t" sets a specific limit for the amount of microseconds that could be passed to the function, approximately something that amounts to 3 hours.
But browsing the specifics and some online resources, it's clearly stated that the ESP32, unlike the ESP8266, is able to deep sleep for over a year.
But how can I achieve such a thing? I mean, I don't need an entire year, but at least 8-9 hours. Ideally, the ESP32 is piloting a WaveShare display that should be able to remain in a deep sleep state for a night. The goal is to optimize battery duration by keeping the display sleeping for as long as I don't need the image refreshed on the display attached.
ESP32 - Deep Sleep for over 3 hours
Re: ESP32 - Deep Sleep for over 3 hours
Use the ULL (unsigned long long) modifier:
esp_deep_sleep_start(8ULL * 60 * 60 * 1000 * 1000); // sleep 8hrs
esp_deep_sleep_start(8ULL * 60 * 60 * 1000 * 1000); // sleep 8hrs
Who is online
Users browsing this forum: Joyes12 and 80 guests