ESP8266 Developer Zone The Official ESP8266 Forum 2016-06-19T18:20:50+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=934 2016-06-19T18:20:50+08:00 2016-06-19T18:20:50+08:00 https://bbs.espressif.com:443/viewtopic.php?t=934&p=7403#p7403 <![CDATA[Re: How to check if sntp_init() completed?]]> Statistics: Posted by eriksl — Sun Jun 19, 2016 6:20 pm


]]>
2016-06-08T14:05:16+08:00 2016-06-08T14:05:16+08:00 https://bbs.espressif.com:443/viewtopic.php?t=934&p=7256#p7256 <![CDATA[Re: How to check if sntp_init() completed?]]>
Yes. SNTP is getting time info from internet, it needs to connect to router first.

Statistics: Posted by ESP_Faye — Wed Jun 08, 2016 2:05 pm


]]>
2016-06-07T11:38:53+08:00 2016-06-07T11:38:53+08:00 https://bbs.espressif.com:443/viewtopic.php?t=934&p=7236#p7236 <![CDATA[Re: How to check if sntp_init() completed?]]>
About the usage of testing the sntp I have changed to the api provided example way to do.

The results still shows sntp start first !

Does this sntp api should first connect to router ?

because connect to server right ?

Statistics: Posted by PaulTsai111 — Tue Jun 07, 2016 11:38 am


]]>
2016-06-06T10:14:51+08:00 2016-06-06T10:14:51+08:00 https://bbs.espressif.com:443/viewtopic.php?t=934&p=7208#p7208 <![CDATA[Re: How to check if sntp_init() completed?]]>
Please refer to the documentation "ESP8266 Non-OS SDK API Guide" http://www.espressif.com/support/download/documents.

Thanks for your interest in ESP8266 !

Statistics: Posted by ESP_Faye — Mon Jun 06, 2016 10:14 am


]]>
2016-06-03T18:47:10+08:00 2016-06-03T18:47:10+08:00 https://bbs.espressif.com:443/viewtopic.php?t=934&p=7196#p7196 <![CDATA[Re: How to check if sntp_init() completed?]]>
I have encountered the same question , sntp_get_real_time got 1970 ..........

Can you show me where I can find espressif Documents ? about sntp_get_real_time usage ?

I hope to correct my code thanks you !!

Statistics: Posted by PaulTsai111 — Fri Jun 03, 2016 6:47 pm


]]>
2015-08-13T13:52:08+08:00 2015-08-13T13:52:08+08:00 https://bbs.espressif.com:443/viewtopic.php?t=934&p=3198#p3198 <![CDATA[Re: How to check if sntp_init() completed?]]>
also when RTOS SDK will have SNTP support?

Statistics: Posted by derekh — Thu Aug 13, 2015 1:52 pm


]]>
2015-08-11T16:43:42+08:00 2015-08-11T16:43:42+08:00 https://bbs.espressif.com:443/viewtopic.php?t=934&p=3146#p3146 <![CDATA[Re: How to check if sntp_init() completed?]]> Statistics: Posted by deadmetaphor — Tue Aug 11, 2015 4:43 pm


]]>
2015-08-11T15:08:21+08:00 2015-08-11T15:08:21+08:00 https://bbs.espressif.com:443/viewtopic.php?t=934&p=3140#p3140 <![CDATA[Re: How to check if sntp_init() completed?]]>
So sorry for the inconvenience.

Set a timer to check if current_stamp got a real timestamp, not 0 any more.

Code:

uint32 current_stamp;
current_stamp = sntp_get_current_timestamp();


We will update our example in documentation.

Thanks for your interest in ESP8266 !

Statistics: Posted by ESP_Faye — Tue Aug 11, 2015 3:08 pm


]]>
2015-08-11T14:57:37+08:00 2015-08-11T14:57:37+08:00 https://bbs.espressif.com:443/viewtopic.php?t=934&p=3139#p3139 <![CDATA[How to check if sntp_init() completed?]]>
It works fine except that sometimes when I call

Code:

sntp_get_current_timestamp()


it returns the time equivalent to "1970.01.01 00:00:00" and logs an error

Code:

please start sntp first !


How to I test if sntp_init() has completed? Or, provide a callback perhaps?

Statistics: Posted by deadmetaphor — Tue Aug 11, 2015 2:57 pm


]]>