Using the exact code from the example I wondered to did get this output:
Boot number: 2
wakeup_reason = 4
Wakeup caused by touchpad
Setup ESP32 to sleep for every 5 Seconds
Although the wakeup is really caused by the timer.
Trying a different case statement however works fine:
case ESP_SLEEP_WAKEUP_EXT0 : Serial.println(“Wakeup caused by external signal using RTC_IO”); break;
case ESP_SLEEP_WAKEUP_EXT1 : Serial.println(“Wakeup caused by external signal using RTC_CNTL”); break;
case ESP_SLEEP_WAKEUP_TIMER : Serial.println(“Wakeup caused by timer”); break;
case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println(“Wakeup caused by touchpad”); break;
case ESP_SLEEP_WAKEUP_ULP : Serial.println(“Wakeup caused by ULP program”); break;
default : Serial.printf(“Wakeup was not caused by deep sleep: %d\n”, wakeup_reason); break;
According to my findings the definition in
line 62 the enum statement gives ESP_SLEEP_WAKEUP_TIMER indeed the number 4
So the numbers of the cases in the example should be changed?
I’ve tested the example with the latest release of ESP32 for Arduino IDE, and it is working fine.
I get “Wakeup caused by timer”
Are you using the latest table release or the latest development release? https://github.com/espressif/arduino-esp32
Thank you for your quick answer!
Please excuse my impertinent question: are you sure to use the latest update?
I found that with the latest update from Sep 21, 2018 there has really been a change in the file:
A new wakeup item has been added and with that update the timer wakeup got now number 4 (in former versions it’s been number 3)
I think other new users with a fresh installed environment will see the same effect as I did.
Perhaps you can check it.
Anyway – Thank you for your great job and all the material you did supply!!!
For you an Rui a happy & successful new year!
I was not able to reproduce that error.
I get the right wake up reason with the latest installation.
I think that issue was already resolved. Take a look at the following links:
I hope this helps. Let me know if you have any other issues.
Thank you for supporting our work!