Chat freely about anything...

User avatar
By jc508
#42150 Hi,
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
User avatar
By Hoka
#50458 hi Jc I bought a Sparktronics 'thing', non dev version and ran into similar problems trying to verify the serial port i.e. it would only communicate at 74880 and then came back with the message ets Jan 8 2013,rst cause:2, boot mode:(1,6) or ets Jan 8 2013,rst cause:2, boot mode:(3,6). I was about 1.5 weeks banging my head until I found a user on stackexchange who really knew what he was talking about.
some things I didn't know:
1) ets Jan 8 2013,rst cause:2, boot mode:(1,6) or 3,6 is NOT an error message its informational
2) ESP8266 talks at two rates 74880 when it is booting, it the switches to 115200 (or maybe another I'm not sure)
3) the 1 or 3 refers to the boot source i.e. reset pin, the 6 refers to where it is now, 6 means it is waiting for upload so it wont be able to communicate via serial. this is documented on github esp8266 boot causes

with my boards, to get them going I had to download esp_iot_sdk_v1.4.0 from espressif then flash using espressif flash tool
the files needed are blank.bin, boot_v1.4(b1).bin, esp_init_data_default.bin and user1.1024.new.2.bin
I placed them at offsets 0XFE000, 0X00000, 0XFC000 and 0X01000 respectively
next step flash the esp (with it in boot loader mode)
next make sure the esp is NOT in boot loader mode but is connected to your FTDI board
start Arduino serial monitor in either 74880 or 15200 Baud
if in 74880 you should see the 8266 information followed by a short line of gobbledegook
if in 15200 you should see a lot of gobbledegook followed by Ready if this happens you can input AT commands
one further note about Sparkfun thing, the board is shipped with a trace shorting a jumper, sparkfun say you need to cut the trace and fit a jumper if you are using certain terminals BUT if you do not cut the trace, fit the jumper and make sure its off BEFORE you boot after uploading V1.4.0 then the board will only talk at 74880 Baud and you will see the message ets Jan 8 2013,rst cause:2, boot mode:(1,6) or (3,6) at this point its waiting for upload and so cannot communicate by serial port
I hope this helps someone, it is the result of a lot of frustration and searching the internet for information