Page 1 of 1

SNTP not working in ESP8266

Posted: Fri Aug 18, 2017 6:18 pm
by exerion
Hello.

I'm always getting the same result with the CIPSNTPTIME? command: "+CIPSNTPTIME:Thu Jan 01 00:00:00 1970".
It's using the default servers, and I tested them outside the ESP just to check conectivity. Servers are active and reachable.
ESP is correctly connected to Wifi, STA mode, etc. I have tried different steps, configurations, servers, etc. It's always returning the same time (epoch).

Any suggestion?

ESP info:
AT version:1.4.0.0(May 5 2017 16:10:59)
SDK version:2.1.0(116b762)

Re: SNTP not working in ESP8266

Posted: Wed Aug 23, 2017 5:01 pm
by ESP_Faye
Hi,

You need to set the time zone first.

Code: Select all

AT+CIPSNTPCFG=1,8 //set time zone


If your problem is still unsolved, please feel free to let me know.
Sorry for the inconvenience.

Re: SNTP not working in ESP8266

Posted: Thu Jul 12, 2018 1:22 am
by mobzero
Hello, sorry for bumping in an old topic but i have the exact same problem.

Even when i set the SNTP configuration by:

Code: Select all

AT+CIPSNTPCFG=1,8

OK
or

Code: Select all

AT+CIPSNTPCFG=1,8,"cn.ntp.org.cn","ntp.sjtu.edu.cn","us.pool.ntp.org"

OK


When i check the time, i always get this:

Code: Select all

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


Any suggestion? Thanks.

Re: SNTP not working in ESP8266

Posted: Fri Jul 20, 2018 9:50 pm
by Her Majesty
Have you connected the ESP8266 to a WiFi AP first?

Re: SNTP not working in ESP8266

Posted: Fri Jul 20, 2018 11:27 pm
by mobzero
Yes. But my problem is already solved. It seems like if i give a little delay to my ESP it works perfectly. Just need to set the mode as a Station, connect to an AP, set the timezone and after a little delay i can ask for a time without a problem.

Thanks.