ESP32 Deep Sleep - is 24h sleep effectively possible?

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.

For such a long sleep time, using the ULP to control when the system wakes and sleeps, would be the route I'd take.

Way 1:

The ULP can do a thing or two whiles the main processor sleeps. Under the Arduino IDE to program the ULP use GNU Legacy make to program the ULP.

Under the Arduino IDE, the ULP gets only 2K of slow ram and 2K of fast ram and not 8K as stated in the API. I like to put the variables at address 2001 to 2048, leaving the lower address spaces for program storage. Remember the ULP is a 32bit processor and that each memory space will occupy a 32 bit address, even a bool.


WAY 2:
Oh, the issue you are running into is a known issue with the ESP32. You can, if using deep sleep, grab a fast RTC ram address to store a count, which will be preserved through a deep sleep wake up, to count the number of shorter wakes ups, say once an hour. When the count reaches 24 then clear the rtc fast address, run your program, and do the count thing again.


ESP32 API: API Reference - ESP32 - — ESP-IDF Programming Guide latest documentation