instructables
ESP-12F: ESP8266 module - connection test
by flav1972
This instructable will show you the first steps in order to use and test an ESP8266 ESP-12F module.
I put here just the thinks to know... mainly also to rembember myself what I did.
This will show only how to do a first connexion and to test the module with a serial USB connected to a computer
and use of Arduino IDE Serial Monitor.
Step 1: Parts needed
The parts needed are:
1. ESP-12F Module from ebay for example around 2.31USD
2. An USB to serial TTL UART Module (like CP2102 from ebay for exemple): 1.24USD
3. A 3.3V Power supply like MB102 from ebay: two for 1.67USD
4. An optional ESP-12 adapter like this one from ebay: 3 for 1.20USD
ESP-12F: ESP8266 module - connection test: Page 1
Step 2: Setup the Power Supply
The ESP8266 is a 3.3V device. So setup all the pins of the power supply to 3.3V (on bot sides) and use only the
green marked pins in the pictures. Do not use the 2 pins markend in red (5V).
ESP-12F: ESP8266 module - connection test: Page 2
Step 3: Solder the ESP-12F on the adapter
It is now time to solder the ESP-12F on the adapter. The 2mm pitch of the ESP-12F is big enough to solder with a
solering iron.
Start by soldering the ESP on the adapter.
The solder the pins.
Step 4: The ESP-12F
ESP- 12F WiFi module is developed by Ai - thinker Team. It contains a ESP8266 and 4MB external SPI flash.
I have found here the datasheet of the module. This datasheet describes all the pins but also the PIN Mode.
Modes are:
UART (for programming): GPIO0 - low, GPIO2 - high, GPIO15 - low
Flasg boot (for running the flashed software): GPIO0 - high, GPIO2 - high, GPIO15 - low
Another PIN not to forget is EN (also named CH_PD on other devices). This need to be pulled high in order the
device to work.
ESP-12F: ESP8266 module - connection test: Page 3
Step 5: Wire
Wire as follow:
Power GND / CP2102 GND / ESP-12F GND / ESP-12F GPIO15
Power 3.3V / ESP-12F VCC / ESP-12F GPIO0 / ESP-12F GPIO2 / ESP-12F EN
CP2102 RX / ESP-12F TX
CP2102 TX / ESP-12F RX
Some connections done here to VCC should not be done directly but with a pull-up resistor.
See my next Instructable.
ESP-12F: ESP8266 module - connection test: Page 4
Step 6: Start and test with putty
Connect CP2102 to computer and identity COM port. The data looks like :
Start putty and connect to the COM port with speed ets Jan 8 2013,rst cause:2, boot mode:(3,6)
74880 bauds. load 0x40100000, len 1856, room 16
Power un the power supply. tail 0
Some data will be displayed. This data is from the chksum 0x63
ESP8266 startup itself.
load 0x3ffe8000, len 776, room 8
Now switch the baud rate to 115200. Restart ESP- Example AT<ENTER><Control-J>
12F
You will get:
This time the data displayed comes from the
embeded AT commands software. Data looks like: AT+GMR<ENTER><Control-J>
AT version:1.2.0.0(Jul 1 2016 20:04:45)
Garbage caracters
Ai-Thinker Technology Co. Ltd. SDK version:1.5.4.1(39cb9a32)
ready Ai-Thinker Technology Co. Ltd. Dec 2 2016 14:21:16
You can start type AT commands. OK
After each ENTER press also Control-J
ESP-12F: ESP8266 module - connection test: Page 5
Step 7: Arduino IDE
Close putty if not done already. rf cal sector: 1017 rf[112] : 00 rf[113] : 00 rf[114] : 01
Start Arduino IDE, choose COM port (Tools>Port) SDK ver: 1.5.4.1(39cb9a32) compiled @ Jul 1 2016
and run Serial Monitor (Tools>Serial Monitor) 20:04:35 phy ver: 972, pp ver: 10.1
With Arduino IDE Serial Monitor set speed 74880 With Arduino IDE Serial Monitor set speed 115200
and restart ESP. and "Both NL & CR" at bottom right of the screen.
ets Jan 8 2013,rst cause:2, boot mode:(3,6) You will se also garbage then:
load 0x40100000, len 1856, room 16 tail 0 chksum
0x63 load 0x3ffe8000, len 776, room 8 tail 0 chksum Ai-Thinker Technology Co. Ltd.
0x02 load 0x3ffe8310, len 552, room 8 tail 0 chksum ready
0x79 csum 0x79
Now you are ready for last step.
2nd boot version : 1.5 SPI Speed : 40MHz SPI Mode
: DIO SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000
ESP-12F: ESP8266 module - connection test: Page 6
Step 8: AT Commands
The full reference ot AT commands is on expressif website or a short reference here.
Here is a short list:
AT
returns OK
AT+GMR
returns version
example:
AT version:1.2.0.0(Jul 1 2016 20:04:45)
SDK version:1.5.4.1(39cb9a32)
Ai-Thinker Technology Co. Ltd. Dec 2 2016 14:21:16 OK
AT+CWMODE?
displays current Acces point mode
AT+CWMODE=<mode>
sets acces point mode.
1 : station mode
2 : softAP mode
3 : softAP + station mode
Here is an example:
Set Dual Mode
AT+CWMODE=3
OK
List acces points
AT+CWLAP
+CWLAP:(4,"TOTO-500D00A0",-00,"40:65:03:40:03:30",1,10,0)
+CWLAP:(4,"TOTO-1300",-00,"04:A0:00:dA:50:50",1,13,0)
+CWLAP:(0,"TOTO1",-54,"36:00:03:61:00:50",3,-4,0)
+CWLAP:(0,"TOTO_sA0urA",-54,"36:00:03:61:00:50",3,-4,0)
+CWLAP:(4,"TOTO-A006",-50,"00:30:06:30:A0:06",6,-11,0)
+CWLAP:(0,"TOTO2",-50,"1A:30:06:30:A0:06",6,-11,0)
+CWLAP:(4,"TOTO-A506",-00,"60:0A:05:03:05:06",6,-10,0)
+CWLAP:(0,"TOTO",-06,"4A:0A:05:03:05:06",6,-10,0)
+CWLAP:(4,"TOTO-305A",-01,"00:00:61:d0:30:5A",6,3,0)
+CWLAP:(0,"TOTO3",-00,"00:00:61:05:04:00",6,-0,0)
+CWLAP:(3,"TOTO 34556",-00,"50:00:01:d3:10:46",6,10,0)
+CWLAP:(4,"TOTO-04A0",-00,"00:00:61:05:04:00",6,-0,0)
+CWLAP:(4,"TOTO4",-50,"64:00:34:10:10:00",0,-10,0)
+CWLAP:(3,"TOTO-0C00",-00,"00:00:00:06:00:00",11,06,0)
+CWLAP:(0,"TOTO_011",-05,"00:30:00:05:00:11",11,-10,0)
+CWLAP:(4,"TOTO-D3000030",-00,"64:00:34:00:A0:04",11,-10,0)
Connect
ESP-12F: ESP8266 module - connection test: Page 7
AT+CWJAP="TOTO","password"
WIFI CONNECTED
WIFI GOT IP
OK
List IP adresses
AT+CIFSR
+CIFSR:APIP,"192.168.56.1"
+CIFSR:APMAC,"aa:aa:aa:aa:cd:ef"
+CIFSR:STAIP,"192.168.23.17"
+CIFSR:STAMAC,"cd:01:23:45:ef:cd"
OK
Make a http request
1st connect
AT+CIPSTART="TCP","www.google.fr",80
CONNECT
OK
Make the request
AT+CIPSEND=20
OK
GET / HTTP/1.0
> Recv 20 bytes
SEND OK
And the response is
+IPD,471:HTTP/1.0 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.fr/?gfe_rd=cr&ei=MR6WWPuYDIvu8w...
Content-Length: 258
Date: Sat, 04 Feb 2017 18:32:17 GMT
<HTML>Some html here</HTML>
CLOSED
ESP-12F: ESP8266 module - connection test: Page 8