loading

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.

  • 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 3: 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

  • 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

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

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

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...

<p>Anyone happen to know if these would be compatible with Wink home automation hub?</p>
<p>Those of you who are having the problem &quot;Failed to Connect&quot; just make sure:</p><p>1. GPIO 0 --&gt; GND</p><p>2. Use external 3.3V source to power ESP</p><p>3. Make common GND between Arduino and ESP power source (this is most important) </p>
<p>I tried all these steps, yet i got &quot;Failed to Connect&quot;</p>
<p>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.</p>
<p>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.</p>
<p>what is .bin file for esp8266 flashing and how to dwn it ,pls help me</p>
Thanks man, i have been spendig days without finding a solution!
<p>I was having the same problem,I solved this by changed usb to ttl from Figure 1 to Figure 2. </p>
<p>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.</p>
<p>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.</p><p> Next is the firmware file is itself corrupt.you need to download the AT firmware file from github.com. </p><p>Also check the esp8266 temperature regularly.If the temperature is exceeded due to excess of voltage the esp can get internally damage.</p><p>There are fake esp8266 01 modules available in market be careful. </p>
<p>Hi NavalJ ,I am also stuck in same error plz share what did you find.</p>
Let me know how your are powering the esp8266 first and the other connections too
<p>Hi,</p><p>I have just started learning ESP8266-01 module. </p><p>Is it necessary to flash the 8266 module before programming it with any code to use it for some purpose ?</p><p>OR</p><p>Does it it come pre-flashed and we can start programming it with our own code without the need of flashing ?</p>
By default it comes with AT firmware.There is no need to flash new firmware.
<p>Hi thanks Ravi,</p><p>Got that. So then how and when a re-flash is needed for ESP8266. Is that when the chip corrupts or freezes or what ?</p>
<p>Hi, I'm stuck with trying to communicate with my esp8266 -01.</p><p>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.. </p>
how are u powering esp8266?make sure you do not power from laptop nor arduino .use an external power supply and then try.
<p>ah perfect!! that worked! thank you.</p>
<p>Hey.. I always get &quot;invalid head of packet&quot; on 6%.. what to do? &sup2;</p>
<p>I had this issue. Swapped USB cords and got to 100%.</p>
<p>Try some other esp8266 firmware .it looks like the firmware that you are trying to put is corrupt </p>
I'm using fimware recommended for you
<p>Kindly check the power. provided to ESP-01</p>
<p>Hi EliasA5 - I get the very same problem. If you find a solution, it will be very much appreciated if you share it.</p>
<p>Hi Ranip, I found a soluction. I using the esptool <br>(https://github.com/themadinventor/esptool) . First I changed the line <br>44 to &quot;ESP_RAM_BLOCK = 0x180&quot; and changed the line 45 for or to &quot;ESP_FLASH_BLOCK = 0x40&quot; (<a href="https://github.com/themadinventor/esptool" rel="nofollow">esptool</a>/<strong>esptool.py</strong>).</p><p>Firmwares ----&gt; <a href="http://bbs.espressif.com/viewforum.php?f=46" rel="nofollow"> http://bbs.espressif.com/viewforum.php?f=46</a></p><p>I have a esp01</p>
<p>Thank you Elias for sharing your opinion.</p>
<p>Great guide!</p><p>[SOLVED] To all the people having &quot;Failed to connect&quot;, this is how I solved it.</p><p>My setup:</p><p>1) os: OSX El Capitan</p><p>2) esp: ESP8266-01</p><p>3) Arduino Uno: DCCDuino clone</p><p>4) flasher: esptool.py</p><p>5) connections:</p><p>ESP---&gt;Arduino</p><p>GND(-): GND</p><p>GPIO0: GND</p><p>EN(CH_PD): 3.3v</p><p>VCC(+): 3.3v</p><p>TX: TX</p><p>RX: RX</p><p>This was failing, so the solution was:</p><p>Add 1000mf capacitor between + and -, and that's it!</p><p>Hope it helps, I spent more than a day 100% on this, and finally got it working thanks to the above..</p><p>cheers</p>
<p>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.<br></p>
<p>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.<br><br>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</p>
<p>Thank you berlingozzo for sharing it.</p>
<p>Hi, can you draw the scheme of your setup, because i'm new in this...</p><p>And, what capacitor voltage do you use...?</p><p>Thanks..</p>
<p>Thank you for such a nice Tutorial :) !<br><br>Yeah I worked for me. and solved the following Issues:</p><p><strong>1- My ESP-01</strong> <em>(Black PCB 1024k)</em> was printing garbage on serial monitor. But after re-flashing that problem is gone !. and the <strong>BAUD rate restored to 9600</strong>.<br><strong>2-</strong> 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)</p><p><strong>3-</strong> Error occur right after resting the Module &quot;ets Jan 8 2013,rst cause:2, boot mode:(3,6)&quot; also gone. </p><p>Thank you once again :) !</p>
<p>it*</p>
<p>Please help me in following :</p><p>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, </p><p>I have tried to add pull up resister of 3k between 3.3v and ch_pd pin, but still it disconnects my arduino.</p>
<p>Kindly post the picture of the schematic you used.<br>Try these :</p><p>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) .<br>The Continuous/ fast blinking Blue LED should stop.<br>the problem will not go until you re-flash it. (worked for me!).</p>
<p>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 &quot;nodemcu_float_0.9.6-dev_20150704&quot;. In Lua Loader I get a page of this gibberish when uploading a file to the esp. In esplorer I get this &quot;Can't autodetect firmware, because proper answer not received. Please, reset module or continue manually...&quot; 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.</p><p>Thanks</p>
<p>Please Help resolve this error</p>
<p>Have you solved your problem? I have same issue.</p>
<p>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 </p>
<p>Hello Experts <br><br>We<br> have been struggling to execute application on ESP8266 and I tried all the flashing procedure mentioned above but no luck and <br>our esp8266-01 is resetting again &amp; again with watchdog reset error<br><br>wdt reset<br>load 0x4010f000, len 1264, room 16<br>tail 0<br>chksum 0x42<br>csum 0x42<br>~ld<br> Setup don start<br><br>We have been using below schematic for the connection and here is the part number.<br><br><strong>ESP8266 01 wifi transreciver </strong></p>D-SUN &quot;USB to TTL&quot; (Blue)<p>We are connecting 2 pencil cells to supply 3.3V to ESP8266. is that correct ? what should be the current ?</p><p>Please advice how to proceed further.</p>
<p>getting error: FILE=&quot;init.lua&quot; file.remove(FILE) file.open(FILE,&quot;w+&quot;) uart.setup(0,9600,8,0,1,0)</p><p>file.close();</p><p>Error</p>
<p>while uploading the code to ESP using Esplorer I get the error stating: &quot;waiting answer from ESP &ndash; timeout reached,send abort.&quot;.. how to solve it?</p>
How did you connect the esp? Have you grounded esp gpio 0?
Yes I grounded the Gpio0 pin
<p>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?</p>
<p>Here is the link for firmware : <a href="https://github.com/espressif/ESP8266_AT" style="">https://github.com/espressif/ESP8266_AT</a></p>
<p>How have you connected the esp module?</p>
<p>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. </p>
<p>Remove the tx and rx pin of esp from arduino during uploading.</p><p>You can program esp 8266 with three methods .one is using AT commands other is node mcu firmware and last is with arduino itself. </p><p>1.)if you like to use esp as standalone then use arduino ide to flash the sketch in esp </p><p>2.)if you want to use arduino and esp together ,you have two choices AT and node mcu ,i prefer node mcu as it is easy to write and understand.</p><p>if you know any another method feel free to share :)</p>
<p>Can you tell me if using Arduino needs any special firmware preflashed to ESP or does it do it in-setu while writing the sketch? I am not sure, but does Arduino need NodeMCU firmware to be present to work? Or does Arduino compiles to the sketch to native executable for ESP (in which case probably no need to install separate development tools since using Aurido we can compile C files also stand alone or part of sketch, right?)</p>

About This Instructable

474,078views

133favorites

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 »
More by RaviP6:Diy Bench power supply(single channel) Persistence Of Vision Esp8266 firmware update 
Add instructable to: