Professional Documents
Culture Documents
AT Command Reference PDF
AT Command Reference PDF
com
!
!
!
!
!
ESP8266 REFERENCE
Page 1
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
ESP8266 Dimensions
Page 2
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
ESP8266 Pinout
!
!
!
!
!
!
!
!
!
!
!
ESP8266 Basic connect
Page 3
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
AT Instruction Set
Overview
!
This is the documentation for ESP8266 AT command instruction set
and usage. Instruction set is divided into: Basic AT commands,
WiFi function, AT commands, TCP/IP Toolbox AT commands.
!
!
Version Info
!
Date Version Author Changes
!
!
Disclaimer and Copyright Notice
!
Information in this document, including URL references, is subject
to change without notice.
THIS DOCUMENT IS PROVIDED "AS IS" WITH NO WARRANTIES WHATSOEVER,
INCLUDING ANY WARRANTY OF MERCHANTABILITY, NONINFRINGEMENT,
FITNESS FOR ANY PARTICULAR PURPOSE, OR ANY WARRANTY OTHERWISE
ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. All
liability, including liability for infringement of any proprietary
rights, relating to use of information in this document is
disclaimed. No licenses express or implied, by estoppel or
otherwise, to any intellectual property rights are granted herein.
The Wi-Fi Alliance Member Logo is a trademark of the Wi-Fi
Alliance.
All trade names, trademarks and registered trademarks mentioned in
this document are property of their respective owners, and are
hereby acknowledged.
!
Page 4
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
Instruction Description
!
Each instruction set contains four types of AT commands.
!
Type Format Description
Page 5
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
AT Instruction Listing
Instruction Description
Basic
AT Test AT startup
AT+RST Restart
AT+GMR View version info
AT+GSLP Enter deep-sleep mode
ATE AT commands echo
WiFi
AT+CWMODE WIFI mode(station/softAP/station+softAP)
AT+CWJAP Connect to AP
AT+CWLAP Lists available APs
AT+CWQAP Disconnect from AP
AT+CWSAP Set parameters under AP mode
AT+CWLIF Get stations’ ip which are connected to ESP8266 softAP
AT+CWDHCP Enable/Disable DHCP
AT+CIPSTAMAC Set mac address of ESP8266 station
AT+CIPAPMAC Set mac address of ESP8266 softAP
AT+CIPSTA Set ip address of ESP8266 station
AT+CIPAP Set ip address of ESP8266 softAP
TCP/IP
AT+CIPSTATUS Get connection status
AT+CIPSTART Establish TCP connection or register UDP port
AT+CIPSEND Send data
AT+CIPCLOSE Close TCP/UDP connection
AT+CIFSR Get local IP address
AT+CIPMUX Set multiple connections mode
AT+CIPSERVER Configure as server
AT+CIPMODE Set transmission mode
AT+CIPSTO Set timeout when ESP8266 runs as TCP server
AT+CIUPDATE Force OTA(upgrade through network)
Data RX
+IPD Data received from network
Page 6
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
!
!
Page 7
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
Instructions
!
AT - Test AT startup
Instruction: Response:
! !
AT OK
!
Param description:
!
null
!
AT+RST - Restart Module
Instruction: Response:
! !
AT+RST OK
!
Param description:
!
null
!
AT+GMR - View version Info
Instruction: Response:
! !
AT+GMR <number>
OK
!
Param description:
!
<number>
Version Info, length: 8bytes
Note: response is 0017xxxxxx, then 0017 means the AT version.
Page 8
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
WiFi Functions
Overview
!
Instruction Description
AT+CWMODE WIFI mode(station/softAP/station+softAP)
AT+CWJAP Connect to AP
AT+CWLAP Lists available APs
AT+CWQAP Disconnect from AP
AT+CWSAP Set parameters under AP mode
AT+CWLIF Get stations’ ip which are connected to ESP8266 softAP
AT+CWDHCP Enable/Disable DHCP
AT+CIPSTAMAC Set mac address of ESP8266 station
AT+CIPAPMAC Set mac address of ESP8266 softAP
AT+CIPSTA Set ip address of ESP8266 station
AT+CIPAP Set ip address of ESP8266 softAP
!
!
Page 9
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
Instructions
!
AT+CWMODE - WiFi mode(station/softAP/station+softAP)
Type: test Response:
!
Function:
!
+CWMODE:(value scope of <mode>)
!
Get value scope of WiFi mode.
OK
! !
Param description:
Instruction:
! !
AT+CWMODE=? <mode>
1 - Station Mode
2 - AP Mode
3 - AP + Station Mode
Type: query Response:
!
Function:
!
!
Query ESP8266’s current wifi mode.
+CWMODE:<mode>
OK
! !
Param description:
Instruction:
! !
AT+CWMODE? <mode>
1 - Station Mode
2 - AP Mode
3 - AP + Station Mode
Type: set Response:
!
Function:
!
!
Set ESP8266 wifi mode.
OK
!
!
Instruction:
Param description:
!
! <mode>
AT+CWMODE=<mode> 1 - Station Mode
2 - AP Mode
3 - AP + Station Mode
!
!
Page 10
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
AT+CWJAP – Connect to AP
Type: test Response:
!
Function:
!
+CWJAP:<ssid>
!
Query AP’s info which is connect by
OK
ESP8266. !
!
Instruction:
Param description:
!
! <ssid>
string, AP’s SSID
AT+CWJAP?
Type: set Response:
!
Function:
!
!
Set AP’s info which will be connect by
OK
ERROR
ESP8266. !
!
Instruction:
Param description:
!
! <ssid>
AT+CWJAP=<ssid>,<pwd> string, AP’s SSID
<pwd>
string, MAX: 64bytes
!
AT+CWLAP – List available APs
Type: set Response:
!
Function:
!
+CWLAP:<ecn>,<ssid>,<rssi>,<mac>
!
Search available APs with specific
OK
conditions. ERROR
!
Instruction:
!
Param description:
! !
AT+ CWLAP = <ssid>,<mac>,<ch> <ssid>
string, AP’s SSID
Type: execute Response:
!
Function:
!
!
Lists all available APs.
+CWLAP:<ecn>,<ssid>,<rssi>,<mac>
OK
!
Instruction:
ERROR
!
! Param description:
!
AT+CWLAP
<ecn>
0 - OPEN
1 - WEP
2 - WPA_PSK
3 - WPA2_PSK
4 - WPA_WPA2_PSK
<ssid>
string, AP’s SSID
<rssi>
signal strength
<mac>
string, MAC address
Page 11
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
Page 12
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
!
AT+CWDHCP – Enable/Disable DHCP
Type: set Response:
!
Function:
!
!
Enable/Disable DHCP.
OK
!
!
Instruction:
Param description:
!
! <mode>
1 - Station Mode
AT+CWDHCP=<mode>,<en>
2 - AP Mode
3 - AP + Station Mode
<en>
0 - enable DHCP
1 - disable DHCP
!
AT+CIPSTAMAC – Set mac address of station
Type: query Response:
!
Function:
!
+CIPSTAMAC:<mac>
!
Get mac address of ESP8266 station.
OK
! !
Param description:
Instruction:
! !
AT+CIPSTAMAC? <mac>
string, mac address of station
Type: set
!
Function:
Response:
!
!
Set mac address of ESP8266 station.
OK
!
!
Instruction:
Param description:
!
! <mac>
AT+CIPSTAMAC=<mac> string, mac address of station
Page 13
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
!
AT+CIPSTA – Set ip address of ESP8266 station
Type: query Response:
!
Function:
!
+CIPSTA:<ip>
!
Get ip address of ESP8266 station.
OK
! !
Param description:
Instruction:
! !
AT+CIPSTA? <ip>
string, ip address of station
Type: set
!
Function:
Response:
!
!
Set ip address of ESP8266 station.
OK
!
!
Instruction:
Param description:
!
! <ip>
AT+CIPSTA=<ip> string, ip address of station
Page 14
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
Page 15
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
TCP/IP Related
Overview
!
Instruction Description
AT+CIPSTATUS Get connection status
AT+CIPSTART Establish TCP connection or register UDP port
AT+CIPSEND Send data
AT+CIPCLOSE Close TCP/UDP connection
AT+CIFSR Get local IP address
AT+CIPMUX Set multiple connections mode
AT+CIPSERVER Configure as server
AT+CIPMODE Set transmission mode
AT+CIPSTO Set timeout when ESP8266 runs as TCP server
AT+CIUPDATE Force OTA(upgrade through network)
!
!
Page 16
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
Instructions
!
AT+CIPSTATUS – Information about connection
Type: execute Response:
!
Function:
!
!
Get information about connection
STATUS:<stat>
+CIPSTATUS:<id>,<type>,<addr>,
! <port>,<tetype>
Instruction:
! !
OK
AT+CIPSTATUS
!
Param description:
!
<stat>
2 - Got IP
3 - Connected
4 - Disconnected
<id>
id of the connection (0~4), for
multi-connect
<type>
“TCP” or “UDP”
<addr>
string, IP address
<port>
port number
<tetype>
0 - ESP8266 run as a client
1 - ESP8266 run as a server
Page 17
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
AT+CIPSTART
Establish TCP connection or register UDP port, start connection
Type: test Response:
!
Function:
!
If AT+CIPMUX=0
!
Get the information of param.
+CIPSTART:(<type>),(<IPaddress>),
!
Instruction:
(<port>)[,(<localport>),(<mode>)]
+CIPSTART:(<type>),(<domainname>),
! (<port>)[,(<localport>),(<mode>)]
AT+CIPSTART=? OK
!
If AT+CIPMUX=1
+CIPSTART:(id),(<type>),
(<IPaddress>),(<port>)[,
(<localport>),(<mode>)] +CIPSTART:
(id),(<type>),(<domain name>),
(<port>)[,(<localport>),(<mode>)]
OK
!
!
Param description:
!
null
Type: set Response:
!
Function:
!
!
Start a connection as client.
OK
ERROR
!! ALREADY CONNECT
!
Instruction:
!
SINGLE CONNECTION
Param description:
!
<id>
(+CIPMUX=0) ID of connection (0-4)
AT+CIPSTART= <type>
<type>,<addr>,<port> [, “TCP” or “UDP”
(<localport>),(<mode>)] <addr>
!
MULTIPLE CONNECTIONS <port>
string, remote IP
Page 18
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
Page 19
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
Page 20
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
!
AT+CIPMUX – Enable multiple connections or not
Type: query Response:
!
Function:
!
!
Get param config.
+CIPMUX:<mode>
!
!
Instruction:
OK
! !
Param description:
AT+CIPMUX? !
The same as below
Type: set Response:
!
Function:
!
!
Set connection mode.
OK
!
!
Instruction:
If already connected, returns
LINK IS BUILDED
! !
AT+CIPMUX=<mode> Param description:
!
<mode>
0 - Single connection
1 - Multiple connections
Note: This mode can only be changed after all connections are
disconnected. If server is started, reboot is required.
Page 21
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
!
AT+CIPMODE – Set transfer mode
Type: query Response:
!
Function:
!
!
Query transfer mode.
+CIPMODE:<mode>
!
!
Instruction:
OK
! !
Param description:
AT+CIPMODE? !
The same as below
Type: set Response:
!
Function:
!
!
Set transfer mode.
OK
!
!
Instruction:
If already connected, returns
LINK IS BUILDED
! !
AT+CIPMODE=<mode> Param description:
!
<mode>
0 - Normal mode
1 - unvarnished transmission mode
!
!
Page 22
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
!
AT+CIUPDATE – update through network
Type: execute Response:
!
Function:
!
!
Start upgrade.
+CIPUPDATE:<n>
!
!
Instruction:
OK
! !
Param description:
AT+CIPMODE? !
<mode>
0 - found server
1 - connect to server
2 - download firmware
4 - flash firmware
Page 23
! of !24 ESP8266 Ref v1.0
www.pighixxx.com
Note: When the module receives network data, it will send the data
through the serial port using +IPD command
Page 24
! of !24 ESP8266 Ref v1.0