Repository navigation
Command Reference
- About
- Core AT Commands
- AT& extended commands
- AT+ commands
- SLIP and PPP modes
- AT$ configuration variables
- ATS registers
- Espressif AT commands
This contains a full list of Hayes-style AT commands compatible with the PerryZi firmware. Note that, for the majority of commands that use quotes, those quotes are optional unless the parameter contains one or more spaces. This is not true, however, for Espressif commands, and quotes should always be used if expected by the command.
| Command | Description |
|---|---|
AT |
Attention prefix. On its own, returns OK. Prefixes all commands below. |
ATA |
Answer / accept a waiting incoming connection. |
ATB<n> |
Set the serial baud rate. A comma-separated suffix may set the line format (data/parity/stop). |
ATC |
Connect: bring up wifi (and/or open the pending connection). |
ATD"host:port"ATDT"host:port"
|
Dial a remote host and enter online (stream) mode. The T in ATDT is optional. |
ATDT5517545ATDT5517546
|
Enter SLIP mode (5517545) or PPP mode (5517546), as AT+SLIP and AT+PPP do, but replying CONNECT instead of OK. See SLIP and PPP modes. |
ATE<n> |
Echo:0 - off1 - on |
ATF<n> |
Serial flow-control type:0 - RTS/CTS1 - XON/XOFF, 2 - XON/XOFF auto-off3 - manual4 - disabled |
ATH |
Hang up: close all open connections. |
ATI<n> |
Information:0 / 1 / 5 - settings strings2 - IP3 - SSID4 - firmware version6 - MAC7 - date/time8 - build date9 - network details10 - last printer spec11 - free heap |
ATL |
Re-send the last packet on a connection. |
ATM |
Hayes compatibility (speaker control); no operation. |
ATN<n> |
Create or remove a TCP listener (server) port. |
ATO |
Return to online (stream) mode with the current connection, or dial a phonebook entry by number. |
ATP |
Phonebook: list, add or remove stored dialling entries. |
ATQ<n> |
Quiet mode:0 - enable result codes1 - suppress result codes |
ATR<n> |
Line-ending mode:0 - CR1 - CRLF2 - LFCR3 - LF
|
ATRD / ATRT
|
Display the current UTC date/time obtained via NTP from uk.pool.ntp.org in NIST time format:YY-MM-DD HH:MM:SSImplemented to maintain compatibility with ST.COM
|
ATS<n>? / ATS<n>=<v>
|
Read or write an S-register. See the ATS registers table below. |
ATT |
Transmit a data packet to the current connection (optional CRC). |
ATV<n> |
Result-code style:0 - numeric1 - verbose |
ATW |
WiFi: scan/list access points, or connect with:ATW"SSID,PASSWORD"
|
ATX<n> |
Result-code set:0 - short1 - long/extended |
ATY |
Hayes compatibility; no operation. |
ATZ |
Reset the modem and reload the last saved configuration. |
| Command | Description |
|---|---|
AT&D<c> |
Append a character to the delimiter set. |
AT&F |
Factory reset. |
AT&F86 |
Factory reset, and reformat the SPIFFS filesystem. |
AT&G |
Fetch/stream a web URL to the terminal. |
AT&K<n> |
Flow-control shortcut:0 / 1 / 2 - off3 / 6 - RTS/CTS4 / 5 - XON/XOFF. |
AT&L |
Reload configuration from flash. |
AT&M<c> |
Append a character to the "mask-out" set (bytes stripped from the stream). |
AT&N<n> / AT&N<n>=<v>
|
Read or force a GPIO pin. |
AT&O<n> |
Start logging if no argument is provided. Debug log control: 0 - dump log86 / 87 - delete log88 - log and echo to UART |
AT&S<n>=<value> |
Set a string setting:40 - mDNS hostname41 - terminal type42 - busy message |
AT&T |
Show the current time. Configure the timezone: AT&T<args>
|
AT&W |
Save the current configuration to flash. |
AT&Y... |
Define the escape/state-machine sequence. |
| Command | Description |
|---|---|
AT+CONFIG |
Enter the interactive configuration menu. Its SLIP and PPP settings submenu toggles automatic SLIP entry (S65), automatic PPP entry (S66) and the blocking of broadcasts and multicasts to the host (S67); see SLIP and PPP modes. Settings changed in the menu are saved when you leave it and answer y. |
AT+IRC |
Enter IRC chat mode. |
AT+PING"host" |
Ping a host to test connectivity/DNS. |
AT+PPP |
Enter PPP networking mode: the modem becomes a PPP server for the host, and the host's traffic is passed between the host and wifi unchanged; the host shares the modem's wifi address. Replies OK once the mode has started, or ERROR if it could not be started. See SLIP and PPP modes. |
AT+PRINT<mode>:<host>:<port>/<path> |
Print to a CUPS/IPP printer. Mode is Ascii, or Raw. |
AT+SLIP |
Enter SLIP networking mode: IP packets over the serial line (RFC 1055), passed between the host and wifi unchanged; the host shares the modem's wifi address. Replies OK once the mode has started, or ERROR if it could not be started. See SLIP and PPP modes. |
In SLIP and PPP modes, the serial line is a network link between the host computer and the modem. From PerryZi 1.3.0, the host shares the modem's own wifi IP address: there is no NAT, and packets are passed between the host and wifi unchanged. The modem is not a router, so it is not a hop on the way to anywhere; the first hop is the wifi network's own router.
-
Network to host: every TCP, UDP and ICMP packet for the modem's wifi address is passed to the host, including incoming connections from the network, except UDP to port 68, which stays with the modem's own DHCP client. Broadcasts and multicasts are passed only with
S67=0(by default they are blocked). Other IP protocols are not passed. -
Host to network: the host must send from the modem's wifi address, which it shares; a packet with any other source address is dropped. A packet the host sends to that address, its own, is dropped too, as there is nowhere for it to go.
-
Largest IP packet: 1500 bytes, both ways.
In SLIP mode, the modem answers DHCP (and BOOTP) on the serial line itself, giving the host the modem's wifi address, the wifi netmask, the wifi gateway, the modem's DNS servers, and a lease of 3600 seconds. Nothing is answered while the modem has no wifi address, so the host must ask again. A request for an address that is no longer the modem's (for example after the modem has rejoined wifi with another address) is answered with a DHCPNAK, and the host must start again. A host set up with a fixed address instead must use the modem's own wifi address, so the modem needs a fixed address too: a static address set with AT+CONFIG, or a reservation on the router.
In PPP mode the host is given the modem's wifi address, the wifi gateway as the modem's end of the link, and the modem's DNS servers during negotiation (IPCP). No authentication is asked for, and VJ header compression is not accepted.
-
Entering either mode closes any connections the modem itself has open.
-
The modem's clock is not updated from NTP.
-
AT+SLIPorATDT5517545for SLIP,AT+PPPorATDT5517546for PPP. The modem waits about a second, discards anything else received in that time (such as anLFafter the command'sCR), starts the mode and then replies. The host should wait for the reply before sending its first packet. -
Automatically, from command mode, when the host simply starts sending packets, so that network software does not need to send any AT commands:
-
With
S65=1(the default), a complete SLIP frame switches the modem to SLIP mode:0xC0, an IPv4 packet with a correct header checksum and a total length equal to the frame's length, then0xC0. The packet is then handled as the first one, and no reply is sent. -
With
S66=1(the default), a PPP LCP Configure-Request switches the modem to PPP mode:0x7E,0xFF,0x03,0xC0,0x21, code1, the rest of the request and a correct frame check sequence, then0x7E. The request is then answered as the start of the session. -
Nothing that can be typed on a terminal can do this, as
0xC0and0xFFare not ASCII characters. The bytes of a possible frame are held back (not echoed, and not added to the command line) until it is known whether they are one; if they are not, those that could have been typed are processed as usual, slightly later. A mode is only ever entered from command mode, never while a connection is open (so a file upload cannot start one), and the data ofAT+CIPSENDis not looked at.
-
Both modes are left with the escape sequence: at least one second with nothing sent, the escape character (S2, + by default) three times, and at least one second with nothing sent. SLIP mode ends at once; PPP mode first closes the session with the host (LCP Terminate-Request). The modem then replies NO CARRIER and is in command mode again. A working SLIP or PPP host cannot send the sequence by accident: every frame starts and ends with a delimiter, so the last byte before a pause is never the escape character, and nothing after a pause starts with it. The escape sequence is not recognised in these modes if S2 is set to one of the framing bytes (0xC0, 0xDB, 0x7E or 0x7D).
PPP mode also ends, back to command mode, when the host closes the session.
The modem does not switch from one mode to the other by itself: in SLIP mode, PPP frames are thrown away, and in PPP mode, SLIP frames are thrown away. To change mode, the host must leave the current one with the escape sequence first.
| Command | Description |
|---|---|
AT$MDNS=<value> |
Set the mDNS hostname. |
AT$PASS=<value> |
Set the wifi password. |
AT$SB=<value> |
Set the serial baud rate. |
AT$SSID=<value> |
Set the wifi SSID. |
Read a register with ATS<n>? and set one with ATS<n>=<v>.
| Register | Meaning | Values |
|---|---|---|
0 |
Auto-answer: number of rings before answering an incoming connection (0 disables auto-answer). |
0 to 255
|
2 |
Escape character used in the +++ escape sequence. The sequence is at least one second of silence, the character three times (no more than a second apart), then at least one second of silence. It also leaves SLIP and PPP modes. |
0 to 255
|
3 |
Carriage-return character code. |
0 to 127
|
4 |
Line-feed character code. A line feed straight after a carriage return is ignored, so a terminal that ends its lines with CR LF gives one line end, not two (in the AT+CONFIG and AT+IRC menus as well). |
0 to 127
|
5 |
Backspace character code. |
0 to 32
|
40 |
Streaming packet size, in bytes. | ≥ 1 |
41 |
Auto-stream mode; enter stream mode automatically on answer/connect: |
0 - off>0 - on |
42 |
CRC-8 value used by the transmit command (ATT). |
0 to 255
|
43 |
Temporary baud rate applied to the next dialled connection. |
baud rate≤0 - clear |
44 |
Inter-character serial output delay, in milliseconds. | ≥ 0 |
45 |
Binary translation type for streaming. |
0 to (BTYPE_INVALID−1)
|
46 |
DCD line polarity mode. |
0 - normal1 - inverted2 - always active3 - always inactive |
47 |
GPIO pin assigned to DCD (output). | supported pin 0 to MAX_PIN_NO
|
48 |
CTS line polarity mode. |
0 - normal1 - inverted2 - always active3 always inactive |
49 |
GPIO pin assigned to CTS (input). | supported pin 0 to MAX_PIN_NO
|
50 |
RTS line polarity mode. |
0 - normal1 - inverted2 - always active3 - always inactive |
51 |
GPIO pin assigned to RTS (output). | supported pin 0 to MAX_PIN_NO
|
52 |
RI (ring indicator) line polarity mode. |
0 - normal1 - inverted2 - always active3 - always inactive |
53 |
GPIO pin assigned to RI (output). | supported pin 0 to MAX_PIN_NO
|
54 |
DTR line polarity mode. |
0 - normal1 - inverted2 - always active3 - always inactive |
55 |
GPIO pin assigned to DTR (input). | supported pin 0 to MAX_PIN_NO
|
56 |
DSR line polarity mode. |
0 - normal1 - inverted2 - always active3 - always inactive |
57 |
GPIO pin assigned to DSR (output). | supported pin 0 to MAX_PIN_NO
|
60 |
Preserve TCP listeners across resets (persisted to flash). |
0 - offnon- 0 - on |
61 |
Printer job completion timeout, in seconds. | > 0 |
62 |
Telnet protocol handling on connections. |
0 - off>0 - on |
63 |
Hang-up trigger type. |
0 - none1- PPP-hard2 - DTR3 - PDP |
64 |
Discard incoming NUL bytes. |
0 - off>0 - on |
65 |
Enter SLIP mode automatically when the host sends a SLIP frame in command mode (see SLIP and PPP modes). Saved with AT&W. Shown by ATI1 when off, and always by ATI5. |
0 - off1 - on (default) |
66 |
Enter PPP mode automatically when the host sends an LCP Configure-Request in command mode (see SLIP and PPP modes). Saved with AT&W. Shown by ATI1 when off, and always by ATI5. |
0 - off1 - on (default) |
67 |
Block broadcasts and multicasts to the host in SLIP and PPP modes (see SLIP and PPP modes). Saved with AT&W. Shown by ATI1 when off, and always by ATI5. |
0 - off1 - on (default) |
These commands provide compatibility with software written for the stock Espressif ESP-AT firmware, so that utilities expecting this command set will continue to work. They are available from PerryZi 1.2.4.
The MOD-WIFI-ESP8266 build for the Agon Light / Neo6502 uses the Espressif v1.7.6.0 (NonOS) command set, whereas all other builds use the v2.3.0.0 (ESP-AT) command set. This is due to existing Agon Light and Neo6502 software being written for the older Espressif firmware.
v1.7.6.0 |
v2.3.0.0 |
|
|---|---|---|
AT+CIPRECVDATA reply |
,<len>:<data> |
:<len>,<data> |
_CUR / _DEF suffixes |
accepted | not accepted |
AT+CIPDOMAIN reply |
:<ip> |
:"<ip>" |
Failed AT+CWJAP returns |
FAIL |
ERROR |
A single connection only, so AT+CIPMUX accepts 0 alone. Plain TCP and UDP only: there is no TLS in PerryZi, so the SSL transmission type and the AT+CIPSSLC* family are unsupported. IPv6 is unavailable because the ESP8266 Arduino core is built with LWIP_IPV6=0, so the v6 transmission types are rejected.
AT and ATE<n> are used by this command set too, and behave as described in Core AT commands above.
| Command | Description |
|---|---|
AT+RST |
Reset the AT layer: closes any open connection and returns AT+CIPRECVMODE, AT+CIPDINFO and AT+CIPMODE to their defaults. Replies OK followed by ready.Note this does not reboot the module, which would drop the host's serial settings. |
AT+RESTORE |
Behaves as AT+RST above. Unlike stock firmware it does not erase the saved configuration; use AT&F for that. |
AT+GMR |
Version information, as four lines:AT version:SDK version:compile time:Bin version:
|
AT+CMD? |
List the Espressif commands this firmware supports, as +CMD: lines. |
AT+SYSRAM? |
Free heap, in bytes:+SYSRAM:<free>
|
AT+SYSSTORE=<n> / AT+SYSSTORE?
|
Accept or report the persist-settings flag:+SYSSTORE:<n>PerryZi writes configuration to flash with AT&W, so this flag is recorded but does not itself save anything. |
AT+GSLP=<ms> |
Enter deep sleep for the given number of milliseconds. |
| Command | Description |
|---|---|
AT+CWMODE=1 / AT+CWMODE?
|
Station mode. Values other than 1 return ERROR; SoftAP is not supported.+CWMODE:1
|
AT+CWJAP="SSID","PASSWORD" |
Join an access point. On success replies WIFI CONNECTED and WIFI GOT IP, then OK; on failure +CWJAP:4 then FAIL.As with ATW, this updates the live settings only - use AT&W to persist them. |
AT+CWJAP? |
Report the current access point:+CWJAP:"<ssid>","<bssid>",<channel>,<rssi>or No AP when not connected. |
AT+CWQAP |
Disconnect from the current access point. |
AT+CWLAP |
Scan for access points, one line each:+CWLAP:(<ecn>,"<ssid>",<rssi>,"<mac>",<channel>)
|
AT+CWAUTOCONN=<n> |
Automatic reconnection:0 - off1 - on |
AT+CWSTATE? |
Connection state:+CWSTATE:<state>,"<ssid>"
|
AT+CWHOSTNAME=<name> / AT+CWHOSTNAME?
|
Read or set the mDNS hostname:+CWHOSTNAME:<name>
|
AT+CWRECONNCFG=<interval>[,<repeat>] / AT+CWRECONNCFG?
|
Reconnection interval, in seconds:+CWRECONNCFG:<interval>,0
|
AT+CWCOUNTRY? |
Report the WiFi country settings:+CWCOUNTRY:<policy>,"<country code>",<start channel>,<channel count>
|
AT+CWCOUNTRY=<policy>,"<cc>",<start>,<count> |
Set the WiFi country settings.<policy>:0 - auto1 - manual |
AT+RFPOWER=<n> / AT+RFPOWER?
|
Transmit power, in units of 0.25 dBm:+RFPOWER:<n>
|
AT+SLEEP=<n> / AT+SLEEP?
|
WiFi sleep mode:0 - none1 - light2 - modem |
| Command | Description |
|---|---|
AT+CIFSR |
Station address, as two lines:+CIFSR:STAIP,"<ip>"+CIFSR:STAMAC,"<mac>"
|
AT+CIPSTA? |
IPv4 configuration, as three lines:+CIPSTA:ip:"<ip>"+CIPSTA:gateway:"<gateway>"+CIPSTA:netmask:"<netmask>"
|
AT+CIPSTA="<ip>"[,"<gateway>"[,"<netmask>"]] |
Set a static address for this session. |
AT+CIPSTAMAC? |
Station MAC address:+CIPSTAMAC:"<mac>"
|
AT+CIPDNS? |
Report the DNS servers in use:+CIPDNS:<manual>,"<dns1>"[,"<dns2>"]
|
AT+CIPDNS=1,"<dns1>"[,"<dns2>"] |
Set the DNS server(s) manually.AT+CIPDNS=0, which returns DNS to DHCP control, returns ERROR: lwIP will only do that on a fresh lease. |
AT+CIPDOMAIN="<host>" |
Resolve a hostname:+CIPDOMAIN:"<ip>"
|
| Command | Description |
|---|---|
AT+CIPMUX=0 / AT+CIPMUX?
|
Single-connection mode. 1 returns ERROR.+CIPMUX:0
|
AT+CIPMODE=0 / AT+CIPMODE?
|
Normal transmission mode. 1 (passthrough) returns ERROR.+CIPMODE:0
|
AT+CIPDINFO=<n> |
Include the remote address and port in +IPD and +CIPRECVDATA replies:0 - off1 - on |
AT+CIPSTART="TCP","<host>",<port>[,<keepalive>]AT+CIPSTART="UDP","<host>",<remote port>[,<local port>]AT+CIPSTARTEX=...
|
Open a connection. Replies CONNECT then OK.Returns ERROR if a connection is already open (preceded by ALREADY CONNECTED), or if the SSL or v6 transmission types are requested. |
AT+CIPSEND=<length> |
Send data. Replies OK then the > prompt, after which exactly <length> raw bytes are read from the serial port. These bytes are taken verbatim: NUL, CR and LF are all passed through unaltered.On completion replies Recv <n> bytes then SEND OK, or SEND FAIL.Maximum 2048 bytes. |
AT+CIPCLOSE |
Close the connection. Replies CLOSED then OK. |
AT+CIPSTATUS |
Connection status:STATUS:<state>+CIPSTATUS:0,"<type>","<remote ip>",<remote port>,<local port>,0
|
AT+CIPSTATE? |
As AT+CIPSTATUS but without the STATUS: line. |
AT+CIPSTO=<seconds> / AT+CIPSTO?
|
Server timeout:+CIPSTO:<seconds>
|
AT+CIPSERVERMAXCONN=<n> / AT+CIPSERVERMAXCONN?
|
Maximum server connections:+CIPSERVERMAXCONN:<n>
|
AT+CIPSERVER |
Always returns ERROR: a server requires AT+CIPMUX=1, which is not supported. Use ATN<n> instead. |
AT+CIPTCPOPT? |
Report TCP socket options. |
Two receive models are supported, selected with AT+CIPRECVMODE.
In active mode (the default, AT+CIPRECVMODE=0) incoming data is pushed to the serial port as it arrives, prefixed with +IPD,<length>: and followed by the data itself. With AT+CIPDINFO=1 the prefix becomes +IPD,<length>,"<remote ip>",<remote port>:.
In passive mode (AT+CIPRECVMODE=1) the arrival of data is announced once with +IPD,<length> and no data follows. The data is then read explicitly with AT+CIPRECVDATA. A further announcement is not made until the buffer has been drained.
| Command | Description |
|---|---|
AT+CIPRECVMODE=<n> / AT+CIPRECVMODE?
|
Receive model:0 - active1 - passive+CIPRECVMODE:<n>
|
AT+CIPRECVDATA=<length> |
Read up to <length> buffered bytes:+CIPRECVDATA:<actual length>,<data>Buffered data stays readable after the remote end disconnects. Once the buffer is empty and the connection has gone, ERROR is returned. |
AT+CIPRECVLEN? |
Bytes currently buffered:+CIPRECVLEN:<length>,0,0,0,0
|
| Command | Description |
|---|---|
AT+CIPSNTPCFG=<enable>,<timezone>[,"<server>"] / AT+CIPSNTPCFG?
|
Read or set the SNTP configuration. <enable> 0 disables time updates, 1 enables them and forces an immediate update. The server defaults to uk.pool.ntp.org.<timezone> is the offset from UTC, as in ESP-AT: whole hours from -12 to 14, or [+|-]hhmm for an offset with minutes (for example 530 or +0530). It is matched to a time zone with exactly that offset; an offset that no time zone has returns ERROR, and nothing is changed.+CIPSNTPCFG:<enable>,<timezone>,"<server>"The time zone is reported in the same form; for a zone with summer time, its standard offset is given. |
AT+CIPSNTPTIME? |
Current time in asctime format:+CIPSNTPTIME:<Day> <Mon> <date> <hh:mm:ss> <year>Returns ERROR if the time has not yet been set. |
AT+SYSTIMESTAMP? |
Current time as a Unix epoch value:+SYSTIMESTAMP:<epoch>Returns ERROR if the time has not yet been set. |
| Command | Description |
|---|---|
AT+PING="<host>" |
Ping a host:+PING:<milliseconds>or +PING:TIMEOUT followed by ERROR.PerryZi's own AT+PING"<host>" form, described in AT+ commands above, is unaffected and continues to work: the two are told apart by the =. |