Hi,
I have issues with the following code:
extern "C" void app_main(void) {
ets_delay_us(10001000);
ets_printf("wakeup_cause=%d reset_reason=%d\n", esp_sleep_get_wakeup_cause(), esp_reset_reason());
esp_sleep_enable_timer_wakeup(5001000);
esp_deep_sleep_start();
Most of the time it outputs a wakeup_cause 4 and a reset_reason 8, which is fine as it corresponds to a wake-up from deep sleep.
However from time to time, it (randomly?) outputs a wakeup_cause 0 and a reset_reason 1, corresponding to a power-on reset (see below).
The same code on an Arduino Nano ESP32 works just fine, I can see no poweron resets after wake-ups.
I am reading the text from "idf.py monitor". The code is built with EDF-IDF v5.1.4.
Do you know how to work around this?
Many thanks!
I (322) main_task: Calling app_main()
wakeup_cause=0 reset_reason=0
--- Error: read failed: [Errno 6] Device not configured
--- Waiting for the device to reconnect.
wakeup_cause=4 reset_reason=8
--- Error: read failed: [Errno 6] Device not configured
--- Waiting for the device to reconnect.
wakeup_cause=4 reset_reason=8
--- Error: read failed: [Errno 6] Device not configured
--- Waiting for the device to reconnect.
wakeup_cause=4 reset_reason=8
--- Error: read failed: [Errno 6] Device not configured
--- Waiting for the device to reconnect.
wakeup_cause=4 reset_reason=8
--- Error: read failed: [Errno 6] Device not configured
--- Waiting for the device to reconnect.
PROBLEM --> wakeup_cause=0 reset_reason=1
--- Error: read failed: [Errno 6] Device not configured
--- Waiting for the device to reconnect.