Esp 8266 Reference sheet

Share Embed Donate


Short Description

Descripción: An ESP8266 Reference Sheet...

Description

www.pighixxx.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 09 Dec 2014

Version 1.0

Author Pighixxx

Changes Draft

! !

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

Test

AT+=?

Query the Set command or internal parameters and its range values.

Query

AT+?

Returns the current value of the parameter.

Set

AT+= in commands and run.

Execute

AT+

Set the value of user-defined parameters

! ! NOTE: !

Runs commands with no user-defined parameters.

1. Not all AT instruction has four commands.


! 2. [] = default value, not required or may not appear 
 !

3. String values require double quotation marks, for example: 
 AT+CWSAP=“ESP756190”,”21030826”,1,4


! !

4. Baud rate = 115200 


!

5. AT instruction ends with “\r\n”

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

Page 6 ! of !24

Data received from network

ESP8266 Ref v1.0

www.pighixxx.com

Basic AT Instruction Set Overview

!

Instruction

Description

AT

Test AT startup

AT+RST

Restart module

AT+GMR

View version info

AT+GSLP

Enter deep-sleep mode

ATE

AT commands echo on/off

! !

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

OK

!

!

!

Param description:

!



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 ) OK

!

! ! ! !

Get value scope of WiFi mode.

!

Instruction:

Param description:

AT+CWMODE=?



!

1 - Station Mode 2 - AP Mode 3 - AP + Station Mode

Type: query

Response:

Function: Query ESP8266’s current wifi mode.

+CWMODE: OK

Instruction:

Param description:

AT+CWMODE?



! ! ! !

! !

!

1 - Station Mode 2 - AP Mode 3 - AP + Station Mode

Type: set

Response:

Function:

!

OK

Set ESP8266 wifi mode.

!

! ! ! !

Instruction:

AT+CWMODE=

Param description:

!



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: OK

Type: set

Response:

Function:

OK ERROR

Query AP’s info which is connect by ESP8266.

! !

Param description:

!

Instruction:



string, AP’s SSID

AT+CWJAP?

! ! ! !

Set AP’s info which will be connect by ESP8266.

! !

Param description:

!

Instruction:

AT+CWJAP=,



string, AP’s SSID



string, MAX: 64bytes

! AT+CWLAP – List available APs Type: set

Response:

Function: Search available APs with specific conditions.

+CWLAP:,,, OK ERROR

Instruction:

Param description:

!

! ! ! !

!

!

AT+ CWLAP = ,,



string, AP’s SSID

Type: execute

Response:

Function:

+CWLAP:,,, OK ERROR

! ! ! !

Lists all available APs.

!

Instruction:

AT+CWLAP

!

Param description:

!



0 1 2 3 4

-

OPEN WEP WPA_PSK WPA2_PSK WPA_WPA2_PSK



string, AP’s SSID



signal strength



string, MAC address

Page 11 ! of !24

ESP8266 Ref v1.0

www.pighixxx.com

AT+CWQAP - Disconnect from AP Type: test

! ! ! !

Response:

!

Function: Only for test.

OK

Instruction:

Param description:

!

!

null

AT+CWQAP=? Type: execute

! ! ! ! AT+CWQAP !

Response:

!

Function:

Disconnect from AP.

OK

Instruction:

Param description:

!

!

null

AT+CWSAP – Configuration of softAP mode Type: query

Response:

Function:

+CWSAP:,,, OK ERROR

!

! ! ! !

Query configuration of softAP mode. Instruction:

!

AT+ CWSAP?

!

Param description:

The same as below

Type: set

Response:

Function: Set configuration of softAP mode.

OK ERROR

Instruction:

Param description:

! ! ! !

AT+CWSAP=,,,

! !

!



0 1 2 3 4

-

OPEN WEP WPA_PSK WPA2_PSK WPA_WPA2_PSK



string, AP’s SSID



string, MAX: 64bytes



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

ESP8266 Ref v1.0

www.pighixxx.com

AT+CWLIF – ip of stations which are connected to ESP8266 softAP Type: execute

Response:

Function:

OK

!

! ! ! !

Get ip of stations which are connected to ESP8266 softAP.

!

Param description:

!

Instruction:



ip address of stations which are connected to ESP8266 softAP

AT+CWLIF

! AT+CWDHCP – Enable/Disable DHCP Type: set

Response:

Function:

OK

! ! ! !

! !

Enable/Disable DHCP.

Param description:

!

Instruction:



1 - Station Mode 2 - AP Mode 3 - AP + Station Mode

AT+CWDHCP=,



0 - enable DHCP 1 - disable DHCP

! AT+CIPSTAMAC – Set mac address of station Type: query

Response:

Function:

+CIPSTAMAC: OK

!

! ! ! !

Get mac address of ESP8266 station.

!

Instruction:

Param description:

AT+CIPSTAMAC?



!

Type: set

string, mac address of station

! ! ! !

Response:

Function:

!

Set mac address of ESP8266 station.

!

Instruction:

!

AT+CIPSTAMAC=

Page 13 ! of !24

OK Param description:



string, mac address of station

ESP8266 Ref v1.0

www.pighixxx.com

AT+CIPAPMAC – Set mac address of softAP Type: query

Response:

Function:

+CIPAPMAC: OK

!

! ! ! !

Get mac address of ESP8266 softAP.

!

Instruction:

Param description:

AT+CIPAPMAC?



!

Type: set

string, mac address of softAP

! ! ! ! AT+CIPAPMAC= !

Response:

Function:

!

Set mac address of ESP8266 softAP.

!

Instruction:

!

OK Param description:



string, mac address of softAP

AT+CIPSTA – Set ip address of ESP8266 station Type: query

Response:

Function:

+CIPSTA: OK

!

! ! ! !

Get ip address of ESP8266 station.

!

Instruction:

Param description:

AT+CIPSTA?



Type: set

!

! ! ! !

Response:

Function:

!

Set ip address of ESP8266 station.

!

Instruction:

!

AT+CIPSTA=

Page 14 ! of !24

string, ip address of station

OK Param description:



string, ip address of station

ESP8266 Ref v1.0

www.pighixxx.com

AT+CIPAP – Set ip address of ESP8266 softAP Type: query

Response:

Function:

+CIPAP: OK

!

! ! ! !

Get ip address of ESP8266 softAP.

!

Instruction:

Param description:

AT+CIPAP?



Type: set

!

! ! ! !

Response:

Function:

!

Set ip address of ESP8266 softAP.

!

Instruction:

!

AT+CIPAP=

Page 15 ! of !24

string, ip address of softAP

OK Param description:



string, ip address of softAP

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:

STATUS:
 +CIPSTATUS:,,,
 ,

! ! ! !

Get information about connection

! !

Instruction:

AT+CIPSTATUS

OK !

Param description:

!



2 - Got IP 3 - Connected 4 - Disconnected



id of the connection (0~4), for multi-connect



“TCP” or “UDP”



string, IP address



port number



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

!

! ! ! !

+CIPSTART:(),(), ()[,(),()] +CIPSTART:(),(), ()[,(),()]

Get the information of param. Instruction:

OK

AT+CIPSTART=?

!

If AT+CIPMUX=1 
 +CIPSTART:(id),(), (),()[, (),()] +CIPSTART: (id),(),(), ()[,(),()]

OK

! !

Param description:

!

null Type: set

Response:

Function:

OK ERROR ALREADY CONNECT

! ! !! !

Start a connection as client.

!

Instruction: SINGLE CONNECTION

(+CIPMUX=0) AT+CIPSTART= ,, [, (),()]

!

MULTIPLE CONNECTIONS

(+CIPMUX=1) AT+CIPSTART= ,, [, (),()]

!

!

Param description:

!



ID of connection (0-4)



“TCP” or “UDP”



string, remote IP



string, remote port

[]

for UDP only

[]

for UDP only 0 - destination peer entity of UDP will not change. 1 - destination peer entity of UDP can change once

2 - destination peer entity of UDP is allowed to change.

Note: [] can only be used when [] is set.

Page 18 ! of !24

ESP8266 Ref v1.0

www.pighixxx.com

AT+CIPSEND – Send data Type: test

! ! ! !

Response:

!

Function: Only for test.

OK

Instruction:

Param description:

!

!

null

AT+CIPSEND=? Type: set

Response:

Function:

Wrap return “>” after set command. Begins receive of serial data, when data length is met, starts transmission of data.


! ! ! !

!

Set length of the data that will be sent. For normal send.

! ! ERROR ! !

Instruction:

If connection cannot be established or gets disconnected during send, returns

SINGLE CONNECTION

(+CIPMUX=0) AT+CIPSEND=

!

If data is transmitted successfully, returns

MULTIPLE CONNECTIONS

(+CIPMUX=1) AT+CIPSEND=,

SEND OK !

Param description:

!



ID of transmit connection



data length, MAX 2048 bytes

Type: execute

Response:

Function:

Wrap return “>” after execute command. Enters unvarnished transmission, 20ms interval between each packet, maximum 2048 bytes per packet. When single packet containing “+++” is received, it returns to command mode.

! ! ! !

Send data. For unvarnished transmission mode. Instruction:

AT+CIPSEND

Page 19 ! of !24

! !

This command can only be used in unvarnished transmission mode which require to be single connection mode.

ESP8266 Ref v1.0

www.pighixxx.com

AT+CIPCLOSE – Close TCP or UDP connection Type: test

! ! ! !

Response:

!

Function: Only for test.

OK

Instruction:

Param description:

!

!

null

AT+CIPCLOSE=? Type: set

Response:

Function:

Wrap return “>” after set command. Begins receive of serial data, when data length is met, starts transmission of data.


! ! ! !

!

Close TCP or UDP connection.

! ! ERROR ! !

Instruction:

If connection cannot be established or gets disconnected during send, returns

MULTIPLE CONNECTIONS

AT+CIPCLOSE=

If data is transmitted successfully, returns

SEND OK !

Param description:

!



Type: execute

! ! !! !

Function: For single connection mode Instruction:

AT+CIPCLOSE

ID no. of connection to close, when id=5, all connections will be closed.

Response:

! OK ! ERROR !

If no such connection, returns

UNLINK

when there is no connection.

Note: id=5 has no effect in server mode

Page 20 ! of !24

ESP8266 Ref v1.0

www.pighixxx.com

AT+CIFSR – Get local IP address Type: test

! ! ! !

Function:

Response:

Only for test.

!

Instruction:

!

OK Param description:

!

AT+CIFSR=?

null

Type: execute

Response:

Function:

+CIFSR: OK ERROR

! ! ! !

Get local IP address.

! !

Instruction:

Param description:

!

AT+CIFSR



IP address of ESP8266

Note: for softAP or station

! AT+CIPMUX – Enable multiple connections or not Response:

Type: query

! ! ! !

Get param config.

! +CIPMUX: !

Instruction:

!

Function:

OK

Param description:

!

AT+CIPMUX?

The same as below Type: set

! ! ! !

Response:

Set connection mode.

! OK !

Instruction:

LINK IS BUILDED

Function:

AT+CIPMUX=

If already connected, returns

!

Param description:

!



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+CIPSERVER – Configure as TCP server Type: set

Response:

Function:

OK

! ! ! ! AT+CIPSERVER= [,] !

! !

Set TCP server.

Param description:

!

Instruction:



0 - Delete server (need to follow by restart) 1 - Create server



port number, default is 333

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

! ! ! !

Query transfer mode.

! +CIPMODE: !

Instruction:

!

Function:

OK

Param description:

!

AT+CIPMODE?

The same as below Type: set

! ! ! !

Response:

Set transfer mode.

! OK !

Instruction:

LINK IS BUILDED

Function:

AT+CIPMODE=

If already connected, returns

!

Param description:

!



0 - Normal mode 1 - unvarnished transmission mode

! !

Page 22 ! of !24

ESP8266 Ref v1.0

www.pighixxx.com

AT+CIPSTO – Set server timeout Response:

Type: query

! ! ! !

Query server timeout.

! +CIPSTO: !

Instruction:

!

Function:

OK

Param description:

!

AT+CIPSTO?

The same as below Type: set

Response:

! ! ! !

! OK ! ! !

Function: Set server timeout.

Param description:

Instruction:



AT+CIPSTO=

server timeout, range 0-7200 seconds

! AT+CIUPDATE – update through network Response:

Type: execute

! ! ! !

Start upgrade.

! +CIPUPDATE: !

Instruction:

!

Function:

AT+CIPMODE?

OK

Param description:

!

0 1 2 4

Page 23 ! of !24

-

found server connect to server download firmware flash firmware

ESP8266 Ref v1.0

www.pighixxx.com

+IPD – Receive network data Instruction:

Param description:

SINGLE CONNECTION



!

(+CIPMUX=0) +IPD,:

!

MULTIPLE CONNECTIONS

(+CIPMUX=1) +IPD,,:

!

number ID of connection



data length



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

ESP8266 Ref v1.0

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF