SNTP not working in ESP8266

exerion
Posts: 5
Joined: Sat Aug 12, 2017 9:30 pm

SNTP not working in ESP8266

Postby exerion » Fri Aug 18, 2017 6:18 pm

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)

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: SNTP not working in ESP8266

Postby ESP_Faye » Wed Aug 23, 2017 5:01 pm

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.

mobzero
Posts: 2
Joined: Thu Jul 12, 2018 1:19 am

Re: SNTP not working in ESP8266

Postby mobzero » Thu Jul 12, 2018 1:22 am

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.

Her Mary
Posts: 537
Joined: Mon Oct 27, 2014 11:09 am

Re: SNTP not working in ESP8266

Postby Her Mary » Fri Jul 20, 2018 9:50 pm

Have you connected the ESP8266 to a WiFi AP first?

mobzero
Posts: 2
Joined: Thu Jul 12, 2018 1:19 am

Re: SNTP not working in ESP8266

Postby mobzero » Fri Jul 20, 2018 11:27 pm

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.

anbly

Re: SNTP not working in ESP8266

Postby anbly » Fri Mar 06, 2020 11:32 pm

ESP_Faye wrote: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.

1.6的固件(esp-01s),设置时区之后依然获取到的只是初始时间

Who is online

Users browsing this forum: No registered users and 130 guests