ESP32 - Keep the deep sleep timing when other wakeup source occurs

I'm working on a system that should wakeup every 2 minutes to perform a specific task and come back to sleep. During the sleep I need to count the edges (rise and fall) of a signal so I implemented the EXT1 wakeup too. But when the system wakes up by EXT1, if I use only the esp_sleep_enable_ext1_wakeup function to come back to sleep the timer wakeup is disabled, so I need to know how many seconds remains to the next timer wakeup and use them with the esp_sleep_enable_timer_wakeup function.

How can I keep the deep sleep timing when other wakeup source occurs?

Use the ULP, that's the other ESP32's processor, to keep track of things while the main processor is sleeping.

An example would be nice :grinning:. Anyway I solved my problem with the time( NULL ) that keep the time elapsed since the system power up, also in deep sleep. I don't know if it's the best solution but it works!

Here is a nice,

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/search.html?q=ulp&check_keywords=yes&area=default

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.