Espressif Systems ESP8266 AT Instruction Set Download Page 11

!

1. Overview

 Notes: 

Please make sure that correct BIN (

/ESP8266_NONOS_SDK/bin/at

) is already in the chip (ESP8266) before using 

the AT commands listed in this document. 

AT firmware uses priority levels 0 and 1 of 

system_os_task

, so only one task of priority 2 is allowed to be set up by 

the user. 

AT returns messages below to show status of the ESP8266 Station’s Wi-Fi connection. 

Wi-Fi CONNECTED

: Wi-Fi is connected. 

Wi-Fi GOT IP

: the ESP8266 Station has got the IP from the AP. 

Wi-Fi DISCONNECT

: Wi-Fi is disconnected.

Espressif

!

/

!

5 58

2017.05

Summary of Contents for ESP8266 AT

Page 1: ...Version 2 1 0 Copyright 2017 ESP8266 AT Instruction Set...

Page 2: ...ds of basic functions Chapter 4 Wi Fi AT Commands Lists Wi Fi related AT commands Chapter 5 TCP IP Related AT Commands Lists TCP IP related AT commands Chapter 6 Appendix Lists the AT commands of whic...

Page 3: ...8 3 2 5 ATE AT Commands Echoing 9 3 2 6 AT RESTORE Restores the Factory Default Settings 9 3 2 7 AT UART UART Configuration 9 3 2 8 AT UART_CUR Current UART Configuration Not Saved in the Flash 11 3...

Page 4: ...the ESP8266 SoftAP 27 4 2 11 AT CWSAP_CUR Configures the ESP8266 SoftAP Configuration Not Saved in the Flash 27 4 2 12 AT CWSAP_DEF Configures the ESP8266 SoftAP Configuration Saved in the Flash 28 4...

Page 5: ...38 4 2 34 AT CWSTARTDISCOVER Enables the Mode that ESP8266 can be Found by WeChat 39 4 2 35 AT CWSTOPDISCOVER Disables the Mode that ESP8266 can be Found by WeChat 39 4 2 36 AT WPS Enables the WPS Fun...

Page 6: ...18 AT PING Ping Packets 52 5 2 19 AT CIUPDATE Updates the Software Through Wi Fi 53 5 2 20 AT CIPDINFO Shows the Remote IP and Port with IPD 53 5 2 21 IPD Receives Network Data 53 5 2 22 AT CIPSNTPCFG...

Page 7: ...used to define four types of a command for details of which please refer to the following table Definition Type Description at_testCmd Test AT Command AT TEST Registered Callback In Example at_testCm...

Page 8: ...Mbit flash but does not supports FOTA upgrade AT firmware through Wi Fi function 1 2 2 8 Mbit Flash If the flash size is 8 Mbit or larger users can use boot mode which supports AT firmware upgrade fe...

Page 9: ...000 In bin at 512 512 BIN Address Description blank bin 0x1FB000 Initializes RF_CAL parameter area esp_init_data_default bin 0x1FC000 Stores default RF parameter values has to be downloaded into flash...

Page 10: ...a is initialized this bin has to be downloaded too blank bin 0x7E000 Initializes Flash user parameter area more details in Appendix blank bin 0x3FE000 Initializes Flash system parameter area more deta...

Page 11: ...firmware uses priority levels 0 and 1 of system_os_task so only one task of priority 2 is allowed to be set up by the user AT returns messages below to show status of the ESP8266 Station s Wi Fi conn...

Page 12: ...ser defined parameters in commands and runs these commands Execute Command AT x Runs commands with no user defined parameters Notice Not all AT commands support all four variations mentioned above Squ...

Page 13: ...guration saved in flash AT SLEEP Configures the sleep modes AT WAKEUPGPIO Configures a GPIO to wake ESP8266 up from Light sleep mode AT RFPOWER Sets the maximum value of the RF TX Power AT RFVDD Sets...

Page 14: ...mpile time OK Parameters AT version info information about the AT version SDK version info information about the SDK version compile time the duration of time for compiling the BIN Set Command AT GSLP...

Page 15: ...RROR when a parameter other than 0 or 1 was specified Execute Command AT RESTORE Response OK Note The execution of this command will reset all parameters saved in flash and restore the factory default...

Page 16: ...trol flow control 0 flow control is not enabled 1 enable RTS 2 enable CTS 3 enable both RTS and CTS Notes 1 The configuration changes will be saved in the user parameter area in the flash and will sti...

Page 17: ...is set as 115200 the baud rate returned by using command AT UART_CUR could be 115273 Parameters baudrate UART baud rate databits data bits 5 5 bit data 6 6 bit data 7 7 bit data 8 8 bit data stopbits...

Page 18: ...topbits stop bits 1 1 bit stop bit 2 1 5 bit stop bit 3 2 bit stop bit parity parity bit 0 None 1 Odd 2 Even flow control flow control 0 flow control is not enabled 1 enable RTS 2 enable CTS 3 enable...

Page 19: ...y GPIO trigger_GPIO Sets the GPIO to wake ESP8266 up range of value 0 15 trigger_level 0 The GPIO wakes up ESP8266 on low level 1 The GPIO wakes up ESP8266 on high level awake_GPIO Optional this param...

Page 20: ...nge 0 82 unit 0 25 dBm Note This command sets the maximum value of ESP8266 RF TX power it is not precise The actual value could be smaller than the set value Example AT RFPOWER 50 Command Query Comman...

Page 21: ...equency offset trace 1 enables RF frequency offset trace Notes The RF frequency offset trace function is enabled by default This configuration will be saved in the user parameter area in flash and tak...

Page 22: ...GPIO12 to work as a GPIO Set Command AT SYSIOGETCFG pin Response SYSIOGETCFG pin mode pull up OK Parameter pin number of an IO pin mode the working mode of the IO pin pull up 0 disable the pull up 1...

Page 23: ...n GPIO pin number level 0 low level 1 high level Note Please refer to ESP8266 Pin List for uses of AT SYSGPIO related commands Example AT SYSIOSETCFG 12 3 1 Set GPIO12 to work as a GPIO AT SYSGPIODIR...

Page 24: ...Please refer to ESP8266 Pin List for uses of AT SYSGPIO related commands Example AT SYSIOSETCFG 12 3 1 Set GPIO12 to work as a GPIO AT SYSGPIODIR 12 0 Set GPIO12 to work as an input AT SYSGPIOREAD 12...

Page 25: ...ion of the ESP8266 SoftAP configuration not saved in the flash AT CWSAP_DEF Sets the configuration of the ESP8266 SoftAP configuration saved in the flash AT CWLIF Gets the Station IP to which the ESP8...

Page 26: ...the IP address of the ESP8266 Station configuration saved in the flash AT CIPAP Sets the IP address of ESP8266 SoftAP deprecated AT CIPAP_CUR Sets the IP address of ESP8266 SoftAP configuration not sa...

Page 27: ...SoftAP mode 3 SoftAP Station mode Note The configuration changes will be saved in the system parameter area in the flash Example AT CWMODE 3 Commands Test Command AT CWMODE_CUR Query Command AT CWMOD...

Page 28: ...rameter showing the SSID of the target AP ssid the SSID of the target AP pwd password MAX 64 byte ASCII bssid the target AP s MAC address used when multiple APs have the same SSID error code for refer...

Page 29: ...nection timeout 2 wrong password 3 cannot find the target AP 4 connection failed This command requires Station mode to be active Escape character syntax is needed if SSID or password contains any spec...

Page 30: ...s command requires Station mode to be active Escape character syntax is needed if SSID or password contains any special characters such as or or Note The configuration changes will be saved in the sys...

Page 31: ...CWLAP bit 1 determines whether ssid will be shown in the result of AT CWLAP bit 2 determines whether rssi will be shown in the result of AT CWLAP bit 3 determines whether mac will be shown in the resu...

Page 32: ...offset freq calibration OK Parameters ecn encryption method 0 OPEN 1 WEP 2 WPA_PSK 3 WPA2_PSK 4 WPA_WPA2_PSK 5 WPA2_Enterprise AT can NOT connect to WPA2_Enterprise AP for now ssid string parameter S...

Page 33: ...chl channel ID ecn encryption method WEP is not supported 0 OPEN 2 WPA_PSK 3 WPA2_PSK 4 WPA_WPA2_PSK max conn optional maximum number of Stations to which ESP8266 SoftAP can be connected within the ra...

Page 34: ...nds Query Command AT CWSAP_DEF Function to obtain the configuration parameters of the ESP8266 SoftAP Set Command AT CWSAP_DEF ssid pwd chl ecn max conn ssid hidden Function to list all available APs R...

Page 35: ...Set Command AT CWDHCP mode en Function to enable disable DHCP Response DHCP disabled or enabled now OK Parameters Bit0 0 Station DHCP is disabled 1 Station DHCP is enabled Bit1 0 SoftAP DHCP is disabl...

Page 36: ...bled depends on the last configuration Example AT CWDHCP_CUR 0 1 Commands Query Command AT CWDHCP_DEF Set Command AT CWDHCP_DEF mode en Function to enable disable DHCP Response DHCP disabled or enable...

Page 37: ...6 runs as SoftAP and when DHCP is enabled The IP address should be in the same network segment as the IP address of ESP8266 SoftAP Examples AT CWDHCPS_CUR 1 3 192 168 4 10 192 168 4 15 or AT CWDHCPS_C...

Page 38: ...er up by default Note The configuration changes will be saved in the system parameter area in the flash Example AT CWAUTOCONN 1 Commands Query Command AT CIPSTAMAC Set Command AT CIPSTAMAC mac Functio...

Page 39: ...18 fe 35 98 d3 7b Commands Query Command AT CIPSTAMAC_DEF Set Command AT CIPSTAMAC_DEF mac Function to set the MAC address of the ESP8266 Station Response CIPSTAMAC_DEF mac OK OK Parameters mac strin...

Page 40: ...dress of ESP8266 SoftAP Notes The configuration changes will NOT be saved the flash The MAC address of ESP8266 SoftAP is different from that of the ESP8266 Station Please make sure you do not set the...

Page 41: ...atic IP is enabled DHCP will be disabled If DHCP is enabled static IP will be disabled Whether it is DHCP or static IP that is enabled depends on the last configuration Example AT CIPSTA 192 168 6 100...

Page 42: ...mands If static IP is enabled DHCP will be disabled If DHCP is enabled static IP will be disabled Whether it is DHCP or static IP that is enabled depends on the last configuration Example AT CIPSTA_DE...

Page 43: ...disabled If DHCP is enabled static IP will be disabled Whether it is DHCP or static IP that is enabled depends on the last configuration Example AT CIPAP_CUR 192 168 5 1 192 168 5 1 255 255 255 0 Comm...

Page 44: ...successfully acquired the AP information ESP8266 will try to connect to the target AP Message Smartconfig connected Wi Fi is printed if the connection is successful Use command AT CWSTOPSMART to stop...

Page 45: ...it only makes response to queries from WeChat Otherwise the time interval for ESP8266 to send packets regularly in order to be detected by WeChat on the same LAN Note For details on detection function...

Page 46: ...me ESP8266 SoftAP mode does not support the MDNS function for now Example AT MDNS 1 espressif iot 8080 Commands Query Command AT CWHOSTNAME Function Checks the host name of ESP8266 Station Set Command...

Page 47: ...egment is sent or not AT CIPCLOSE Closes TCP UDP SSL connection AT CIFSR Gets the local IP address AT CIPMUX Configures the multiple connections mode AT CIPSERVER Deletes Creates a TCP server AT CIPMO...

Page 48: ...is disconnected 5 The ESP8266 Station does NOT connect to an AP link ID ID of the connection 0 4 used for multiple connections type string parameter TCP or UDP remote IP string parameter indicating t...

Page 49: ...SSL remote IP string parameter indicating the remote IP address remote port the remote port number TCP keep alive detection time interval when TCP is kept alive this function is disabled by default 0...

Page 50: ...SSL Connection Set Command AT CIPSTART link ID type remote IP remote port TCP keep alive Response OK or ERROR If the TCP connection is already established the response is ALREADY CONNECT Parameters li...

Page 51: ...smission of data starts If the connection cannot be established or gets disrupted during data transmission the system returns ERROR If data is transmitted successfully the system returns SEND OK Wrap...

Page 52: ...of data length determined by length is met or when 0 appears in the data the transmission starts If connection cannot be established or gets disconnected during transmission the system returns ERROR I...

Page 53: ...uint32 the ID assigned to each data packet starting from 1 the ID number increases by 1 every time a data packet is written into the buffer length data length MAX 2048 bytes Notes This command only w...

Page 54: ...mber available TCP queue number it s not reliable and should be used as a reference only Notes This command can not be used for SSL connection Example For example in single connection the command AT C...

Page 55: ...in multiple connections AT CIPCLOSE link ID Function closes the TCP UDP Connection Execute Command used in multiple connections AT CIPCLOSE Response OK Parameters link ID ID of the connection to be cl...

Page 56: ...TCP server is created When a client is connected to the server it will take up one connection and be assigned an ID Example AT CIPMUX 1 AT CIPSERVER 1 1001 Commands Query Command AT CIPMODE Function t...

Page 57: ...time interval unit second s Notes This command will save the UART Wi Fi passthrough mode and its link in the flash ESP8266 will enter the UART Wi Fi passthrough mode on any subsequent power cycles As...

Page 58: ...to check the TCP server timeout Set Command AT CIPSTO time Function to set the TCP server timeout Response CIPSTO time OK OK Parameter time TCP server timeout within the range of 0 7200s Notes ESP8266...

Page 59: ...ed to make their own AT CIUPDATE upgrade Espressif provides a demo as a reference for local upgrade ESP8266_NONOS_SDK example at It is suggested that users call AT RESTORE to restore the factory defau...

Page 60: ...SNTP server1 optional parameter indicating the second SNTP server SNTP server2 optional parameter indicating the third SNTP server Example AT CIPSNTPCFG 1 8 cn ntp org cn ntp sjtu edu cn us pool ntp o...

Page 61: ...by default Commands Query Command AT CIPDNS_DEF Function Get the user defined DNS servers which saved in flash Set Command AT CIPDNS_DEF enable DNS server0 DNS server1 Function Set user defined DNS s...

Page 62: ...1 208 67 220 220 AT RFAUTOTRACE AT RFAUTOTRACE 0 Configuration Saved in the System Parameter Area in the Flash AT CWMODE_DEF AT CWMODE_DEF 3 AT CWJAP_DEF AT CWJAP_DEF abc 0123456789 AT CWSAP_DEF AT CW...

Page 63: ...current AT command version Hardware Module information for example ESP WROOM 02 Screenshot of the test steps for example If possible please provide the printed log information such as ets Jan 8 2013 r...

Page 64: ...ty for infringement of any proprietary rights relating to the use of information in this document is disclaimed No licenses express or implied by estoppel or otherwise to any intellectual property rig...

Reviews: