Deepsleep - wakeup reason is wrong

bobo1974
Posts: 26
Joined: Fri Feb 08, 2019 2:14 pm

Deepsleep - wakeup reason is wrong

Postby bobo1974 » Wed Mar 01, 2023 2:55 pm

I put my esp32 in deepsleep after configuring the following wakeup sources:

Code: Select all

esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, 0);
esp_sleep_enable_ext1_wakeup(GPIO_SEL_32, ESP_EXT1_WAKEUP_ANY_HIGH);
esp_sleep_enable_timer_wakeup(CHARGING_WAKEUP_INTERVAL);
When it wakes up I print the wakeup reason

Code: Select all

wakeup_reason = esp_sleep_get_wakeup_cause();
Serial.println("wakeup_reason");
Serial.println(wakeup_reason);
When the wakeup source is ext0: it works, the ESP32 leaves sleep. BUT the wakeup reason returned is -2- Timer.

Now when I comment out the timer source esp_sleep_enable_timer_wakeup(CHARGING_WAKEUP_INTERVAL), in this case I get the correct wakeup reason as EXT0.

Anyone has an idea why?
I'm only giving out extracts as they are part of a much larger program. I'm using Board manager 2.0.3

Who is online

Users browsing this forum: No registered users and 44 guests