The ESP8266
Hello there. It has been a while. I recently came across a little board known as the ESP8266. It is a Wifi board with a full TCP/IP Stack. Meaning you can send TCP/UDP packets and various other functionality.
https://en.wikipedia.org/wiki/ESP8266
I found some on amazon 4 for $15 and my mind started to fill with the ideas of cheap IoT things.
I had some hurdles to overcome to finally get this board to talk on the serial line. And I thought I'd share what I had done to maybe help some people in the future.
1) I did not have an FTDI cable so I opted to use the one built in on the Arduino. You can do this by essentially disabling the arduino control of the Rx/Tx lines that are typically used to talk through the USB cable.
The simplest way to do this is upload a sketch with pinMode(0, INPUT) and pinMode(1,INPUT) (If you are using an Arduino UNO)
2) An important note is that the ESP8266 is only 3.3V compatible, meaning hooking it straight up to the Arduino could cause damage.
2a) It is also important to power the ESP8266 from a power supply capable of delivering more than 200mA.
2ai) By the way if you want a cheap source ($1) of >12V to 5V power supplies, Dollar Tree has those 12V to USB adapters for $1. I busted one open and looked at the data sheet on it. It can deliver 5V 1A at 12V input and 5V 600mA at >20V. I am using one to step down a wallwart from like 15V down to 5V and then my little variable supply takes it down to 3.3V (Saves the variable power supply from overheating)
2b) I purchased the recommend LLC (Logic Level Converter) from amazon also to make it easier to go from 5V to 3.3V and vice versa. This is for the Serial line communication between the ESP and the Arduino.
There is plenty of conflicting stories of how to get these things up and running. But the wiring documentation seems to be correct.
My board talks at 115200 baud rate on the serial lines. When I power it on I get this:
(a bunch of garbage text, which is the board booting up and talking at 76800 initially)
Ai-Thinker Technology Co. Ltd. invalid
Apparently Invalid is the right thing to see. However for a while I could not get the board to respond to anything that I did. Typing AT is supposed to give a response OK but I was not getting anything
I'm not sure if my wiring (currently a mess of proto wires strewn about) isn't making good connection or what. But through various different tests I verified that the LLC was working as it was supposed to.
The final but kind of odd thing I did, was put an LED on the TX from computer -> RX on ESP8266. When I did that and reset the ESP8266, the board started echoing my input.
I had read that all you might need was the CR (Carriage Return) but apparently you need the CR and LF (Line Feed) combo to get it to respond with OK.
To reiterate: My board - 115200 baud, 5V to 3.3V LLC, using the FTDI on the Arduino with a sketch with those two ports disabled. For some reason, my last attempt with an LED (which was to verify data travel) on the 5V side of the LLC of the RX line of the ESP8266
Finally! Now I can see if I can get it on the Wifi. I will update with another post later. WunderVision
Comments