Espressif Systems ESP8266 At Instruction Set
Hide thumbs Also See for ESP8266:
Table of Contents

Advertisement

Quick Links

ESP8266 AT Instruction Set
Version 0.24
Espressif Systems IOT Team
Copyright (c) 2015

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP8266 and is the answer not in the manual?

Questions and answers

Summary of Contents for Espressif Systems ESP8266

  • Page 1 ESP8266 AT Instruction Set Version 0.24 Espressif Systems IOT Team Copyright (c) 2015...
  • Page 2 The WiFi Alliance Member Logo is a trademark of the WiFi Alliance. All trade names, trademarks and registered trademarks mentioned in this document are property of their respective owners, and are hereby acknowledged. Copyright © 2015 Espressif Systems Inc. All rights reserved. Espressif Systems Confidential 2 54...
  • Page 3: Table Of Contents

    AT+CWJAP_DEF – Connect to AP,save as default ....... AT+CWLAP – List available APs ............. AT+CWQAP – Disconnect from AP ............AT+CWSAP – Configuration of softAP mode .......... 10. AT+CWSAP_CUR – Current config of softAP mode ........ Espressif Systems Confidential 3 54 Friday, May 22, 2015...
  • Page 4 AT+CIPBUFSTATUS – Check status of TCP-send-buffer ......AT+CIPCHECKSEG – Check if specific segment sent successfully or not 4 7 AT+CIPCLOSE – Close TCP or UDP connection ........10. AT+CIFSR – Get local IP address ............Espressif Systems Confidential 4 54 Friday, May 22, 2015...
  • Page 5 15. AT+CIPSTO – Set TCP server timeout ........... 16. AT+CIUPDATE – Update through network ..........17. AT+PING – Function Ping ............... 18. +IPD – Receive network data ..............Appendix ....................Q&A ......................Espressif Systems Confidential 5 54 Friday, May 22, 2015...
  • Page 6: Preambles

    , so only one task of priority 2 is allowed system_os_task to set up by 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 ‣...
  • Page 7: Command Description

    [] = default value, not required or may not appear String values require double quotation marks, for example: AT+CWSAP="ESP756290","21030826",1,4 Baudrate = 115200 AT Commands has to be capitalized, and end with " " /r/n Espressif Systems Confidential 7 54 Friday, May 22, 2015...
  • Page 8: Basic At Command Set

    AT Instruction Set Basic AT Command Set 3.1. Overview The ESP8266 wireless WiFi 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...
  • Page 9: At+Rst - Restart Module

    0R. XPD_DCDC EXT_RSTB AT+GSLP=<time> <time> Response The time unit of < time > is ms. ESP8266 will wake up after X ms and then Parameters enter the deep sleep mode. Espressif Systems Confidential 9 54 Friday, May 22, 2015...
  • Page 10: Ate - At Commands Echo

    5: 5 bits data
 <databits>
 6: 6 bits data
 7: 7 bits data
 8: 8 bits data 1: 1 bit stop bit
 <stopbits> 2: 1.5 bit stop bit
 Parameters 3: 2 bit stop bit Espressif Systems Confidential 10 54 Friday, May 22, 2015...
  • Page 11: At+Uart_Cur - Current Uart Configuration

    3: enable both RTS and CTS • This configuration will NOT be stored in the flash; unlike the AT+UART command. Notes • Flow control needs hardware support: MTCK is UART0 CTS and MTDO is UART0 RTS. Espressif Systems Confidential 11 54 Friday, May 22, 2015...
  • Page 12: At+Uart_Def - Default Uart Configuration

    3: enable both RTS and CTS • This configuration will be stored in the flash user parameter area. Notes • Flow control needs hardware support: MTCK is UART0 CTS and MTDO is UART0 RTS. Espressif Systems Confidential 12 54 Friday, May 22, 2015...
  • Page 13: At+Sleep - Sleep Mode

    Parameters The same as above. 11. AT+RFPOWER – set RF TX Power This command sets ESP8266 RF TX power, it is not precise, it is setting the maximum value of RF TX power. AT+RFPOWER – set RF TX Power Example...
  • Page 14: At+Rfvdd - Set Rf Tx Power According To Vdd33

    AT Instruction Set 12. 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. AT+RFVDD – set RF TX power according to VDD33...
  • Page 15: Wifi Functions Overview

    Set configuration of ESP8266 softAP AT+CWSAP_CUR Won’t save to Flash. Set configuration of ESP8266 softAP AT+CWSAP_DEF Save to Flash. AT+CWLIF Get station’s IP which is connected to ESP8266 softAP AT+CWDHCP Enable/Disable DHCP, [@deprecated] AT+CWDHCP_CUR Enable/Disable DHCP, won’t save to Flash AT+CWDHCP_DEF...
  • Page 16 ESP8266 Espressif Systems AT Instruction Set Set mac address of ESP8266 station AT+CIPSTAMAC_DEF Save to Flash. Set mac address of ESP8266 softAP AT+CIPAPMAC [@deprecated] Set mac address of ESP8266 softAP AT+CIPAPMAC_CUR Won’t save to Flash. Set mac address of ESP8266 softAP AT+CIPAPMAC_DEF Save to Flash.
  • Page 17: Commands

    <mode>3 means AP + Station mode This setting will be stored in the flash system parameter area. It won’t Notes be erased even when the power is off and restarted. Espressif Systems Confidential 17 54 Friday, May 22, 2015...
  • Page 18: At+Cwmode_Cur - Current Wifi Mode

    <mode>3 means AP + Station mode Command AT+CWMODE_CUR=<mode> Response <mode>1 means Station mode Parameters <mode>2 means softAP mode <mode>3 means AP + Station mode Notes This configuration will store in Flash. Espressif Systems Confidential 18 54 Friday, May 22, 2015...
  • Page 19: At+Cwmode_Def - Default Wifi Mode

    AP + Station mode Command AT+CWMODE_DEF=<mode> Response <mode>1 means Station mode Parameters <mode>2 means softAP mode <mode>3 means AP + Station mode Notes This configuration will store in Flash system parameter area. Espressif Systems Confidential 19 54 Friday, May 22, 2015...
  • Page 20: At+Cwjap - Connect To Ap

    This command needs station mode enable. Escape character syntax is needed if "SSID" or "password" contains any special characters (’,’、’"’and’/’) Notes This configuration will store in Flash system parameter area. Espressif Systems Confidential 20 54 Friday, May 22, 2015...
  • Page 21: At+Cwjap_Cur - Connect To Ap,For Current

    <error code> 4 connect fail This command needs station mode enable. Escape character syntax is needed if "SSID" or "password" contains any special characters (’,’、’"’and’/’) This configuration will store in Flash . Notes Espressif Systems Confidential 21 54 Friday, May 22, 2015...
  • Page 22: At+Cwjap_Def - Connect To Ap,Save As Default

    This command needs station mode enable. Escape character syntax is needed if "SSID" or "password" contains any special characters (’,’、’"’and’/’) Notes This configuration will store in Flash system parameter area. Espressif Systems Confidential 22 54 Friday, May 22, 2015...
  • Page 23: At+Cwlap - List Available Aps

    Espressif Systems AT Instruction Set 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" Find AP with specific SSID Command AT+CWLAP=<ssid>,<mac>,<ch>...
  • Page 24: At+Cwsap - Configuration Of Softap Mode

    Response ERROR Parameters The same as above. This CMD is only available when softAP mode enable. Notes ESP8266 softAP don’t support WEP. This configuration will store in Flash system parameter area. Espressif Systems Confidential 24 54 Friday, May 22, 2015...
  • Page 25: At+Cwsap_Cur - Current Config Of Softap Mode

    WPA_WPA2_PSK Command AT+CWSAP_CUR=<ssid>,<pwd>,<chl>,<ecn> Response ERROR Parameters The same as above. This command is only available when softAP mode enable. Notes ESP8266 softAP don’t support WEP. This configuration will store in Flash. Espressif Systems Confidential 25 54 Friday, May 22, 2015...
  • Page 26: At+Cwsap_Def - Default Config Of Softap Mode

    This configuration will store in Flash system parameter area. 12. 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>...
  • Page 27: At+Cwdhcp - Enable/Disable Dhcp

    0 - station dhcp disable 1 - station dhcp enable Command AT+CWDHCP=<mode>,<en> Response <mode> 0 : set ESP8266 softAP 1 : set ESP8266 station Parameters 2 : set both softAP and station <en> 0 : Disable DHCP 1 : Enable DHCP This configuration will store in Flash user parameter area.
  • Page 28: At+Cwdhcp_Cur - Enable/Disable Dhcp

    AT+CWDHCP_CUR – Enable/Disable DHCP, won’t save to Flash Example AT+CWDHCP_CUR=0,1 Command AT+CWDHCP_CUR=<mode>,<en> Response <mode> 0 : set ESP8266 softAP 1 : set ESP8266 station Parameters 2 : set both softAP and station <en> 0 : Disable DHCP 1 : Enable DHCP This configuration will store in Flash.
  • Page 29: At+Cwdhcp_Def - Enable/Disable Dhcp And Save To Flash

    0 : do auto-connect to AP when power on 1 : connect to AP automatically when power on Parameters Default is enable, ESP8266 station will connect to AP automatically when power on. This configuration will store in Flash system Notes parameter area.
  • Page 30: At+Cipstamac - Set Mac Address Of Station

    ESP8266 station Notes This configuration will store in Flash user parameter area. 18. AT+CIPSTAMAC_CUR – Set mac address of station AT+ CIPSTAMAC_CUR – Set mac address of ESP8266 station, won’t save to Flash Example AT+CIPSTAMAC_CUR="18:fe:35:98:d3:7b" Command AT+CIPSTAMAC_CUR? +CIPSTAMAC_CUR:<mac>...
  • Page 31: At+Cipstamac_Def - Set Mac Address Of Station, Save As Default

    ESP8266 Espressif Systems AT Instruction Set 19. AT+CIPSTAMAC_DEF – Set mac address of station, save as default AT+ CIPSTAMAC_DEF – Set mac address of ESP8266 station, save to Flash Example AT+CIPSTAMAC_DEF="18:fe:35:98:d3:7b" Command AT+CIPSTAMAC_DEF? +CIPSTAMAC_DEF:<mac> Response Param description Parameters <mac> string, mac address of ESP8266 station Command AT+CIPSTAMAC_DEF=<mac>...
  • Page 32: At+Cipapmac_Cur - Set Mac Address Of Softap

    ESP8266 Espressif Systems AT Instruction Set 21. AT+CIPAPMAC_CUR – Set mac address of softAP AT+CIPAPMAC_CUR – Set mac addr of ESP8266 softAP, won’t save to Flash Example AT+CIPAPMAC_CUR="1a:fe:36:97:d5:7b" Command AT+CIPAPMAC_CUR? +CIPAPMAC_CUR:<mac> Response Parameters <mac> string, mac address of ESP8266 softAP Command AT+CIPAPMAC_CUR=<mac>...
  • Page 33: At+Cipsta - Set Ip Address Of Station

    Parameters [<gateway>] gateway [<netmask>] netmask This configuration will store in Flash user parameter area. Only after ESP8266 station connected to AP, station IP can be got and inquiried. Notes This configuration interacts with DHCP related AT commands(AT +CWDHCP related): If enable static IP, DHCP will be disabled;...
  • Page 34: At+Cipsta_Cur - Set Ip Address Of Station

    ESP8266 Espressif Systems AT Instruction Set 24. AT+CIPSTA_CUR – Set IP address of station AT+CIPSTA_CUR – Set IP address of ESP8266 station, won’t save to Flash Example AT+CIPSTA_CUR="192.168.6.100","192.168.6.1","255.255.255.0" Command AT+CIPSTA_CUR? +CIPSTA_CUR:<IP> Response Param description Parameters <IP> string, IP address of ESP8266 station Command AT+CIPSTA_CUR=<IP>[,<gateway>,<netmask>]...
  • Page 35: At+Cipsta_Def - Set Ip Address Of Station And Save As Default

    ESP8266 Espressif Systems AT Instruction Set 25. 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> string, IP address of ESP8266 station Command AT+CIPSTA_DEF=<IP>[,<gateway>,<netmask>]...
  • Page 36: At+ Cipap - Set Ip Address Of Softap

    ESP8266 Espressif Systems AT Instruction Set 26. AT+ CIPAP – Set IP address of softAP AT+ CIPAP – Set IP address of ESP8266 softAP [@deprecated]. Please use AT+CIPAP_CUR or AT+CIPAP_DEF instead. Example AT+CIPAP="192.168.5.1",“192.168.5.1”,“255.255.255.0” Command AT+CIPAP? +CIPAP:<IP> Response Parameters <IP> string, IP address of ESP8266 softAP Command AT+CIPAP=<IP>[,<gateway>,<netmask>]...
  • Page 37: At+Cipap_Cur - Set Ip Address Of Softap

    ESP8266 Espressif Systems AT Instruction Set 27. AT+CIPAP_CUR – Set IP address of softAP 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” Command AT+CIPAP_CUR? +CIPAP_CUR:<IP> Response Parameters <IP> string, IP address of ESP8266 softAP Command AT+CIPAP_CUR=<IP>[,<gateway>,<netmask>]...
  • Page 38: At+Cipap_Def - Set Ip Address Of Softap, Save As Default

    ESP8266 Espressif Systems AT Instruction Set 28. AT+CIPAP_DEF – Set IP address of softAP, save as default 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> Response Parameters <IP> string, IP address of ESP8266 softAP Command AT+CIPAP_DEF=<IP>[,<gateway>,<netmask>]...
  • Page 39: At+Cwstartsmart - Start Smartconfig

    • Message "Smart get wifi info" means Smart Config get AP’s Notes information successfully, then ESP8266 try to connect to target AP,print “WIFI CONNECTED” and “WIFI GOT IP” if succeed; • ESP8266 can’t do anything during SmartConfig so please wait till it succeed or use command "AT+CWSTOPSMART"...
  • Page 40: Tcp/Ip Related At Commands

    AT+CIPSERVER 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 Espressif Systems Confidential 40 54 Friday, May 22, 2015...
  • Page 41: Tcp/Ip

    "TCP" or "UDP" Parameters <remote_IP> string, remote IP address. <remote_port> remote port number <local_port> ESP8266 local port number <tetype> <tetype> 0: ESP8266 runs as client <tetype> 1: ESP8266 runs as server Espressif Systems Confidential 41 54 Friday, May 22, 2015...
  • Page 42: At+Cipstart - Start Connection

    Note: [<UDP mode>] can only be used when [<UDP local port>] is set. [<TCP keep alive>] default 0. unit: 500 milliseconds. [<TCP keep alive>] 0 : disable TCP keep-alive [<TCP keep alive>] 1 ~ 7200 : TCP keep-alive interval Espressif Systems Confidential 42 54 Friday, May 22, 2015...
  • Page 43: At+Cipsend - Send Data

    For UDP transparent transmission, <UDP mode> has to be 0 in command “AT+CIPSTART” Please refer to "Espressif AT Command Examples" for more Notes examples. Espressif Systems Confidential 43 54 Friday, May 22, 2015...
  • Page 44: At+Cipsendex - Send Data

    If connection cannot be established or gets disconnected during send, returns ERROR If data is transmitted successfully, returns SEND OK <link ID> ID of the connection (0~4), for multi-connect Parameters <length> data length, MAX 2048 bytes Espressif Systems Confidential 44 54 Friday, May 22, 2015...
  • Page 45: At+Cipsendbuf - Write Data Into Tcp-Send-Buffer

    (+CIPMUX=1) Multiple connection AT+CIPBUFRESET=<link ID> Response If connection is not established or there are still TCP data wait for sending,returns ERROR Parameters <link ID> ID of the connection (0~4), for multi-connect Espressif Systems Confidential 45 54 Friday, May 22, 2015...
  • Page 46: At+Cipbufstatus - Check Status Of Tcp-Send-Buffer

    <remain buffer size> TCP-send-buffer remain buffer size; <queue number> available TCP queue number, it’s not reliable; when queue number is 0, no more TCP data can be sent. Espressif Systems Confidential 46 54 Friday, May 22, 2015...
  • Page 47: At+Cipcheckseg - Check If Specific Segment Sent Successfully Or Not 4

    <link ID> ID no. of connection to close, when ID=5, all Parameters connections will be closed. (ID=5 has no effect in server mode) Single connection AT+CIPCLOSE Response If no such connection, returns ERROR Espressif Systems Confidential 47 54 Friday, May 22, 2015...
  • Page 48: At+Cifsr - Get Local Ip Address

    + CIFSR:<IP address> Response ERROR <IP address> Parameters IP address of ESP8266 softAP IP address of ESP8266 station Only after ESP8266 station connected to AP, station IP can be got Note and inquiried. Espressif Systems Confidential 48 54 Friday, May 22, 2015...
  • Page 49 1. Server can only be created when AT+CIPMUX=1 2. Server monitor will automatically be created when Server is created. Notes 3. When a client is connected to the server, it will take up one connection,be gave an Espressif Systems Confidential 49 54 Friday, May 22, 2015...
  • Page 50 [<type>] TCP or UDP, default to be “TCP” 1. This command will save the UART-WiFi passthrough mode and its link into Flash user parameter area,ESP8266 will enter UART-WiFi passthrough mode since next power on. Notes 2. As long as the IP, port numerical conformance to specification, we will save them to Flash Espressif Systems Confidential...
  • Page 51 Response Param description Parameters < time> TCP server timeout, range 0~7200 seconds ESP8266 as TCP server, will disconnect to TCP client that didn’t communicate with it Notes even if timeout. If AT+CIPSTO=0, it will never timeout. We don’t recommend that.
  • Page 52 <ID> id no. of connection Parameters <len> data length <data> data received When the module receives network data, it will send the data Notes through the serial port using +IPD command. Espressif Systems Confidential 52 54 Friday, May 22, 2015...
  • Page 53 ESP8266 Espressif Systems AT Instruction Set Appendix ESP8266 AT commands below will save configuration parameters restoretes: • We will check the new setting with original configuration from flash first,only if the configuration changes,we will write it to flash. • To 512KB flash, default setting: user parameter area is 16KB;...
  • Page 54 4 chksum 0xcb csum 0xcb SDK version: 0.9.1 addr not ack when tx write cmd mode : sta(18: fe: 34: 97: d5: 7b) + softAP(1a: fe: 34: 97: d5: 7b) Espressif Systems Confidential 54 54 Friday, May 22, 2015...

Table of Contents