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

rin67630
Posts: 102
Joined: Sun Mar 11, 2018 5:13 pm

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

Postby rin67630 » 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...

woofy!
Posts: 21
Joined: Tue Oct 03, 2017 12:02 pm

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

Postby woofy! » Tue Apr 03, 2018 4:41 pm


rin67630
Posts: 102
Joined: Sun Mar 11, 2018 5:13 pm

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

Postby rin67630 » Wed Apr 04, 2018 3:46 pm

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.

Who is online

Users browsing this forum: Baidu [Spider] and 53 guests