Deepsleep - wakeup reason is wrong
Posted: Wed Mar 01, 2023 2:55 pm
I put my esp32 in deepsleep after configuring the following wakeup sources:
When it wakes up I print the 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
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);
Code: Select all
wakeup_reason = esp_sleep_get_wakeup_cause();
Serial.println("wakeup_reason");
Serial.println(wakeup_reason);
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