DeepSleep - Preserve Time

mojesp32s
Posts: 4
Joined: Wed Aug 22, 2018 5:01 pm

DeepSleep - Preserve Time

Postby mojesp32s » Wed Aug 22, 2018 5:17 pm

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?

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: DeepSleep - Preserve Time

Postby ESP_igrr » Wed Aug 22, 2018 11:03 pm

Please have a look at protocols/sntp example in ESP-IDF:

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

mojesp32s
Posts: 4
Joined: Wed Aug 22, 2018 5:01 pm

Re: DeepSleep - Preserve Time

Postby mojesp32s » Sun Aug 26, 2018 11:51 am

Tnx,

Link helped me and it works now.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 164 guests