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 SDK (menuconfig) and navigate to CONFIG AT CMD settings. Uncheck Enable Network to disable this command set.

AT+PING

Functional Description

Perform ping test on domain name or IP address

Command Format

AT+PING=<host>[,<-t>,<interval>,<-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>: Set interval time
    • Followed by <interval> parameter

    • <interval>: Interval time (seconds) - Positive integer - Default: 1

  • <-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