Introduction: Esp8266 Firmware Update

Picture of Esp8266 Firmware Update

The ESP8266 module is a cheap Wireless module.It has SOC(system on chip) that can handle TCP protocols.By default, these modules come with an AT command processor and can act as a serial to WiFi bridge. There is lots of info on the web about this module.

I got 3 of the ESP8266 for my home automation project, initially the module was working perfect.

but accidently i uploaded wrong files and my esp8266 stopped working after then the serial port was giving me random garbage values,so i tried myself to solve this problem.

Step 1: Find an Esp8266 Flasher.

Picture of Find an Esp8266 Flasher.
  • Download ESP flasher from this link http://www.xess.com/blog/esp8266-reflash/
  • The ESP flasher is easy software to put firmware on to the Esp SOC.
  • Make sure you download write bin file (this bin files are firmware files of different version )

Step 2: Find Proper ESP8266 Firmware Files or Bin Files.

Picture of Find Proper ESP8266 Firmware Files or Bin Files.

Step 3: Connecting ESP to Flash Mode

Picture of Connecting ESP to Flash Mode
  1. ESP 8266-01 module


I connected esp directly to tx and rx of Arduino .Connect Esp RX to Arduino Rx and esp TX to Arduino TX, the module works on 3.3v logic according to documentation but I had no issue with 5v rx and tx of arduino ,play it at your own risk .you can use simple voltage divider to cutdown 5v to 3.3 v .I am not going into details of connection now .

The esp module goes into flash mode by making GPIO 0 ground

2. Esp 8266-12 module

I found daflabs instructables best for this module so far

https://www.instructables.com/id/Getting-Started-with-the-ESP8266-ESP-12/

I used Arduino instead of cp2102 module, and I had no issue in communication.

The connection will remain mostly same for esp8266-12 to run it in flash mode.

GPIO0 -> LOW

GPIO2 -> HIGH

GPIO15 -> LOW

YOU can upload any firmware to any of the Esp8266 module.

Step 4: Uploading Firmware

Picture of Uploading Firmware
  • Browse the bin file or firmware version files, you want to upload to Esp 8266 module, then write the proper address .By default it is 0x000000 but I used 0x40000080 and also check the correct com port
  • Then just click download button ,if everything is fine the flasher will show you the status of download and also your esp 8266 module led will blink very fast.
  • In the end at 99% it will show some error but this is ok. Congratulation!!! .you have uploaded latest firmware to esp8266.
  • IT’s time to test your Esp module .now just remove GPIO 0 wire that was connected to GND ,you can connect it to VCC or leave it like this.
  • Now plug your Arduino back to pc and open serial port.
  • Open 9600 baud rate ,most of the esp works fine.on this baud rate .
  • NOW its time to test AT commands .enter "AT" in serial port and you will get "OK". Now enter "AT+GMR" and check the firmware version.

Step 5: Using Esp Flash Download Toll V0.9.3.1

Picture of Using Esp Flash Download Toll V0.9.3.1

There are two software to install the bin file on soc of esp8266 ,The second method is by using esp flash download .

1.)Download the software from the below link

http://bbs.espressif.com/viewtopic.php?t=25

2.)Now just browse the bin file you want to upload on esp and do not change any of the settings except the com port and change baud rate to 115200 and click on start .you will see an uploading status .Have some patience until it says finish.

Step 6: Program Esp Using Esplorer

Picture of Program Esp Using Esplorer

esplorer is a software specially made for esp8266 wifi module.you can upload lua code or AT commands on the esp8266 by using this software.

download this from the link given.

http://esp8266.ru/esplorer/

Step 7: Troubleshooting

Picture of Troubleshooting

1.)Power esp 8266 from external power supply .please avoid using arduino or computer for vcc.

2.)check the circuit thrice and always while uploading firmware try to manually reset esp8266 by making chpd gnd for some time and put it back to vcc .

3.)make sure you use either a buck or a 3.3 regulator. esp8266 needs constant current too.

4.)Note: http://www.allaboutcircuits.com/projects/update-the-firmware-in-your-esp8266-wi-fi-module/ another link that might help you to solve the problems with esp module.if non of the above

method works...

Comments

LorensW (author)2017-09-11

Hi fellow,

I have problem flashing nodemcu to esp-01 using arduino (empty skectch). Here is my configuration:

ESP8266 - Arduino

GND <-> GND (black)
VCC <-> 3.3v (red)
GPIO0 <-> GND (purple)
GPIO2 <-> 3.3v (orange)
CH_PD <-> 3.3v (pink)
TX <-> TX (via logic level shifter) (yellow)
RX <-> RX (green)

The esp module works normally in normal mode (Esp GIPO0 ->3.3v), i can run AT commands and connect to access point. But if change the GPIO0 to GND in flash mode, i get no response in serial terminal and also the esptool.py returns reponse time out.

Is anything wrong with my configuration? sorry i'm new to this, need your help. thank you.

Abhishek Basu (author)2016-12-24

Those of you who are having the problem "Failed to Connect" just make sure:

1. GPIO 0 --> GND

2. Use external 3.3V source to power ESP

3. Make common GND between Arduino and ESP power source (this is most important)

I tried all these steps, yet i got "Failed to Connect"

PaulA24 (author)Anusha Bharati2017-08-14

Hey!

I have got the same problem! Try to restart the ESP-module by unpluging the 3.3V pin and then plug it back! It worked for me all the times.If not, be sure that the COM port is closed, the voltage pin is unplugged and then repeat the steps from this tutorial.

bmiller91 (author)2017-05-13

Anyone happen to know if these would be compatible with Wink home automation hub?

Jatinder PalS (author)2017-04-09

I am using FTDI Basic, ESP8266 Breakout Board and ESP-01 module as shown in the Image below. I am able to flash firmware (4 files with ESP download tool and One bin file with ESP Flasher tool). But whenever I am trying to execute any AT command, ESP-01 doesn't even respond. I have tried changing baud rate from 9600 to 115200. but the result is same. Screenshot of ESPlorer is also attached. Can you please suggest some solution to it.

I got it rectified myself. Just sharing the solution here. I didn't use any external supply to esp8266. I just replaced the FTDI Basic with PL2303 moddule connected to ESP8266 Breakout board. I am connecting it to my laptop. I am able to flash Firmware successfully and now getting response of AT commands using ESPlorer.

MaignanamgnanavelM (author)2017-02-16

what is .bin file for esp8266 flashing and how to dwn it ,pls help me

PietroR4 made it! (author)2017-02-11

Thanks man, i have been spendig days without finding a solution!

YuthapongP made it! (author)2017-02-08

I was having the same problem,I solved this by changed usb to ttl from Figure 1 to Figure 2.

NavalJ (author)2016-09-24

Hi All, After Reading the Instructable and doing it on 2 diffrenet esp . I always end up with an unresponsive AT. I want to know the easist way to factory reset esp8266. So i can Send AT commsnds.

RaviP6 (author)NavalJ2016-11-30

Let me know how your are powering the esp8266 first and the other connections too.This is the first hurdle when you use the esp8266.

Next is the firmware file is itself corrupt.you need to download the AT firmware file from github.com.

Also check the esp8266 temperature regularly.If the temperature is exceeded due to excess of voltage the esp can get internally damage.

There are fake esp8266 01 modules available in market be careful.

UjjwalA7 (author)NavalJ2016-11-28

Hi NavalJ ,I am also stuck in same error plz share what did you find.

RaviP6 (author)UjjwalA72016-11-29

Let me know how your are powering the esp8266 first and the other connections too

Babar Latif (author)2016-11-06

Hi,

I have just started learning ESP8266-01 module.

Is it necessary to flash the 8266 module before programming it with any code to use it for some purpose ?

OR

Does it it come pre-flashed and we can start programming it with our own code without the need of flashing ?

RaviP6 (author)Babar Latif2016-11-06

By default it comes with AT firmware.There is no need to flash new firmware.

Babar Latif (author)RaviP62016-11-06

Hi thanks Ravi,

Got that. So then how and when a re-flash is needed for ESP8266. Is that when the chip corrupts or freezes or what ?

yumach (author)2016-10-08

Hi, I'm stuck with trying to communicate with my esp8266 -01.

Any ideas on what could be going wrong? I can't upload any lua code. I've followed the firmware flash and done it a few times. I feel like I'm missing something..

parmarravi (author)yumach2016-10-08

how are u powering esp8266?make sure you do not power from laptop nor arduino .use an external power supply and then try.

yumach (author)parmarravi2016-10-09

ah perfect!! that worked! thank you.

EliasA5 (author)2015-09-12

Hey.. I always get "invalid head of packet" on 6%.. what to do? ²

DeamonS (author)EliasA52016-09-19

I had this issue. Swapped USB cords and got to 100%.

RaviP6 (author)EliasA52015-09-13

Try some other esp8266 firmware .it looks like the firmware that you are trying to put is corrupt

EliasA5 (author)RaviP62015-09-13

I'm using fimware recommended for you

a1m918 (author)EliasA52016-08-29

Kindly check the power. provided to ESP-01

RaniP1 (author)EliasA52015-09-22

Hi EliasA5 - I get the very same problem. If you find a solution, it will be very much appreciated if you share it.

EliasA5 (author)RaniP12015-09-22

Hi Ranip, I found a soluction. I using the esptool
(https://github.com/themadinventor/esptool) . First I changed the line
44 to "ESP_RAM_BLOCK = 0x180" and changed the line 45 for or to "ESP_FLASH_BLOCK = 0x40" (esptool/esptool.py).

Firmwares ----> http://bbs.espressif.com/viewforum.php?f=46

I have a esp01

RaviP6 (author)EliasA52015-09-28

Thank you Elias for sharing your opinion.

berlingozzo (author)2016-01-06

Great guide!

[SOLVED] To all the people having "Failed to connect", this is how I solved it.

My setup:

1) os: OSX El Capitan

2) esp: ESP8266-01

3) Arduino Uno: DCCDuino clone

4) flasher: esptool.py

5) connections:

ESP--->Arduino

GND(-): GND

GPIO0: GND

EN(CH_PD): 3.3v

VCC(+): 3.3v

TX: TX

RX: RX

This was failing, so the solution was:

Add 1000mf capacitor between + and -, and that's it!

Hope it helps, I spent more than a day 100% on this, and finally got it working thanks to the above..

cheers

a1m918 (author)berlingozzo2016-08-29

I was having the same Issue,I solved this but by pressing the reset button 2 or 3 times (while holding the [PROG] button) when it tries to connect.

diy_bloke (author)berlingozzo2016-04-25

just to avoid some confusion, the Rx-Rx and Tx-Tx connection I presume is when you use arduino board to flash the software as connecting the Tx of ESP8266 to Tx of Arduino, is in fact connecting it to Rx of the USB interface.

Obviously if you want to have your ESP8266 work with yr Arduino, e.g. as a WiFi shield, you need to connect Rx-Tx and Tx-Rx

RaviP6 (author)berlingozzo2016-01-27

Thank you berlingozzo for sharing it.

JakaY (author)berlingozzo2016-01-13

Hi, can you draw the scheme of your setup, because i'm new in this...

And, what capacitor voltage do you use...?

Thanks..

a1m918 made it! (author)2016-08-29

Thank you for such a nice Tutorial :) !

Yeah I worked for me. and solved the following Issues:

1- My ESP-01(Black PCB 1024k) was printing garbage on serial monitor. But after re-flashing that problem is gone !. and the BAUD rate restored to 9600.
2- I was failing flashing again and again even I thought I bricked my module (The blue LED was blinking very fast even if there was no Rx and TX wires attached to USB-TTL converter)

3- Error occur right after resting the Module "ets Jan 8 2013,rst cause:2, boot mode:(3,6)" also gone.

Thank you once again :) !

a1m918 (author)a1m9182016-08-29

it*

HarshadB6 (author)2016-07-05

Please help me in following :

I have successfully upgraded firmware in my ESP8266-01, but after upgrading when I connect ch_pd to 3.3v it disconnects my arduino, and LED on uno starts blinking fast,

I have tried to add pull up resister of 3k between 3.3v and ch_pd pin, but still it disconnects my arduino.

a1m918 made it! (author)HarshadB62016-08-29

Kindly post the picture of the schematic you used.
Try these :

Disconnect RX and TX connections, GND, VCC (must be 3.3V) CH_PD(pull high),RESET(PULL HIGH) and press the RESET button 2 OR 3 times rapidly. circuit should be as following(image attached) .
The Continuous/ fast blinking Blue LED should stop.
the problem will not go until you re-flash it. (worked for me!).

JakeO11 (author)2016-04-25

I'm a complete beginner. I'm using a 201 module (also tried the 01 with the same issues) I flashed the newest firmware called "nodemcu_float_0.9.6-dev_20150704". In Lua Loader I get a page of this gibberish when uploading a file to the esp. In esplorer I get this "Can't autodetect firmware, because proper answer not received. Please, reset module or continue manually..." In case this is a situation with the firmware I also tried the stock firmware with ESP8266Flasher and also v0.9.2.2 AT Firmware. I followed the steps to cycle reset a few times but nothing works GPIO0 is indeed high, GPIO2 10k resistor high, GPIO15 10k to low, reset to high, CH_PD high, RX through a voltage divider. Any other clues? I've spent days trying to get this going.

Thanks

Muhammad faizanF made it! (author)2016-02-22

Please Help resolve this error

MadT2 (author)Muhammad faizanF2016-03-02

Have you solved your problem? I have same issue.

Akshay Jha (author)2016-02-17

I am done I have done all the steps as you mentioned but at last I am able to sent at commands using esplorer but I am unable to send any LUA file to esp it sends error after every line on right hand side of the software's window

SanjeevS11 made it! (author)2016-02-15

Hello Experts

We
have been struggling to execute application on ESP8266 and I tried all the flashing procedure mentioned above but no luck and
our esp8266-01 is resetting again & again with watchdog reset error

wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld
Setup don start

We have been using below schematic for the connection and here is the part number.

ESP8266 01 wifi transreciver

D-SUN "USB to TTL" (Blue)

We are connecting 2 pencil cells to supply 3.3V to ESP8266. is that correct ? what should be the current ?

Please advice how to proceed further.

SamitS1 (author)2016-02-14

getting error: FILE="init.lua" file.remove(FILE) file.open(FILE,"w+") uart.setup(0,9600,8,0,1,0)

file.close();

Error

SamitS1 (author)2016-02-13

while uploading the code to ESP using Esplorer I get the error stating: "waiting answer from ESP – timeout reached,send abort.".. how to solve it?

RaviP6 (author)SamitS12016-02-13

How did you connect the esp? Have you grounded esp gpio 0?

SamitS1 (author)RaviP62016-02-14

Yes I grounded the Gpio0 pin

Whatthedell (author)2016-02-05

I've already downloaded the firmware to esp8266. However, when I disconnect the gpio0 , the com port of the computer disappeared. Any AT command to esp8266 cannot get any response. Is there any solution to this problem?

RaviP6 (author)Whatthedell2016-02-11

Here is the link for firmware : https://github.com/espressif/ESP8266_AT

RaviP6 (author)RaviP62016-02-11

How have you connected the esp module?

hale_dm (author)2016-02-04

So if i dont update the firmware, i wont be able to run esp8266 with arduino codes? cause it works when i insert AT commands in serial monitor but when i write a code and upload it, it gives me garbage.

About This Instructable

516,860views

137favorites

License:

Bio: I am a Electronics and telecom graduate engineer and an enthusiastic embedded student with experience in latest technology and also an video and project documentation ... More »
Add instructable to: