Finally got around to playing with the ESP8266 WiFi Module with an Arduino UNO. I am using the UNO simply because it has a steady, 3.3v output while the HalfByte Console isn’t as steady and the module is, from everything I have read, is not tolerant of much more than the 3.3 volts. Until I fix the console’s 3.3volt output, I will use the UNO.
Before I go on, I have to say, this little board isn’t very reliable. It is only connecting about a third of the time.
The documentation is spotty, even though it has been out for quite sometime now. So, I hope to help anyone who just wants to use it as a WiFi module and not reprogram it to play Tic Tac Toe.
First, it is important to know which module you have as there are quite a few variations. You go here to figure that out. The board I have is an ESP-01 Rev 2. The Rev is important as you have a couple of extra steps from the rev 1 board.
From the wiki, here’s the pin out for the rev 2 board:
In order for this thing to work, you MUST jumper the CHIP_EN (or CHIP_PD) pin to the VCC pin, pulling the pin high. This enables the whole thing to, you know, work.
One other important detail…the baud rate is 115,200. Most documentation I read said it was 9600, but, at least on mine, it is 115,200 baud.
Those two things were the key for me to get my module to connect and work.
|UTX||RX (pin 0)|
|URX||TX (pin 1)|
#define SSID “xxx”
#define PASS “xxx”
#define DST_IP “126.96.36.199” //google.com
SoftwareSerial dbgSerial(10, 11); // RX, TX
// Open serial communications and wait for port to open:
dbgSerial.begin(9600); //can’t be faster than 19200 for softserial
//test if the module is ready
dbgSerial.println(“Module is ready”);
dbgSerial.println(“Module have no response.”);
//connect to the wifi
connected = true;
//set the single connection mode
String cmd = “AT+CIPSTART=\”TCP\”,\””;
cmd += DST_IP;
cmd += “\”,80″;
cmd = “GET / HTTP/1.0\r\n\r\n”;
char c = Serial.read();
dbgSerial.println(“OK, Connected to WiFi.”);
dbgSerial.println(“Can not connect to the WiFi.”);
Because I am using the serial I/O on the UNO for the module, I used softwareserial to talk to a HalfByte Console running the HalfByte graphical terminal sketch so I could see the output of the module. Normally, you would, likely, not have any kind of output on the Arduino as you’d be using the WiFi module for your I/O. I’m guessing.
I can see the potential, but the reliability is an issue.