我使用这个指令:
AT+CIPSNTPTIME?
返回时间不对
at哪条指令能够获取网络时间,命令找不到
Moderator: ESP_XCGuang
Re: at哪条指令能够获取网络时间,命令找不到
你设置的时区和 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
-
- Posts: 171
- Joined: Thu Sep 23, 2021 10:03 am
Re: at哪条指令能够获取网络时间,命令找不到
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哪条指令能够获取网络时间,命令找不到
那你可以先设置 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
AT+CIPSNTPCFG 命令文档:https://docs.espressif.com/projects/esp ... tpcfg-sntp
Who is online
Users browsing this forum: No registered users and 27 guests