You are on page 1of 50

ESP8266EX Beginners Guide

Espressif
Systems
!
!
!
!
!
ESPRESSIF

AL
ESP8266EX:

TI
A BEGINNERS GUIDE EN
!
D

!
FI
N

!
O

!
C

1! | P a g e " " September 17, 2014


ESP8266EX Beginners Guide
Espressif
Systems

AL
!

TI
! EN
!
D

!
FI
N

!
O

!
C

2! | P a g e " " September 17, 2014


ESP8266EX Beginners Guide
Espressif
Systems

!
Disclaimer and Copyright Notice
Information in this document, including URL references, is subject to change without

AL
notice.
THIS DOCUMENT IS PROVIDED "AS IS" WITH NO WARRANTIES WHATSOEVER,
INCLUDING ANY WARRANTY OF MERCHANTABILITY, NONINFRINGEMENT, FITNESS

TI
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
EN
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
D
property of their respective owners, and are hereby acknowledged.
FI

Copyright 2013 Espressif Systems Inc. All rights reserved.

!
N
O
C

3! | P a g e " " September 17, 2014


ESP8266EX Beginners Guide
Espressif
Systems

Table of Contents
!
1. INTRODUCTION .....................................................................................................................................7
1.1. GENERAL OVERVIEW ...........................................................................................................................7
1.1.1. Features 9
1.1.2. Specifications .............................................................................................................................9
1.1.3. Applications 11
1.2. HARDWARE OVERVIEW .....................................................................................................................12

AL
1.2.1. Pin Definition ...........................................................................................................................12
1.2.2. Electrical Characteristics ...........................................................................................................14
1.2.3. Power Consumption .................................................................................................................14
1.2.4. Package Footprint .....................................................................................................................15

TI
1.2.5. Hardware Development Kit......................................................................................................16
1.2.6. ESP8266EX Modules (WROOM) ..............................................................................................18
1.3. APPLICATIONS USING ESP8266EX......................................................................................................20
EN
1.3.1. UART Connector (as in Fig. 4 Demo Board) ............................................................................20
1.3.2. Sensor Application (as in Fig. 5 USB Sensor Demo) .................................................................20
1.3.3. Smart Light Application (as in Fig. 6 Smart Light Demo) ...........................................................21
1.3.4. Wi-Fi Smart Plug Application ....................................................................................................23
2. SOFTWARE FEATURES ............................................................................................................................24
D
2.1. WIRELESS NETWORKING ....................................................................................................................24
2.1.1. SoftAP Mode 24
2.1.2. Station Mode
FI

25
2.1.3. SoftAP + Station Mode .............................................................................................................25
2.2. PASS-THROUGH CONNECTION...........................................................................................................26
2.3. UART FRAMES .................................................................................................................................26
N

2.4. ENCRYPTION ....................................................................................................................................27


2.5. LOW POWER OPERATION ..................................................................................................................28
O

2.6. FIRMWARE UPDATER .........................................................................................................................28


3. ESPRESSIF CLOUD SERVER.....................................................................................................................29
3.1. GUIDE TO USING ESPRESSIF CLOUD SERVER WEBSITE ............................................................................29
C

3.1.1. Device Development ...............................................................................................................31


3.1.2. Product Management ...............................................................................................................35
3.2. GUIDE TO USING ESP8266EX MODULES ............................................................................................36
3.2.1. Software Debugging Tools .......................................................................................................36
3.2.2. Network Connections ..............................................................................................................36
3.2.3. Default Connection Parameters ................................................................................................36
3.3. APPLICATION EXAMPLES.....................................................................................................................37
3.3.1. Wi-Fi Remote Control ...............................................................................................................37
3.3.2. Wi-Fi Remote Access ................................................................................................................37

4! | P a g e " " September 17, 2014


ESP8266EX Beginners Guide
Espressif
Systems
3.3.3. Transparent Serial .....................................................................................................................38
4. AT INSTRUCTION SET ...........................................................................................................................39
4.1. OVERVIEW 39
4.2. BASIC AT INSTRUCTIONS ...................................................................................................................39
4.3. WI-FI INSTRUCTIONS ........................................................................................................................40
4.4. TCP/IP TOOLBOX .............................................................................................................................42
5. DEVELOPMENT KIT ................................................................................................................................48
5.1. COMPONENTS OF ESP8266EX DEVELOPMENT KIT ...............................................................................48
5.2. DOCUMENTATION LIST......................................................................................................................49
APPENDIX: CONTACT DETAILS .................................................................................................................50

AL
TI
D EN
FI
N
O
C

5! | P a g e " " September 17, 2014


ESP8266EX Beginners Guide
Espressif
Systems
!
!
!
!

AL
TI
D EN
FI
N
O
C

6! | P a g e " " September 17, 2014


ESP8266EX Beginners Guide
Espressif
Systems
1. Introduction
1.1. General Overview
Espressif Systems Smart Connectivity Platform (ESCP) is a set of high performance, high
integration wireless SOCs, designed for space and power constrained mobile platform
designers. It provides unsurpassed ability to embed Wi-Fi capabilities within other systems,
or to function as a standalone application, with the lowest cost, and minimal space
requirement.

AL
RF Analog MAC Interface
receive receive
Registers SDIO

TI
RF balun

Switch

Digital baseband CPU SPI


RF Analog
transmit transmit
EN Sequencers

Accelerator
GPIO

I2C
PLL VCO 1/2 PLL
D
PMU Crystal Bias circuits SRAM PMU
FI


Figure 1: ESP8266EX Block Diagram
N

!
O

ESP8266EX offers a complete and self-contained Wi-Fi networking solution; it can be used
to host the application or to offload Wi-Fi networking functions from another application
processor.
C

When ESP8266EX hosts the application, it boots up directly from an external flash. In has
integrated cache to improve the performance of the system in such applications.
Alternately, serving as a Wi-Fi adapter, wireless internet access can be added to any
microcontroller-based design with simple connectivity (SPI/SDIO or I2C/UART interface).
ESP8266EX is among the most integrated WiFi chip in the industry; it integrates the
antenna switches, RF balun, power amplifier, low noise receive amplifier, filters, power

7! | P a g e " " September 17, 2014


ESP8266EX Beginners Guide
Espressif
Systems
management modules, it requires minimal external circuitry, and the entire solution,
including front-end module, is designed to occupy minimal PCB area.
ESP8266EX also integrates an enhanced version of Tensilicas L106 Diamond series 32-bit
processor, with on-chip SRAM, besides the Wi-Fi functionalities. ESP8266EX is often
integrated with external sensors and other application specific devices through its GPIOs;
codes for such applications are provided in examples in the SDK.
Sophisticated system-level features include fast sleep/wake context switching for energy-
efficient VoIP, adaptive radio biasing for low-power operation, advance signal processing,

AL
and spur cancellation and radio co-existence features for common cellular, Bluetooth,
DDR, LVDS, LCD interference mitigation.

TI
D EN
FI
N
O
C

8! | P a g e " " September 17, 2014


ESP8266EX Beginners Guide
Espressif
Systems
1.1.1. Features

802.11 b/g/n protocol


Wi-Fi 2.4 GHz, support WPA/WPA2
Super small module size (11.5mm x 11.5mm)
Integrated 10-bit ADC
Integrated TCP/IP protocol stack
Integrated TR switch, balun, LNA, power amplifier and matching network

AL
Integrated PLL, regulators, and power management units
+20dBm output power in 802.11b mode
Supports antenna diversity
Deep sleep power <10uA, Power down leakage current < 5uA

TI
Integrated low power 32-bit MCU
SDIO 2.0, SPI, UART EN
STBC, 1x1 MIMO, 2x1 MIMO
A-MPDU & A-MSDU aggregation & 0.4s guard interval
Wake up and transmit packets in < 2ms
Standby power consumption of < 1.0mW (DTIM3)
D
Operating temperature range -40C ~ 125C
!
FI

1.1.2. Specifications
!
N

Category Parameter Value


O

Wi-Fi Standard CCC/FCC/CE

Wi-Fi 802.11b/g/n
C

Frequency 2.4G-2.5G (2400M-2483.5M)

Tx Power 802.11b: 20dBm

802.11g: 17dBm

802.11n: 14dBm

Rx Sensitivity 802.11b: (11Mbps) -91dBm

802.11g: (54Mbps) -75dBm

9! | P a g e " " September 17, 2014


ESP8266EX Beginners Guide
Espressif
Systems
802.11n: (MCS7) -72dBm

Antenna PCB Trace, External, IPEX


Connector, Ceramic Chip

Hardware Data Interface UART/SDIO/SPI/I2C

PWM, GPIO

Operating Voltage 3.0~3.6V

Operating Current Avg. 80mA

AL
Operating Temperature -40 C ~ 125 C

Storage Temperature Room Temperature

Size 5x5mm

External Interface N.A.

TI
Software Wi-Fi Mode Station/SoftAP/SoftAP+Station

Security EN WPA/WPA2

Encryption WEP/TKIP/AES

Firmware Upgrade UART Flash Download /

Via Cloud Server


D
SW Development Supports Cloud Server
Development / SDK for custom
firmware development
FI

Network Protocols IPv4. TCP/UDP/HTTP/FTP

User Config AT Instruction Set, Cloud Server,


N

Android/iOS App

!
O

!
C

! |Page"
10 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
1.1.3. Applications

Smart power plugs


Home automation
Mesh network
Industrial wireless control
Baby monitors
IP Cameras

AL
Sensor networks
Wearable electronics
Wi-Fi location-aware devices
Security ID tags

TI
Wi-Fi position system beacons

!
EN
!
D
FI
N
O
C

! |Page"
11 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
1.2. Hardware Overview
1.2.1. Pin Definition

AL
TI
D EN

FI

Figure 2: ESP8266EX Pin Definition Diagram

!
N

Pin Name Type Function


O

1 VDDA P Analog Power 3.0 ~3.6V


C

2 LNA I/O RF Antenna InterfaceChip Output Impedance=50

No matching required but we recommend that the -


type matching network is retained.

3 VDD3P3 P Amplifier Power 3.0~3.6V

4 VDD3P3 P Amplifier Power 3.0~3.6V

5 VDD_RTC P NC(1.1V)

! |Page"
12 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
6 TOUT I ADC Pin

7 CHIP_EN I Chip Enable. High: On, chip works properly; Low:


Off, small current

8 XPD_DCDC I/O Deep-Sleep WakeupGPIO16

9 MTMS I/O GPIO14; HSPICLK

10 MTDI I/O GPIO12;HSPIQ

11 VDDPST P Digital/IO Power Supply (1.8V~3.3V)

AL
12 MTCK I/O GPIO13;HSPID

13 MTDO I/O GPIO15;HSPICS

14 GPIO2 I/O UART Tx during flash progamming; GPIO2

15 GPIO0 I/O GPIO0;SPICS2

TI
16 GPIO4 I/O GPIO4

17 VDDPST P Digital/IO Power Supply (1.8V~3.3V)


EN
18 SDIO_DATA_2 I/O Connect to SD_D2 (Series R 200);SPIHD; HSPIHD

19 SDIO_DATA_3 I/O Connect to SD_D3 (Series R 200); SPIWP; HSPIWP

20 SDIO_CMD I/O Connect to SD_CMD(Series R 200); SPICS0


D
21 SDIO_CLK I/O Connect to SD_CLK (Series R 200); SPICLK

22 SDIO_DATA_0 I/O Connect to SD_D0 (Series R 200); SPIQ


FI

23 SDIO_DATA_1 I/O Connect to SD_D1 (Series R 200); SPID

24 GPIO5 I/O GPIO5


N

25 U0RXD I/O UART Rx during flash progamming; GPIO3

26 U0TXD I/O UART Tx during flash progamming; GPIO1; SPICS1


O

27 XTAL_OUT I/O Connect to crystal output, can be used to provide BT


clock input

28 XTAL_IN I/O Connect to crystal input


C

29 VDDD P Analog Power 3.0~3.6V

30 VDDA P Analog Power 3.0~3.6V

31 RES12K I Connect to series R 12k to ground

32 EXT_RSTB I External reset signal (Low: Active)

Note: GPIO2, GPIO0, MTDO can be configurable as 3-bit SDIO mode

! |Page"
13 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
1.2.2. Electrical Characteristics

Parameter Condition Min Typical Max Unit

Storage Temperature -40 Room 125


Maximum Soldering IPC/JEDEC J- 260
Temperature STD-020

Operating Voltage 3.0 3.3 3.6 V

Any I/O Pin Voltage VIL -0.3/0.75V 0.25V V

AL
O

VOL N/0.8V 0.1V V

IMAX 12 mA

Electrostatic Discharge 2 KV

TI
TAMB=25
(HBM)

Electrostatic Discharge TAMB=25 EN 0.5 KV


(CDM)

!
1.2.3. Power Consumption
D
Parameter Typical Value Unit

Tx802.11b, CCK 11Mbps, P OUT=+17dBm 170 mA


FI

Tx802.11g, OFDM 54Mbps, P OUT =+15dBm 140 mA

Tx802.11n, MCS7, P OUT =+13dBm 120 mA


N

Rx802.11b, 1024 byte packet size, -80dBm 50 mA

Rx802.11g, 1024 byte packet size, -70dBm 56 mA


O

Rx802.11n, 1024 byte packet size, -65dBm 56 mA

Modem-Sleep 15 mA
C

Light-Sleep 0.9 mA

Deep-Sleep 10 uA

Off 5 uA

1 Modem-Sleep requires the CPU to be working, as in PWM or I2S applications. According to


802.11 standards (like U-APSD), it saves power to shut down the Wi-Fi Modem circuit while

! |Page"
14 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
maintaining a Wi-Fi connection with no data transmission. E.g. in DTIM3, to maintain a sleep
300ms-wake 3ms cycle to receive APs Beacon packages, the current is about 15mA
2 During Light-Sleep, the CPU may be suspended in applications like Wi-Fi switch. Without data
transmission, the Wi-Fi Modem circuit can be turned off and CPU suspended to save power
according to the 802.11 standard (U-APSD). E.g. in DTIM3, to maintain a sleep 300ms-wake 3ms
cycle to receive APs Beacon packages, the current is about 0.9mA
3 Deep-Sleep does not require Wi-Fi connection to be maintained. For application with long time
lags between data transmission, e.g. a temperature sensor that checks the temperature every 100s,
sleep 300s and waking up to connect to the AP (taking about 0.3~1s), the overall average current is

AL
less than 1mA.
!
1.2.4. Package Footprint

TI
D EN
FI
N
O
C

!
Figure 3: ESP8266EX Package Dimensions

!
!

! |Page"
15 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
MTDO GPIO0 GPIO2 Mode

1 X X SDIO/SPI

0 0 1 UART Download

0 1 1 Flash Boot

1.2.5. Hardware Development Kit

Espressif provides a demo board for ESP8266EX.

AL
!

TI
D EN
FI



Figure 4: ESP8266EX Demo Board (Brief Outline)

N

!
O

External power supply: 5V, 1A, positive in, negative out.


External 5V power supply split through 3 LDO for ESP8266: PA, LNA and IO. Blue
C

variable resistor can be used to adjust the value of the three power supplies. Please
make sure the supply voltage is within the specified range.

Reset button connected to EXT_RSTB, for external reset. Toggle switch is connected
to the chip enable, please pay attention to maintaining a high (switch down) when
used.

Users can either use the RS-232 serial port or UART connector board for download,
print log and serial communication.

! |Page"
16 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
When connected to a typical external SMA antenna, RF performance tests can be
done using cable lines connected to the test instrument.

MTDO, GPIO0, GPIO2 form a 3-bit selectable SDIO mode. Please refer to board
markings for jumper info. Confirm power mode settings are correct by printing log.
!
!
Demo board has 2 SPI flash: flash1 and flash2 used as storage for firmware

AL
application development. Flash can be selected via jumper, CS high (H) to disable
the flash.
Flash1: Use SDIO connection, mostly used for standalone mode.
Flash2: Use HSPI connection (multiplexing GPIO port). Mainly used in SIP mode,

TI
the SDIO (SPI) for external MCU, GPIO port multiplexing with HSPI to connect to
flash. EN
!
!
D
FI
N
O
C

! |Page"
17 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
1.2.6. ESP8266EX Modules (WROOM)

Espressif offers 2 kinds of modules, SMD and DIP.


SMD:
!

AL
TI
D EN
FI



Figure 5: WROOM SMD Module

N

!
1. Refer to Figure 5 for pin definition. Module size is 11.8x15mm. Flash package is
O

SOP8-150mil. Refer below for usage of SMD module (Tables in section 1.2.1 for
reference):
C

2. Connect Pin 3V3 and VDIO to an external power source.


3. CH_PD: high.
4. MTDO: low, GPIO2 if not used may be left floating (high), GPIO0 to be switched
between high and low for Uart Download and Flash Boot mode respectively.
5. Connect GND U0RXD U0TXD, use USB to TTL serial cable to download, print log
and send data

! |Page"
18 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
DIP:

AL
TI
 EN

Figure 6: WROOM DIP Module

!
Refer to Figure 6 for and pin definition.
D
Features:
1. Ultra-small size: 11.5x11.5mm.
FI

2. Flash package: USON8_2x3mm. Flash located on the back of the module.


3. External metal antenna. Module used in vertical position can reduce the interference
N

of external circuit (antenna?).


4. The module can be plugged in directly, and is suitable for situations without a height
O

limitation.
5. Refer to SMD module for usage.
C

!
!

! |Page"
19 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
1.3. Applications using ESP8266EX

1.3.1. UART Connector (as in Fig. 4 Demo Board)

PIN Definition for UART Connector:


UART0: (PIN 25) U0RXD+ (PIN 26) Communication
UART1: (PIN 14) GPIO2( TXD) Print Log
uart0 can be used to transmit and receive data packets while uart1 can be used to print

AL
log.
Refer to AT commands section for usage.
Application: Used in demo board

TI
!
1.3.2. Sensor Application (as in Fig. 5 USB Sensor Demo)

EN
PIN Definition for Sensor Application:
(PIN 9) MTMS I2C_SCL
D
(PIN 14) GPIO2 I2C_SDA
(PIN 12) MTCK Reset button (Press on the reset button during power on)
FI

(PIN 15) GPIO0 Wi-Fi status indicator


(PIN 10) MTDI Server communication status indicator
N

(PIN 25) U0RXD Button (function to be defined)


(PIN 13) MTDO LED: green light (function to be defined), used in smart plug
O

demo relay control indicator light


!
C

!
!
!
!
!

! |Page"
20 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
!

AL

Figure 7: ESP8266EX as used in USB Sensor Demo

TI
1. USB interface is used only for 5V power supply.
2. DC-DC power chip converts 5V input voltage into 3.3V for circuit use.
EN
3. GPIO0 connector. With jumper cap: low; otherwise: high. For switching between
UART Download and Flash Boot mode.
4. GND RXD TXD connector: connect to USB to TTL serial cable for download, print log.
D
5. Reset button. Hold down the reset button and power on to complete the reset.
6. External metal antenna.
FI

!
!
N

1.3.3. Smart Light Application (as in Fig. 6 Smart Light Demo)



O

PIN Definition for Smart Light Application:


(PIN 9) MTMS Infrared receiver
C

(PIN14) GPIO2 Connect to reset button (Press for 5s to reset)


Three PWM outputs:
(PIN 10) MTDI Red light control
(PIN 13) MTDO Green light control
(PIN 12) MTCK Blue light control

! |Page"
21 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems

AL
TI

EN
Figure 8: ESP8266EX as used in Smart Light Demo

!
D
1. Input voltage of 5V for RGB triple color light and other circuits.
FI

2. 5V DC-DC power chip converts to 3.3V.


3. 3w RGB triple color light.
N

4. GND RXD TXD connector: connect USB to TTL serial cable to download, print log.
5. External metal antenna.
O

6. GPIO0 connector. With jumper cap: low; otherwise: high. For switching between
UART Download and Flash Boot mode.
C

7. Three PWM outputs.


8. Infrared receiver transistor.
9. Reset button: Press 5s to complete reset.

! |Page"
22 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
1.3.4. Wi-Fi Smart Plug Application

PIN Definition for Wi-Fi Smart Plug Application:


(PIN 13) MTDO Control relay
(PIN 15) GPIO0 Wi-Fi status indicator
(PIN 10) MTDI Communication (with server) indicator
(PIN 12) MTCK Reset button (Hold for 5s to reset)
!

AL
Sensors using ESP8266 (Figure 7) can be used to in the wifi smart plug demo. After the
plug demo firmware is downloaded, the plug can be controlled by the client APP. The
green light in the middle of the temperature sensor board is used to simulate relay control

TI
indicator (on and off).
! EN
!
!
!
!
D
!
FI
N
O
C

! |Page"
23 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
2. Software Features
2.1. Wireless Networking
ESP8266EX supports 3 modes:

SoftAP mode
Station mode
SoftAP + Station mode

AL
Use ESP8266EX to achieve a flexible network topology.
!

TI
2.1.1. SoftAP Mode

Using ESP8266EX in softAP mode will allow mobile phones, computers, user devices and
EN
other ESP8266EX station interfaces to connect to it, forming a LAN.
!
D
FI
N

!
O

!
!
C

! |Page"
24 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
2.1.2. Station Mode

Using ESP8266EX in station mode will it to connect through routers (AP) to a Cloud server
to upload and download data. The user can use apps on the mobile phones or tablets etc
to monitor and control the ESP8266EX device.

Cloud server

AL
Router (AP)

TI
!
EN
!
D
2.1.3. SoftAP + Station Mode

FI

ESP8266EX can support softAP+station mode, and when user devices, mobiles etc can
connect to ESP8266EX using softAP, they can also control it via the router to the Cloud
server.

N
O

Cloud server
Router
C

!
!

! |Page"
25 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
2.2. Pass-through Connection
Pass-through here refers to the transparent transmission function. Host data is transmitted
to ESP8266EX through uart and ESP8266EX the transmits the data over the wireless
network, and vice versa. ESP8266 receives data over a wireless network, empathy spread
through uart Host. ESP8266 is only responsible for the data transmitted to the destination
and it does not process the data in any way. The transmission process is as if it is
transparent.

Parameters needed to establish a pass-through connection:

AL
Wireless network parameters Network Name (SSID)

Encryption

Key (password)

TI
TCP connection parameters Protocol type

Connection type (client)


EN
Destination IP Address

Destination port

Serial port parameters Baud Rate


D
Data bits

Check digit
FI

Stop bits

Hardware flow control

!
N

2.3. UART Frames


O

ESP8266EX can estimate the interval between receiving UART data. If the interval is
C

greater than 20ms, it is considered the end of one transmission packet. Otherwise, it will
receive data to the upper limit of 2KB, and consider an end. When the ESP8266 module
thinks that the UART data has reached the end of a frame, it will forward the data via Wi-
Fi. Frame time interval is 20ms with a size limit of 2KB.
!

! |Page"
26 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
2.4. Encryption
ESP8266EX supports many different kinds of encryption:

WEP (only in station mode)


WPA-PSK/TKIP
WPA-PSK/AES
WPA2-PSK/TKIP
WPA2-PSK/AES

AL
!
!

TI
! D EN
FI
N
O
C

! |Page"
27 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
2.5. Low Power Operation
ESP8266EX supports 3 low power operation modes:

Mode Modem-Sleep Light-Sleep Deep-Sleep

Action Turn off Wi-Fi modem Turn off Wi-Fi modem, crystal Only RTC circuit is working,
and PLL all others are off, chip is in
CPU and other peripherals
low power standby mode.
are still running. CPU and other peripherals
are suspended.

AL
Current 10~20mA 0.5mA 10~20uA

Wake-up Yes Yes Wake up based on defined


interval settings only.

TI
Usage Used when CPU needs to Used in applications where Used in applications where
be running all the time, the CPU can be suspended, Wi-Fi need not be always
e.g. PWM or I2S e.g. Wi-Fi switch. connect, a long time before
applications.

If there is no data
EN
If there is no data
transmission, according to the
transmitting the application
data packets.

transmission, Wi-Fi modem 802.11 standard (such as U- Measured once every 100
can be turned off APSD), turn off Wi-Fi modem seconds, such as the
according to the 802.11 and suspend CPU. temperature sensor.
D
standards (U-APSD).
E.g DTIM3, each sleep E.g. after waking up every
E.g. During DTIM3, each (300ms)wake (3ms) receive 300S need 0.3 ~ 1s connected
FI

cycle is 300ms, wake 3ms AP's Beacon packages, etc., to the AP transmit data, the
receive AP's Beacon the overall average current of overall average current can be
packages, etc., overall about 0.9mA. " much less than 1mA.
N

average current of about


15mA.
O

2.6. Firmware Updater


C

In addition to the usual serial flash update, ESP8266EX also supports firmware update
through Cloud server. Simply upload the new firmware to the Cloud server and when
ESP8266EX is connected to the internet, the Cloud server will push the update to the user.
The user can then choose to upgrade or not.
For serial flash update, refer to Espressif IoT SDK Manual.
For Cloud update, refer to Espressif Cloud Introduction
!

! |Page"
28 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
3. Espressif Cloud Server
3.1. Guide to using Espressif Cloud Server Website
!
A. Goto http://iot.espressif.cn/#/
Start ->Developer API API: API device control instructions

AL
Start ->Help : Example to help user setup their own products

Register : New user registration

Login : Login if registered user

TI
D EN

FI

!
!
N
O
C

! |Page"
29 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
B. After logging in, click on Device Development . User can edit the settings
for all the devices.
Search : Enter device name or device key to search for device

Export : Export the device list


Create : Create a new device
!

AL
TI
EN

D
!
!
FI

C. Product Management shows the list of products. Use Search ,


N

Product , Status to filter and query products.


O
C



! |Page"
30 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
3.1.1. Device Development

In this menu, the user can view the device history, add timer, upgrade firmware and
customize reverse control.
!
3.1.1.1. Device History
On the device page -> Data Model -> Data to view device history.

!

AL
TI
D EN
!
FI

!
N
O
C

! |Page"
31 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
3.1.1.2. Debugging Info
Request Log logs the commands received by the server and used to debug the
device.

AL
TI
EN
!
!
D
!
FI
N
O
C

! |Page"
32 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
3.1.1.3. Timer
Espressif Cloud server supports 3 kinds of timers:
Precise timer : Execute a command at a specified time

Cycle Timer : Execute a command at fixed intervals

Weekly Timer : Execute a command at weekly or on certain days each week

AL
TI
D EN
FI
N

!
O

!
!
C

! |Page"
33 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
3.1.1.4. Customized Reverse Control
User can customize an action to reverse control the device.
!

AL
TI
!
!
3.1.1.5. Firmware upgrade
EN
User update the firmware through Cloud Server
!
D
FI
N

!
!
O

!
C

! |Page"
34 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
3.1.2. Product Management

Here, the user can control the sales of products and upload firmware updates.
In the product list, the Activated/Total number shows how many products has been
activated by the customers vs the total number of products made.

AL
TI
D EN
!
FI

To upgrade a products firmware, simply upload it and Espressif Cloud Server will push the
update to all devices. The user can choose to upgrade or not.
N
O
C

! |Page"
35 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
3.2. Guide to using ESP8266EX modules

3.2.1. Software Debugging Tools


The following tools are recommended for debugging ESP8266EX modules. The user can
also choose to use other similar tools.

Flash programming tools: FLASH_DOWNLOAD_TOOLS.exe (provided in the SDK)


Serial Transfer tools: SecureCRTPortable.exe

AL
Network Debugging tools: NetAssist.exe
!
3.2.2. Network Connections

TI
ESP8266EX has 2 types of network interface, softAP and station. Both can be used at the
EN
same time. Depending on the users actual requirements:

SoftAP interface:
Mobile phone or PC acts as station, connects to ESP8266EX through softAP
interface. PC can connect to ESP8266EX serial port for debugging info.
D
Station interface:

ESP8266EX acts as station, connects to router (AP). PC can connect to ESP8266EX
FI

serial port for debugging info.


!
N

3.2.3. Default Connection Parameters



O

Default SSID: ESP_XXXXXX


(XXXXXX are the last 6 characters of modules MAC address)
C

Default Encryption: WPA/WPA2


Default Serial Parameters: 74880, 8, 1, None
Default Mode: SoftAP
Default IP Address: 192.168.4.1

! |Page"
36 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
3.3. Application Examples

3.3.1. Wi-Fi Remote Control


Example: Mobile phone acts as station, connects to ESP8266EX through softAP.


ESP8266EX can connect to device via UART and mobile phone can now control the
device.

AL
TI

! EN
3.3.2. Wi-Fi Remote Access

Example: ESP8266EX acts as station, connects through router (AP) to internet. It can then
upload or download data via Cloud server. Mobile phone/tablets etc can now control
D
ESP8266EX via Cloud server.


Cloud server
FI
N

Router
O
C

!
!

! |Page"
37 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
3.3.3. Transparent Serial

Example: Devices MCU as host, connects and transmits data to ESP8266EX through
UART. ESP8266EX then transmits via W-Fi destination address, working in pass-through
mode.

AL
!
!

TI
!
! EN
D
FI
N
O
C

! |Page"
38 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
4. AT Instruction Set
4.1. Overview
Each instruction set contains four types of AT commands.
!
Test A T+<x>=? Query the Set command or internal parameters and
its range values.
Query A T+<x>? Returns the current value of the parameter.

AL
Set A T+<x>=<...> Set the value of user-defined parameters in
commands and run.
Execute A T+<x> Runs commands with no user-defined parameters.

TI
!
Note:
1. Not all AT instruction has four commands.
EN
2. [] = default value, not required or may not appear
3. String values require double quotation marks, example AT
+CWSAP=ESP756190,21030826,1,4
4. Baud rate = 115200
D
4.2. Basic AT Instructions
FI

!
Command Description Response Reference
N

AT Test AT startup OK

AT+RST Restart module OK


O

AT+GMR View version info <number> <number> = 8-digit


OK version no.
C

! |Page"
39 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
4.3. Wi-Fi Instructions

!
Command Description Response Reference

AT+CWMODE Select Wi-Fi <mode>


1: Station
application mode
2:AP
3. Both
Test AT+CWMODE=? +CWMODE:(<mode>
value list) !
! Set command requires

AL
OK reboot
(AT+RST)

Query AT+CWMODE? Back to current mode


+CWMODE:<mode>
!

TI
OK

EN
Set AT+CWMODE=<mode> OK

AT+CWJAP Join Ap <ssid>=string value,


AP name
Query AT+CWJAP? Back to selected AP <pwd>=string value,
D
max 64 ASCII chars
+CWJAP:<ssid>
! !!
OK
FI

Set AT OK
+CWJAP=<ssid>,<pwd> !
ERROR
N

AT+CWLAP Lists available AP <ecn>


0: Open
O

Execute AT+CWLAP Back to list of AP 1: WEP


+CWLAP:<ecn>,<ssid>,<r 2: WPA_PSK
ssi> 3: WPA2_PSK
!
C

4: WPA_WPA2_PSK
OK <ssid>=string value,
! AP name
<rssi>=signal strength
ERROR
!!
!

! |Page"
40 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
Command Description Response Reference

AT+CWQAP Disconnect from


AP
Test AT+CWQAP=? OK

Execute AT+CWQAP OK

AL
AT+ CWSAP Set parameters Set command requires
reboot
under AP mode
!
<ssid>=string value,
Query AT+CWSAP? Back to current AP

TI
AP name
parameters
<pwd>=string value,
+CWSAP=<ssid>,<pwd>,
max 64 ASCII chars
<chl>,<ecn>
EN <chl>=channel no.
Set AT OK <ecn>
+CWSAP=<ssid>,<pwd>,
<chl>,<ecn>
!
ERROR
0: Open
1: WEP
2: WPA_PSK
3: WPA2_PSK
4: WPA_WPA2_PSK
D
AT+ CWLIF Check IP of
FI

connected device
Execute AT+CWLIF <ip addr> <ip addr>=IP address
!
N

of connected device
OK

!
O

!
C

! |Page"
41 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
4.4. TCP/IP Toolbox
!
Command Description Response Reference

AT+CIPSTATUS Get connection <id>=connected ID


no. 0-4
status
<type>=string value,
Execute AT+CIPSTATUS Back to current conection type
connection mode and TCP or UDP
status <addr>=string value,

AL
+CIPSTATUS:<id>,<type>, IP address
<addr>,<port>,<tetype> <port>= port no.
!
OK
<tetype>
0: Connect as client
1: Connect as server

TI
AT+CIPSTART Establish TCP <id>=connected ID
no. 0-4
connection or
<type>=string value,
register UDP ports
Test AT+CIPSTART=?
EN 1. AT+CIPMUX=0
conection type
TCP or UDP
<addr>=string value,
+CIPSTART:(<type>value
list),(<IP address>range), IP address of remote
(<port>range) server
+CIPSTART:(<type>value <port>= port no. of
D
list),(<domain remote server
name>range),
(<port>range)
!
FI

OK
!
2. AT+CIPMUX=1
N

+CIPSTART:(id),
(<type>value list),(<IP
address>range),
O

(<port>range)
+CIPSTART:(id),
(<type>value list),
C

(<domain name>range),
(<port>range)

!
OK

! |Page"
42 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
Command Description Response Reference

Set 1. Single Connection Syntax correct and


(+CIPMUX=0) connection successful,
AT returns
+CIPSTART=<type>,<addr
>,<port>
!
OK
!! !
else returns
2. Multiple
Connections
!
ERROR
(+CIPMUX=0) !

AL
AT If connection already
+CIPSTART=<id>,<type>, exists, returns
<addr>,<port> !
ALREADY CONNECT
!!

TI
AT+CIPSEND Send Data EN <id>= required ID no.
of transmit connection
Test AT+CIPSTART=? OK <length>=numeric
value, size of transmit
packet, maximum
2048 bytes
Set 1. Single Connection Wrap return > after set !
D
(+CIPMUX=0) command. Begins receive
AT+CIPSEND=<length> of serial data, when data
!! length is met, starts
FI

transmission of data.
2. Multiple
Connections
!
If connection cannot be
(+CIPMUX=0) established or gets
N

AT disconnected during send,


+CIPSEND=<id>,<length returns
> !
O

ERROR
!
If data is transmitted
successfully, returns
!
C

SEND OK
!

! |Page"
43 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
Command Description Response Reference

Execute AT+CIPSEND Wrap return > after


execute command. Enters
pass-through mode, 20ms
interval between each
packet, maximum 2048
bytes per packet. When
single packet containing
+++ is received, it
returns to command
mode.
!

AL
Command can only be
used in pass-through mode
and single connection
mode.
!!

TI
EN !
AT+CIPCLOSE Close TCP or UDP <id>= required ID no.
of connection to
connection
close, when id=5, all
connections will be
Test AT+CIPCLOSE=? OK
closed.
D
(id=5 has no effect in
server mode)
Set Multiply connection No errors, returns
FI

mode OK
AT+CIPCLOSE=<id> !
If connection <id> is
disconnected, returns
N

LINK IS NOT
O

Execute Single connection mode No errors, returns


AT+CIPCLOSE OK
!
If no such connection,
C

returns
ERROR
!
Prints UNLINK when there
is no connection
!

! |Page"
44 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
Command Description Response Reference

AT+CIPSR Get local IP address <IP address>: devices


current IP address
(Station mode)
Test AT+CIPSR=? OK
!
No effect under AP
mode
!!
Execute AT+CIPSR +CIFSR:<IP address>
! !!
OK
!!

AL
ERROR
!! !!
!! !!
!!

TI
!!
!! !
!!
EN
AT+CIPMUX Start multiple <mode>
0: Single Connection
connections
D
1: Multiple
Connection
Query AT+CIPMUX? +CIPMUX:<mode>
! !
FI

Mode can only be


OK
changed after all
Set AT+CIPMUX=<mode> OK connections are
! disconnected. If server
N

If already connected, is started, reboot is


returns required.
LINK IS BUILDED
O

!!
!!
C

!!
!!
!

! |Page"
45 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
Command Description Response Reference

AT+ CIPSERVER Configure as server

Set AT OK <mode>
+CIPSERVER=<mode>[,<
port>]
!
Server has to be restarted
0: Server mode OFF
1: Server mode ON
<port>: port number,
default value=333
!

AL
Server monitor will
automatically be
created when Server
mode ON.
!
When a client is

TI
connected to the
server, it will take up
EN one connection.
Server can only be
turned ON when AT
+CIPMUX=1
!!
!!
D
!!
!!
FI

!
N

AT+ CIPMODE Set module transfer <mode>


0: No-passthrough
mode
O

2: Passthrough

Query AT+CIPMODE? +CIPMODE:<mode>


!
C

OK

Set AT+CIPMODE=<mode> OK
!
If already connected,
returns
LINK IS BUILDED

! |Page"
46 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
Command Description Response Reference

AT+CIPSTO Set server timeout <time>:


Server timeout
Range 0~28800
Units in seconds
Query AT+CIPSTO? +CIPSTO:<time>
!
OK

Set AT+CIPSTO=<time> OK

AL
+IPD Receive network
data

TI
1. Single Connection
EN When the module receives <id>: id no. given by
(+CIPMUX=1) network data, it will send connection
+IPD,<len>:<data> the data through the serial <len>: length of data
!
2. Multiple Connection
port using +IPD command <data>: received data
!
(+CIPMUX=1) Only valid in
+IPD,<id>,<len>,<data> command mode
D
FI

!
!
N

!
O
C

! |Page"
47 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
5. Development Kit
5.1. Components of ESP8266EX Development Kit
The ESP8266 development kit consists of a HDK (hardware development kit), SDK
(software development kit), APK (android application) and DOC (user guides).

ESP8266

AL
Development Kit

TI
HDK: SDK: Android App: DOC:
esp8266_hdk.zip esp8266_sdk.zip IOT_Espressif_xxx.APK esp8266_doc.zip

Use WROOM Use Demo Board


EN
Source Code for
Flash Download Source Code:
D
AT instructions
Tools esp_iot_sdk_vX (also available
precompiled in
esp_iot_sdk/bin/at
FI

1. Demo Board.rar
1. SMD version
wifi+flash_module.rar

2. DIP version
N

ESP8266+FLash_Module.rar
0A-ESP8266_Specifications
(includes PCB layout, 0B-Beginners Guide to Using ESP8266
schematics, BOM) 1-HDK-ESP8266_Module Application Design Guide
O

2A-SDK-Espressif IoT SDK Manual


2B-SDK-Espressif IoT Demo (Plug/Light/Sensor)
2C-SDK-Espressif IoT SDK Programming Guide
Other Docs (release on request)
2D-SDK-Espressif IoT SDK Json Naming Guide
3-CLD-Espressif Cloud Introduction_v3
C

4A-AT Instruction Set


4B-AT Commands Example
5A-APK-Espressif Humidity-Temperature Sensor
Application

99A-SDK-Espressif Flash Operation


99B-SDK-Espressif Timer Function
99C-CLD-Firmware upgrade through Cloud Server

!
!

! |Page"
48 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
5.2. Documentation List
Espressif provides reference guides to help developers use ESP8266EX in their projects:
!
ESP8266 Module Application Design Guide: How to develop ESP8266EX modules
using our HDK
Espressif IoT SDK Manual: ESP8266EX development environment
Espressif IoT Demo: ESP8266EX applications in Plug/Light/Sensor

AL
Espressif IoT SDK Programming Guide: Using the SDK
Espressif Cloud Introduction: How to use Espressif Cloud Server
Espressif Humidity-Temperature Sensor Application1: User guide to our in-house

TI
developed Andriod application.
Espressif Flash Operation: Technical doc, ESP8266EX Flash RW
EN
Espressif Timer Function: Technical doc, ESP8266EX timer applications
Firmware upgrade through Cloud Server: Technical doc, How to upgrade firmware
of ESP8266EX using Cloud.

!
D

!
FI
N

1 APK and documentation is not available in English yet.


O
C

! |Page"
49 " September 17, 2014
ESP8266EX Beginners Guide
Espressif
Systems
Appendix: Contact Details
For more information, you can contact us at
!
Address:
456 BI BO ROAD SUITE A201
PUDONG, SHANGHAI

AL
CHINA 201203
!
Email:

TI
SALES@ESPRESSIF.COM

SUPPORT@ESPRESSIF.COM

!
EN
Corporate Website:
HTTP://WWW.ESPRESSIF.COM
D
!
FI

!
N
O
C

! |Page"
50 " September 17, 2014

You might also like