ESP 8266 timed out waiting for packet header

Hi, may I know what is the cause of esp8266 timing out waiting for packet header? I just ran blink on it and it did not seem to work. Any help is greatly appreciated

The error message are as shown below:

Arduino: 1.8.9 (Windows 7), Board: “Generic ESP8266 Module, 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), ck, 26 MHz, 40MHz, DOUT (compatible), 512K (no SPIFFS), 2, nonos-sdk 2.2.1 (legacy), v2 Lower Memory, Disabled, None, Only Sketch, 115200”

Sketch uses 257696 bytes (51%) of program storage space. Maximum is 499696 bytes.
Global variables use 26572 bytes (32%) of dynamic memory, leaving 55348 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.6
2.6
esptool.py v2.6
Serial port COM5
Connecting……____Traceback (most recent call last):
File “C:\Users\Ong\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/upload.py”, line 25, in
esptool.main(fakeargs)
File “C:/Users/Ong/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py”, line 2653, in main
esp.connect(args.before)
File “C:/Users/Ong/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py”, line 468, in connect
raise FatalError(‘Failed to connect to %s: %s’ % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

_

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

2 Likes

Are you sure the drivers of your board are correctly installed?
There is a smal chip on the ESP board that converts from usb to uart. without drivers you can´t upload the code ...
What ESP8266 board are you using?

With the Arduino IDE open and the ESP8286 disconnected, note the serial ports, connect the ESP8286 note the serial ports, did they change?

Did you try holding down the EN button, after selecting to upload the code and release the EN button after the connection has been made?

Have you uploaded code to other devices with the USB cable you are using?

After looking at the schematics of the ESP32, I use a powered USB hub between the ESP32 and the computer. If you look at the ESP8286 schematic, you will see that 5V, of the ESP, is a straight shot into your PC. You may eventually find that to put more then 5V onto the USB line to your PC may cause damage. With a powered hub, I do not need to press the EN button to upload code to the ESP32 and, when I frack up, the frack up is sent to the powered USB hub and not onto the PC's USB power rail.

Make sure that you have all the cable connections correct.
I got the same error when i had the data cable connected to NodeMCU's D8, but the code accidentally reading from D2. Changed it and everything worked fine again.

"Connecting......................................____"

I see this error if I forget to plug in the USB, or have the wrong port selected.

Hi

I have the same issues with an ESP8285 (TYWE2S chip)…
I can flash the same code to an ESP8266 without any issues.

Everyting is wired up correctly, I checked the voltage, everything.

Does anyone have an idea? Thank you very much in advance.

Best regards.

Sebastian

esptool.py v2.8
Serial port COM10
Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
  File "C:\Users\Seb\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.1/tools/upload.py", line 69, in <module>
    esptool.main(cmdline)
  File "C:/Users/Seb/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.1/tools/esptool\esptool.py", line 2890, in main
    esp.connect(args.before)
  File "C:/Users/Seb/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.1/tools/esptool\esptool.py", line 483, in connect
    raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
_

I had the same issue today. I wanted to update a code I wrote for a generic ESP 8266 last year. I do not have a programmer so I work though Arduino Uno board. Last year this procedure worked seamlessly, today I struggled to make it work. I use the esp8266 by ESP8266 Community drivers. The last version (2.6.3 at time of writing) gave me a compile error with python3 symbolic link. The downgrade to version 2.5.2 enabled to compile the code successfully, but timed out waiting for packet header appeared.

I finally solved by downgrading the board drivers to version 2.5.0. I hope this help as reference. Do not update your board drivers until strict necessary.

I had exactly this just now. I had just upgraded and found the flashing was broken on a setup I'd been using a while. The downgrade of the esp8266 drivers fixed it. Thanks.

What a bummer. If they are going to sell this stuff to us lemmings, the very least they could do is make it work without days spent googling for answers and finding nothing much useful mostly.

2 Likes

A 10mf cap between enable and ground might help some having this issue.

I got the same problem but could at least solve this one by removing the external power source while uploading code, i got the very fricked ps from my pcs usb, its enough to upload but no more and used a ps to supply the esp, remove the external ps and it at least uploads the code

Solved the same issue, well it solves itself with a second attempt.

  1. Ensure serial monitor is closed.
  2. Reset board in flash mode.
  3. Hit upload and accept that it will fail the first time.
  4. Hit upload again and it works.

I have experienced the same problem with ESP8266 01 and ESP8266 201, and for both, the second attempt to upload works every time.

1 Like

Awesome! This solved my problem, David_O_Donovan. You've saved the day, thanks!!!!

8 members with only 1 post - how unusual.

check out the port
see whether esp is connected or not
and make sure to download proper library as my problem was solved by changing the library.

ESP8266-01 or ESP8266-03 can’t upload from IDE any sketch anymore.

System: Linux Debian Buster 10
IDE: arduino-1.8.12 and arduino-PR-beta1.9-BUILD-117
Board Manager:
– ESP8266 Comunity version 2.6.3 INSTALLED Don’t work
Downgrade to lower versions also Don’t work

this setup was working few days ago perfectly.

Testing with:
1-Generic ESP8266 module for the ESP8266-01
2-Sparkfunk ESP8266 thing for the ESP8266-03

Using TTL to USB and also Using Arduino uno for the serial transfer.

Pings for Programming mode are set correctly:
ESP8266-1,ESP8266-3 needs GPIO 0 to GND for Programming mode.

serial port is selected correctly
TTL blue led blinking during connection and upload

however i get this error:

“Connecting……____”

esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
_
the selected serial port _
does not exist or your board is not connected

Warning: file /home/yoo/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 links to an absolute path /usr/bin/python3


This was working before. I just needed to start the upload and short after that power on the board. This recognized the packet header Connecting…_____… stops and the upload continue and finish correctly.

Any ideas way now don’t work anymore?

Thanks to all

yoosamui:
– ESP8266 Comunity version 2.6.3 INSTALLED Don’t work
Downgrade to lower versions also Don’t work

Even with ESP8266 Comunity version 2.5.0 does not work? What did you update last time? I was on Windows 7, Arduino IDE 1.8.9 and I powered the ESP before the upload.

I'm in the same boat. My esp-12 is setup with a manual upload button, hold + tap reset to put into programming mode. The 8266 works fine and watching the serial monitor tells me whether it booted into the sketch or programming mode. Upload from 2.5.0 works using the command esptool

/Users/riley/Library/Arduino15/packages/esp8266/tools/esptool/2.5.0-3-20ed2b9/esptool -vv -cd ck -cb 115200 -cp /dev/cu.usbmodemFA13141 -ca 0x0 -cz 0x400000 -ca 0x00000 -cf /var/folders/xh/n5zy5nxd7y90sny04qn508fw0000gn/T/arduino_build_837131/BasicOTA.ino.bin

2.5.1 and later however, fail when using the command upload.py

/Users/riley/Library/Arduino15/packages/esp8266/tools/python/3.7.2-post1/python /Users/riley/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/upload.py --chip esp8266 --port /dev/cu.usbmodemFA13141 --baud 115200 --trace erase_flash --end --chip esp8266 --port /dev/cu.usbmodemFA13141 --baud 115200 --trace write_flash 0x0 /var/folders/xh/n5zy5nxd7y90sny04qn508fw0000gn/T/arduino_build_837131/BasicOTA.ino.bin --end

Unfortunately the project I'm working on requires 2.5.2 for ssl and these bare 8266-12 modules for their serial ports...

Anybody know how to bring back esptool or fix upload.py?

Here's a workaround for MacOS. I copied esptool from a 2.5.0 install into the sketch folder

/Users/riley/Library/Arduino15/packages/esp8266/tools/esptool/2.5.0-3-20ed2b9/esptool

and created a file called flash.sh consisting of

#!/bin/bash

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd "${DIR}"

./esptool -vv -cd none -cb 115200 -cp /dev/cu.usbmodemFA13141 -ca 0x0 -cz 0x400000 -ca 0x00000 -cf ./*.bin

The 3rd & 4th lines change the working directory to the current location, the 5th invokes esptool and feeds it whatever .bin file is found

Use is fairly simple once you've upgraded the esp8266 libraries to 2.6.3 (or whatever). Copy the 2.5.0 esptool and flash.sh into your sketch folder, use "export compiled binary" from the tools menu, then double click on flash.sh.

/dev/usbmodemFA13141 will of course need to be whatever usb port you're using.

I had this error and it was unpredictable. I found that if I unhook every wire except the usb, then it would work.
A pain in the rear I admit but whatcha gonna do ?