Hi, I am just wondering does anyone know if there is a technical reason why it may NOT be possible to have both a timer interrupt AND an external interrupt setup at the same time on the ESP32. If I know this is not supposed to work, I can stop trying to fix..
I have successfully got both to work on their own, but not together and wondering if it is supported. Using Arduino environment with relevant included code snippets.
Works: (timer interrupt, wakes up after 1 hour).
esp_sleep_enable_timer_wakeup(3600000000);
esp_deep_sleep_start();
Works: (External interrupt when gpio33 goes high).
esp_sleep_enable_ext0_wakeup(GPIO_NUM_33,1);
esp_deep_sleep_start();
Not working: (timer and external interrup).
esp_sleep_enable_timer_wakeup(3600000000);
esp_sleep_enable_ext0_wakeup(GPIO_NUM_33,1);
esp_deep_sleep_start();
The use case I have in mind is as follows:
Wake-up once per day and send heartbeat signal (use timer interrupt for this).
Then go into deep sleep mode, with a PIR sensor primed (I.E gpio33 listening for external interrupt when movement detected).
So you can see how using the 2 types of wake-up are required.
But currently as soon as the esp_deep_sleep_start() is run, the device resets.
Good to know if its possible, and has anyone setup such a use case.
Thanks,
Rory
Using timer AND external interrupt to wake up from deep sleep mode.
-
- Posts: 1
- Joined: Sat Mar 03, 2018 9:55 pm
-
- Posts: 5
- Joined: Sun Apr 15, 2018 7:48 am
Re: Using timer AND external interrupt to wake up from deep sleep mode.
I have the same case. This you find a solution.?
Re: Using timer AND external interrupt to wake up from deep sleep mode.
How exactly it does not work ?rory_gleeson wrote:Not working: (timer and external interrup).
esp_sleep_enable_timer_wakeup(3600000000);
esp_sleep_enable_ext0_wakeup(GPIO_NUM_33,1);
esp_deep_sleep_start();
I'm using it all the time, also mixed with ext1 wake up and wake stub and it works as expected.
I'm not using Arduino, maybe it is an Arduino problem.
-
- Posts: 5
- Joined: Sun Apr 15, 2018 7:48 am
Re: Using timer AND external interrupt to wake up from deep sleep mode.
Hi,
Thank you very much. I am using Mongoose OS. I found the solution. I made a little mistake in my code.I fix it. But now I have a different problem . I posted this problem in the following post.
viewtopic.php?f=2&t=5493
Thank you very much. I am using Mongoose OS. I found the solution. I made a little mistake in my code.I fix it. But now I have a different problem . I posted this problem in the following post.
viewtopic.php?f=2&t=5493
Re: Using timer AND external interrupt to wake up from deep sleep mode.
Hi loboris, what IDE are you using for your projects? I'm starting with ESP32, I started using Arduino but there are many functions that don't work very wellloboris wrote: ↑Sun Apr 15, 2018 3:48 pmHow exactly it does not work ?rory_gleeson wrote:Not working: (timer and external interrup).
esp_sleep_enable_timer_wakeup(3600000000);
esp_sleep_enable_ext0_wakeup(GPIO_NUM_33,1);
esp_deep_sleep_start();
I'm using it all the time, also mixed with ext1 wake up and wake stub and it works as expected.
I'm not using Arduino, maybe it is an Arduino problem.
Regards, Lucas
Who is online
Users browsing this forum: No registered users and 86 guests