Just started to play with the ESP8266-01 modules. Purchased from Taobao.
These, I believe, are version 2 and have the LEDs near the antenna. When first started they identify themselves as [Vendor:www.ai-thinker.com Version:0.9.2.4] and are version 018000902-AI03. This is a custom firmware from ai-thinker.
There seems to be quite a few different versions of similar modules. And the same module could have one of several firmwares.
Initially had trouble getting them to work. A lot of the guides online are a bit sparse and many have conflicting information. Most current guides say the baud rate is 115200 or 57600 (mine are 9600) and they fail to mention you need to pull CH_PD HIGH (10K resistor to 3.3V). This meant I went through a lot of trial and error.
The defaults for the devices I purchased are:
– ID = [Vendor:www.ai-thinker.com Version:0.9.2.4]
– Software version = 0018000902-AI03
– SSID = ESP_xxxxx (will be a hexadecimal number)
– CWMODE =2 (functions as an access point and therefore broadcasts on start)
– Baud rate 9600
I have used an Arduino and also an FTDI serial adaptor to talk to the ESP8266. Both worked the same. For details on connecting an Arduino see Arduino to ESP8266 By Serial Communication. Sending commands is the same for both methods.
FTDI RX to ESP8266 TX
FTDI TX to voltage divider then to ESP8266 RX
FTDI GND to GND
FTDI CP_PD to 10K ohm resistor and then to vcc 3.3v
ESP8266 GND to GND
ESP8266 Vcc to +3.3V
FTDI TX is 5V which needs bringing down to 3.3v. This is done with a voltage divider.
FTDI RX can be connected to ESP8266 TX directly. The FTDI will accept the 3.3v signal from the ESP8266 as HIGH.
A lot of people are using the 3.3v out on the Arduino to power the ESP8266 but the Arduino cannot really provide enough power and may damage something. I have a habit of destroying things and I now try to be more careful and since I have a breadboard power supply that can give 3.3v I am using it.
Plug the FTDI adaptor in to a usb port on your computer and power up the ESP8266. The power LED on the ESP8266 should come on.
To check if there is a signal I used the Android app Wifi Analyzer, available here. This app scans all available wireless networks and displays their signal strength.
It should show up as ESP_xxxxxx. If it doesn’t then check your connections and restart.
Serial Communication With The ESP8266
Once you have confirmed it is working and transmiting you can try to connect by serial. There are many serial terminal programs and one of the easiest ways is to use the serial monitor in the Arduino IDE. Fire up the IDE, select the com port and open the serial monitor.
Now enter AT and hit send and hopefully you should receive an “OK”. If you do not then try all the different baud rates.
The AT command is a simple test to confirm the ESP8266 is communicating. There are many more commands which are used to interrogate the chip and to make changes to the settings.
Join a Network
AT – Confirm that the esp8266 is communicating.
Response is OK
AT+CWMODE=1 – Set the chip to a client (you can also set as an access point or both)
Response should be OK.
AT+CWLAP – List available networks
Response will be a list of local networks:
+CWLAP:(3,"Eye3",-77,"e2:ca:94:56:bf:33",1) +CWLAP:(4,"little",-90,"64:70:02:8e:e8:88",3) +CWLAP:(2,"HKBN_876238",-89,"00:0c:43:87:62:38",1) +CWLAP:(4,"JAMnet_2.4GHz",-34,"08:86:3b:8c:24:74",6) +CWLAP:(1,"JAMguest",-32,"08:86:3b:8c:24:75",6) +CWLAP:(4,"stedward",-89,"c0:c5:20:20:f6:e9",6) +CWLAP:(3,"wah",-96,"10:c3:7b:cc:6e:24",6) +CWLAP:(3,"TP-LINK_6A0DD4",-81,"e8:94:f6:6a:0d:d4",8) +CWLAP:(4,"sandy",-93,"d8:fe:e3:81:74:36",9) +CWLAP:(3,"DIRECT-g4[TV]SamsungTV",-63,"5e:a3:9d:1c:24:ba",11) +CWLAP:(4,"Raymond Fung 2.4GHZ",-90,"70:62:b8:6d:b9:dc",11)
AT+CWJAP – Join a network
AT+CWJAP=”ssid”,”password” – use your own SSID and password
Response is OK
AT+CWJAP? – Check the name of the connected network.
Should give you the SSID , in my case it returns +CWJAP:”JAMguest”
AT+CIFSR – Check the ip address of the chip
Replies with the ip address. I got 192.168.169.14
This is the ip address assigned by your router
Set CP_PD to HIGH. Without this the unit will power on but will not broadcast a signal.
Try to get it broadcasting a signal before you try connecting with a serial terminal.
However, if it is not broadcasting you may need to change the mode to AP (AT+CWMODE=2).
If you cannot talk to it (over serial), try different baud rates. Not all modules have the same baud rate as default. Mine were 9600 but 115200 is also common.
Remember it expects to have newlines and carriage returns (NL&CR) on the end of the commands.