I have an AI Thinker ESP32-CAM and I've had issues uploading the CameraWebServer sketch, every time I hit upload it says "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header" and I've tried everything that I can think of, I disconnected and reconnected all the connections on my FTDI board and I've done all sorts of button presses during the connection, I've switched the voltage and I've bought a whole new board and I don't know what the issue is or how to fix it.

  • Did you connect IO0 to Ground?
    – StarCat
    Jul 7, 2020 at 6:15

2 Answers 2


ESP32 only works with 3.3 V serial do not switch the FTDI voltage to 5 V

Watch out for the serial connections too



If you mixed it up it won't work!

First of all you need to connect two pins only when uploading It is all ready fixed for you need to press the rest button when uploading and seeing these dots as below image.

  • ESP32-CAM on-board RST button Press and hold until you see uploading

Uploading image view

After a few seconds, the code should be successfully uploaded to your board.

I hope this helped for you!

You can reffer to this link for more info


  • 1
    Good info about ESP32. In addition, I think some confusion comes from the ESP32-CAM, which does have +5V option. And you have to ground GPIO0 in order to program that board. But other than that they are very similar. Again, this comment and link applies to ESP32-CAM, as the original question asked about. randomnerdtutorials.com/program-upload-code-esp32-cam
    – hellork
    Dec 2, 2022 at 8:45

I have had the same problem / error message with a different board. I did not realise that during upload you must make sure that any GPIO pins that the board uses to talk to the flash chip are NOT connected to other devices. The upload process should be:

  1. Disconnect any GPIO pin connectors.
  2. Upload your code.
  3. Reconnect any GPIO pin connectors.

(In your question, you say "I disconnected and reconnected all the connections" but you do not say whether all your connections were disconnected while you were trying to upload your code.)

I found this information here (the text in that post says "This message normally means that the ESP32 can't talk to its attached flash chip (the flash chip may be in the module). Check the GPIO pins 6,7,8,9,10 & 11 (which are shared with the flash chip) are not connected to anything external or shorted together, etc.")


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.