to: all -
I am running the Arduino IDE from Ubuntu 18 Linux
In the past (one week ago and before that) I could upload any sketch to an ESP8266 NodeMCU and (with the same usb cable) to a Wemos D1 mini, and the sketch would run. No problems. No problems with all other boards in my collection.
What is happening now a couple of days is that uploading to a NodeMCU is OK, while attempts to upload to the same Wemos D1 mini (and other D1 minis) produces the error message: "esptool.FatalError; failed to connect to ESP8233: Timed out waiting for packet header.'
If I unplug the Wemos D1 mini, replug the NodeMCU and upload the same sketch - no problem.
Uploading the same sketch with the same Wemos D1 mini and using the same cable - from a Windows 10 system: no problem.
Obviously there is a communication (serial port?) problem between the Linux machine that exists only with my dear Wemos D1 minis and not with NodeMCUs. I am uploading to Arduino Unos, Nanos and ESP32's from the same port, no problem, only Wemos D1 mini.
No, I don't change the board type. Both NodeMCU 8266 and Wemos D1 mini 8266 did perfectly well with the board 'NodeMCU 1.0 (ESP-12E Module"
Port under Linux is is /dev/tty/USB0, under Windows COM5
Trying to upload to the Wemos D1 mini does not work (any more) with any of my D1 mini board fleet in the Board Manager. Actually, I can't upload to D1 minis any more with my Linux machine, very strange because uploading to my nodeMCUs is completely unaffected, same port, same parameters in the IDE under Tools.
On my Windows machine the same NodeMCUs and Wemos D1 minis upload and function normally.
Maybe I should uninstall and reisntall Arduino on the Linux machine.
It looks like a driver problem to me. I have NodeMCU with chip CP2102 but Wemos D1 mini is with CH340G. This would explain your problem. I can't think of anything else and I am a not familiar with Linux.