Network AT Commands
Provides DNS, SNTP, ping, iperf throughput testing and other common network services.
Note
The Network AT commands are enabled by default.
Refer to Configuring Project (menuconfig) and navigate to
CONFIG AT CMDsettings. UncheckEnable Networkto disable this command set.
AT+PING
Functional Description
Perform ping test on domain name or IP address
Command Format
AT+PING=<host>[,<-t>,<-n>,<count>,<-l>,<size>]
AT+PING=<stop>
Response Format
Success:
OK
Error:
ERROR:<error_no>
Parameters
- <host>:
Target host address
Supports IPv4 address or domain name
- <-t>:
Ping the specified host until stopped
- <-n>:
Set ping packet count
Followed by <count> parameter
<count>: Number of ping packets
Positive integer
Default: 4
- <-l>:
Set packet size
Followed by <size> parameter
<size>: Packet size (bytes)
Positive integer
Default: 32
- <stop>:
Terminate current ping task
Special parameter value: stop
Note
<-t>, <-l>, <-n> parameters can be in any order
Error Codes
1: Empty parameters
2: Incorrect number of parameters
Examples
Default parameters test:
AT+PING=192.168.31.200
OK
[$][ping_test] 32 bytes from 192.168.31.1: icmp_seq=1 time=135 ms
[$][ping_test] 32 bytes from 192.168.31.1: icmp_seq=2 time=5 ms
[$][ping_test] 32 bytes from 192.168.31.1: icmp_seq=3 time=102 ms
[$][ping_test] 32 bytes from 192.168.31.1: icmp_seq=4 time=3 ms
[$][ping_test] 4 packets transmitted, 4 received, 0% packet loss, average 60 ms
[$][ping_test] min: 3 ms, max: 135 ms
Custom parameters test:
AT+PING=www.sohu.com,-n,3,-l,128
OK
[$][ping_test] 128 bytes from 192.168.31.1: icmp_seq=1 time=40 ms
[$][ping_test] 128 bytes from 192.168.31.1: icmp_seq=2 time=9 ms
[$][ping_test] 128 bytes from 192.168.31.1: icmp_seq=3 time=21 ms
[$][ping_test] 3 packets transmitted, 3 received, 0% packet loss, average 23 ms
[$][ping_test] min: 9 ms, max: 40 ms
AT+IPERF
Functional Description
TCP/UDP network bandwidth test
Note
This command is only supported in manual test mode.
Command Format
Server mode:
AT+IPERF=<-s>[,<-p>,<port>,<-u>]
Client mode:
AT+IPERF=<-c>,<host|stop>[,<-i>,<periodic>,<-l>,<size>,<-u>,<-b>,<bandwidth>,<-d>,<-t>,<transtime>,<-n>,<count>,<-S>,<tos>]
Response Format
Success:
OK
Error:
ERROR:<error_no>
Parameters
- <-s>:
Server mode
- <-c>:
Client mode
Followed by <host|stop> parameter
<host|stop>: Target host or stop command
<stop>: Terminate specific/all test streams
<host>: Server host IPv4 address
- <-p>:
Set port number
Followed by <port> parameter
<port>: Server port
Range [1,65535]
Default: 5001
- <-u>:
Use UDP protocol
Default TCP when omitted
- <-i>:
Set report interval
Followed by <periodic> parameter
<periodic>: Bandwidth report interval (seconds)
Positive integer
- <-l>:
Set packet size
Followed by <size> parameter
<size>: Packet size (bytes)
Positive integer
Default: 1460
- <-b>:
Set UDP bandwidth
Followed by <bandwidth> parameter
<bandwidth>: Bandwidth (bits/sec)
Default: 1
- <-d>:
Enable bidirectional test
- <-t>:
Set test duration
Followed by <transtime> parameter
<transtime>: Transmission duration (seconds)
Default: 10
- <-n>:
Set transmission byte count
Followed by <count> parameter
<count>: Byte count
Positive integer
- <-S>:
Set IP TOS field
Followed by <tos> parameter
<tos>: TOS value
Range [0,255]
Error Codes
1: Empty parameters
3: Incorrect number of parameters
Note
Parameters like <-t>, <-l>, <-i> can be in any order
Examples
TCP test:
AT+IPERF=-s,-p,5002
AT+IPERF=-c,192.168.1.2,-t,100,-p,5002
UDP test:
AT+IPERF=-c,192.168.1.2,-t,100,-p,5002,-u
AT+IPERF3
Functional Description
TCP network bandwidth test (IPERF3 protocol)
Note
This command is only supported in manual test mode.
Command Format
Server mode:
AT+IPERF3=<-s>[,<-p>,<port>]
Client mode:
AT+IPERF3=<-c>,<host|stop>[,<-i>,<periodic>,<-l>,<size>,<-d>,<-t>,<transtime>,<-n>,<count>]
Response Format
Success:
OK
Error:
ERROR:<error_no>
Parameters
- <-s>:
Server mode
- <-c>:
Client mode
Followed by <host|stop> parameter
<host|stop>: Target host or stop command
<stop>: Terminate specific/all test streams
<host>: Server host IPv4 address
- <-p>:
Set port number
Followed by <port> parameter
<port>: Server port
Range [1,65535]
Default: 5001
- <-i>:
Set report interval
Followed by <periodic> parameter
<periodic>: Bandwidth report interval (seconds)
Positive integer
- <-l>:
Set packet size
Followed by <size> parameter
<size>: Packet size (bytes)
Positive integer
Default: 1460
- <-d>:
Enable bidirectional test
- <-t>:
Set test duration
Followed by <transtime> parameter
<transtime>: Transmission duration (seconds)
Default: 10
- <-n>:
Set transmission byte count
Followed by <count> parameter
<count>: Byte count
Positive integer
Error Codes
1: Empty parameters
2: Incorrect number of parameters
Note
Parameters like <-t>, <-l>, <-i> can be in any order
Examples
AT+IPERF3=-s,-p,5002
AT+IPERF3=-c,192.168.1.2,-t,100,-p,5002
AT+DNS
Functional Description
Resolve domain name to IP address
Note
The DNS AT commands are disabled by default.
Refer to Configuring Project (menuconfig) to enter
CONFIG AT CMDconfiguration and checkDNS MQTTto enable the DNS AT commands.
Command Format
AT+DNS=<host>
Response Format
Success:
+DNS:<ip_address>
OK
Error:
ERROR:<error_no>
Parameters
- <host>:
Target host domain name
Error Codes
1: Empty parameters
2: Domain name resolution failed
Usage Example
Resolve domain name www.baidu.com:
AT+DNS=www.baidu.com
+DNS:103.235.46.102
OK
AT+QUERYDNSSRV
Functional Description
Query currently configured DNS server addresses
Note
The DNS AT commands are disabled by default.
Refer to Configuring Project (menuconfig) to enter
CONFIG AT CMDconfiguration and checkDNS MQTTto enable the DNS AT commands.
Command Format
AT+QUERYDNSSRV
Response Format
Success:
+QUERYDNSSRV:[<primary_dns>,<secondary_dns>]
OK
Error:
ERROR:<error_no>
Error Codes
1: Non-empty input parameters
Usage Example
Query DNS servers:
AT+QUERYDNSSRV
+QUERYDNSSRV:8.8.8.8, 8.8.4.4
OK
AT+SETDNSSRV
Functional Description
Set DNS server addresses
Note
The DNS AT commands are disabled by default.
Refer to Configuring Project (menuconfig) to enter
CONFIG AT CMDconfiguration and checkDNS MQTTto enable the DNS AT commands.
Command Format
AT+SETDNSSRV=<primary_dns>[,<secondary_dns>]
Response Format
Success:
OK
Error:
ERROR:<error_no>
Parameters
- <primary_dns>:
Primary DNS server address
- <secondary_dns>:
Secondary DNS server address (optional)
Error Codes
1: Incorrect number of parameters
2: Invalid DNS server address format
Usage Example
Set one DNS server 8.8.8.8:
AT+SETDNSSRV=8.8.8.8
OK
Set two DNS servers 8.8.8.8 and 8.8.4.4:
AT+SETDNSSRV=8.8.8.8,8.8.4.4
OK
AT+SNTPCFG
Functional Description
Configure SNTP service status, timezone, update interval, and server list.
Note
The SNTP AT commands are disabled by default.
Refer to Configuring Project (menuconfig) to enter
CONFIG AT CMDconfiguration and checkSNTP MQTTto enable the SNTP AT commands.
Command Format
AT+SNTPCFG=<enable>[,<timezone>][,<interval>][,<server1>][,<server2>][,<server3>]
Response Format
Success:
OK
Error:
ERROR:<error_no>
Parameters
- <enable>:
Enable SNTP service
0: Disable
1: Enable
- <timezone>:
Timezone offset, supports two formats:
Format 1: In hours, range: [-12,14]
Format 2: UTC offset, format: [+|-][hh]mm, hour (hh) range: [-12,14], minute (mm) range: [00,59]
Default value: 8, China timezone (UTC+08:00)
- <interval>:
Synchronization interval (seconds)
Range: [15,1073741]
Default value: 15
- <server1>:
The first SNTP server address
- <server2>:
The second SNTP server address
- <server3>:
The third SNTP server address
Supports up to 3 servers
If no server is specified, defaults to
pool.ntp.org
Error Codes
1: Incorrect number of parameters
2: Invalid parameter format
Examples
Enable SNTP service with China timezone (UTC+08:00), update interval 15 seconds, and servers pool.ntp.org , ntp.sjtu.edu.cn and ntp.aliyun.com :
AT+SNTPCFG=1,8,15,pool.ntp.org,ntp.sjtu.edu.cn,ntp.aliyun.com
OK
Enable SNTP service with New York timezone (UTC-05:00), update interval 60 seconds, and server time.google.com :
AT+SNTPCFG=1,-500,60,time.google.com
OK
Enable SNTP service with Chatham Islands timezone (UTC+12:45), default interval, and server time.google.com :
AT+SNTPCFG=1,1245,,time.google.com
OK
AT+SNTPQUERY
Functional Description
Query current SNTP configuration
Note
The SNTP AT commands are disabled by default.
Refer to Configuring Project (menuconfig) to enter
CONFIG AT CMDconfiguration and checkSNTP MQTTto enable the SNTP AT commands.
Command Format
AT+SNTPQUERY
Response Format
Success:
enable: <SNTP service enabled status, 0: disabled, 1: enabled>
timezone: <timezone>
interval: <update interval (seconds)>
server_count: <number of configured servers>
server0: <SNTP server address 1>
server1: <SNTP server address 2>
server2: <SNTP server address 3>
OK
Error:
ERROR:<error_no>
Error Codes
1: Invalid parameter
Usage Example
AT+SNTPQUERY
enable: 1
timezone: 800
interval: 60
server_count: 2
server0: pool.ntp.org
server1: ntp.sjtu.edu.cn
OK
AT+SNTPTIME
Functional Description
Query current SNTP time
Note
The SNTP AT commands are disabled by default.
Refer to Configuring Project (menuconfig) to enter
CONFIG AT CMDconfiguration and checkSNTP MQTTto enable the SNTP AT commands.
Command Format
AT+SNTPTIME
Response Format
Success:
+SNTPTIME:<current_time> <timezone>
OK
Error:
ERROR:<error_no>
Examples
AT+SNTPTIME
+SNTPTIME:2025-10-20 18:30:30 UTC+08:00
OK