Hi , I am working my way through the ESP32 course .
And in Module 3 Unit 4 I have enabled the ext1 external trigger to monitor pins 36 and 39 ( bit mask 0x 9000000000) . The interupts work and the ESP32 wakes up when ever either of these two pins are toggled. BUT the print_GPIO_wake_up() function returns “GPIO that triggered the wake up: GPIO inf” and not the GPIO that caused the wake up. This may be because esp_sleep_get_ext1_wakeup_status() returns 0 and log (0) is inf.
Do you know of a fix for this ?
In my project I want to know which pin woke the ESP32 up and act appropriately
Hi John. That’s weird…
If you are using GPIOs 36 and 39, the esp_sleep_get_ext1_wakeup_status() shouldn’t return 0. At the documentation, it says that the esp_sleep_get_ext1_wakeup_status() can return one of the following two options:
- Get the bit mask of GPIOs which caused wakeup (ext1)
- If wakeup was caused by another source, this function will return 0. (http://esp-idf.readthedocs.io/en/latest/api-reference/system/sleep_modes.html)
So, it seems that the ESP considers that it is being woken up by another source or something.
Did that happens only with those pins 36 and 39, or did you get the same result to another pins?
GPIOs 36 and 39 are connected to the internal VP and VN sensors. Can you try with another pins and see if you get the same result?
I hope this helps.
Thanks for the reply, I tried the Sketch again using other allowed GPIO pins and it works as expected for all except the 6 pins in the range 32-39. Looks like I will have to re-arrange my PCB and use these pins for other things.
I don’t know why that happens. Maybe it is some property of those pins that I’m not aware of.
I know that pins 34 to 39 are input only, but that shouldn’t make any difference.
Thanks for testing and letting us know that.