A fatal esptool.py error occurred: failed to connect to esp8266: timed out waiting for packet header,

Hello, I have a error:

a fatal esptool.py error occurred: failed to connect to esp8266: timed out waiting for packet header

I've tried a few things, but still nothing:

  • disnonnect all wires,
  • installing an older version of ESP8266,
  • 10uF capacitor between Enable (EN) and GND,
  • installing the CP210X driver,
  • uploading Blink,
  • changing the board to Olimex MOD-WiFi-ESP8266 (-DEV),
  • GPIO15 to GND,
  • RESET to GND,
  • GPIO0 to GND.

Settings:

Board: NodeMCU 1.0 (ESP-12E Module)
Builtin Led: 2
Upload Speed: 115200
CPU Frequency: 80Mhz
Flash size: 4MB (...)
Debug port: Disabled
Debug level: None
IwIP Variant: v2 Lower Memory
VTables: Flash

(More in images)

Do you know any other ways to make it work?

Bit per second: 9600

GPIO 0 should be pulled LOW, though a nodeMCU should do this automatically, Reset should stay HIGH, and again the nodeMCU will do an automated reset.
GPIO15 is pulled down or the board won't work, (also on the board already) Basically you should not have to connect anything special to make it work, and anything that you do connect to any of these pins (+ TX & GPIO 2) may disturb the upload process.

Please show us a picture of the board you have and a link to where you got it from.

My module

Thank you for answer. Link: https://allegro.pl/oferta/modul-wifi-z-esp8266-lolin-nodemcu-v3-13887057475

almost the same as the ones i have (just different color for the capacitors, but same size)

Mine has a CH340G as a USB to TTL, the CP210X driver is not relevant, but the CH340 driver should be automatically installed. Are there any unknown USB devices in the device manager ?

That is the proper board to select.

Personally i am on 2.7.4,(for reasons of compiled binary size) but there are no known issues with the 3.x.x with this board.

So my best advice is,

  • make sure that the COM port shows up in the IDE (open the IDE, and plug in the nodeMCU, and the new port that shows up is the correct one)
  • Leave all settings for the board at their default value
  • Disconnect anyhing other than the USB cable
  • try another USB cable.

If there is no success, the possibility exist that your board has a malfunction.

I've tried everything but still nothing

Do you have another board ?

I have other boards, But not NodeMCU. (But I have wifi module and Arduino Nano).

Maybe it could be programmed differently or the board needs more power?

I also noticed that the board only works with one cable. When I connect with a different cable, the LED only lights up once.

I also checked the voltage on VIN and 3V, but everything seems to be fine.

USB power should be easily enough, and it is not a programming error, the program compiles just fine, but the the upload fails. It could be that the incorrect boot-mode is selected.
I think you probably tried it already, but connect GPIO 0 to GND and only then plug in the USB cable ( i was going to suggest hold down boot button after successful compile, but this is better.)
Maybe the CH340 is broken, or maybe the ESP, hard to say and doesn't matter much. I have no other advice.

I have the same problem with one of my boards (one works and the other doesn't).
I noticed that the one that doesn't work is missing some components on the board.

Is their absence causing the error?

1 Like

Oh that's not good ! that looks like a resonator and 2 trimming capacitors. Like that the USB to TTL bridge probably doesn't work.

You may be able to program that unit through the Serial pins, but not through the USB port i guess, the same way you can program an ESP-01. For practicality's sake you could upload a sketch that supports OTA updates and update it like that there after.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.