Page 1 of 1

Waking up from deep sleep, detect that and run different setup.

Posted: Tue Apr 03, 2018 4:28 pm
by rin67630
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...

Re: Waking up from deep sleep, detect that and run different setup.

Posted: Tue Apr 03, 2018 4:41 pm
by woofy!

Re: Waking up from deep sleep, detect that and run different setup.

Posted: Wed Apr 04, 2018 3:46 pm
by rin67630
Thank you that problem is solved.
See the new thread "Cannot get a Lolin32 to low-power upon deep sleep."

The problem is now, that all the deep sleep stuff has no power benefit.