Esp 8266 Reference Sheet
Esp 8266 Reference Sheet
com
!
!
!
!
!
ESP8266
REFERENCE
Page 1
! of !24
www.pighixxx.com
ESP8266 Dimensions
Page 2
! of !24
www.pighixxx.com
ESP8266 Pinout
!
!
!
!
!
!
!
!
!
!
!
Page 3
! of !24
www.pighixxx.com
AT Instruction Set
Overview
!
!
Version
!
Info
Date
09 Dec 2014
Version
1.0
Author
Pighixxx
Changes
Draft
!
!
Page 4
! of !24
www.pighixxx.com
Instruction Description
!
Each instruction set contains four types of AT commands.
!
Type
Format
Description
Test
AT+<x>=?
Query
AT+<x>?
Set
Execute
AT+<x>
!
!
NOTE:
!
!
2. [] = default value, not required or may not appear
!
!
!
Page 5
! of !24
www.pighixxx.com
AT Instruction Listing
Instruction
Description
Basic
AT
Test AT startup
AT+RST
Restart
AT+GMR
AT+GSLP
ATE
AT commands echo
WiFi
AT+CWMODE
WIFI mode(station/softAP/station+softAP)
AT+CWJAP
Connect to AP
AT+CWLAP
AT+CWQAP
Disconnect from AP
AT+CWSAP
AT+CWLIF
AT+CWDHCP
Enable/Disable DHCP
AT+CIPSTAMAC
AT+CIPAPMAC
AT+CIPSTA
AT+CIPAP
AT+CIPSTATUS
AT+CIPSTART
AT+CIPSEND
Send data
AT+CIPCLOSE
AT+CIFSR
AT+CIPMUX
AT+CIPSERVER
Configure as server
AT+CIPMODE
AT+CIPSTO
AT+CIUPDATE
+IPD
Page 6
! of !24
www.pighixxx.com
Instruction
Description
AT
Test AT startup
AT+RST
Restart module
AT+GMR
AT+GSLP
ATE
!
!
Page 7
! of !24
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>
Page 8
! of !24
www.pighixxx.com
WiFi Functions
Overview
Instruction
Description
AT+CWMODE
WIFI mode(station/softAP/station+softAP)
AT+CWJAP
Connect to AP
AT+CWLAP
AT+CWQAP
Disconnect from AP
AT+CWSAP
AT+CWLIF
AT+CWDHCP
Enable/Disable DHCP
AT+CIPSTAMAC
AT+CIPAPMAC
AT+CIPSTA
AT+CIPAP
!
!
Page 9
! of !24
www.pighixxx.com
Instructions
Response:
Function:
!
!
!
!
Instruction:
Param description:
AT+CWMODE=?
<mode>
1 - Station Mode
2 - AP Mode
3 - AP + Station Mode
Type: query
Response:
Function:
Query ESP8266s current wifi mode.
+CWMODE:<mode>
OK
Instruction:
Param description:
AT+CWMODE?
<mode>
!
!
!
!
!
!
1 - Station Mode
2 - AP Mode
3 - AP + Station Mode
Type: set
Response:
Function:
OK
!
!
!
!
Instruction:
AT+CWMODE=<mode>
Param description:
<mode>
1 - Station Mode
2 - AP Mode
3 - AP + Station Mode
!
!
Page 10
!
of !24
www.pighixxx.com
AT+CWJAP Connect to AP
Type: test
!
!
!
!
Response:
Function:
+CWJAP:<ssid>
OK
Type: set
Response:
Function:
OK
ERROR
!
!
Param description:
Instruction:
<ssid>
AT+CWJAP?
!
!
!
!
!
!
Param description:
Instruction:
AT+CWJAP=<ssid>,<pwd>
<ssid>
<pwd>
!
AT+CWLAP List available APs
Type: set
Response:
Function:
Search available APs with specific
conditions.
+CWLAP:<ecn>,<ssid>,<rssi>,<mac>
OK
ERROR
Instruction:
Param description:
!
!
!
!
<ssid>
Type: execute
Response:
Function:
+CWLAP:<ecn>,<ssid>,<rssi>,<mac>
OK
ERROR
!
!
!
!
Instruction:
AT+CWLAP
Param description:
<ecn>
0
1
2
3
4
OPEN
WEP
WPA_PSK
WPA2_PSK
WPA_WPA2_PSK
<ssid>
<rssi>
signal strength
<mac>
Page 11
!
of !24
www.pighixxx.com
!
!
!
!
Response:
Function:
Only for test.
OK
Instruction:
Param description:
null
AT+CWQAP=?
Type: execute
!
!
!
!
AT+CWQAP
!
Response:
Function:
OK
Instruction:
Param description:
null
Response:
Function:
+CWSAP:<ssid>,<pwd>,<chl>,<ecn>
OK
ERROR
!
!
!
!
AT+ CWSAP?
Param description:
Type: set
Response:
Function:
Set configuration of softAP mode.
OK
ERROR
Instruction:
Param description:
!
!
!
!
AT+CWSAP=<ssid>,<pwd>,<chl>,<ecn>
!
!
<ecn>
0
1
2
3
4
OPEN
WEP
WPA_PSK
WPA2_PSK
WPA_WPA2_PSK
<ssid>
<pwd>
<chl>
channel ID
Note: This CMD is only available when softAP mode enable, and need to
follow by AT+RST to make it works.
Page 12
!
of !24
www.pighixxx.com
Response:
Function:
<ip addr>
OK
!
!
!
!
Param description:
Instruction:
<ip addr>
AT+CWLIF
!
AT+CWDHCP Enable/Disable DHCP
Type: set
Response:
Function:
OK
!
!
!
!
!
!
Enable/Disable DHCP.
Param description:
Instruction:
<mode>
1 - Station Mode
2 - AP Mode
3 - AP + Station Mode
AT+CWDHCP=<mode>,<en>
<en>
0 - enable DHCP
1 - disable DHCP
!
AT+CIPSTAMAC Set mac address of station
Type: query
Response:
Function:
+CIPSTAMAC:<mac>
OK
!
!
!
!
Instruction:
Param description:
AT+CIPSTAMAC?
<mac>
Type: set
!
!
!
!
Response:
Function:
Instruction:
AT+CIPSTAMAC=<mac>
Page 13
!
of !24
OK
Param description:
<mac>
www.pighixxx.com
Response:
Function:
+CIPAPMAC:<mac>
OK
!
!
!
!
Instruction:
Param description:
AT+CIPAPMAC?
<mac>
Type: set
!
!
!
!
AT+CIPAPMAC=<mac>
!
Response:
Function:
Instruction:
OK
Param description:
<mac>
Response:
Function:
+CIPSTA:<ip>
OK
!
!
!
!
Instruction:
Param description:
AT+CIPSTA?
<ip>
Type: set
!
!
!
!
Response:
Function:
Instruction:
AT+CIPSTA=<ip>
Page 14
!
of !24
OK
Param description:
<ip>
www.pighixxx.com
Response:
Function:
+CIPAP:<ip>
OK
!
!
!
!
Instruction:
Param description:
AT+CIPAP?
<ip>
Type: set
!
!
!
!
Response:
Function:
Instruction:
AT+CIPAP=<ip>
Page 15
!
of !24
OK
Param description:
<ip>
www.pighixxx.com
TCP/IP Related
Overview
Instruction
Description
AT+CIPSTATUS
AT+CIPSTART
AT+CIPSEND
Send data
AT+CIPCLOSE
AT+CIFSR
AT+CIPMUX
AT+CIPSERVER
Configure as server
AT+CIPMODE
AT+CIPSTO
AT+CIUPDATE
!
!
Page 16
!
of !24
www.pighixxx.com
Instructions
Response:
Function:
STATUS:<stat>
+CIPSTATUS:<id>,<type>,<addr>,
<port>,<tetype>
!
!
!
!
!
!
Instruction:
AT+CIPSTATUS
OK
!
Param description:
<stat>
2 - Got IP
3 - Connected
4 - Disconnected
<id>
<type>
TCP or UDP
<addr>
string, IP address
<port>
port number
<tetype>
Page 17
!
of !24
www.pighixxx.com
AT+CIPSTART
Establish TCP connection or register UDP port, start connection
Type: test
Response:
Function:
If AT+CIPMUX=0
!
!
!
!
+CIPSTART:(<type>),(<IPaddress>),
(<port>)[,(<localport>),(<mode>)]
+CIPSTART:(<type>),(<domainname>),
(<port>)[,(<localport>),(<mode>)]
OK
AT+CIPSTART=?
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:
OK
ERROR
ALREADY CONNECT
!
!
!!
!
Instruction:
SINGLE CONNECTION
(+CIPMUX=0)
AT+CIPSTART=
<type>,<addr>,<port> [,
(<localport>),(<mode>)]
MULTIPLE CONNECTIONS
(+CIPMUX=1)
AT+CIPSTART=
<id><type>,<addr>,<port> [,
(<localport>),(<mode>)]
Param description:
<id>
ID of connection (0-4)
<type>
TCP or UDP
<addr>
string, remote IP
<port>
[<localport>]
[<mode>]
Page 18
!
of !24
www.pighixxx.com
!
!
!
!
Response:
Function:
Only for test.
OK
Instruction:
Param description:
null
AT+CIPSEND=?
Type: set
Response:
Function:
!
!
!
!
!
!
ERROR
!
!
Instruction:
SINGLE CONNECTION
(+CIPMUX=0)
AT+CIPSEND=<length>
MULTIPLE CONNECTIONS
(+CIPMUX=1)
AT+CIPSEND=<id>,<length>
SEND OK
!
Param description:
<id>
ID of transmit connection
<length>
Type: execute
Response:
Function:
!
!
!
!
AT+CIPSEND
Page 19
!
of !24
!
!
www.pighixxx.com
!
!
!
!
Response:
Function:
Only for test.
OK
Instruction:
Param description:
null
AT+CIPCLOSE=?
Type: set
Response:
Function:
!
!
!
!
!
!
ERROR
!
!
Instruction:
MULTIPLE CONNECTIONS
AT+CIPCLOSE=<id>
SEND OK
!
Param description:
<id>
Type: execute
!
!
!!
!
Function:
For single connection mode
Instruction:
AT+CIPCLOSE
Response:
!
OK
!
ERROR
!
UNLINK
Page 20
!
of !24
www.pighixxx.com
!
!
!
!
Function:
Response:
Instruction:
OK
Param description:
AT+CIFSR=?
null
Type: execute
Response:
Function:
+CIFSR:<IP address>
OK
ERROR
!
!
!
!
!
!
Instruction:
Param description:
AT+CIFSR
<IP address>
IP address of ESP8266
!
AT+CIPMUX Enable multiple connections or not
Response:
Type: query
!
!
!
!
!
+CIPMUX:<mode>
!
Instruction:
Function:
OK
Param description:
AT+CIPMUX?
!
!
!
!
Response:
!
OK
!
Instruction:
LINK IS BUILDED
Function:
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
www.pighixxx.com
Response:
Function:
OK
!
!
!
!
AT+CIPSERVER= <mode>[,<port>]
!
!
!
Param description:
Instruction:
<mode>
<port>
Note:
1. Server can only be created when AT+CIPMUX=1
2. Server monitor will automatically be created when Server is created.
3. When a client is connected to the server, it will take up one
connection,be gave an id.
!
AT+CIPMODE Set transfer mode
Response:
Type: query
!
!
!
!
!
+CIPMODE:<mode>
!
Instruction:
Function:
OK
Param description:
AT+CIPMODE?
!
!
!
!
Response:
!
OK
!
Instruction:
LINK IS BUILDED
Function:
AT+CIPMODE=<mode>
Param description:
<mode>
0 - Normal mode
1 - unvarnished transmission mode
!
!
Page 22
!
of !24
www.pighixxx.com
Type: query
!
!
!
!
!
+CIPSTO:<time>
!
Instruction:
Function:
OK
Param description:
AT+CIPSTO?
Response:
!
!
!
!
!
OK
!
!
!
Function:
Set server timeout.
Param description:
Instruction:
<time>
AT+CIPSTO=<time>
!
AT+CIUPDATE update through network
Response:
Type: execute
!
!
!
!
Start upgrade.
!
+CIPUPDATE:<n>
!
Instruction:
Function:
AT+CIPMODE?
OK
Param description:
<mode>
0
1
2
4
Page 23
!
of !24
found server
connect to server
download firmware
flash firmware
www.pighixxx.com
Param description:
SINGLE CONNECTION
<id>
(+CIPMUX=0)
+IPD,<len>:<data>
MULTIPLE CONNECTIONS
(+CIPMUX=1)
+IPD,<id>,<len>:<data>
number ID of connection
<len>
data length
<data>
data received
Note: When the module receives network data, it will send the data
through the serial port using +IPD command
Page 24
!
of !24