I have tried to resolve the issues I’ve had attempting to upload code to an ESP32 Dev board off and on for over a year. I have followed your tutorials closely. A month ago I was finally able to upload, once. Since then I have not been able to. I have different errors during my attempts. After rebooting my PC I resolve one of them, but now I am facing the dreaded “A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header” error.
I have followed the instructions to press the boot button while the IDE is attempting the upload and it still fails. I have tried to use Atom and the PlatformIO and get the same error. It is very frustrating since I have so many projects planned that depend on using the ESP32. Can anyone suggest anything more? I can’t be the only Windows 10 user to have this issue.
OK, I have finally determined the root cause of my long struggle to upload to an ESP32. My last try was to buy a new ESP32 board from another supplier. It came today. I plugged it in and heard the sound that the PC recognized a new device, however when I looked in the device manager COM ports, it did not appear. I unplugged it and didn’t hear the disconnect sound. I plugged it back in and suddenly the PC started making the connect disconnect sounds continually. It made me think there might be a loose connection. So I traced the usb cord and found out that there were over four separate connections between the device and my PC. I was using a USB extension cable that was connected to a USB hub that I had connected a second USB extension cable connected to the cable connected to the device.
I plugged the ESP32 directly into the first USB extension and “ta da!” I am able to upload. So the whole time I was having issues was due to the number of USB connections in series between the ESP32 and my PC.
Hopefully this will help anyone else with the same problem with inconsistent error messages and connection issues.