Espressif Systems ESP8266 AT Instruction Set

!
Version 2.1.0
Copyright © 2017
ESP8266 AT Instruction Set
Chapter
Title
Content
Chapter 1
Overview
Provides instructions on user-defined AT commands and downloading of AT firmware.
Chapter 2
Command Description
Gives a basic description of AT commands.
Chapter 3
Basic AT Commands
Lists AT commands 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 which the configuration is saved in the flash.
Chapter 7
Q & A
Provides information on where and how to consult questions about ESP8266 AT commands.
Date
Version
Release notes
2016.04
V1.5.3
First Release.
2016.05
V1.5.4
Updated Section 5.2.16 and Section 5.2.19
2016.07
V2.0.0
Added Section 3.2.11, updated Section 1.2
2017.05
V2.1.0
Updated Section 3.2, Section 4.1 and Section 5.2.
󰋴录
1. Overview 1 ................................................................................................................................................
1.1. User-Defined AT Commands! 1"......................................................................................................................
1.2. Downloading AT Firmware into the Flash! 2"...................................................................................................
1.2.1. 4 Mbit Flash! 2"...................................................................................................................................
1.2.2. 8 Mbit Flash! 2"...................................................................................................................................
1.2.3. 16 Mbit Flash, Map: 512 KB + 512 KB! 3"..........................................................................................
1.2.4. 16 Mbit Flash, Map: 1024 KB + 1024 KB! 3"......................................................................................
1.2.5. 32 Mbit Flash, Map: 512 KB + 512 KB! 4"..........................................................................................
1.2.6. 32 Mbit Flash, Map: 1024 KB + 1024 KB! 4"......................................................................................
2. Command Description 6 ..........................................................................................................................
3. Basic AT Commands 7 .............................................................................................................................
3.1. Overview! 7".....................................................................................................................................................
3.2. Commands! 8".................................................................................................................................................
3.2.1. AT—Tests AT Startup! 8".....................................................................................................................
3.2.2. AT+RST—Restarts the Module! 8".....................................................................................................
3.2.3. AT+GMR—Checks Version Information! 8"........................................................................................
3.2.4. AT+GSLP—Enters Deep-sleep Mode! 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.2.9. AT+UART_DEF—Default UART Configuration; Saved in the Flash! 12".............................................
3.2.10. AT+SLEEP—Configures the Sleep Modes! 13"..................................................................................
3.2.11. AT+WAKEUPGPIO—Configures a GPIO to Wake ESP8266 up from Light-sleep Mode! 13"............
3.2.12. AT+RFPOWER—Sets the Maximum Value of RF TX Power! 14".......................................................
3.2.13. AT+RFVDD—Sets RF TX Power According to VDD33! 14"................................................................
3.2.14. AT+RFAUTOTRACE—Sets RF Frequency Offset Trace! 15"..............................................................
3.2.15. AT+SYSRAM—Checks the Remaining Space of RAM! 15"...............................................................
3.2.16. AT+SYSADC—Checks the Value of ADC! 15"....................................................................................
3.2.17. AT+SYSIOSETCFG—Configures IO Working Mode! 16"....................................................................
3.2.18. AT+SYSIOGETCFG—Checks the Working Modes of IO Pins! 16".....................................................
3.2.19. AT+SYSGPIODIR—Configures the Direction of a GPIO! 16".............................................................
3.2.20. AT+SYSGPIOWRITE—Configures the Output Level of a GPIO! 17"..................................................
3.2.21. AT+SYSGPIOREAD—Reads the GPIO Input Level! 17".....................................................................
4. Wi-Fi AT Commands 19 ...........................................................................................................................
4.1. Overview! 19"...................................................................................................................................................
4.2. Commands! 21"...............................................................................................................................................
4.2.1. AT+CWMODE—Sets the Wi-Fi Mode (Station/SoftAP/Station+SoftAP)! 21".....................................
4.2.2. AT+CWMODE_CUR—Sets the Current Wi-Fi mode; Configuration Not Saved in the Flash! 21"......
4.2.3. AT+CWMODE_DEF—Sets the Default Wi-Fi mode; Configuration Saved in the Flash! 21"..............
4.2.4. AT+CWJAP—Connects to an AP! 22"................................................................................................
4.2.5. AT+CWJAP_CUR—Connects to an AP; Configuration Not Saved in the Flash! 23"..........................
4.2.6. AT+CWJAP_DEF—Connects to an AP; Configuration Saved in the Flash! 23".................................
4.2.7. AT+CWLAPOPT—Sets the Configuration for the Command AT+CWLAP! 25"..................................
4.2.8. AT+CWLAP—Lists Available APs! 26"................................................................................................
4.2.9. AT+CWQAP—Disconnects from the AP! 26".....................................................................................
4.2.10. AT+CWSAP—Configures 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.2.13. AT+CWLIF—IP of Stations to Which the ESP8266 SoftAP is Connected! 29"...................................
4.2.14. AT+CWDHCP—Enables/Disables DHCP! 29"....................................................................................
4.2.15. AT+CWDHCP_CUR—Enables/Disables DHCP; Configuration Not Saved in the Flash! 29".............
4.2.16. AT+CWDHCP_DEF—Enables/Disables DHCP; Configuration Saved in the Flash! 30".....................
4.2.17. AT+CWDHCPS_CUR—Sets the IP Address Allocated by ESP8266 SoftAP DHCP;
Configuration Not Saved in Flash! 31"...............................................................................................................
4.2.18. AT+CWDHCPS_DEF—Sets the IP Address Allocated by ESP8266 SoftAP DHCP; Configuration
Saved in Flash! 31".............................................................................................................................................
4.2.19. AT+CWAUTOCONN—Auto-Connects to the AP or Not! 32".............................................................
4.2.20. AT+CIPSTAMAC—Sets the MAC Address of the ESP8266 Station! 32"...........................................
4.2.21. AT+CIPSTAMAC_CUR—Sets the MAC Address of the ESP8266 Station; Configuration Not
Saved in the Flash! 32".......................................................................................................................................
4.2.22. AT+CIPSTAMAC_DEF—Sets the MAC Address of the ESP8266 Station; Configuration Saved in
the Flash! 33"......................................................................................................................................................
4.2.23. AT+CIPAPMAC—Sets the MAC Address of the ESP8266 SoftAP! 33"..............................................
4.2.24. AT+CIPAPMAC_CUR—Sets the MAC Address of the ESP8266 SoftAP; Configuration Not
Saved in the Flash! 34".......................................................................................................................................
4.2.25. AT+CIPAPMAC_DEF—Sets the MAC Address of the ESP8266 SoftAP; Configuration Saved in
Flash! 34"............................................................................................................................................................
4.2.26. AT+CIPSTA—Sets the IP Address of the ESP8266 Station! 35"........................................................
4.2.27. AT+CIPSTA_CUR—Sets the IP Address of the ESP8266 Station; Configuration Not Saved in
the Flash! 35"......................................................................................................................................................
4.2.28. AT+CIPSTA_DEF—Sets the IP Address of the ESP8266 Station; Configuration Saved in the
Flash! 36"............................................................................................................................................................
4.2.29. AT+CIPAP—Sets the IP Address of the ESP8266 SoftAP! 36"..........................................................
4.2.30. AT+CIPAP_CUR—Sets the IP Address of the ESP8266 SoftAP; Configuration Not Saved in the
Flash! 37"............................................................................................................................................................
4.2.31. AT+CIPAP_DEF—Sets the IP Address of the ESP8266 SoftAP; Configuration Saved in the Flash
! 37"....................................................................................................................................................................
4.2.32. AT+CWSTARTSMART—Starts SmartConfig! 38"...............................................................................
4.2.33. AT+CWSTOPSMART—Stops SmartConfig! 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 Function! 39"........................................................................................
4.2.37. AT+MDNS—Configures the MDNS Function! 40"..............................................................................
4.2.38. AT+CWHOSTNAME—Configures the Name of ESP8266 Station! 40"..............................................
5. TCP/IP-Related AT Commands 41 ..........................................................................................................
5.1. Overview! 41"...................................................................................................................................................
5.2. Commands! 42"...............................................................................................................................................
5.2.1. AT+CIPSTATUS—Gets the Connection Status! 42"...........................................................................
5.2.2. AT+CIPDOMAIN—DNS Function! 42"................................................................................................
5.2.3. AT+CIPSTART—Establishes TCP Connection, UDP Transmission or SSL Connection! 43".............
5.2.4. AT+CIPSSLSIZE—Sets the Size of SSL Buffer! 45"...........................................................................
5.2.5. AT+CIPSEND—Sends Data! 45".........................................................................................................
5.2.6. AT+CIPSENDEX—Sends Data! 46"....................................................................................................
5.2.7. AT+CIPSENDBUF—Writes Data into the TCP-Send-Buffer! 46"........................................................
5.2.8. AT+CIPBUFRESET—Resets the Segment ID Count! 47"...................................................................
5.2.9. AT+CIPBUFSTATUS—Checks the Status of the TCP-Send-Buffer! 48"............................................
5.2.10. AT+CIPCHECKSEQ—Checks If a Specific Segment Was Successfully Sent! 48"............................
5.2.11. AT+CIPCLOSE—Closes the TCP/UDP/SSL Connection! 49"............................................................
5.2.12. AT+CIFSR—Gets the Local IP Address! 49"......................................................................................
5.2.13. AT+CIPMUX—Enable or Disable Multiple Connections! 49"..............................................................
5.2.14. AT+CIPSERVER—Deletes/Creates TCP Server! 50"..........................................................................
5.2.15. AT+CIPMODE—Sets Transmission Mode! 50"...................................................................................
5.2.16. AT+SAVETRANSLINK—Saves the Transparent Transmission Link in Flash! 51"...............................
5.2.17. AT+CIPSTO—Sets the TCP Server Timeout! 52"...............................................................................
5.2.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—Sets the Configuration of SNTP! 54"..................................................................
5.2.23. AT+CIPSNTPTIME—Checks the SNTP Time! 54"..............................................................................
5.2.24. AT+CIPDNS_CUR—Sets User-defined DNS Servers; Configuration Not Saved in the Flash! 54"....
5.2.25. AT+CIPDNS_DEF—Sets User-defined DNS Servers; Configuration Saved in the Flash! 55"............
6. Appendix 56 .............................................................................................................................................
7. Q&A 57......................................................................................................................................................
!
1. Overview
Definition
Type
Description
at_testCmd
Test
AT Command
AT+TEST=?
Registered Callback In Example
at_testCmdTest
Function Design
Return the value"range of parameters
If at_testCmd is registered as NULL, there will be no testing command.
at_queryCmd
Query
AT Command
AT+TEST?
Registered Callback In Example
at_queryCmdTest
Function Design
Return the current value
If at_queryCmd is registered as NULL, there will be no Query Command.
at_setupCmd
Set
AT Command
AT+TEST=parameter1, parameter2, …
Registered Callback In Example
at_setupCmdTest
Function Design
Set configuration
If at_setupCmd is registered as NULL, there will be no setup command.
at_exeCmd
Execute
AT Command
AT+TEST
Registered Callback In Example
at_exeCmdTest
Function Design
Execute an action
If at_exeCmd is registered as NULL, there will be no execution command.
Espressif
! /!1 58
2017.05
!
1. Overview
All the files in folder at should be copied to the folder app in ESP8266_NONOS_SDK if users need to compile the AT firmware.
!
For details please refer to ESP8266 Getting Started Guide.
1.2. Downloading AT Firmware into the Flash
Please refer to ESP8266_NONOS_SDK/bin/at/readme.txt for instructions on how to download AT firmware into flash. Please use Espressif’s official Flash Download Tools to download the firmware. Make sure you select the corresponding flash size.
Espressif’s official Flash Download Tools:"
http://espressif.com/en/support/download/other-tools?keys=&field_type_tid%5B%5D=14.
1.2.1. 4 Mbit Flash
With the release of ESP8266_NONOS_SDK_V2.0.0, AT_V1.3, AT firmware can use 4-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 feature through Wi-Fi by command AT+CIUPDATE. Use Espressif Flash download tool and select flash size: 8 Mbit.
BIN
Address
Description
blank.bin
0x78000
Initializes the RF_CAL parameter area.
esp_init_data_default.bin
0x7C000
Stores the default RF parameter values; the BIN has to be downloaded into flash at least once.
If the RF_CAL parameter area is initialized, this BIN has to be downloaded too.
blank.bin
0x7A000
Initializes the flash user parameter area; for more details please see Appendix.
blank.bin
0x7E000
Initializes Flash system parameter area; for more details please see Appendix.
eagle.flash.bin
0x00000
In /bin/at/noboot.
eagle.irom0text.bin
0x10000
In /bin/at/noboot.
Espressif
! /!2 58
2017.05
!
1. Overview
1.2.3. 16 Mbit Flash, Map: 512 KB + 512 KB
Use Espressif Flash download tool and select flash size: 16 Mbit.
1.2.4. 16 Mbit Flash, Map: 1024 KB + 1024 KB
Use Espressif Flash download tool and select flash size: 16 Mbit-C1.
BIN
Address
Description
blank.bin
0xFB000
Initializes the RF_CAL parameter area.
esp_init_data_default.bin
0xFC000
Initializes the RF_CAL parameter area.
blank.bin
0x7E000
Stores the default RF parameter values; the BIN has to be downloaded into flash at least once.
If the RF_CAL parameter area is initialized, this BIN has to be downloaded too.
blank.bin
0xFE000
Initializes the flash user parameter area; for more details please see Appendix.
boot.bin
0x00000
In /bin/at
user1.1024.new.2.bin
0x01000
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 at least once.
If the RF_CAL parameter area is initialized, this bin has to be downloaded too.
blank.bin
0x7E000
Initializes Flash user parameter area, more details in Appendix.
blank.bin
0x1FE000
Initializes Flash system parameter area, more details in Appendix.
boot.bin
0x00000
In /bin/at.
user1.1024.new.2.bin
0x01000
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 at least once.
If the RF_CAL parameter area is initialized, this bin has to be downloaded too.
blank.bin
0xFE000
Initializes Flash user parameter area, more details in Appendix.
BIN
Espressif
! /!3 58
2017.05
!
1. Overview
1.2.5. 32 Mbit Flash, Map: 512 KB + 512 KB
Use Espressif Flash download tool and select flash size: 32 Mbit.
1.2.6. 32 Mbit Flash, Map: 1024 KB + 1024 KB
Use Espressif Flash download tool and select flash size: 32 Mbit-C1.
blank.bin
0x1FE000
Initializes Flash system parameter area, more details in Appendix.
boot.bin
0x00000
In /bin/at.
user1.2048.new.5.bin
0x01000
In /bin/at/1024+1024.
Address
Description
BIN
BIN
Address
Description
blank.bin
0x3FB000
Initializes RF_CAL parameter area.
esp_init_data_default.bin
0x3FC000
Stores default RF parameter values, has to be downloaded into flash at least once.
If the RF_CAL parameter area 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 details in Appendix.
boot.bin
0x00000
In /bin/at.
user1.1024.new.2.bin
0x01000
In /bin/at/512+512.
BIN
Address
Description
blank.bin
0x3FB000
Initializes RF_CAL parameter area
esp_init_data_default.bin
0x3FC000
Stores default RF parameter values, has to be downloaded into flash at least once.
If the RF_CAL parameter area is initialized, this bin has to be downloaded too.
blank.bin
0xFE000
Initializes Flash user parameter area, more details in Appendix.
blank.bin
0x3FE000
Initializes Flash system parameter area, more details in Appendix.
boot.bin
0x00000
In /bin/at.
user1.2048.new.5.bin
0x01000
In /bin/at/1024+1024.
Espressif
! /!4 58
2017.05
!
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
!
2. Command Description
Type
Command Format
Description
Test Command
AT+<x>=?
Queries the Set Commands’ internal parameters and their range of values.
Query Command
AT+<x>?
Returns the current value of parameters.
Set Command
AT+<x>=<…>
Sets the value of user-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.
Square brackets [ ] designate the default value; it is either not required or may not appear.
String values need to be included in double quotation marks, for example: AT+CWSAP="ESP756290","21030826",
1,4.
The default baud rate is 115200.
AT commands have to be capitalized, and must end with a new line (CR LF).
Espressif
! /!6 58
2017.05
!
3. Basic AT Commands
Commands
Description
AT
Tests AT startup.
AT+RST
Restarts the module.
AT+GMR
Checks version information.
AT+GSLP
Enters Deep-sleep mode.
ATE
Configures echoing of AT commands.
AT+RESTORE
Restores the factory default settings of the module.
AT+UART
UART configuration. [@deprecated]
AT+UART_CUR
The current UART configuration.
AT+UART_DEF
The default UART configuration, 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 the RF TX Power according to VDD33.
AT+RFAUTOTRACE
Sets RF frequency offset trace.
AT+SYSRAM
Checks the available RAM size.
AT+SYSADC
Checks the ADC value.
AT+SYSIOSETCFG
Sets configuration of IO pins.
AT+SYSIOGETCFG
Gets configuration of IO pins.
AT+SYSGPIODIR
Configures the direction of GPIO.
AT+SYSGPIOWRITE
Configures the GPIO output level
AT+SYSGPIOREAD
Checks the GPIO input level.
Espressif
! /!7 58
2017.05
!
3. Basic AT Commands
3.2. Commands
3.2.1. AT—Tests AT Startup
3.2.2. AT+RST—Restarts the Module
3.2.3. AT+GMR—Checks Version Information
3.2.4. AT+GSLP—Enters Deep-sleep Mode
Execute Command
AT
Response
OK
Parameters
-
Execute Command
AT+RST
Response
OK
Parameters
-
Execute Command
AT+GMR
Response
<AT󰲧version󰲧info>
<SDK󰲧version󰲧info>
<compile󰲧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=<time>
Response
<time>
OK
Parameters
<time>: the duration of ESP8266’s sleep. Unit: ms.
ESP8266 will wake up after Deep-sleep for as many milliseconds (ms) as <time> indicates.
Note
A minor adjustment has to be made before the module enter the Deep-sleep mode, i.e., connecting XPD_DCDC to EXT_RSTB via a 0-ohm resistor.
Espressif
! /!8 58
2017.05
!
3. Basic AT Commands
3.2.5. ATE—AT Commands Echoing
3.2.6. AT+RESTORE—Restores the Factory Default Settings
3.2.7. AT+UART—UART Configuration
[@deprecated] This command is deprecated. Please use AT+UART_CUR or AT+UART_DEF instead.
Execute Command
ATE
Response
OK
Parameters
ATE0: Switches echo off.
ATE1: Switches echo on.
Note
This command ATE is used to 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 in normal cases and ERROR 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 settings of the module. The chip will be restarted when this command is executed.
Command
Query Command:
AT+UART?
Set Command:
AT+UART=<baudrate>,<databits>,<stopbits >,<parity>,<flow󰲧control>
Response
+UART:<baudrate>,<databits>,<stopbits>,<parity>, <flow󰲧control>
OK
OK
Note
Command AT+UART? will return the actual value of UART configuration parameters, which may have allowable errors compared with the set value.
For example, if the UART baud rate is set as 115200, the baud rate returned by using command AT+UART? could be 115273.
-
Espressif
! /!9 58
2017.05
!
3. Basic AT Commands
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>: 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 both RTS and CTS
Notes
1. The configuration changes will be saved in the user parameter area in the flash, and will still be valid when the chip is powered on again.
2. The use of flow control requires the support of hardware:
MTCK is UART0 CTS MTDO is UART0 RTS
3. The range of baud rates supported: 110~115200*40.
Example
AT+UART=115200,8,1,0,3
Espressif
! /!10 58
2017.05
!
3. Basic AT Commands
3.2.8. AT+UART_CUR—Current UART Configuration; Not Saved in the Flash
Command
Query Command:
AT+UART_CUR?
Set Command:
AT+UART_CUR=<baudrate>,<databits>,<stop bits>,<parity>,<flow󰲧control>
Response
+UART_CUR:<baudrate>,<databits>,<stopbits>,<pari ty>,<flow󰲧control>
OK
OK
Note
Command AT+UART_CUR? will return the actual value of UART configuration parameters, which may have
allowable errors compared with the set value because of the clock division.
For example, if the UART baud rate 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>: 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 both RTS and CTS
Notes
1. The configuration changes will NOT be saved in the flash.
2. The use of flow control requires the support of hardware:
MTCK is UART0 CTS MTDO is UART0 RTS
3. The range of baud rates supported: 110~115200*40.
Example
AT+UART_CUR=115200,8,1,0,3
Espressif
! /!11 58
2017.05
!
3. Basic AT Commands
3.2.9. AT+UART_DEF—Default UART Configuration; Saved in the Flash
Command
Query Command:
AT+UART_DEF?
Set Command:
AT+UART_DEF=<baudrate>,<databits>,<stopbits> ,<parity>,<flow󰲧control>
Response
+UART_DEF:<baudrate>,<databits>,<stopbits>,< parity>,<flow󰲧control>
OK
OK
Parameter
<baudrate>: UART baud rate
<databits>: data bits
5: 5-bit data
6: 6-bit data
7: 7-bit data
8: 8-bit data
<stopbits>: 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 both RTS and CTS
Notes
1. The configuration changes will be saved in the user parameter area in the flash, and will still be valid when the chip is powered on again.
2. The use of flow control requires the support of hardware:
MTCK is UART0 CTS MTDO is UART0 RTS
3. The range of baud rates supported: 110~115200*40.
Example
AT+UART_DEF=115200,8,1,0,3
Espressif
! /!12 58
2017.05
!
3. Basic AT Commands
3.2.10. AT+SLEEP—Configures the Sleep Modes
3.2.11. AT+WAKEUPGPIO—Configures a GPIO to Wake ESP8266 up from Light-sleep Mode
Command
Query Command:
AT+SLEEP?
Set Command:
AT+SLEEP=<sleep󰲧mode>
Response
+SLEEP:<sleep󰲧mode>
OK
OK
or
ERROR
Parameter
<sleep󰲧mode>:
0: disables sleep mode 1: Light-sleep mode 2: Modem-sleep mode
Notes
This command can only be used in Station mode. Modem-sleep is the default sleep mode.
Example
AT+SLEEP=0
Command
AT+WAKEUPGPIO=<enable>,<trigger_GPIO>,<trigger_level>[,<awake_GPIO>,<awake_level>]
Response
OK
Parameter
<enable>
0: ESP8266 can NOT be woken up from light-sleep by GPIO.
1: ESP8266 can be woken up from light-sleep by 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 parameter is used to set a GPIO as a flag of ESP8266’s being awoken form
Light-sleep; range of value: [0, 15].
[<awake_level>]
Optional;
0: The GPIO is set to be low level after the wakeup process.
1: The GPIO is set to be high level after the wakeup process.
Notes
The value of <trigger_GPIO> and <awake_GPIO> in the command should not be the same.
After being woken up by <trigger_GPIO> from Light-sleep, when the ESP8266 attempts to sleep again, it will check the status of the <trigger_GPIO>:
if it is still in the wakeup status, the EP8266 will enter Modem-sleep mode instead;
if it is NOT in the wakeup status, the ESP8266 will enter Light-sleep mode.
Espressif
! /5813
2017.05
!
3. Basic AT Commands
3.2.12. AT+RFPOWER—Sets the Maximum Value of RF TX Power
3.2.13. AT+RFVDD—Sets RF TX Power According to VDD33
Example
Set ESP8266 to be woken from Light-sleep, when GPIO0 is on low level:
AT+WAKEUPGPIO=1,0,0
Set ESP8266 to be woken from Light-sleep, when GPIO0 is on high level. After the waking-
up, GPIO13 is set to high level.
AT+WAKEUPGPIO=1,0,1,13,1
Disable the function that ESP8266 can be woken up from Light-sleep by a GPIO.
AT+WAKEUPGPIO=0
Set Command
AT+RFPOWER=<TX󰲧Power>
Response
OK
Parameter
<TX󰲧Power>: the maximum value of RF TX power; range: [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 Command:
AT+RFVDD?
Function: Checks the value of ESP8266 VDD33.
Set Command:
AT+RFVDD=<VDD33>
Function: Sets the RF TX Power according to <VDD33>.
Execute Command:
AT+RFVDD
Function: Automatically sets the RF TX Power.
Response
+RFVDD:<VDD33>
OK
OK
OK
Parameter
<VDD33>: power voltage of ESP8266 VDD33; unit: 1/1024 V.
<VDD33>: power voltage of ESP8266 VDD33 ; range: [1900, 3300].
-
Note
The command should only be used when TOUT pin has to be suspended, or else the returned value would be invalid.
-
TOUT pin has to be suspended in order to measure VDD33.
Example
AT+RFVDD=2800
Espressif
! /5814
2017.05
Loading...
+ 44 hidden pages