Page 1 of 1

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

Posted: Wed Mar 02, 2022 9:09 am
by fst202130609
我使用这个指令:
AT+CIPSNTPTIME?

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

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

Posted: Wed Mar 02, 2022 9:29 am
by ESP_Sun
你设置的时区和 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

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

Posted: Wed Mar 02, 2022 9:37 am
by fst202130609
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?而已

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

Posted: Wed Mar 02, 2022 9:44 am
by ESP_Sun
那你可以先设置 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