at哪条指令能够获取网络时间,命令找不到

Moderator: ESP_XCGuang

fst202130609
Posts: 171
Joined: Thu Sep 23, 2021 10:03 am

at哪条指令能够获取网络时间,命令找不到

Postby fst202130609 » Wed Mar 02, 2022 9:09 am

我使用这个指令:
AT+CIPSNTPTIME?

返回时间不对
03.png
04.png

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: at哪条指令能够获取网络时间,命令找不到

Postby ESP_Sun » Wed Mar 02, 2022 9:29 am

你设置的时区和 SNTP server 是什么?(AT+CIPSNTPCFG 命令)
使用示例:

Code: Select all

AT+CWMODE=1
AT+CWJAP="1234567890","1234567890"
AT+CIPSNTPCFG=1,8,"cn.ntp.org.cn","ntp.sjtu.edu.cn"
AT+CIPSNTPTIME?
+CIPSNTPTIME:Tue Oct 19 17:47:56 2021
OK

或

AT+CWMODE=1
AT+CWJAP="1234567890","1234567890"
AT+CIPSNTPCFG=1,530
AT+CIPSNTPTIME?
+CIPSNTPTIME:Tue Oct 19 15:17:56 2021
OK

fst202130609
Posts: 171
Joined: Thu Sep 23, 2021 10:03 am

Re: at哪条指令能够获取网络时间,命令找不到

Postby fst202130609 » Wed Mar 02, 2022 9:37 am

ESP_Sun wrote:
Wed Mar 02, 2022 9:29 am
你设置的时区和 SNTP server 是什么?(AT+CIPSNTPCFG 命令)
使用示例:

Code: Select all

AT+CWMODE=1
AT+CWJAP="1234567890","1234567890"
AT+CIPSNTPCFG=1,8,"cn.ntp.org.cn","ntp.sjtu.edu.cn"
AT+CIPSNTPTIME?
+CIPSNTPTIME:Tue Oct 19 17:47:56 2021
OK

或

AT+CWMODE=1
AT+CWJAP="1234567890","1234567890"
AT+CIPSNTPCFG=1,530
AT+CIPSNTPTIME?
+CIPSNTPTIME:Tue Oct 19 15:17:56 2021
OK

我都不知道怎么设置时区和SNTP server,我就是连接WiFi之后用了这条命令AT+CIPSNTPTIME?而已

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: at哪条指令能够获取网络时间,命令找不到

Postby ESP_Sun » Wed Mar 02, 2022 9:44 am

那你可以先设置 AT+CIPSNTPCFG=1,8,"cn.ntp.org.cn","ntp.sjtu.edu.cn" 这条命令,或者 AT+CIPSNTPCFG=1,8,"ntp1.aliyun.com" 然后间隔 1s 再使用 AT+CIPSNTPTIME? 查询
AT+CIPSNTPCFG 命令文档:https://docs.espressif.com/projects/esp ... tpcfg-sntp

Who is online

Users browsing this forum: No registered users and 25 guests