ESP8266 Developer Zone The Official ESP8266 Forum 2018-02-28T13:15:11+08:00 https://bbs.espressif.com:443/feed.php?f=15&t=105 2018-02-28T13:15:11+08:00 2018-02-28T13:15:11+08:00 https://bbs.espressif.com:443/viewtopic.php?t=105&p=19480#p19480 <![CDATA[Re: NTP support]]>

Code:

+CIPSNTPTIME:Thu Jan 01 00:00:00 1970
It is the initial time, did you connect the ESP8266 to the router?
The SNTP time should be got from the internet, it needs to connect to the router first.

Statistics: Posted by Her Mary — Wed Feb 28, 2018 1:15 pm


]]>
2018-02-26T04:14:14+08:00 2018-02-26T04:14:14+08:00 https://bbs.espressif.com:443/viewtopic.php?t=105&p=19452#p19452 <![CDATA[Re: NTP support]]>
Commands:

AT+CIPSNTPCFG=1,-3

OK
AT+CIPSNTPTIME?
+CIPSNTPTIME:Thu Jan 01 00:00:00 1970

Statistics: Posted by anlpereira — Mon Feb 26, 2018 4:14 am


]]>
2014-12-25T19:38:43+08:00 2014-12-25T19:38:43+08:00 https://bbs.espressif.com:443/viewtopic.php?t=105&p=354#p354 <![CDATA[Re: NTP support]]>
Regarding the messages, I will change to output to OK/ERROR.

Statistics: Posted by Tomer — Thu Dec 25, 2014 7:38 pm


]]>
2014-12-25T19:28:17+08:00 2014-12-25T19:28:17+08:00 https://bbs.espressif.com:443/viewtopic.php?t=105&p=353#p353 <![CDATA[Re: NTP support]]>
scargill wrote:
And are the binaries at 0000 and 0x40000??


Yes:
eagle.app.v6.flash.bin -> 0x0000
eagle.app.v6.irom0text.bin -> 0x40000

Statistics: Posted by Tomer — Thu Dec 25, 2014 7:28 pm


]]>
2014-12-25T19:30:14+08:00 2014-12-25T19:17:40+08:00 https://bbs.espressif.com:443/viewtopic.php?t=105&p=352#p352 <![CDATA[Re: NTP support]]>
On the assumption that the files load at 0 and x040000 I have loaded the version compiled with SDK 0.9.4 - the AT command set responds - and I put in the information for my router.

I set it up - to my router.. and then issued the command to go get the time..


OK
AT+CWMODE=1

OK
AT+CWJAP="loft-east","xxxxxxxxx"


OK
AT+CIPNTP=0

Sntp initializing TZ: GMT00...
Sntp initializing...
pool.ntp.orgsntp_request: Waiting for server address to be resolved.
AT+CIPNTP=0

Sntp initializing TZ: GMT00...
Sntp initializing...
sntp_dns_found: Failed to resolve server address resolved, trying next server
sntp_retry: Next request will be sent in 3000 ms
pool.ntp.orgsntp_request: Waiting for server address to be resolved.
sntp_dns_found: Failed to resolve server address resolved, trying next server
sntp_retry: Next request will be sent in 6000 ms
pool.ntp.orgsntp_request: Waiting for server address to be resolved.
sntp_dns_found: Failed to resolve server address resolved, trying next server
sntp_retry: Next request will be sent in 12000 ms
pool.ntp.orgsntp_request: Waiting for server address to be resolved.
sntp_dns_found: Failed to resolve server address resolved, trying next server
sntp_retry: Next request will be sent in 24000 ms
pool.ntp.orgsntp_request: Waiting for server address to be resolved.
sntp_dns_found: Failed to resolve server address resolved, trying next server
sntp_retry: Next request will be sent in 24000 ms
pool.ntp.orgsntp_request: Waiting for server address to be resolved.
sntp_dns_found: Failed to resolve server address resolved, trying next server
sntp_retry: Next request will be sent in 24000 ms
pool.ntp.orgsntp_request: Waiting for server address to be resolved.
sntp_dns_found: Failed to resolve server address resolved, trying next server
sntp_retry: Next request will be sent in 24000 ms

I left this one for ages and it wimply would not resolve the address...

So I powered the unit off - and then on - and tried again - and it worked... have you tried the NTP command without having the IP address in intially and setting the router info just maybe 10 seconds or so before trying this command?

When it is finished getting the time could you please have the response end with a line "OK" or "ERROR" to make it easier to know if this has succeeded or not - indeed that's all we really need to know....

Does it try one NTP server (dangerous) or a pool?

Pete.

Statistics: Posted by scargill — Thu Dec 25, 2014 7:17 pm


]]>
2014-12-25T16:40:34+08:00 2014-12-25T16:40:34+08:00 https://bbs.espressif.com:443/viewtopic.php?t=105&p=348#p348 <![CDATA[NTP support]]>
I added two new AT commands to get the time from NTP servers (pool.ntp.org). I used AT commands version 20 as starting point.

AT+CIPNTP=<offset from GMT> , to initialize the ntp, and start syncing the time - for example: AT+CIPNTP=2 to intialize it with GMT+2 offset.
AT+CIPNTP? - to get the current time, for example:

AT+CIPNTP?
Time: 22:22:42 12/02/2014 GMT+02

Binaries compiled with SDK 0.9.3: http://bit.ly/esp8266-ntp
Binaries compiled with SDK 0.9.4: http://bit.ly/esp8266-ntp0-9-4

Source code with SDK 0.9.3: https://github.com/TomerCo/ESP8266-AT

Comments/Suggestions are welcome.

Statistics: Posted by Tomer — Thu Dec 25, 2014 4:40 pm


]]>