Fatal erro ESP8266!

Hi, today I was compiling and uploading and everything worked fine until during a new upload I got this error message:

esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

I closed the Arduino program and restarted with a sketch that has worked ok before but had the same error message!

What is happening? What to do?


I tried a long shot, that is to close Arduino and restart restart my computer.
Surprise! It worked!


Having similar error with Wemos D1 Mini:" esptool.FatalError: Timed out waiting for packet header"

Running IDE 1.8.10, Windows7.

Need to confirm folder location of the drivers: CH341, esp8266, other USB drivers. Are they all located in C:\Users\Username\Documents\Arduino?

Or do I need to add them to other folders on C:/ ?

No drivers are required for the ESP8266 itself, just for the serial adapter.

The CH340G drivers are not included with Arduino - you need to download them separately. The arduino IDE is only bundled with drivers for serial adapters used on official boards; the CH340G is only used on clones and third party boards. Google your OS (and for mac, the version of the OS), CH340G and the word drivers.

Drivers are managed by your operating system - the copy of them bundled with the IDE for official boards is just needed if you use the non-installer package (the installer installs the drivers during the installation process), or do something to remove the drivers after installing the IDE. The IDE itself does not do anything with the drivers - it just uses the standard API provided by the OS to talk to serial ports (or, for devices that don’t project as a serial port, the USB device API).

If a serial port appears when you plug in the ESP8266 (check tools → port with the board not plugged in, then plug it in, closes tools menu and reopen it, and a new port should appear), and that’s the error you get, the drivers are already correctly installed (In almost all cases, if the drivers are not correctly installed, no serial port will appear - though a year or two ago, someone posted with a weirdo error, something with COM state, under windows, that was fixed by reinstalling the drivers). If a port does not appear, either the drivers are not installed, or the hardware is not working (be especially careful about damaged, defective, or charging-only cables - charging only cables are very common for cellphones and the like, and we’ve all experienced micro usb cables that we use to charge our phones getting unreliable over time)

That’s unfortunately a rather generic error; like the sync error on AVR-based boards, in practice it means “something is wrong, and it’s not the drivers” (there’s no way for the computer to figure out a more specific error - all it knows is it tried to talk to the board over serial, was able to open the serial port, but didn’t get the response it was expecting) - you’d get the same error if you removed the ESP8266 from the board entirely, just like you’d get the sync error if you cut an uno in half and threw away the half that doesn’t have the USB port on it. You’ll also get that error if you select the wrong port, or the wrong board, or have something connected to the serial pins, or the board is damaged.