This is a story of my initial journey with the ESP8266 module and attempts to control it with an Arduino UNO. I am hoping it will summarise a lot of the individual snippets of information available on a variety of places including this forum.
Inevitably it will show my inexperience with this platform and I would be delighted if more experienced users could correct my errant thoughts.
Initial learnings re the Arduino platform and ESP8266 were
• The board only works on 3.3V – for both power and data levels
• The UNO’s 3.3v supply is incapable of delivering the power the board demands
So I started by also purchasing a Freetronics ESP-01 WiFi Module Shield to provide both the power demands and logic level conversions. This is an UNO shield.
Now the surprises started. My ESP8266 arrived (from a different vendor) in a small plastic bag with a slip of paper referring to a generic e-bay seller site. The board was only marked as ‘AI Cloud Inside’ ; no manufacturer or anything so mundane. So, naturally, I attempted to connect the device and query what it actually was.
Learnings from this:
• Most ESP8266 come out of the box only able to communicate at 115200 baud. You can’t tell if yours is one of these from the physical package because it has no version number or anything attached.
• Using software.serial a UNO cannot reliable get to anything like this rate. Of course there are legends who manage to clock 1M out of their chips but for regular people 38 to 56K is about the limit. This just means a whole lot of the utube videos of this subject assume you already know this! They make it look simple and easy.
• Each ESP8266 can understand a dialect of the AT commands. There are many such dialects and, again, you can’t tell what yours needs from the physical package because it has no version number or anything attached. For example the command to alter the baud rate is described variously as AT+IPR or AT+CIOBAUD or AT+UART_CUR.
Everybody says AT+GMR will tell you such things but 1st you have get it talk to you !
Fortunately, I had a MEGA board as well so I configured that to use one of the extra uarts and just ran jumper leads to my ESP-01 WiFi Module Shield. Then I wrote a sketch that opened the port at each baud rate from 300 to 115200 in turn. I got a mostly English response at 74880 !
AT+GMR
AT version:0.40.0.0(Aug 8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd.
Build:1.3.0.2 Sep 11 2015 11:48:04
OK
I knew I should have been a detective…. Several hours of following trail from “Ai-Thinker Technology” led me to http://bbs.espressif.com/viewforum.php? ... efad01cce0
And one of the files there is ESP8266 AT Instruction Set Version 0.40 (4A-ESP8266__AT Instruction Set__EN_v0.40.pdf) so at last I have the reference for the dialect it uses. Along the way I found the V0.20 set and it is very instructive to compare the vast differences between the 2 releases.
There are many references on the web to re-flashing this device but all of them seem to require a serial breakout board – I couldn’t find any way of doing it via a UNO. I was hoping to avoid this completely because the project I have in mind just needs a simple interface and a six month old version should be fine. Except that before I discovered the manual but after I discovered the frequency it was using I experimented with the other commands various people suggested – somewhere in there, well I think the term is ‘I bricked it’. Now the blue light is on permanently and the most it will respond to is a physical reset whereby it responds at 74880baud with some of the reset text. It is as though it resets at 74880 then switches to something else… maybe on another planet.
So the plan when the new unit arrives is. Use the MEGA (with a physical UART) to discover the frequency the animal converses at and the dialect it uses. Use another echo type sketch to command the device to talk slower – maybe 19200. See if it does !
Then go back to software.serial and the UNO and all the world’s problems are solved.
This is a hobby to me but surely the vendors would get more traction by providing some useful documentation or even stamping the baud rate its set for on the package instead of just ‘AI Cloud Inside’.
JC