
!
5. TCP/IP-Related AT Commands
5.2.22. AT+CIPSNTPCFG—Sets the Configuration of SNTP
5.2.23. AT+CIPSNTPTIME—Checks the SNTP Time
5.2.24. AT+CIPDNS_CUR—Sets User-defined DNS Servers; Configuration Not Saved in the Flash
Commands
Query Command:
AT+CIPSNTPCFG?
Set Command:
AT+CIPSNTPCFG=<enable>[,<timezone>][,<SNTP
server0>,<SNTP server1>,<SNTP server2>]
Response
+CIPSNTPCFG:<enable>,<timezone>,<SN
TP server1>[,<SNTP server2>,<SNTP
server3>]
OK
OK
Parameters
•
<enable>:
‣
0
: SNTP is disabled;
‣
1
: SNTP is enabled.
•
<timezone>
: time zone; range: [-11,13]; if SNTP is enabled, the <timezone> has to be set;
•
<SNTP server0>
: optional parameter indicating the first SNTP server;
•
<SNTP server1>
: optional parameter indicating the second SNTP server;
•
<SNTP server2>
: optional parameter indicating the third SNTP server.
Example
AT+CIPSNTPCFG=1,8,"cn.ntp.org.cn","ntp.sjtu.edu.cn","us.pool.ntp.org"
Note
If the <SNTP server> parameters are not set, servers
"cn.ntp.org.cn","ntp.sjtu.edu.cn",
"us.pool.ntp.org"
will be used by default.
Query
Command
AT+CIPSNTPTIME?
Response
+CIPSNTPTIME:<time>
OK
Parameters
<time>
: SNTP time
For example,
+CIPSNTPTIME:Thu Aug 04 14:48:05 2016
OK
Example
AT+CWMODE=1 //set station mode
AT+CWJAP="DemoAP","password" //connect to router, access the internet
AT+CIPSNTPCFG=8 //set time zone
AT+CIPSNTPTIME? //get time
Commands
Query Command:
AT+CIPDNS_CUR?
Function: Get the current DNS server.
Set Command:
AT+CIPDNS_CUR=<enable>[,<DNS server0>,<DNS server1>]
Function: Set user-defined DNS servers.
Espressif
!
/
!
54 58
2017.05