SNTP AT command set

This section describes the driver SNTP instruction set. The instruction set has different adaptations for different modules. Please go to the next step for details:Firmware iterations and differences

AT+SNTPTIME:Example Query the SNTP time

explain

  • SNTP This function is disabled by default and needs to be started using AT+SNTPTIMECFG after networking. If this function is not enabled, the local RTC time is queried

inquiry command

command:

AT+SNTPTIME?

response:

+SNTPTIME:<week> <month> <day> <HH>:<mm>:<ss> <yyyy>
OK

parameter

  • <week>:week[Mon,Tue,Wed,Thu,Fri,Sat,Sun]

  • <month>:month[Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec]

  • <day>:day

  • <HH>:hour

  • <mm>:minute

  • <ss> :second

  • <yyyy> :year

example

AT+SNTPTIMECFG=1,8//Enable sntp

OK

AT+SNTPTIME?//Query the time after the synchronization is successful

+SNTPTIME:Wed May 03 10:49:41 2023

OK

AT+SNTPTIMECFG Query the time after the synchronization is successful. Query and set the SNTP time zone and server

Set command

command:

AT+SNTPTIMECFG=<enable>,<timezone>[,<SNTP server1>,<SNTP server2>,<SNTP server3>]

response:

OK

parameter

  • <enable>:SNTP Refresh service status Settings; 0 is closed. 1 Start

  • <timezone>:Time zone. The value ranges from -12 to +14

  • <SNTP server1/2/3>:SNTP server domain name, if the default value is “cn.ntp.org.cn”, “ntp.sjtu.edu.cn”, “us.pool.ntp.org”.

example

AT+SNTPTIMECFG=1,8,cn.ntp.org.cn

OK

inquiry command

command:

AT+SNTPTIMECFG?

response:

+SNTPTIMECFG:<enable>,<timezone>[,<SNTP server1>,<SNTP server2>,<SNTP server3>]

OK

parameter

  • <SNTPTIME>:response time

  • <enable>:Whether the SNTP refresh service is started. 0 is not running; 1 Running

  • <timezone>:Time zone. The value ranges from -12 to +14

  • <SNTP server1/2/3>:SNTP server domain name

example

AT+SNTPTIMECFG?

+SNTPTIMECFG:1,8,"cn.ntp.org.cn","ntp.sjtu.edu.cn","us.pool.ntp.org"

OK

AT+SNTPINTV Example Query and set the SNTP refresh interval

Set command

command:

AT+SNTPINTV=<interval second>

response:

OK

parameter

  • <interval second>:The value ranges from 15 to 4,294,967, expressed in seconds

example

AT+SNTPINTV=15

OK

inquiry command

command:

AT+SNTPINTV?

response:

  +SNTPINTV:<interval second>
  OK

interval second:Refresh interval, unit S

parameter

  • <interval second>: second:Refresh interval, unit S

example


AT+SNTPINTV?

+SNTPINTV:3600
OK