So after I’ve received my ESP8266 I’ve built a support protoboard with pin headers for serial connection, Voltage Shifter (used one for I2C voltage shifting), a LM317 voltage regulator (The board uses an external power source) and a reset button so that I can simply reset the esp8266 easily. I’ve also put the GPIO0 and GPIO2 pins available on pin headers, mainly so that I can short the GPIO0 to Ground if I needed to update the firmware, and of course, I glad I did this…
After some tinkering around I came across these page for firmware update using the interner/cloud:
With the following AT command: AT+GMR I’ve determined that my version was 0018000902-AI03, and supposedly it supports the Cloud update.
Also as far the documentation is saying, there is no need for the GPIO0 pin to be grounded to do the firmware upgrade, so I wrote the dreaded command: AT+CIUPDATE after I did the basics, namely connected to an access point and with available internet connection (no mid path proxys).
The upgraded started, but not at it is shown in the above link. For example it shows the command execution something like: +CIUPDATE:1 found server but all I’ve got was +CIUPDATE:1 and +CIUPDATE:2 and so on and no OK at the end. Just garbage…
At this point I though that the ESP8266 was bricked… because I always got garbage despite of configuring my terminal with several different baud rates, including the baud rate 76800 that according to some sources (well google…) it is the default boot loader baud rate. But I had no success and so I thought it was bricked.
Well that is not exactly the case because we can flash a new firmware using the old procedure of tying the GPIO to ground while the ESP8266 is directly connected to the computer via FTDI.
Please note that these instructions are for Linux:
So what is need is the esptool.py available here: https://github.com/themadinventor/esptool/blob/master/esptool.py
and the latest firmware available here: https://drive.google.com/folderview?id=0B3dUKfqzZnlwR2pVWjg3NXRVdW8&usp=drive_web&tid=0B3dUKfqzZnlwRjFaNTUzZFptbzg#list
Download and unzip the firmware file at the same directory where the esptool.py is located.
I’ve tried both firmwares: ESP8266_AT_V00180902_02_baudrate watchdog added.zip and ESP8266_AT_V00180902_04 (0018000902-AI03)_unconfirm version.bin, and kept this last one, the original that my board came with. With both firmwares the cloud update, at least with me fails.
So with GPIO pin grounded, power up the ESP8266, and execute the following command for uploading the 0018000902-AI03 firmware:
./esptool.py -p /dev/ttyUSB0 write_flash 0x000000 ESP8266_AT_V00180902_040018000902-AI03_unconfirm_version.bin
Where /dev/ttyUSB0 is my FTDI usb port. Some times when trying to flash I had the following error (While I was in the Cloud update testing cycle):
Connecting... Traceback (most recent call last): File "./esptool.py", line 353, in esp.connect() File "./esptool.py", line 138, in connect raise Exception('Failed to connect') Exception: Failed to connect
where the esptool.py failed to connect. But pressing my (handy) reset button, and trying again solved the issue.
As the firmware is uploading we can see the progress of flash erasing and then the firmware upload progress. At the end something like this shows up:
Connecting... Erasing flash... Writing at 0x0007ec00... (100 %)Leaving...
Now power off, by disconnecting the USB cable and the external power source to the ESP8266, disconnect the GPI0 pin, so now it floats (not connected to anything) and power up again.
The ESP8266 should be functional again at baud rate 9600.
At the end I’m still unable to do a firmware cloud update…
Hope this helps