Page 3
About This Guide This document provides AT commands list based on ESP8266_NONOS_SDK. The document is structured as follows. Chapter Title Subject Chapter 1 Preambles Instructions on user-define AT command and downloading. Chapter 2 Command Description Basic description of AT commands. Chapter 3 Basic AT Commands List basic function AT commands.
.......... 10. AT+SLEEP – sleep mode ................ 11. AT+WAKEUPGPIO – set a GPIO to wake ESP8266 up from light-sleep mode 18 12. AT+RFPOWER – set maximum value of RF TX Power ......13. AT+RFVDD – set RF TX Power according to VDD33 .......
Page 5
.......... 16. AT+CWDHCP_DEF – Enable/Disable DHCP and save to flash ....17. AT+CWDHCPS_CUR – Set the IP address allocated by ESP8266 soft-AP DHCP, does not save to flash ..................18. AT+CWDHCPS_DEF – Set the IP address allocated by ESP8266 soft-AP DHCP, save to flash...
Page 6
33. AT+CWSTOPSMART – stop SmartConfig ..........34. AT+CWSTARTDISCOVER – Start the mode that ESP8266 can be found by WeChat ... 35. AT+CWSTOPDISCOVER – Stop the mode that ESP8266 can be found by WeChat ..36. AT+WPS – Set WPS function ..............
Page 7
ESP8266 Espressif Systems AT Instruction Set " " " Q&A ......................Espressif Systems 4 73 Friday, July 15, 2016...
Please use only letters when naming user-defined AT commands. The AT command name must NOT contain characters or numbers. AT firmware is based on the ESP8266_NONOS_SDK. Espressif Systems AT commands are provided in libat.a. In the example of \ESP8266_NONOS_SDK\examples\at\user\user_main.c, ways are delivered on how to implement a custom, user-defined AT Command, "...
ESP8266 Espressif Systems AT Instruction Set " " " Please refer to ESP8266_Getting_Started_Guide for instructions on compiling applications. 1.2. Downloading AT firmware into Flash Refer to ESP8266_NONOS_SDK\bin\at\readme.txt for instructions on how to download AT firmware into Flash. Please use Espressif official Flash download tool and select corresponding Flash size to download the firmware.
ESP8266 Espressif Systems AT Instruction Set " " " Address Description 0xFB000 Initialize RF_CAL parameter area blank.bin 0xFC000 Stores default RF parameter values, has to be downloaded into esp_init_data_default.bin flash at least once. If the RF_CAL parameter area is initialized, this bin has to be downloaded too.
ESP8266 Espressif Systems AT Instruction Set " " " Address Description 0x1FC000 Stores default RF parameter values, has to be downloaded into esp_init_data_default.bin flash at least once. If the RF_CAL parameter area is initialized, this bin has to be downloaded too.
Page 12
, so only one task of priority 2 is allowed system_os_task to be set up by the user. • AT returns messages below to show status of Wi-Fi connection of ESP8266 station ‣ WiFi CONNECTED - Wi-Fi connected ‣ WiFi GOT IP - ESP8266 station got IP from AP ‣...
ESP8266 Espressif Systems AT Instruction Set " " " Command Description Each Command set contains four types of AT commands. Type Command Format DescrIPtion Query the Set command or internal parameters and its Test AT+<x>=? range values. Query AT+<x>? Returns the current value of the parameter.
" " Basic AT Commands 3.1. Overview The ESP8266 wireless Wi-Fi modules can be driven via the serial interface using the standard AT commands. Here is a list of some basic AT commands that can be used. Basic Command Description...
ESP8266 Espressif Systems AT Instruction Set " " " 3.2. Commands AT – Test AT startup The type of this command is "executed". It is used to test the setup function of your wireless Wi-Fi module. AT – Test AT startup...
The time unit of <time> is ms. Parameters ESP8266 will wake up after deep sleep <time> ATE – AT commands echo This command ATE is an AT trigger command echo. It means that entered commands can be echoed back to the sender when ATE command is used. Two parameters are possible. The command returns "OK"...
ESP8266 Espressif Systems AT Instruction Set " " " AT+UART – UART configuration This command sets the UART configuration and writes the new configuration to the flash. It is stored as the default parameter and will also be used as the default baudrate henceforth. [THIS API IS DEPRECATED.]...
ESP8266 Espressif Systems AT Instruction Set " " " AT+UART_CUR – current UART configuration This command sets the current UART configuration, it does not write changes to the flash. Hence there is no change in the default baud rate. AT+UART_CUR=<baudrate>, <databits>, <stopbits>, <parity>, <flow control>...
ESP8266 Espressif Systems AT Instruction Set " " " AT+UART_DEF – default UART configuration This command sets the UART configuration and saves it to flash. It is stored as the default parameter and will also be used as the default baud rate henceforth.
AT Instruction Set " " " 10. AT+SLEEP – sleep mode This command sets ESP8266 sleep mode. It can only be used in station mode. Modem sleep is the default sleep mode. AT+SLEEP – sleep mode Command AT+SLEEP? +SLEEP : <sleep mode>...
11. AT+WAKEUPGPIO – set a GPIO to wake ESP8266 up from light-sleep mode This command sets a GPIO to wake the ESP8266 up from light-sleep mode. Please note that the <trigger_GPIO> and the <awake_GPIO> in the command cannot use the same GPIO.
13. AT+RFVDD – set RF TX Power according to VDD33 This command sets ESP8266 RF TX power according to VDD33. To get the power voltage of ESP8266 VDD3P3, TOUT pin has to be suspended. TOUT pin has to be suspended in order to measure VDD33.
Page 23
ESP8266 Espressif Systems AT Instruction Set " " " "AT+RFVDD" will automatically set RF TX power according to VDD33. Note TOUT pin has to be suspended. Espressif Systems 20 73 Friday, July 15, 2016...
Set current configuration of ESP8266 soft-AP AT+CWSAP_CUR Settings not updated in flash. Set configuration of ESP8266 soft-AP AT+CWSAP_DEF Save changes to flash. AT+CWLIF Get station IP which is connected to ESP8266 soft-AP AT+CWDHCP Enable/Disable DHCP, [@deprecated] AT+CWDHCP_CUR Enable/Disable DHCP, changes not save to flash AT+CWDHCP_DEF...
Page 25
AT+CIPAP_DEF Save changes to flash. AT+CWSTARTSMART Start SmartConfig AT+CWSTOPSMART Stop SmartConfig AT+CWSTARTDISCOVER Start the mode that ESP8266 can be found by WeChat AT+CWSTOPDISCOVER Stop the mode that ESP8266 can be found by WeChat AT+WPS Set WPS function AT+MDNS Set MDNS function...
ESP8266 Espressif Systems AT Instruction Set " " " 4.1. Commands AT+CWMODE – WiFi mode The function of this AT command is to get the value scope of Wi-Fi mode, including station mode, softAP mode, and station+softAP mode, enquiry about the information of Wi-Fi mode, or set the Wi-Fi mode.
ESP8266 Espressif Systems AT Instruction Set " " " AT+CWMODE_CUR – current WiFi mode There are three Wi-Fi working modes: Station mode, softAP mode, and the co-existence of Station mode and softAP mode. This command is used to query the current Wi-Fi mode, or to set a desired Wi-Fi mode.
ESP8266 Espressif Systems AT Instruction Set " " " AT+CWMODE_DEF – default WiFi mode AT+CWMODE_DEF - WiFi mode (sta/AP/sta+AP), save to flash Example AT+CWMODE_DEF=3 Command AT+CWMODE_DEF=? +CWMODE_DEF:( value scope of <mode>) Response <mode> 1 : station mode Parameters 2 : softAP mode...
ESP8266 Espressif Systems AT Instruction Set " " " AT+CWJAP – Connect to AP AT+CWJAP – Connect to AP [@deprecated]. Please use AT+CWJAP_CUR or AT+CWJAP_DEF instead. • AT+CWJAP ="abc", "0123456789" • If SSID is "ab\, c" and password is "0123456789"\"...
ESP8266 Espressif Systems AT Instruction Set " " " AT+CWJAP_CUR – Connect to AP, for current AT+CWJAP_CUR – Connect to AP, won‘t save to flash • AT+CWJAP_CUR ="abc", "0123456789" • If SSID is "ab\, c" and password is "0123456789"\" Example AT+CWJAP_CUR="ab\\\, c", "0123456789\"\\"...
ESP8266 Espressif Systems AT Instruction Set " " " AT+CWJAP_DEF – Connect to AP, save as default AT+CWJAP_DEF – Connect to AP and save AP info to flash • AT+CWJAP_DEF="abc", "0123456789" If SSID is "ab\, c" and password is "0123456789"\"...
ESP8266 Espressif Systems AT Instruction Set " " " AT+CWLAPOPT – Set configuration for command AT+CWLAP This command is to set the configuration for command AT+CWLAP, whether the result of AT+CWLAP will be ordered according to <rssi>, and which parameters will be shown in the result of AT+CWLAP.
" " " AT+CWLAP – List available APs AT+CWLAP - Lists available APs • AT+CWLAP List of all available AP's detected by ESP8266 • AT+CWLAP="WiFi", "ca:d7:19:d8:a6:44", 6 Example Find AP with specific SSID and MAC at specific channel. • AT+CWLAP="WiFi"...
2 : WPA_PSK 3 : WPA2_PSK Parameters 4 : WPA_WPA2_PSK <max conn> maximum count of stations that are allowed to connect to ESP8266 soft-AP range: [1, 4] <ssid hidden> Broadcast SSID by default 0 : broadcast SSID of ESP8266 soft-AP...
3 : WPA2_PSK Parameters 4 : WPA_WPA2_PSK [<max conn>], optional, default is 4 maximum count of stations that are allowed to connect to ESP8266 soft-AP range: [1, 4] [<ssid hidden>], optional, b roadcast SSID by default 0 : broadcast SSID of ESP8266 soft-AP 1 : do not broadcast SSID of ESP8266 soft-AP This command is only available when softAP is active.
3 : WPA2_PSK Parameters 4 : WPA_WPA2_PSK [<max conn>], optional, default is 4 maximum count of stations that are allowed to connect to ESP8266 soft-AP range: [1, 4] [<ssid hidden>], optional, b roadcast SSID by default 0 : broadcast SSID of ESP8266 soft-AP 1 : do not broadcast SSID of ESP8266 soft-AP This command is only available when softAP is active.
" " " 13. AT+CWLIF – IP of stations This command is used to get the IP of stations that are connected to ESP8266 softAP. AT+ CWLIF– IP of stations which are connected to ESP8266 softAP <IP addr>, <mac> Response <IP addr>...
: 0 - station DHCP disabled 1 - station DHCP enabled Command AT+CWDHCP=<mode>, <en> Response <mode> 0 : set ESP8266 soft-AP 1 : set ESP8266 station Parameters 2 : set both softAP and station <en> 0 : Disable DHCP 1 : Enable DHCP •...
: 0 - station DHCP disabled 1 - station DHCP enabled Command AT+CWDHCP_CUR=<mode>, <en> Response <mode> 0 : set ESP8266 soft-AP 1 : set ESP8266 station Parameters 2 : set both softAP and station <en> 0 : Disable DHCP 1 : Enable DHCP •...
: 0 - station DHCP disabled 1 - station DHCP enabled Command AT+CWDHCP_DEF=<mode>, <en> Response <mode> 0 : set ESP8266 soft-AP 1 : set ESP8266 station Parameters 2 : set both softAP and station <en> 0 : Disable DHCP 1 : Enable DHCP •...
This AT command is enabled when ESP8266 runs as soft-AP, and when DHCP server is running normally. The IP address should be on the same network segment with the IP address of ESP8266 soft-AP. Configuration changes will not be stored in flash.
This AT command is enabled when ESP8266 runs as soft-AP, and when DHCP server is running normally. The IP address should be on the same network segment with the IP address of ESP8266 soft-AP. This configuration will be stored in flash user parameter area.
MAC addresses of ESP8266 soft-AP and station are different, please do NOT set them to be the same. Note that the bit 0 of the first byte of ESP8266 MAC address cannot be 1, for example, MAC address can be "18:fe:35:98:d3:7b", but cannot be "15:fe:35:98:d3:7b".
MAC addresses of ESP8266 soft-AP and station are different, please do NOT set them to be the same. Note that the bit 0 of the first byte of ESP8266 MAC address cannot be 1, for example, MAC address can be "18:fe:35:98:d3:7b", but cannot be "15:fe:35:98:d3:7b".
MAC addresses of ESP8266 soft-AP and station are different, please do NOT set them to be the same. Note that the bit 0 of the first byte of ESP8266 MAC address cannot be 1, for example, MAC address can be "1a:fe:36:97:d5:7b", but cannot be "15:fe:36:97:d5:7b".
MAC addresses of ESP8266 soft-AP and station are different, please do NOT set them to be the same. Note that the bit 0 of the first byte of ESP8266 MAC address cannot be 1, for example, MAC address can be "1a:fe:36:97:d5:7b", but cannot be "15:fe:36:97:d5:7b".
" 26. AT+CIPSTA – Set IP address of station Only after ESP8266 station is connected to an AP, station IP can be obtained and inquired. Configuration changes will be stored in flash user parameter area. AT+ CIPSTA – Set IP address of ESP8266 station [@deprecated].
" 27. AT+CIPSTA_CUR – Set IP address of station Only after ESP8266 station is connected to an AP, station IP can be obtained and inquired. This configuration will NOT be stored in flash. AT+CIPSTA_CUR – Set IP address of ESP8266 station, do not save to flash Example AT+CIPSTA_CUR="192.168.6.100", "192.168.6.1", "255.255.255.0"...
ESP8266 Espressif Systems AT Instruction Set " " " 28. AT+CIPSTA_DEF – Set IP address of station and save as default AT+CIPSTA_DEF – Set IP address of ESP8266 station, save to flash Example AT+CIPSTA_DEF="192.168.6.100", "192.168.6.1", "255.255.255.0" Command AT+CIPSTA_DEF? +CIPSTA:<IP> Response Parameters <IP>...
" " 29. AT+ CIPAP – Set IP address of softAP ESP8266 only supports class C IP addresses. This configuration will be stored in flash user parameter area. AT+ CIPAP – Set IP address of ESP8266 softAP [@deprecated]. Please use AT+CIPAP_CUR or AT+CIPAP_DEF instead.
" " 30. AT+CIPAP_CUR – Set IP address of softAP ESP8266 only support class C IP address. This configuration will NOT store in flash. AT+CIPAP_CUR – Set IP address of ESP8266 softAP, won’t save to flash Example AT+CIPAP_CUR="192.168.5.1", "192.168.5.1", "255.255.255.0"...
" " " 31. AT+CIPAP_DEF – Set IP address of softAP, save as default ESP8266 only supports class C IP addresses. AT+ CIPAP_DEF – Set IP address of ESP8266 softAP, save to flash Example AT+CIPAP_DEF="192.168.5.1", "192.168.5.1", "255.255.255.0" Command AT+CIPAP_DEF? +CIPAP_DEF:<IP>...
3 : ESP-Touch + AirKiss Message "Smart get WiFi info" means Smart Config acquired AP • information successfully, then ESP8266 will try to connect to target AP. "Smartconfig connected WiFi" is printed if connection is successful. Notes • ESP8266 cannot do anything during SmartConfig. Please wait for the message "Smartconfig connected...
34. AT+CWSTARTDISCOVER – Start the mode that ESP8266 can be found by WeChat The parameter of this command needs to be obtained from Espressif Cloud. After connecting to an AP and obtaining an IP address, ESP8266 can be found by WeChat which is on the same LAN. WeChat : http://iot.weixin.qq.com AT+CWSTARTDISCOVER –...
AT Instruction Set " " " 36. AT+WPS – Set WPS function Noe that WPS function can only be used when ESP8266 station is enabled. WPS function does not support WEP encryption. AT+WPS – Set WPS function AT+CWMODE=1 Example AT+WPS=1 Command AT+WPS=<enable>...
Configure as server AT+CIPMODE Set transmission mode AT+SAVETRANSLINK Save transparent transmission link to flash AT+CIPSTO Set timeout when ESP8266 runs as TCP server AT+CIUPDATE Upgrade firmware through network AT+PING Function PING AT+CIPDINFO Show remote IP and remote port with "+IPD"...
0 : ESP8266 runs as client 1 : ESP8266 runs as server AT+CIPDOMAIN – DNS function ESP8266 needs to connect to a router to access to the internet first, then it is able to call the DNS function. AT+CIPDOMAIN – DNS function...
ESP8266 Espressif Systems AT Instruction Set " " " AT+CIPSTART – Establish TCP connection, UDP transmission or SSL connection Refer to documentation "4B-ESP8266__AT Command Examples" for more on how to use this command. AT+CIPSTART – Function 1: Establish TCP connection AT+CIPSTART="TCP", "iot.espressif.cn", 8000...
Page 59
IP <remote port> string, remote port [<UDP local port>] optional, UDP port of ESP8266 Parameters [<UDP mode>] optional. In UDP transparent transmission, it has to be 0. 0 : destination peer entity of UDP will not change, default option.
AT Instruction Set " " " 1. ESP8266 can only set one SSL connection at most. 2. SSL connection does not support UART-WiFi passthrough mode (transparent transmission). Note 3. SSL connection needs a lot of memory, otherwise, it may cause system reboot.
ESP8266 Espressif Systems AT Instruction Set " " " AT+CIPSEND – Send data Please refer to documentation "4B-ESP8266__AT Command Examples" for more examples. Espressif Systems 58 73 Friday, July 15, 2016...
Page 62
ESP8266 Espressif Systems AT Instruction Set " " " AT+CIPSEND – Send data (+CIPMUX=0) Single connection AT+CIPSEND=<length> (+CIPMUX=1) Multiple connection AT+CIPSEND=<link ID>, <length> UDP Transmission AT+CIPSEND=[<link ID>, ]<length>[, <remote IP>, <remote port>] Wrap return ">" after set command. Begins receiving serial data, when data length is met, starts transmission of data.
ESP8266 Espressif Systems AT Instruction Set " " " AT+CIPSENDEX – Send data AT+CIPSENDEX – Send data (+CIPMUX=0) Single connection AT+CIPSENDEX=<length> (+CIPMUX=1) Multiple connection AT+CIPSENDEX=<link ID>, <length> UDP Transmission AT+CIPSENDEX=[<link ID>, ]<length>[, <remote IP>, <remote port>] Wrap return ">" after set command. Begins receiving serial data, when data length or "\0"...
ESP8266 Espressif Systems AT Instruction Set " " " AT+CIPSENDBUF – Write data into TCP-send-buffer This command only writes data into TCP-send-buffer, so it can be called continually, and the user need not wait for "SEND OK"; if a TCP segment is sent successfully, it will return <segment ID>, SEND OK.
ESP8266 Espressif Systems AT Instruction Set " " " AT+CIPBUFSTATUS – Check status of TCP-send-buffer Please do not use this command on SSL connections. AT+CIPBUFSTATUS – Check status of TCP-send-buffer Single connection: AT+CIPBUFSTATUS returns 20, 15, 10, 200, 7 : means the latest segment ID is 19, next time...
ESP8266 Espressif Systems AT Instruction Set " " " AT+CIPCHECKSEQ – Check if a specific segment was sent successfully AT+CIPCHECKSEQ – Check if a specific segment was sent successfully (+CIPMUX=0) Single connection AT+CIPCHECKSEQ=<segment ID> (+CIPMUX=1) Multiple connection AT+CIPCHECKSEQ=<link ID>, <segment ID>...
+ CIFSR:<IP address> Response <IP address> Parameters IP address of ESP8266 softAP IP address of ESP8266 station Only after ESP8266 station is connected to an AP, station IP can be obtained Note and inquired. Espressif Systems 64 73 Friday, July 15, 2016...
ESP8266 Espressif Systems AT Instruction Set " " " 14. AT+CIPSERVER – Configure as TCP server Server monitor will automatically be created when Server is created. When a client is connected to the server, it will take up one connection and be assigned an ID.
During UART-WiFi passthrough transmission, if it is TCP connection and the TCP connection breaks, ESP8266 will keep trying to reconnect until "+++" is input to quit from transmission. After sending the "+++" token, please wait for at least 1 second before sending the next AT command.
This command will save the UART-WiFi passthrough mode and its link into • Flash user parameter area, ESP8266 will enter UART-WiFi passthrough mode Notes on any subsequent power cycles. As long as the IP (or domain name), port conform to the specification, they •...
Response Parameters <time> TCP server timeout, range 0~7200 seconds ESP8266 configured as TCP server will disconnect to TCP client that did not Notes communicate with it until timeout. If AT+CIPSTO=0, the connection will never time out. It is not recommended.
ESP8266 Espressif Systems AT Instruction Set " " " 19. AT+CIUPDATE – Update through network Firmware upgrade depends on network condition. It will return ERROR if upgrade failed due to unfavorable network conditions. Please wait for some time before retrying.
ESP8266 Espressif Systems AT Instruction Set " " " Appendix ESP8266 AT commands below will save configuration parameters into flash: AT Command Example Save into flash user parameter area AT+UART_DEF AT+UART_DEF=115200, 8, 1, 0, 3 AT+CWDHCP_DEF AT+CWDHCP_DEF=1, 1 AT+CIPSTAMAC_DEF AT+CIPSTAMAC_DEF="18:fe:35:98:d3:7b"...
Page 76
ESP8266 Espressif Systems AT Instruction Set " " " Q&A If you have any questions about AT Commands, please contact us (feedback@espressif.com) with information as follows: • Version info of AT : Using "AT+GMR" to get the version info. Hardware Module info: example Ai-thinker ESP-01 •...
Need help?
Do you have a question about the ESP8266 and is the answer not in the manual?
Questions and answers