Page 1 of 1

DeepSleep - Preserve Time

Posted: Wed Aug 22, 2018 5:17 pm
by mojesp32s
Hi

I would like to know if it is possible to preserve time when doing deep sleep? Any example?

My goal is to log time when it goes to deep sleep and retrieve the time when it wakes up. So i can calculate the difference in seconds.

I will connect to WIFI only on initial reset and not on other deep sleep wake ups.

Let say that i connect to ntpServer server on initial reset. I get the time.

Than ESP goes to sleep. When it wakes up can i retrieve the time or it is lost? Now i get 0.

If not possible Is there any other way using only ESP not external units?

Re: DeepSleep - Preserve Time

Posted: Wed Aug 22, 2018 11:03 pm
by ESP_igrr
Please have a look at protocols/sntp example in ESP-IDF:

https://github.com/espressif/esp-idf/tr ... cols/sntp/

Re: DeepSleep - Preserve Time

Posted: Sun Aug 26, 2018 11:51 am
by mojesp32s
Tnx,

Link helped me and it works now.