Waking up from deep sleep, detect that and run different setup.
Posted: Tue Apr 03, 2018 4:28 pm
The ESP32 wakes up from deep sleep mostly in undefined state, requiring the setup() to run again.
I did not find yet an example of waking up from deep sleep, detecting that it is a return from deep sleep*, and then running an alternative setup procedure.
Can somebody provide a didactic example?
E.g. the SimpleTime example provides a SNTP sync with the internet time, then disables WiFi and let the RTC run on its own.
It uses delay(). For power saving reasons I would prefer using a deep sleep, but upon returning form deep sleep, it should avoid reinitializing the SNTP procedure.
Can anyone help?
Regards
*alternatively detecting that the RTC is set...
I did not find yet an example of waking up from deep sleep, detecting that it is a return from deep sleep*, and then running an alternative setup procedure.
Can somebody provide a didactic example?
E.g. the SimpleTime example provides a SNTP sync with the internet time, then disables WiFi and let the RTC run on its own.
It uses delay(). For power saving reasons I would prefer using a deep sleep, but upon returning form deep sleep, it should avoid reinitializing the SNTP procedure.
Can anyone help?
Regards
*alternatively detecting that the RTC is set...