D1 mini esp8266 error: esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
I'm not sure if this will help EVERYONE, but I hope it at least helps someone.  I had the same issue with several different boards (3 Nano's, 2 NodeMCU ESP8266's, and 1 Uno).  I searched and searched for an answer and I kept reading about this pin or that pin being &quot;pulled low&quot; or &quot;pulled hi&quot; interfering with uploading sketches.  Well, since I couldn't find a solid answer anywhere I decided to disconnect all of the peripherals hooked to my board (except for powers and grounds) and Wah Laa!!!  The sketch uploaded like it was supposed to.  So, I believe if you just unhook all of the sending and receiving pins from all of your peripherals during upload, the sketch should upload just fine.  I hope this helps you.