![](http://s1.manualzz.com/store/data/006515184_1-81d7166ba74e09d608e63fe1cf63e09b-128x128.png)
advertisement
![AirM2M_ESP8266_WiFi Module User Manual V2.9 | Manualzz AirM2M_ESP8266_WiFi Module User Manual V2.9 | Manualzz](http://s1.manualzz.com/store/data/006515184_1-81d7166ba74e09d608e63fe1cf63e09b-360x466.png)
A6501
AirM2M_ESP8266_WiFi Module User Manual V2.9
1
AirM2M_ESP8266 WiFi module user manual V2.9
Contents
AirM2M_ESP8266 WiFi module user manual V2.9
Page 3 of 48
AirM2M_ESP8266 WiFi module user manual V2.9
Terms and acronyms
Table 1 Terms and acronyms
CCK
DQPSK
DBPSK
QAM
OFDM
WPA
TKIP
WAPI
WEP
GPIO
OTA
IEEE bps
MIMO
MPDU
MSDU
IOT
CRC
Abbreviations Descriptions
WiFi Wireless Fidelity
AP
UART
Access Point
Universal Asynchronous Receiver & Transmitter
DTIM
SOC
P2P
TCP
IP
STBC
MCU
Delivery Traffic Indication Message
System On a Chip
Point to Point
Transmission Control Protocol
Internet Protocol
Space-Time Block Coding
Microprogrammed Control Unit
Multiple Input Multiple Output
MAC Protocol Data Unit
MAC Server Data Unit
Internet Of Things
General Purpose Input/Output
Over The Air
Institute Of Electrical And Electronics Engineers
Bits Per Second
Corporate Control Key
Differential Quadrature Phase Shift Keying
Differential Binary Phase Shift Keying
Quadrature Amplitude Modulation
Orthogonal Frequency Division Multiplexing
Wi-Fi Protected Access
Temporal Key Integrity Protocol
Wlan Authentication And Privacy Infrastructure
Wired Equivalent Privacy
Cyclic Redundancy Check
AirM2M_ESP8266 WiFi module user manual V2.9
1. Product introduction
1.1. Summary
Up to now Shanghai AirM2M Communication Technology Co., Ltd has released 3 kinds of
ESP8266 WiFi modules, including A6501、A6501S and A6502. There will be more kinds coming to meet different PCB package requirements of enterprise users and individual developers.
A650X series modules own competitive PCB packaging sizes in the industry and ultralow power consumption technology. They are designed for mobile devices and IOT applications, which can connect users’ physical devices to WiFi wireless network,so communications on INTERNET or
LAN may happen.
There are different kinds of PCB packagings for A650X series modules. Some models of antennas are supported,including on-board PCB antenna, IPEX interface and stamp hole interface.
A650X series modules can be widely used on smart power grids, intelligent transportation, intelligent furniture, handheld devices, industrial control and so on.
For more details please refer to http://www.luam2m.com/
1.1.1 Product features
Support 802.11 b/g/n wireless standard
Support STA/AP/STA+AP 3 working modes
Built-in TCP/IP protocol stack, support multipath TCP Client connections
Support abundant Socket AT commands.
Built-in 32 bit MCU, can be used as the application processor
Support UART/GPIO data communication interfaces
Support PWM output
Support I2C interfaces
Support WiFi configuration parameters
Support Smart Link intelligent networking function
Support remote firmware upgrade(OTA)
3.3V single power supply
Support multiple power consumption modes like Active、Modem sleep、Light sleep、Deep sleep
Ultra low power consumption, suitable for battery-powered applications
AirM2M_ESP8266 WiFi module user manual V2.9
1.1.2 Module Packages
AirM2M ESP8266 A650X series modules support multiple PCB packages, which greatly enriches users’ choices. They can be easily applied to a variety of networking applications and solutions.
Picture 1 front & bottom view of A6501 module
AirM2M_ESP8266 WiFi module user manual V2.9
1.1.3 Specifications
A650X
Wireless parameters
Mater chip wireless standard frequency range transmitting power receiving sensitivity antenna mode hardware interface working voltage
GPIO drive capability
Hardware parameters working current operating temperature storage environment dimension
Serial transmission
Software parameters transmission rate
TCP Client wireless network types security mechanism
Encryption type firmware upgrade networking protocol user configuration
Table 2 A6501 Module technical specifications
ESP8266
IEEE 802.11b/g/n
2.412GHz-2.484GHz
802.11b: +18.5 +/-1dBm (@11Mbps)
802.11g: +16 +/-1dBm (@54Mbps)
802.11n: +15 +/-1dBm (@HT20, MCS7)
802.11b: -91 dBm (@11Mbps ,CCK)
802.11g: -75dBm (@54Mbps, OFDM)
802.11n: -71dBm (@HT20, MCS7) built-out: stamp hole interface or I-PEX connector built-in: onboard PCB antenna
UART,IIC,PWM,GPIO,ADC
3.0V--3.6V(VDD voltage)
Max:15ma normal mode average value:~70mA, peak value: 215mA
Deep Sleep
Modem Sleeps
<15uA average value: ~15mA
Light Sleep 0.9mA
-40℃ ~ 125℃ temperature:<40℃,relative humidity:<90%R.H.
onboard PCB antenna:16*24*3.3mm; built-out antenna:16*18.6*3.3mm
9600 ~ 921600 bps
4
STA/AP/STA+AP
WEP/WPA-PSK/WPA2-PSK
WEP64/WEP128/TKIP/AES local serial, OTA remote upgrade
IPv4, TCP/UDP/HTTP
AT+ instruction set
Web page + PC configuration tool
Android/iOS terminal Smart Link intelligent configuration APP
AirM2M_ESP8266 WiFi module user manual V2.9
1.2.
Hardware introduction
A650X series modules powered by ESP8266 SOC processor with abundant hardware interfaces support UART,IIC,PWM,GPIO,ADC, which can be widely used on different internet applications.
1.2.1
A6501 PIN Definition
Picture 2 A6501 pin configuration
AirM2M_ESP8266 WiFi module user manual V2.9
Table 3 A6501 detailed Pin descriptions
Pin Function Description
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
U1CTS
U1RTS
U1RI
U1DTR
HeartBeat
RESET
GND
ENABLE
VDD
ANT
GND
MODE
ADC
U1RXD
U1TXD nReload
1)UART_CTS (in normal mode, i.e. MODE pin float when booting up);
2)GPIO3(can be redefined in SDK firmware version);
3)U0RXD for ESP8266 firmware dowloading (MODE pin pulled down when booting up).
1)UART_RTS (in normal mode, i.e. MODE pin float when booting up);
2)GPIO1(can be redefined in SDK firmware version);
3)U0TXD for ESP8266 firmware dowloading (MODE pin pulled down when booting up);
Note:Internally pulled up,please remain float when booting up, no pulling down!
1)UART_RI, to wake up MCU, active low;
2)GPIO5(can be redefined in SDK firmware version);
1)UART_DTR,to wake up A6501, active low;
2)GPIO14(can be redefined in SDK firmware version);
1)Wake up A6501(with AT+AMSLEEP) from deep sleep mode when shorted with RESET;
2)GPIO16(can be redefined in SDK firmware version);
3)High level output is defaulted after boot- up.
1)Non-deep-sleep mode: external reset signal, active low;
2)Deep sleep mode: to wake up A6501 when shorted with Heartbeat
GND
1)Module enable Pin, internal 10K ohm pull up, powered on by VDD by default;
2)Shutdown on low level, power consumption current is less than 5uA
3.3V,module power supply
WiFi Antenna
GND
1) Red LED:TCP/UDP connection state indicator.
2) GPIO0(can be redefined in SDK firmware version);
3) mode selection:
Float when booting up:normal operating mode
Pulled down when bootingup:firmware download mode
ADC, input range:0V-1V;
1)UART_RXD, receive data
2)GPIO13(can be redefined in SDK firmware version)
1) UART_TXD, send data
2) GPIO15(can be redefined in SDK firmware version);
Note: internally pulled down at 10K ohm, no hardware pull up outside when booting up!
1) Press-key functions(“press” means pulling down the pin): press once:start Smartlink process; press twice:start OTA firmware download process; long press:reset to factory configuration.
2) GPIO2(can be redefined in SDK firmware version);
3) Debug_TXD, used for output of debugging log;
AT+OPENLOG can open the log output function for this pin,which means the press-key funtions will cease to be effective.
Note: Must kept high level when booting up, no hardware pull down please!
AirM2M_ESP8266 WiFi module user manual V2.9
17 GPIO4
18 GPIO12
GPIO4(can be redefined in SDK firmware version);
1) Blue LED:TCP/UDP indication light control signal is defaulted.
2) GPIO12(can be redefined in SDK firmware version)
Notes:
1)There are 3 types serial ports(uarts),among which:
UART0(U0RXD、U0TXD)is an uart for firmware download. Marked in red in table3.
UART1(U1RXD、U1TXD、U1CTS、U1RTS、U1DTR、U1RI) is an uart for AT commands /data.
Debug_UART(Debug_TXD)is a debug uart for log printing. Marked in dark yellow in table 3.
2) Please pay close attention to the levels of certain pins when the module is being powered on to avoid the malfuncition happening.
Pins that request initialization level when booting up are already marked by blue color .
Take a normal scenario for example(AT command input/output after power-on):
step1:
The module is in power-off state;
step2:
Keep MODE pin float, connect AT uart(i.e. data uart ,PIN14 and PIN15) with MCU;
step3:
The module’s flow control mode is OFF by default, this mode can be set to HARDWARE by
AT+IFC,which means U1CTS(pin1) and U1RTS(pin2) need to be connected with MCU(if flow control is needed ) or be shorted with each other(if flow control is not needed).
step4:
Power on the module,pay close attention that pin2 and pin16 are forbidden to be pulled down and pin15 is forbidden to be pulled up at the moment of power-on.
step5:
Input AT commands via AT uart. The baud-rate is 921600 by default , and baud-rate lower than
921600 can be trained by inputting several AT commands(please refer to
for more details)
3) PIN “MODE” is used for module mode selection. Connect “MODE”to“GND” and then power on the module,the module will go into firmware upgrading mode.
4) Statements for“Red LED” and “Blue LED”:
Red LED:
As the TCP/UDP connection state indicator, blinks when connected, extinguishes when disconnected.
Blue LED: a) Lit for 2S,and then turned off after boot-up; b) As the TCP/UDP data transmission state indicator ,blinks when transmitting, extinguishes when transmission finished.
5) There are 3 GPIO pins of A6501 which are completely unrestricted (no request on initialization
AirM2M_ESP8266 WiFi module user manual V2.9
level, no default function or default function can be modified). They are marked by green . First using these pins is recommended.
6) Special reminding:
Please remember that in firmware versions later than V0003, firmware upgrade serial and data transmission serial do not use the same pins any more.
AirM2M_ESP8266 WiFi module user manual V2.9
1.2.2
A6501S
Picture 3 A6501S pin configuration
For the 18 fixed pins, A6501S and A6501 are totally identically defined. The newly added pins S1---S6 ,
AirM2M_ESP8266 WiFi module user manual V2.9
S1
S2
S3
S4
S5
S6 except “5V”, are defined in the same way as 5 of the fixed pins but the space between the added pins is 2.54mm. The purpose of leading out the 6 pins that are often used is to make it easy for debugging.
Details are as following:
PIN Function Description
GND
U1RTS
U1CTS
U1TXD
U1RXD
5V
GND identical to PIN2 identical to PIN1 identical to PIN15 identical to PIN14 module power supply
Table 4 A6501S S1---S6 Pin definition
Main distinctions between A6501S and A6501 are:
(1) One LDO is added:AMS1117, developer can use the 5V power of serial port line USB2TTL directly for power supply ;
(2) 6 pins are added whose space between each other is 2.54mm:5V、GND、U1RXD、U1TXD、U1RTS、
U1CTS;
(3)Shielding case is not welded in the developer’s versions of modules for easy developments.
(4)The dimension is added from 16mm*24mm*3.3mm(A6501)to 16mm*32mm*3.3mm(A6501S);
(5)A6501S+USB2TTL Serial port line will be enough for debugging directly, no need for development board.
AirM2M_ESP8266 WiFi module user manual V2.9
1.2.3
A6502
Picture 4 A6502 pin configuration
A6502 uses 12 pins whose spacing is 1.27mm leading out all the signals that are needed for serial port data transmission application. Compared to A6501 和 A6501S, the main characteristics of A6502 are as follow:
(1) smaller dimension:11.8mm*24mm*3.0mm;
(2) Pin spacing has been changed to 1.27mm;
(3) Hardware all flow control interface can be applied to various data transmission applications.
AirM2M_ESP8266 WiFi module user manual V2.9
1.3. Power consumption
All the following power consumption data come from tests basing on 3.3V power supply and 25° C environment temperature.
[1] All the tests are completed at the antenna interface.
[2] All emitting data are acquired in continuous emission mode, basing on a duty ratio of 90%.
Mode Min Normal Max unit transmit 802.11b,CCK 1Mbps,Pout=+19.5dBm
transmit 802.11b,CCK 11Mbps,Pout=+18.5dBm
transmit 802.11g,OFDM54 Mbps,Pout=+16dBm transmit 802.11n,MCS7,Pout=+14dBm receive 802.11b,package length is 1024 bytes,-80dBm receive 802.11g,package length is 1024 bytes,-70dBm receive 802.11n,package length is 1024 bytes,-65dBm
System standby mode
Deep sleep
Energy-saving mode DTIM1
Energy-saving mode DTIM3
Shutdown
0.9
10
1.2
0.86
0.5
60
62
135
60
215
197
145 mA
μA mA mA
μA mA mA mA mA mA mA mA
Table 5 Power consumption data
AirM2M_ESP8266 WiFi module user manual V2.9
1.4. Radio frequency index
Following data gained at indoor temperature, voltage 3.3V.
Description Min Normal
Input frequency
Input resistance
Input reflection
Under 72.2Mbps,PA ’s output power
In 802.11b mode,PA’s output power
Sensitivity
CCK 1Mbps
CCK 11Mbps
6Mbps(1/2BPSK)
54Mbps(3/4 64-QAM)
HT20,MCS7(65Mbps,72.2Mbps)
Adjacent channel suppression
OFDM,6Mbps
OFDM,54Mbps
HT20,MCS0
HT20,MCS7
2412
14
17.5
Table 6 Radio frequency index
Note:
1)72.2Mbps gained in 802.11n mode, when MCS=7,GI=200uS.
2)Output power can reach to +19.5dBm in 802.11b mode.
50
37
20
37
21
15
18.5
-98
-91
-93
-75
-71
Max
2484
-10
16
19.5
Unit
MHz
Ω dB dBm dBm dB dB dB dB dBm dBm dBm dBm dBm
AirM2M_ESP8266 WiFi module user manual V2.9
1.5. Dimension
A6501
A6501S
A6502
Picture 5 A650X module Pin Design
AirM2M_ESP8266 WiFi module user manual V2.9
1.6. WiFi antenna
A650X series modules support 3 kinds of antenna interfaces. They are onboard PCB antenna, IPEX interface and stamp hole interface. Customers can use onboard PCB antenna and IPEX interface directly without adding any matching circuit. Customers can use A650X stamp hole antenna interface if they want to design antenna part on big board. In this case, matching circuit should be reserved on big board for this design. For example:
Picture 6 WiFi radio frequency reference circuit
Note:
1、 The parts inside the above dashed box need antenna matching. Should take actual electronic parameters of the matching components of the antenna as standard.
2、 Need 50 ohm resistance for RF wiring. 90 degree angle wiring is forbidden. No longer than 15mm.
1.7. Recommended furnace temperature curve
Refer to IPC/JEDEC standard ; Peak Temperature : <250°C ; Number of Times: ≤2 times ;
AirM2M_ESP8266 WiFi module user manual V2.9
Picture 7 Recommended back flow curve
AirM2M_ESP8266 WiFi module user manual V2.9
2.Functional description
2.1. Main function
Main functions that A650X series modules can achieve include serial port transmission, PWM control and
GPIO control.
Serial port data transmission: good reliability, stability, can reach 11Kbyte at serial rate 115200kbps
PWM control: light-control, three-colour LED control, motor speed control
GPIO control: control switch, relay and so on.
2.2. Operating mode
A650X modules support STA/AP/STA+AP 3 operating modes.
STA mode: A6501 modules can connect to the internet by router. So cell phone or computer can remote control device by internet.
AP mode: As hotspot, A6501 modules achieve that cell phone, computer can communicate with modules directly, which makes local area network wireless connections come true.
STA+AP mode: Coexistence of these two modes.
2.3. Application fields
RS232 serial data to Wi-Fi interface
industrial data transparent transmission
Wi-Fi remote control
toy field
color LED control
fire protection, security and intelligent integrated management
Intelligent card terminal, wireless POS machines, Wi-Fi cameras, handheld devices.
2.4. AirM2M Cloud
AirM2M Cloud is internet cloud platform service provided by Shanghai AirM2M(AirM2M). Users can monitor and manage device on the platform to realize huge data management and analysis, which make device intelligence really come true.
AirM2M Cloud can accept customers’ customized requests, including Web Page Configuration,
Android/iOS platform and App development.
AirM2M_ESP8266 WiFi module user manual V2.9
3.EVB Introduction
AirM2M can offer special UART_WiFi_EVB development board for customers’ to debug A650X. By this development board, traditional serial device or MCU device can easily connect to WiFi network to realize managing and controlling of the devices by network.
This development board can offer hardware demonstration programs like UART serial port data transmission solution, RGB light-control and intelligent socket. At the same time, development board has reserved hardware circuit on which our GSM/GPRS standard module A2350 works as main controlling unit( MCU) to communicate with A6501 via serial port. So it can support GSM/GPRS long-distance transmission, and support LAN range WiFi communication.
Picture 8 EVB front view
Notice:
Because this EVB is compatible to different application by using module’s periphery pins. So it need jumper cap or buttons for distinguishing.
1) Button “download”: Press this button before power up for download until downloading begins.
2) Jumper wire “boot”: when break over, turn on; when break, shutdown.
3) Button “reset”: Restore factory default settings: AP mode.
4) Button “reboot”: module’s hardware reboot, software configuration parameter won’t change.
AirM2M_ESP8266 WiFi module user manual V2.9
3.1. Module Firmware Download
The steps are:
1) Before firmware download, the A6501 module should be in shutdown state.
2) The firmware download is via UART0(PIN1=U0RXD,PIN2=U0TXD),so PC should be connected by
UART-to-USB cable to A6501’s UART0, and the cable’s Tx should be connected to PIN1,the cable’s Rx should be connected to PIN2.
If the developer is using AirM2M’s EVB board, the method for connection is indicated in the following picture:
3) Run the AirM2M_ESP8266_Firmware Download Tool on PC.
This tool can be run directly without installation. Open the tool and choose the port number for UART0.
4) Click the third toolbox button: “Setup” button firmware directory and click “OK”
, choose the config file( _cfg.lua) in the new
AirM2M_ESP8266 WiFi module user manual V2.9
5) Click on the “download” button , then pull down P IN 12(MODE) before powering on the module, then pull up MODE pin after the module goes into downloading mode.
If the developer is using AirM2M’s EVB board, the steps are:
Click on the “download” button on the PC tool -> press MODE button on the EVB -> power on the
EVB->release the MODE button after the module comes into downloading mode.
6) When the prompt message: “FINISHED” appears, the downloading process is completed.
4.PC Configuration tool
4.1. Basic application methods
A650X supports using PC tools: AirM2M_ESP8266_CONFIG_TOOL to configure relative parameters for easy using.
Here we take how to set module to multilink transparent transmission mode(module working as
STA+CLIENT) for example, introducing following configuration steps:
Step 1:
A650X wireless module is powered on, and in AP or AP+STATION mode(default is AP+STATION mode).
Step 2:
Put A650X module and the PC in the same LAN in order for the PC config tool to search out the module.
There are two ways:
AirM2M_ESP8266 WiFi module user manual V2.9
a) Using computer’s WIFI function to search out wireless module A650X (SSID of an
AirM2M WiFi module as an AP is named as “AirM2M_MAC” e.g. AirM2M_97F502) and click connect.
b) PC and module join the same router. The SSID and password for the module to join the router can be provided to module by 2 means :
AT command (please refer:
Start SMART LINK: AT+AMSL ) or
SMARTLINK app(please refer:)
Step 3:
Open configuration tool AirM2M_WiFi_CONFIG_Tool. Please add trust if intercepted by PC security software.
Step 4:
Click Web Control -> SEARCH , the found module will be showed at the left-hand display column. If the module is not found, we can repeatedly click the button “SEARCH”.
PC and module being in the same LAN is the precondition for the search function. Please refer to for details.
Step 5:
Click “BASE” tab ,and click “READ” button to get basic info of AirM2M WiFi module.
In the “BASE” tab, you can set the Wifi working mode and the related IP address.
Set the WiFi working mode to Station.
Setup the parameters in the green frame in the following picture(Ignore this part when module is in AP mode)
The parameters in the red frame are for AP configuration. Please ignore this part when module works as
Station.
AirM2M_ESP8266 WiFi module user manual V2.9
Note:
1) When working mode or IP address is changed, the module need to be restarted to make the parameters work;
2) If the IP address under the AP mode is changed , the developer need to do the search once more and select the module to use this tool after the restart of the module because the PC CONFIG Tool connects
192.168.4.1 without search by default .
Step 6:
Click “Set TCPUDP Client” tab to configure link. It supports 4 links at most at the same time.
You need set 4 parameters for every link:
Local_port:local port
Port:server port
Protocol:TCP or UDP
Ip: server IP address
To configure links basing on need. Here take 2 for example and then click “POST”
AirM2M_ESP8266 WiFi module user manual V2.9
Note: If user wants single link transparent transmission only, to configure one link at this step is enough.
Step 7:
Click “set transparent transmission mode” option page to set transparent transmission mode.
Data_mode = 1 ,transparent transmission mode
Data_mode = 0 ,non-transparent transmission mode,that is AT command mode
Set data_mode=1 here,then POST
AirM2M_ESP8266 WiFi module user manual V2.9
Step 8:
Reboot module. After rebooting, module will turn into transparent transmission state. Look from the server’s side, there will be two links established.
Step 9:
Open AT tab, choose the port, put in data in the input box at the left-bottom corner and send. Look from the server’s side, two links all receive data “qqqqq”.
AirM2M_ESP8266 WiFi module user manual V2.9
Step 10:
Quit transparent transmission mode and go back to AT command mode.
Click “set transparent transmission mode” set to set data_mode=0,POST, then reboot module.
Note:
There are 3 ways to quit transparent transmission mode:
1) +++ quit transparent transmission, but it will go back to transparent transmission mode after rebooting.
2) +++, then AT+CIPSCON=0, it will go to normal AT mode after rebooting module.
3) open AirM2M_ESP8266_CONFIG_TOOL->WEB CONTROL-> Set transparent transmission tab, set data_mode= 0 and then POST. Enter normal AT mode after rebooting module.
There are 2 ways to enter transparent transmission mode:
1) AT+CIPMODE=1,AT+CIPSERVER to configure server or AT+CIPSTART to configure client ,then
AT+CIPSCON=1, reboot module and it will enter transparent transmission, and automatically set up connection according to last saved data (query-able by AT+CIPSCON)
2) open AirM2M_ESP8266_CONFIG_TOOL->WEB CONTROL-> Set transparent transmission tab, set data_mode= 1 and then POST. At Set TCPUDP client side/server tab to configure CLIENT/SERVER link, and then POST, reboot module to enter transparent transmission and automatically set up socket connection according to configuration.
AirM2M_ESP8266 WiFi module user manual V2.9
4.2. Search AirM2M Module in the same LAN
In practical Wifi applications,such as Smart Home Systems,there is a scenario that most developers must consider: phone app or PC app need to search all the WIFI module/devices in the same home LAN in order to control them.
This function can be realized on APP in such method: UDP broadcast.
For APP, such parameters should be set:
Broadcast IP address: 255.255.255.255
Broadcast port: 1025
Query packet from APP:Are You AirM2M IOT Smart Device?
Response from A6501:I'm FW_VER. MAC address IP address
Here is an PC APP example:
Note:
The search function in AirM2M_ESP8266_CONFIG_TOOL is implemented in this way too.
AirM2M_ESP8266 WiFi module user manual V2.9
4.3. Smartlink Function
In the Wifi applications,module need to join APs. But modules have no keyboard or screen,it is not a easy thing for a module to join an AP .
Smart Link (sometimes called Smart Config), invented by TI(Texas Instruments), is a key to the solution.
The process is as follows:
1) The phone joins an router(=AP),
2) Open the the SmartLink phone App, input SSID and password of the router, then press Start, it will broadcast some packets which include ssid info,
3) Trigger the module to enter Smartlink process,the module will capture the broadcast packets and get the ssid info and then join the router according to the ssid info.
Note: there are 3 ways to trigger the module’s smartlink process for the AT command firmware version.
a) AT+AMSL=1. for details,please refer to: Start SMART LINK: AT+AMSL
b) Pull down nReload once c) AirM2M_ESP8266_CONFIG_TOOL->”Set the SmartLink” tab, set the smartlink.timeout ≠ 0. reboot module , it will begin smartlink process repeatedly until it joins the router successfully.
AirM2M_ESP8266 WiFi module user manual V2.9
This parameter describes the timeout of the smartlink packet capturing process,the unit is seconds. The default value is 0, which means no smartlink process at all.
For the SDK firmware version, the airm2m_smartlink_start API will trigger the Smartlink process once.(In
SDK version , AT commands are not available.)
AirM2M_ESP8266 WiFi module user manual V2.9
5. AT Instructions Introduction
5.1. Basic AT instruction
5.1.1 Reboot module:AT+RST
Syntax: command type execute command grammar
AT+RST response
OK
5.1.2 Set Uart baud rate:AT+IPR
Syntax: command type set command
Read command test command
Items needing attention grammar Response
AT+IPR=<rate> go back:
OK
AT+IPR?
go back:
+IPR: <rate>
OK
AT+IPR=?
go back:
+IPR: (<rate> value list)
OK
Self-adaptive baud rate is supported by default.
1. The range of <rate> is:
BIT_RATE_9600
BIT_RATE_19200
BIT_RATE_38400
BIT_RATE_57600
BIT_RATE_74880
BIT_RATE_115200
BIT_RATE_230400
BIT_RATE_256000
BIT_RATE_460800
BIT_RATE_921600
2. The baud rate is 921600 by default
3. Can be adaptive to baud rate that is no larger than the present one by training.
For example,if the present baud rate is 115200,then any baud rate from among 9600、19200、
AirM2M_ESP8266 WiFi module user manual V2.9
38400、57600、74880 can be achieved by sending several AT commands after power on via the
UART .
4. The adaption is needed only when the baud rates between the module and the MCU are not the same.
5. The trained and adapted baud rate will be stored,which means the module’s baud rate is the the last saved one before the rebooting.
6. The supported data bits: 5/6/7/8
The supported stop bits: 1/1.5/2
The supported parity: 0-none 1-odd 2-even
The supported flow control: 0-none 1-hw control
5.1.3 Sleep and Wake-up Command:AT+AMSLEEP
Syntax: command type grammar set command
Response
AT+AMSLEEP=<mode>,<sleep_time> OK
+AMSLEEP:<mode>, <sleep_time>
Read command AT+AMSLEEP?
OK
+AMSLEEP:list of <mode>s, range of
<sleep_time> test command AT+AMSLEEP=?
OK
Parameter definition: parameters
<mode> definition sleep mode value
2
<sleep_time> time duration for sleep 0~4294 value instruction deep sleep.
only this mode is supported at present unit: seconds when the <sleep_time> is up, the module will wake up by itself, on the precondition that the
PIN5(HEARTBEAT pin) is connected with RESET pin.
5.1.4 Cloud Firmware Update:AT+CIUPDATE
Syntax: command type grammar command AT+CIUPDATE
Response
+CIUPDATE: Update info
OK
AirM2M_ESP8266 WiFi module user manual V2.9
Examples: cmd (->)/
Resp(<-)
AT sequences
1)normal update
->
AT+CIUPDATE
<+CIUPDATE: CONNECT OK
+CIUPDATE: A6501,V0008
+CIUPDATE: START UPGRADE
OK
2)no need to update
->
<-
AT+CIUPDATE
+CIPUPDATE:CONNECT OK
+CIPUPDATE:NO NEW VERSION AVAILABLE
Explanation the precondition for firmware update of the module is that it join the router that can access the INTERNET.
the module connects AirM2M Server automatically
A6501 is the model,V0008 is the version of the new firmware the version of the running firmware is already the latest
5.1.5 Open log print:AT+OPENLOG
Syntax: command type grammar command AT+OPENLOG
Response
OK the module firmware log is printed via nReload (PIN16)
Notes
Pull down nReload once,start Smartlink process pull down nReload twice,start firmware update process pull down nReload for a long time(>3s), to restore factory settings
Input AT+OPENLOG,the functions mentioned above will be disabled. Reboot the module to restore.
5.1.6 Enable Command Echo:ATE
The ATE command determines whether or not the TA echoes characters received from TE during command state.
Syntax: command type grammar command ATE<value>
Response
OK
Parameter definition: parameters definition
<value> value
0 value instruction echo mode off
AirM2M_ESP8266 WiFi module user manual V2.9
1 echo mode on,default value
5.1.7 Set Flow Control:AT+IFC
Syntax: command type grammar
Set command AT+IFC=<mode>
Parameter definition: parameters definition
<mode> value
0
1
Response
OK value instruction flow control OFF
HARDWARE
5.2. WiFi function AT instruction
5.2.1 Select WiFi working mode:AT+CWMODE
Syntax: command type
Set command
Read command test command grammar
AT+CWMODE
<mode>
AT+CWMODE?
AT+CWMODE = ?
=
Responseuction
OK
(AT+RST)Command will be in valid after reboot
+CWMODE:<mode>
OK
What mode is currently in?
+CWMODE:(<mode> value list)
OK
What mode it support currently?
Parameter definition: parameters definition
<mode>
WiFi mode application
2
3 value
1 value instruction
Station mode
AP mode
AP+Station mode
AirM2M_ESP8266 WiFi module user manual V2.9
5.2.2 List current available access points: AT+CWLAP
Syntax: command type grammar execute command
AT+CWLAP
Response
+CWLAP: <ecn>,<ssid>,<rssi>[,<mode>]
OK this command will go back to AP list
Parameter definition: parameter definition
<ecn>
<ssid>
<rssi>
<mode> encryption way access point name signal strength connect mode
0
1
3
4
1
2 value
0 value instruction
OPEN
WEP
WPA_PSK
WPA2_PSK
WPA_WPA2_PSK character string parameter manual connect automatic connection
5.2.3 Add access point:AT+CWJAP
Syntax: command type
Set command
Grammar
AT+CWJAP=<ssid>,<pwd>
Read command
AT+CWJAP?
Response
OK or ERROR
Successfully join AP, OK. If not, ERROR
+CWJAP:<ssid>
OK go back to current choice AP
Parameter definition: parameter definition
<ssid>
<pwd> access point name password value value instruction character string character string, the longest is 64 byte, ASCII coding
AirM2M_ESP8266 WiFi module user manual V2.9
5.2.4 Quit access point: AT+CWQAP
Syntax: command type grammar execute command AT+CWQAP test command AT+CWQAP=?
Response
OK means exit this AP successfully
OK check whether this command is supported
5.2.5 Set parameter in AP mode: AT+CWSAP
Syntax: command type grammar set command AT+CWSAP=<ssid>,<pwd>,<chl>, <ecn>
Read command
AT+CWSAP?
Response
OK successfully set parameters
OK check current AP parameter parameter definition: parameter definition
<ecn>
<ssid>
<pwd>
<chl> encryption way access point name password channel number
3
4
1
2 value
0 value instruction
OPEN
WEP
WPA_PSK
WPA2_PSK
WPA_WPA2_PSK character string parameter character string, the longest is 64 byte, ASCII coding
5.2.6 Inquire MAC address: AT+AMMAC
Syntax : command type grammar execute command
AT+AMMAC
Response
If CWMODE set as 1(STA mode):
STATION_MAC: xx:xx:xx:xx:xx:xx
OK
If CWMODE set as 2(AP mode):
AirM2M_ESP8266 WiFi module user manual V2.9
AP_MAC: xx:xx:xx:xx:xx:xx
OK
If CWMODE set as 3(STA+AP mode):
STATION_MAC: xx:xx:xx:xx:xx:xx
AP_MAC: xx:xx:xx:xx:xx:xx
OK
Successfully set up parameters
→
←
→
←
Examples: cmd(→)
/Rep(←)
→
← example
AT+CWMODE?
+CWMODE::3
→
←
OK
AT+AMMAC
STATION_MAC: 18:fe:34:9e:ab:e4
AP_MAC: 1a:fe:34:9e:ab:e4
OK
AT+CWMODE=2
OK
AT+AMMAC
AP_MAC: 1a:fe:34:9e:ab:e4
OK explanation and instruction
Inquire WIFI level working mode
3:AP+STA mode
Inquire AC address
Set working mode to 2,AP mode
Inquire MAC adress
5.2.7 Query the signal strength of the AP: AT+CAPR
Syntax : command type grammar execution command
AT+CAPR
Response
+CAPR:<ssid>,<rssi>
OK parameter definition: parameter
<ssid>
<rssi> definition
AP hot spot name
AP signal strength value Value instruction the name of the joined AP by the module
AirM2M_ESP8266 WiFi module user manual V2.9
Examples: cmd(→)
/Rep(←)
→ example
AT+CAPR
← +CAPR:"AIRM2M", -65
OK explanation and instruction query the strength of the AP joined by the module currently
AP’s name is AIRM2M,the rssi is -65
5.2.8 Start SMART LINK: AT+AMSL
Syntax:
Command type grammar
Set command AT+AMSL=1
Response
+AMSL:<ssid>,<password>
OK successfully configured SMART LINK parameter definition: parameter
<ssid>
<password> definition
AP hot spot name
AP hot spot password value Value instruction
Examples: cmd (->)/
Resp(<-) example Explanation and instruction
Turn on cell phone’s WIFI function and link to a router (name it A for easy understanding).
Turn on SMARTLINK Android App that released by our company. Input name and password of a router that we want module to link to(named B). And click SMARTLINK button below. Keep it running until configuration finish.
Note: A and B can be the same router.
That means that cell phone can directly link to router B that we want module to join, and configure router B in APP.
→ AT+CWMODE?
Inquire WIFI level working mode
AirM2M_ESP8266 WiFi module user manual V2.9
←
+CWMODE:1
→
←
→
←
OK
AT+AMSL=1
+AMSL: yh_taih,qin02666
OK
AT+CWJAP?
+CWJAP:"yh_taih"
OK
Mode 1:STA mode
Mode 3:STA+AP mode
Mode 1 and 3,both can use SMART LINK
But mode 2(pure AP mode)cannot configure SMARTLINK.
Start SMART LINK configuration.
It means configuration is successful
Ssid = yh_taih
Password = qin02666
Inquire which hotspot module joins up currently.
means successfully joined up yh_taih
Click STOP,turn off APP
AirM2M_ESP8266 WiFi module user manual V2.9
5.3. TCPIP AT command
5.3.1 set up TCP/UDP connection :AT+CIPSTART
Syntax: command type grammar Response if format is right:
OK set command when single way connection (+CIPMUX=0):
AT+CIPSTART=<type>,<addr>,<port>,[local_po rt] otherwise:
+CME ERROR: invalid input value successfully connect :
CONNECT OK (CPIMUX=0)
<id>, CONNECT OK (CIPMUX=1)
When multichannel connection:
AT+CIPSTART=<id>,<type>,<addr>,<port>,[loc al_port]
And local port is optional parameters
If connection already exist:
ALREADY CONNECT connection fail :
CONNECT FAIL (CIPMUX=0)
<id>, CONNECT FAIL (CIPMUX=1) parameter definition: parameter definition
<id> Link No.
<type>
<addr> connection type
Remote server IP address
<port> remote service port number
[local_port] local port value
0~3
“TCP”/”UDP” value instruction if AT+CIPMUX=0,the value of <id> is fixed to 0 character string
IP address or domain name number, optional parameters
5.3.2 Get TCP/UDP connection mode :AT+CIPSTATUS
Syntax: command type grammar Response
AirM2M_ESP8266 WiFi module user manual V2.9
If it is single connection (AT+CIPMUX=0):
OK
STATE: <state>
C:<cid>, <TCP/UDP>, <Local IP address>,<Local port>,<Remote IP address>, <Remote port>, <client state> execute command
AT+CIPSTATUS
Note: If it is single connection, it uses the following way for connection:
AT+CIPSTART=<type>,<addr>,<port>,[local_port] way, and one link can be set up only. The occupied <cid> = 0 test command
AT+CIPSTATUS=?
If it is mult connection (AT+CIPMUX=1):
OK
STATE:<state>
S: <sid>,<port>,<server state>
C:<cid>, <TCP/UDP>, <Local IP address>,<Local port>,<Remote IP address>, <Remote port>, <client state>
OK parameter definition: parameter
<state>
<sid>
<server state> definition single connection state server ID server status value
IP INITIAL
IP STATUS
TCP
CONNECTING/UDP
CONNECTING
CONNECT OK
TCP CLOSING/UDP
CLOSING
0~1
OPENING
LISTENING
CLOSING
0~3 value instruction initialization obtain local IP status
TCP connecting/UDP port registering successfully connect setup
Shutting down TCP connection, and logging out UDP port.
value 0 and 1 turning on monitoring turning off value as 0,1,2,3 <cid>
<Local IP address>
<Local port>
<Remote IP address>
<Remote port> customer’s ID local IP local port remote IP remote port
<client state> client status
INITIAL
CONNECTING
CONNECTED turn off state connecting connected
AirM2M_ESP8266 WiFi module user manual V2.9
Examples: cmd(->)/ example
Resp(<-)
→ AT+CWMODE?
←
→
←
+CWMODE:3
OK
AT+CIPMUX?
→
←
+CIPMUX:0
OK
AT+CIPSTATUS
→
←
OK
STATE:IP STATUS
C:0,"","",,"",,"INITIAL"
C:1,"","",,"",,"INITIAL"
C:2,"","",,"",,"INITIAL"
C:3,"","",,"",,"INITIAL"
AT+CIPSTART="TCP","192.168.1.51",6800
OK
CONNECT OK
→
←
AT+CIPSTATUS
OK
STATE:CONNECT OK
C:0,"TCP",”192.168.1.52”,38330,"192.168.1.
51",6800,"CONNECTED"
C:1,"","",,””,,"INITIAL"
C:2,"","",,””,,"INITIAL"
C:3,"","",,””,,"INITIAL"
AT+CIPCLOSE →
←
→
CLOSE OK
AT+CIPMUX=1
←
→
←
← (URC)
→
←
OK
AT+CIPSERVER=1,7777
OK
0,CONNECT OK
AT+CIPSTATUS
OK
STATE:IP STATUS
S:0,7777,LISTENING
C:0,"TCP","192.168.4.1",7777,"192.168.4.1
01",59319,"CONNECTED"
C:1,"","",,"",,"INITIAL"
C:2,"","",,"",,"INITIAL"
Explanation and instruction
Inquire WIFI level working mode
3:AP+STA mode
Single connection mode
Set up one connection as client close the connection
Must close all connection before configure mult- connection module accepts a socket link
AirM2M_ESP8266 WiFi module user manual V2.9
C:3,"","",,"",,"INITIAL C:2,"","",,””,,"INITIAL"
5.3.3 Start multi-connection:AT+CIPMUX
Syntax: command type set command
Read command grammar
AT+CIPMUX=<mode>
AT+CIPMUX?
Response
The response is :
OK
Note:Start multi-connection successfully
If it is in multi- connection mode,the response is:
+CME ERROR: The socket is already connected
Note:That is when there already is a connection for module,
<mode> value can not be modified. Only after all connections are closed by AT+CIPCLOSE, <mode> can be modified.
+CIPMUX:<mode>
OK parameter definition: parameter definition
<mode> whether to boot multi-connection mode value
0
1 value instruction
Configure to single connection mode
Configure to multi- connection mode
5.3.4 Send data:AT+CIPSEND
Grammatical rues: command type
Grammar Response set command single connection(+CIPMUX=0):
AT+CIPSEND=<length> multi connection(+CIPMUX=1):
AT+CIPSEND=<id>,<length> response
When module receives command it will feed back ”>” first, then start to receive serial port data. Data will be sent automatically when its length reaches <length>.
If connection is not setup,the module responds:
ERROR
If successfully sent data, the module responds:SEND OK.
If parameters error:
AirM2M_ESP8266 WiFi module user manual V2.9
+CME ERROR: invalid input value test command
AT+CIPSEND=?
execute command
AT+CIPSEND description send data of assigned length single connection(AT+CIPMUX=0): response
+CIPSEND: <length>
OK multi- connection(AT+CIPMUX=1):
+CIPSEND: <0-3>,<length> description
OK
AT+CIPMODE=1 and as a client, this command will make the module enter transparent transmission mode(hardware flow control is recommended in this circumstances, otherwise data mayl be lost when there are mass data.)
When module receives command it will send back ”>” first, then start to send data h received via serial port.
Parameter definition: parameter definition
<length>
<id> data length link No.
value
0~3 value instruction unit: bytes connection id
5.3.5 Set the TCP socket window size:AT+CIPWND
command type set command grammar Response
AT+CIPWND=<linkid>,<tcp_window_size> OK
+CIPWND:<linkid>,<tcp_window_size> execute command
AT+CIPWND?
test command
AT+CIPWND=?
OK
+CIPWND:(range of <linkid>), (range of
<tcp_window_size>)
AirM2M_ESP8266 WiFi module user manual V2.9
OK
Parameter definition: parameter
<linkid> definition connection id
<tcp_window_size> TCP window size value
0~3
0~1024
Examples: cmd(->)/
Resp(<-)
→
← example
AT+CIPWND=?
+CIPWND:(0-4),(0-1024)
→
←
→
←
→
←
OK
AT+CIPSTART="TCP","192.168.1.51",6800
OK
CONNECT OK
AT+CIPWND?
+CIPWND:
C:0,5840
C:1,
C:2,
C:3,
OK
AT+CIPWND=0,100
+CIPWND:
C:0,100
C:1,
C:2,
C:3,
OK value instruction unit: bytes
Explanation and instruction
建立一个单链接
连接上了
5.3.6 Set the frame size for transparent transmission:AT+CIPCCFG
Set the frame size for automatic sending in transparent data transmission mode.
Syntax: command type grammar Response
AirM2M_ESP8266 WiFi module user manual V2.9
set command
AT+CIPCCFG=<wait_time>,<frame_size> OK execute command test command
AT+CIPCCFG?
AT+CIPCCFG=?
+CIPCCFG:<wait_time>,<frame_size>
OK
+CIPCCFG:range of <wait_time>,range of
<frame_size>
OK
Parameter definition: parameter
<wait_time>
<frame_size> definition waiting time frame size value
1~65535
1~65535 value instruction unit:ms , default value =100 when the waiting time exceeds the set value ,the data are sent automatically unit:bytes, default value = 2048 when the frame size exceeds the set value,the data are sent automatically
5.3.7 Close TCP/UDP connection:AT+CIPCLOSE
Syntax: command type grammar Response
Single connection
CLOSE OK set command
AT+CIPCLOSE=<id>
Multi-connection
<n>,CLOSE OK
AT+CIPCLOSE=<n>[,<id>]
If shut down successfully:
CLOSE OK execution command
AT+CIPCLOSE
If shut down fail:
ERROR test command
Items need attention
AT+CIPCLOSE=?
OK
Execution command is effective to single connection only, it will respond ERROR in multi-connection.
Execution command AT+CIPCLOSE is only available when module is in TCP/UDP
CONNECTING or CONNECT OK status, in otherwise it will return ERROR.
Status after shutting down is IP CLOSE in single connection mode.
AirM2M_ESP8266 WiFi module user manual V2.9
parameter definition: parameters definition
<id>
<n> shut down mode
Link No.
value
0
1
0~3 value instruction slow shutdown(default value) quit shutdown integer type, connection serial number
5.3.8 Obtain local IP address:AT+CIFSR
Set command can set the module’s IP address.
Read command can read the module’s current IP addresses under AP and/or STA modes.
Syntax: command type grammar Responses success OK
Set command
AT+CIFSR=<mode>,<ip_addr>,< netmask>,<gateway> fail +CME ERROR: invalid input value
+CIFSR:<sta_IP address>
CWMODE=1
OK
+CIFSR:<ap_IP address>
CWMODE=2
Read command
AT+CIFSR
CWMODE=3
OK
+CIFSR:<sta_IP address>
+CIFSR:<ap_IP address> fail to get IP
OK
ERROR test command
AT+CIFSR=?
success OK parameter definition: parameter definition
<mode> WIFI mode
<ip_addr>
<netmask>
<gateway>
<sta_IP address>
<ap_IP address>
Set IP address net mask gateway
IP address in STA mode
IP address in AP mode value
1
2 value instruction
Station
AP
格式为 xx.xx.xx.xx
格式为 xx.xx.xx.xx
格式为 xx.xx.xx.xx
格式为 xx.xx.xx.xx
格式为 xx.xx.xx.xx
AirM2M_ESP8266 WiFi module user manual V2.9
5.3.9 Configure module as server:AT+CIPSERVER
Need execute AT+CIPMUX=1 first to turn on mux mode. To monitor 2 ports at most at the same time, including TCP and UDP.
Syntax: command type grammar Responses
Execute command success
OK
AT+CIPSERVER=<mode>[,<port>]
If there is a client to connect the module( as a server)
<linkid>,CONNECT OK parameter definition: parameter definition
<mode>
<port> value whether turn on server mode
0
1 port number value instruction turn off server mode
Note: Need reboot if use AT+CIPSERVER=0 to shut down server.
turn on server mode default value is 333
5.3.10 Receives data from server:+IPD and+RECEIVE
The URC(Unsolicited Result Code) is sent by module to serial port. When module receives network data it sends data which uses +IPD and RECEIVE as header to serial port.
Syntax: command type grammar Response and instruction single connect (+CIPMUX=0): received data will take +IPD as beginning.
non-transpar ent transmission
+IPD,<len>:<data> multi- connect (+CIPMUX=1):
+RECEIVE,<id>,<len>:<data>
<data> is received data, there is one \r\n between it and +RECEIVE, <n>,<length>:
Note: Colon is an English colon.
There is no data head, data come up directly when it is transparent transmission.
transparent transmission <data>
Note:
Ways for transparent transmission for
AirM2M_ESP8266 WiFi module user manual V2.9
multi-connections are: Every single data sent to module serial port will be automatically sent to all connections under CONNECTED state by module.
Users can guarantee data’s pertinence by application layer’s protocol.
Parameter definition: parameter definition
<id> Link No.
<len>
<data>
<data> length burst value
0~3 value instruction connection serial number unit: bytes
Note: The length is <data>’s length, data head not included.
Example of data receiving(take receiving “TEST123” for example):
Non-transparent transmission Transparent transmission single link +IPD,7:TEST123 TEST123 multi-link +RECEIVE,1,7:
TEST123
TEST123(at connection) every CONNECTED
5.3.11 Select TCPIP application mode :AT+CIPMODE
Syntax: command type set command grammar
AT+CIPMODE=<mode>
Read command AT+CIPMODE?
test command AT+CIPMODE=?
backward
OK
+CIPMODE: <mode>
OK
+CIPMODE: (0-NORMAL MODE,1-TRANSPARENT MODE)
OK parameter definition: parameter definition
<mode>
TCPIP mode application value
0
1 value instruction
Non-transparent transmission mode, default mode.
transparent transmission mode
5.3.12 Save transparent transmission configuration:AT+CIPSCON
Syntax: command type grammar backward
AirM2M_ESP8266 WiFi module user manual V2.9
set command
AT+CIPSCON=<action>
Read command
AT+CIPSCON
OK
C:<id>,<protocol>,<ip>,<remotePort>,<localPort>
S:<id>,<localPort>,<timeout>
DATA_MODE:<mode>
OK
+CIPSCON:(0,1) test command
AT+CIPSCON=?
OK parameter definition: parameter
<action> definition
Save/delete transparent transmission parameter
<id> connection id
<protocol> TCPIP protocol
<ip> Ip address
<remotePort> remote port
<localPort>
<timeout> local port
<mode>
Server link time-out
Transparent transmission mode value
1
0
TCP
UDP
0
1
→
←
→
←
→
←
Examples: cmd(->)
/resp(<-)
→
← example
AT+CWMODE?
+CWMODE:1
OK
AT+CIPMODE=1
OK
AT+CIPMUX=1
OK
AT+CWJAP="ChinaNet-hXug","5qsqruiv"
OK value instruction
Save transparent transmission parameter
Module enters transparent transmission after booting and :
1) Join the AP according to AT+CWJAP
2) Set up connection according to data of C: and monitor port according to data of S:.
delete transparent transmission parameter. Data of S and C is deleted. Module quits transparent transmission mode at the same time x.x.x.x
means server port
To C, that is module’s local CLIENTport
To S,that is module’s loca SERVER port
Please refer to AT+CIPSTO. Default value is 180
Common AT mode
Transparent transmission mode
Explanation and instruction
AirM2M_ESP8266 WiFi module user manual V2.9
→
←
AT+CIPSTART=0,"TCP","192.168.1.51",6800
OK
0,CONNECT OK
AT+CIPSCON=1 →
←
→
←
OK
AT+CIPSCON
C:0,"TCP","192.168.1.51",6800,1793
C:1,"","", ,
C:2,"","", ,
C:3,"","", ,
S:0, ,
S:1, ,
DATA_MODE:1
OK
AT+CIPSTATUS
OK
STATE:IP STATUS
C:0,"TCP","192.168.1.51",6800,"CONNECTED"
C:1,"","",,"INITIAL"
C:2,"","",,"INITIAL"
C:3,"","",,"INITIAL"
Then reboot module.
Module will enter transparent transmission mode after reboot and automatically set up connection of
0,"TCP","192.168.1.51",6800,"CONNECTED"
5.3.13 Time-out for server disconnection:AT+CIPSTO
command type set command
Read command grammar
AT+CIPSTO=<server timeout >
AT+CIPSTO?
Response
OK
+ CIPSTO:<server timeout>
OK parameter definition: parameter
<server timeout > definition value time-out for server automatically disconnected.
0 ~4294967295 value unit is 1s
Using this command to set up time-out time, server will disconnect when time is up.
0 is default value. Means never to take initiative to disconnect.
Default value is 180s.
Examples:
AirM2M_ESP8266 WiFi module user manual V2.9
example cmd(->)
/resp(<-)
→
←
→
←
AT+CIPSTO=0,120
OK
AT+CIPSTO?
S:0,120
S:1,180
Explanation and instruction set server timeout = 120 seconds query the settings
5.3.14 Select non-transparent transmission data sending mode :
AT+CIPQSEND
Under non-transparent transmission data sending mode, there are two sending modes quick sending and slow sending also, using +CIPQSEND to set up.
Syntax: grammar Backward command type set command
AT+CIPQSEND=<n> OK
+CIPQSEND: <n>
Read command
AT+CIPQSEND?
OK
+CIPQSEND: (0,1) test command
AT+CIPQSEND=?
OK parameter definition: parameter
<n> definition non-transparent transmission mode value value instruction
0
1
Common mode, also called slow sending mode—when server receives TCP data, module goes back to SEND OK.
Quick sending mode—when data sent to module, module single link:DATA ACCEP:<length>
Multi-link:DATA ACCEPT:<id>,<length> but not SEND OK
5.3.15 Set the reconnection times on a TCP link :AT+CIPRCON
Set command determines the re-connection times after an abnormal link disconnection happens on a TCP link.
In either data sending modes ,normal AT mode or transparent transmission mode, on a TCP link, a packet of data input will do the service of discerning the link connection state:CONNECTED or otherwise.
Syntax: command type grammar Backward
AirM2M_ESP8266 WiFi module user manual V2.9
set command
Read command
Test command
AT+CIPRCON=<times>
AT+CIPRCON?
AT+CIPRCON=?
OK
+CIPRCON:<times>
OK
+CIPRCON:range of <times>
OK parameter definition: parameter definition
<times > re-connection times after an abnormal TCP link disconnection value
0~65535 value
Unit:times,default value = 3 .
0= never reconnect
65535 = always reconnect
5.3.16 Quit transparent transmission mode: + + +
There are 3 ways to quit transparent transmission mode:
4) +++ quit transparent transmission, but it will go back to transparent transmission mode after rebooting.
5) +++, then AT+CIPSCON=0, it will go to normal AT mode after rebooting module.
6) open AirM2M_ESP8266_CONFIG_TOOL->WEB CONTROL-> Set transparent transmission tab, set data_mode= 0 and then POST. Enter normal AT mode after rebooting module.
There are 2 ways to enter transparent transmission mode:
3) AT+CIPMODE=1,AT+CIPSERVER to configure server or AT+CIPSTART to configure client ,then
AT+CIPSCON=1, reboot module and it will enter transparent transmission, and automatically set up connection according to last saved data (query-able by AT+CIPSCON)
4) open AirM2M_ESP8266_CONFIG_TOOL->WEB CONTROL-> Set transparent transmission tab, set data_mode= 1 and then POST. At Set TCPUDP client side/server tab to configure CLIENT/SERVER link, and then POST, reboot module to enter transparent transmission and automatically set up socket connection according to configuration.
Syntax:
Command type execute command grammar
+++ backward
Attention:+++ no other character at front or back
5.3.17 Application examples
Module can work as STATION on WIFI level, also can work as AP, and AP+ STATION. Module can work as
SERVER or CLIENT on transmission level. While on application level, it can work in non-transparent data transmission (normal AT mode) and transparent data transmission mode as well.
Examples:
AirM2M_ESP8266 WiFi module user manual V2.9
cmd(→)
/resp(←) example explanation and demonstration
1)Module works in STATION mode(mode=1):
The parts in light blue grids are the common premise steps in this mode:
→ AT+CWMODE?
Step1: check WIFI level working mode
← +CWMODE::3 Default mode is 3: AP+STA mode
OK
→ AT+CWMODE=1 Step2: Set as Station mode
← OK
→
←
→
AT+RST
OK
AT+CWLAP
Step3: Need reboot after setting operation mode.
Note: Step2 and Step 3 can be ignored if after booting AT+CWMODE? is already Step
1.
Step 4: check current available access point
← +CWLAP:(3,"yh_taihdhad",-45,"54:e6:fc:52:
36:e6",9) result
+CWLAP:(4,"lemon",-86,"6c:e8:73:69:4b:76
",10)
+CWLAP:(4,"Xiaomi_yu",-85,"8c:be:be:2c:4
6:ea",11)
OK
→ AT+CWJAP="yh_taihdhad","UUU02339" Step 5: join one AP
←
OK
Note: After finishing this step, it will automatically save the WIFI working mode and the AP information.
1.1)Module works as CLIENT, single connection, non-transparent transmission:
→
AT+CWJAP?
Check current joined AP.
← +CWJAP:"yh_taihdhad"
OK
→
←
→
←
←
AT+CIFSR
172.168.1.114
Check current module IP address
AT+CIPSTART="TCP","172.168.1.119",4321 Set up one TCP link
OK
CONNECT OK Means connection success.
→
AT+CIPSEND=5
Set sending length to 5, module will automatically send data after data up to 5 ones.
→
←
←
>hello
SEND OK
+IPD,14:hello,thisispc
After > comes up, send 5 characters hello to serial port, module will automatically send data.
means sending is successful
Module receives server’s data and send to
AirM2M_ESP8266 WiFi module user manual V2.9
←
→
←
←
→
→ AT+CIPCLOSE serial port directly.
Turn off connection
← OK
1.2)Module works as CLIENT, single connection, data transparent transmission:
→
←
→
←
←
→
→
→
←
→
←
→
AT+CIPMODE=1 set module to transparent transmission mode
OK
AT+CIPSTART="TCP","172.168.1.119",4321 connect to one server
OK
CONNECT OK means connection is successful
AT+CIPSCON=1
Save parameter(link parameter and transparent transmission mode)
OK
AT+CIPSEND
>
SSSSAAAAAAAA
Reboot module
+++
AT+CIPSCON
Enter transparent transmission.
Enter transparent transmission directly without reboot.
After enter AT+CIPSEND, it will send back >, then MCU can send data to module from serial port, module can automatically send out data.
After server sending “SSSSAAAAAAAA”, module will display directly. Note: No data head when received by transparent transmission.
Module will enter transparent transmission directly after reboot and set up connection according to "TCP","172.168.1.119",4321.
quit transparent transmission state
Note: there should be no other characters at front or behind +++.
Inquire transparent transmission parameter and state
Inquire result is status and parameter of the last time when AT+CIPSCON=1.
C:0,"TCP","172.168.1.119",4321,1793
C:1,"","", ,
C:2,"","", ,
C:3,"","", ,
S:0, ,
S:1, ,
DATA_MODE:1
OK
AT+CIPSTATUS
O K
STATE:CONNECT OK
C:0,"TCP",”172.168.1.121”,35330,"172.168
.1.119",4321,"CONNECTED"
C:1,"","",,””,,"INITIAL"
C:2,"","",,””,,"INITIAL"
C:3,"","",,””,,"INITIAL"
Reboot module. Module will re-enter transparent transmission after reboot and set up one connection automatically. Connection parameter is the same as saved last time.
AirM2M_ESP8266 WiFi module user manual V2.9
1.3)Module works as CLIENT, multi connection, data transparent transmission.
→
AT+CIPMUX=1
After CIPMUX=1, module can do transparent transmits only.
←
→
OK
AT+CIPMODE=1 Transparent transmission mode
←
→
←
OK
AT+CIPSTART=0,"TCP","172.168.1.119",432
1
OK
CONNECT OK
172.168.1.119 is an INTERNET server.
→
AT+CIPSCON=1
Save parameter(connection parameter and transparent transmission mode )
← OK
Reboot module. Reenter transparent transmission after reboot and set up two connections automatically. Connection parameter is the same as saved last time when +CIPSCON is input .
1.4) Module works as SERVER, multi- connection, non-transparent transmission.
→ AT+CIPMUX=1
← OK
→ AT+CIPSERVER=1,8800 Module works as SERVER
←
OK configuration is successful,
Can monitor TCP and UDP link at the same time
→ AT+CIPSTATUS
←
←
OK
STATE:IP STATUS
S:0,8800,LISTENING
C:0,"","",,””,,"INITIAL"
C:1,"","",,””,,"INITIAL"
C:2,"","",,””,,"INITIAL"
C:3,"","",,””,,"INITIAL"
0,CONNECT OK CLIENT link to module (TCP),linkid = 0
← CLIENT link to module (UDP),linkid = 1
1,CONNECT OK
→
←
←
→
AT+CIPSTATUS
OK
STATE:IP STATUS
S:0,8800,LISTENING
C:0,UDP,”192.168.4.1”,8800,”192.168.4.11
2”,65074,CONNECTED
C:1,TCP,”192.168.4.1”,8800,”192.168.4.112
”,50114,CONNECTED
C:2,"","",,””,,"INITIAL"
C:3,"","",,””,,"INITIAL"
+RECEIVE,0,10:
0123456789
AT+CIPSEND=0,6
Note: No matter TCP or UDP, 4 links can be set up at most at the same time.
Inquire TCPIP level status
Receive data from CLIENT on link 0. the content is:0123456789
AirM2M_ESP8266 WiFi module user manual V2.9
←
←
←
>
0,SEND OK
0,CLOSE OK
AT+CIPSERVER=0
OK
Now data can be input. Input 6 characters, data will send initiatively.
Data sending successfully.
Opposite terminal(CLIENT)break connection initiatively.
→
← Need reboot module after shut down server.
we must restart
1.5)Module works as SERVER, single and multi-connection, data transparent transmission.
→ AT+CIPMUX=1
← OK
→ AT+CIPSERVER=1,8800 Module works as SERVER
←
OK
Configuration is successful.
can monitor TCP and UDP connection at the same time
→ AT+CIPMODE=1
← OK
→ AT+CIPSCON=1
← OK
Will enter transparent transmission mode after reboot.
And wait for CLIENT connection setup.
There will be no reminder after connection set up successfully. Now data can be two-way transmitted.
module as server can monitor 4 TCP and/or
UDP links at most.
2)Module operates in AP mode:
The following words in light blue are the same common premise steps in this mode:
→ AT+CWMODE?
Step 1: check WIFI level operation mode
← +CWMODE:3
OK
Default mode is 3: AP+STA mode
→ AT+CWMODE=2 Step2: Set as AP mode
← OK
→ AT+RST Step 3: Need reboot after setting mode.
←
→
←
OK
AT+CWSAP="aptest","123456",1,0
OK
Note: Step2 and Step 3 can be ignored if after booting AT+CWMODE it is already Step 1.
Step4: Set mode to AP and configure AP parameters.
Note: After finishing this step, it will automatically save the original mode after module reboot. It will be AP also if it is AP mode before reboot, and keeps the same AP parameters (SSID, password and so on) as before reboot.
STATION join the aptest AP
2.1)CLIENT,single connection, non-transparent transmission data:
Please refer to 1.1)
2.2)CLIENT,single connection, transparent transmission data:
AirM2M_ESP8266 WiFi module user manual V2.9
Please refer to 1.2)
2.3)SERVER,multi-connection, non-transparent transmission data:
Please refer to 1.3) .the different part is all connections are LAN connection under this application.
2.4) SERVER,multi- connection, non-transparent transmission data:
Please refer to 1.4)
2.5) SERVER,single and multi-connection, transparent transmission data:
Please refer to 1.5)
3)Module works in AP+STATION mode :
The parts in the following light blue grids are the common premise steps in this mode:
→ AT+CWMODE=3 Set as AP + STA mode
←
→
OK
AT+RST Need reboot after configuring mode.
← OK
→
AT+CWJAP="yh_taihdhad","UUU02339"
Add into one AP which is a router can access outer net.
← OK
→
AT+CWSAP="aptest","123456",1,0
Configure module as AP(name as aptest), and configure AP parameter
←
→
OK
There is one computer(name as user) using
WIFI to join this aptest AP.
AT+CIPMUX=1 Start multi- connection mode
←
→
←
AT+CIPSTART=1,"TCP","120.209.197.145",8
000
OK
1,CONNECT OK
Set up TCP connection with one SERVER of
INTERNET. Connection number is 1.
Successfully connect to INTERNET SERVER.
3.1) Module works as CLIENT to link local server, meanwhile works as CLIENT to link INTERNET server.
→ AT+CIFSR
← 192.168.2.110 is the allocated IP address when joins router which can surf outer net.
192.168.4.1
192.168.2.110
OK
→
←
←
AT+CIPSTART=2,"TCP","192.168.4.100",777
7
OK
2,CONNECT OK
+RECEIVE,2,11: hhhhhhfdddd
192.168.4.1 is the IP address and module works as AP itself.
To set up one connection with USER’s server, connection number is 2.
receive one pack of data from USER
→
←
AT+CIPSEND=1,11
>
Receive data from USER’s server (link 2) and send to outer net’s server (link 1) input hhhhhhfdddd
←
OK
1,SEND OK
When character’s number is up to 11, it will send out by itself.
AirM2M_ESP8266 WiFi module user manual V2.9
3.2) Besides linking to internet server, module also works as CLIENT to link local server, serve as : multi- link and transparent transmission.
→ AT+CIPSTART=2,"TCP","192.168.4.100",777
7
To set up one connection with USER’s server, connection number is 2.
← OK
2,CONNECT OK
→ AT+CIPMODE=1
← OK
→ AT+CIPSCON=1
←
→
OK
Reboot module.
Module will enter transparent transmission after reboot and automatically sets up 1 and 2 connections at the same time.
+++
→
AT+CIPSTATUS
Linking status can be checked after quiting transparent transmission mode
← S TATE:IP STATUS
C:0,"","",,””,,"INITIAL"
C:1,"TCP",”192.168.1.119”,12363,"120.209
.197.145",8000,"CONNECTED"
C:2,"TCP",”192.168.1.119”,36890,"192.168
.1.100",7777,"CONNECTED"
C:3,"","",,””,,"INITIAL"
3.3) Besides linking to Internet server, module also works as server to monitor local connection, service including: multi- link and non- transparent transmission.
→ AT+CIPSERVER=1,3366
←
←
←
→
OK
0,CONNECT OK
2,CONNECT OK
AT+CIPSEND=0,8 accept a link , linkid is 0.
accept a link , linkid is 2.
←
>
After input 12345678, then data can send out by itself.
← 0,SEND OK
→
AT+CIPSTATUS
Inquire TCPIP status
← OK
STATE:IP STATUS
S:0,3366,LISTENING
C:0,UDP,”192.168.4.1”,3366,”192.168.4.10
0”,51733,CONNECTED
C:1,TCP,”192.168.1.119”,35669,”120.209.1
97.156”,8000,CONNECTED
C:2,TCP,”192.168.4.1”,3366,”192.168.4.100
”,57957,CONNECTED
C:3,"","",,””,,"INITIAL"
3.4 ) Besides linking to Internet server, module also works as server to monitor local connection ,
AirM2M_ESP8266 WiFi module user manual V2.9
service including: multi- link and transparent transmission.
→ AT+CIPSERVER=1,3366
← OK
→ AT+CIPMODE=1
←
→
OK
AT+CIPSCON=1
← OK
Reboot module. It will enter transparent transmission mode automatically and set up connection 1,"TCP","120.209.197.145",8000. Module works as SERVER at the same time to monitor port 3366, waiting for setting up connection from client
advertisement
Related manuals
advertisement