ESP 8266 timed out waiting for packet header

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 ?

I wish the fix were that simple! I tried using the laptop on its own and got same fail result.

Today I added a 100nF capacitor between supply & ground, and rewired the RST with a 10k resistor to pull it up. Still same result, its like either the module doesn't go into flash mode (I have a big switch to ground, and I checked that too), or it does but the packets are only recognised sometimes (and not recently for me). This is driving me nuts!

Github has issue listed as well (Fatal Error Failed to connect to ESP8266: Timed out waiting for packet header (ESPTOOL-183) · Issue #490 · espressif/esptool · GitHub) .

Minor success, yesterday I detached everything from the laptop, booted, plugged in the serial connector and ESP8266-01S, and not only updated the firmware loaded a sketch as well. On 2 seperate 01S boards. Secret is to release the ground connection to GPIO0 soon after the triple blue flash at ESP boot. previously I'd left it grounded as I had many times before.

So, thought I'd do the same again today with a ESP8266-01, reflashed the firmware to v3.0.3 with everything connected on docking station, but the sketch wouldn't load with IDE, same issue as before the esptool is failing to connect. Tried rebooting pc off dock and got the same result, interestingly the firmware flasher wouldn't connect either. So I've no idea what's going on.

Windows 10
esptool is v2.8 (tried 2.5, 2.6, 2.7)
IDE 1.8.12
Espressif firmware tool v3.6.8

Today, i found solution for my configuration

Win10
IDE Arduino 1.8.12

1°) Close your IDE Arduino
2°) locate esp8266 folder - normaly located at C:\Users\Manu\AppData\Local\Arduino15\packages
3°) delete folder named "esp8266"
4°) restart IDE Arduino and install esp8266 board - Tools>Board>Board Manager
5°) search "esp8266" board and install version "2.6.0" - version 2.6.2 not working for me
6°) compile and upload you code - It work's :wink:

I hope, it can help you

Manu

Fighting with uploading to a bare ESP-12 the last days after changing the 1k:2k2 voltage divider on the Rx pin.
Flashing with an Uno with blank sketch loaded.
ESP8266 v2.6.3

Tried 10k:22k, 4k7:10k, 470ohm with clamping diode to 3.3volt, straight with clamping diode to 3.3volt.
Nothing worked, except for that 1k:2k2 divider.

Not sure yet what causes it, but the Rx pin of the ESP seems to need a specific load to work.
Leo..

Finally discovered my problem yesterday, a dry joint in the connection of my switch to ground, so when I held it a certain way, it worked, else it didn’t.

Frustrating as I’d checked the switch, but when checking ground to GPIO I duscovered it wasn’t being pulled down. Fixed the joint, IDE 1.8.12 and ESP 2.6.3 works after reboot and multiple times.

Lesson to self, check the circuit not the component!

I had the same problem (Connecting............................_____...) when uploading a sketch to NodeMCU. That was after i upgraded boards from 2.5.0 to 2.6.3.

The solution (A 10 uF capacitor between Enable and Ground) solved the issue. See allso: [SOLVED] Failed to connect to ESP32: Timed out waiting for packet header | Random Nerd Tutorials

The strange thing i observed, is that since i uploaded onetime a sketch succesfull, the problem is solved. That is, i can now upload normal without the capacitor between enable and ground. Maybe afterall it was an cable connection issue.

I get a different error:
esptool.py v2.8
Serial port COM5
Connecting…
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 18:fe:34:f2:6c:08
Uploading stub…
Running stub…
Stub running…
Configuring flash size…
Auto-detected Flash size: 1MB
Compressed 281920 bytes to 205388…

Writing at 0x00000000… (7 %)
Writing at 0x00004000… (15 %)
Writing at 0x00008000… (23 %)
Writing at 0x0000c000… (30 %)
Writing at 0x00010000… (38 %)
Writing at 0x00014000… (46 %)Traceback (most recent call last):
File “C:\Users\warner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3/tools/upload.py”, line 65, in
esptool.main(cmdline)
File “C:/Users/warner/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py”, line 2938, in main
operation_func(esp, args)
File “C:/Users/warner/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py”, line 2374, in write_flash
esp.flash_defl_block(block, seq, timeout=DEFAULT_TIMEOUT * ratio * 2)
File “C:/Users/warner/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py”, line 104, in inner
return func(*args, **kwargs)
File “C:/Users/warner/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py”, line 672, in flash_defl_block
self.ESP_FLASH_DEFL_DATA, struct.pack(’<IIII’, len(data), seq, 0, 0) + data, self.checksum(data), timeout=timeout)
File “C:/Users/warner/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py”, line 369, in check_command
val, data = self.command(op, data, chk, timeout=timeout)
File “C:/Users/warner/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py”, line 347, in command
p = self.read()
File “C:/Users/warner/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py”, line 292, in read
return next(self._slip_reader)
File “C:/Users/warner/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py”, line 2045, in slip_reader
raise FatalError(“Timed out waiting for packet %s” % waiting_for)
esptool.FatalError: Timed out waiting for packet header
esptool.FatalError: Timed out waiting for packet header

I try to program a ESP01 on a programmer with a FTDI232 board (a DIY by my friend, which worked in the past).
I tried 2 ESP01’s and both stop now at the same point. When I tried a brand-new ESP it programmed ok but the program gave only crashes in the serial window at 74880 baud.
I tried to set uploadspeed to 57600 but same result.

I run W10, Arduino 1.8.12, ESP8266 community version 2.6.3
Edit:
I succesfully programmed a ESP12 with the same adapter/USBserialprint so I think that is not the problem…

I am having the same problem with a Wemos D1. I tried all the solutions I found on the internet and none of them had any effect. Any help?

Uploading 252080 bytes from C: \ Users \ silvi \ AppData \ Local \ Temp \ arduino_build_165664 / Blink.ino.bin to flash at 0x00000000
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command (FLASH_DOWNLOAD_BEGIN) failed
error: espcomm_upload_mem failed

cnuma:
Today, i found solution for my configuration

Win10
IDE Arduino 1.8.12

1°) Close your IDE Arduino
2°) locate esp8266 folder - normaly located at C:\Users\Manu\AppData\Local\Arduino15\packages
3°) delete folder named "esp8266"
4°) restart IDE Arduino and install esp8266 board - Tools>Board>Board Manager
5°) search "esp8266" board and install version "2.6.0" - version 2.6.2 not working for me
6°) compile and upload you code - It work's :wink:

I hope, it can help you

Manu

Thanks a lot Manu, it works perfectly.
No need to press RST or BOOT/FLASH button.

I got the same problem in my nodemcu esp8266. That was because i have plugged a wire to D4 pin while the code was uploading. once i removed it, the code got uploaded successfully

I have the same problem, I have a nodemcu 1.0 that was working fine until i tried OTA. That worked fine and I put it away, now when i plug it into USB it’s dead. No port no nothing.

Is the IDE maybe bugged?

Ive spent the whole day to no avail, reinstall all libraries and the IDE over 20 times each, tried all these suggesttions yet nothing. My IDE doesnt even open without me having to fully delete all files including those in AppData when I reinstal, then as soon as I close the IDE same story, wont open.