carr3r

ESP8266 with FT232RL USB 2 Serial Adapter

Hello there ESP8266, you've just got a new fan!

The first time I played with ESP8266 "Wifi to Serial" module I used my USB-to-UART cable and Ubuntu, very straight forward.

For starters, two things to have in mind:

  • Use 3V3! (Also, if you're planning to use it with Arduino and/or other microcontrollers, use voltage regulators for every pin, since Arduino's HIGH voltage level is usually up to 5V).
  • ESP8266's CH_PD pin (which means Chip enabled) must be always HIGH, so connect it to VCC (putting it to LOW makes the chip enter Power Save mode).

Having said that, wire both modules like schematic below:

 undefined

 undefined

 undefined

I confess I could not get minicom to work properly with this module, so I used cutecom (apt-get install cutecom) instead. You can get plenty information about this module at https://nurdspace.nl/ESP8266, so I really recommend taking a look at it.

In this example I connected to the ESP, listed all Access-Points available, connected it to my personal AP and consumed an online Geo-IP API service with it. (Connection settings can be seen/checked at screenshot below)

undefined

 

 

 Command history:

// restart the module, just in case
AT+RST

OK
7!aS\0xcaS:\0xf1\0xfe\0x01\0xd91\0xb51\0x19\0xe2\0xd9\0xe6\0x0c<\0xff@b\0xe0
[Vendor:www.ai-thinker.com Version:0.9.2.4]

ready

// STAtion/client mode
AT+CWMODE=1


OK

// list all APs in within antenna's field area
AT+CWLAP

+CWLAP:(4,"Rep. Rancho Fundo",-X,"cc:a4:62:df:43:f0",1)
+CWLAP:(3,"Kakaroto4",-X,"28:c6:8e:b3:a7:12",1)
+CWLAP:(4,"RepX",-X,"c4:6e:1f:6d:7e:fc",6)
+CWLAP:(2,"raegui",-X,"c8:3a:35:1b:3b:98",6)
+CWLAP:(3,"sergioveio",-X,"5c:57:1a:22:6d:70",6)
+CWLAP:(4,"dlink-00F0",-X,"90:94:e4:fe:00:f0",2)
+CWLAP:(4,"SuiteMasterPranda",-X,"70:62:b8:80:4e:a3",6)
+CWLAP:(4,"arc",-X,"fc:b0:c4:d2:eb:7e",5)
+CWLAP:(4,"WakaWaka",-X,"e8:94:f6:eb:ba:10",6)
+CWLAP:(3,"net virtua 123",-X,"00:1d:d6:51:f5:d0",6)
+CWLAP:(4,"Dado",-X,"1c:7e:e5:be:7b:c6",6)
+CWLAP:(0,"S20CAM",-X,"00:40:96:57:99:32",8)
+CWLAP:(3,"EDSON A",-X,"00:1d:d5:01:c7:70",9)
+CWLAP:(1,"A.C.",-X,"00:23:cd:11:5e:b2",11)
+CWLAP:(3,"HP-Print-38-Deskjet 4640 series",-X,"a0:48:1c:65:5a:38",11)
+CWLAP:(4,"apto 113",-X,"70:54:d2:94:c9:9e",11)
+CWLAP:(4,"Zuza-Wireless",-X,"14:cf:e2:13:05:20",11)
+CWLAP:(4,"Chines",-X,"f4:ec:38:a0:74:bc",11)
+CWLAP:(4,"ed5a1c",-X,"d8:97:ba:87:82:bb",11)
+CWLAP:(4,"AP 133",-X,"a8:9d:d2:18:ee:0e",11)

OK
// setup connection 
AT+CWJAP="SSID","PASSWORD"


OK
// check IP received by DHCP
AT+CIFSR

10.0.0.103

OK
//set mutiple connection
AT+CIPMUX=1


OK
//setup TCP connectin on Port 80 at domain ip-api.com on connection id 0
AT+CIPSTART=0,"TCP","ip-api.com",80


OK
Linked

//using connection id 0, send the following 40 bytes (which will be a GET request on /json resource, similar to http://ip-api.com/json)
AT+CIPSEND=0,40

> GET /json HTTP/1.0
Host: ip-api.com


SEND OK

+IPD,0,433:HTTP/1.0 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Date: Tue, 14 Apr 2015 00:23:31 GMT
Content-Length: 277

{"as":"AS27699 TELEF\0xc3\0x94NICA BRASIL S.A","city":"Campinas","country":"Brazil","countryCode":"BR","isp":"Vivo","lat":-22.X,"lon":-47.X,"org":"Vivo","query":"xxx.xxx.xxx.xxx","region":"SP","regionName":"Sao Paulo","status":"success","timezone":"America/Sao_Paulo","zip":"13083"}

OK
Home ← Older posts