Esp32cam Failed to connect to ESP32: Timed out waiting for packet header
Solution 1
This was solved by using other jumpers. It seems one of the jumpers used in the wiring was faulty.
If you're having the same issue and tried everything in this post, try checking your cables!
Solution 2
Pre-requisites for flashing:
- ArduinoIDE 1.8.12
- Core ESP32 1.04 (at time of writing)
- Select board AI Thinker Cam
- uplooad speed 921600
- freq 240Mhz
- flashfreq 80Mhz
- mode QIO if not working try DIO
- partition scheme default
- Serial monitor is closed
- NO hardware connected to the pins of the ESPcam
- Make sure the USB cable is a data cable and NO loading cable only
- check Windows device manager if programmer is shown and has max speed / 8n1 hardware
Connections
FTDI - ESP32
GND GND
5V 5V
TXD UOR
RXD UOT
If you use an AIThinker Cam clone you have to ground GIPO 0:
- connect GPIO 0 with a dupont wire connected to GND
- press reset
- compile and upload (use AI THINKER CAM)
- optional:
- press reset
- upload filesystem data (SPIFFS)
- disconnect GPIO 0 and GND
- press reset
- code should execute
And yes you have to do it every upload, on my dev board I soldered a little switch with proper isolation
Some more solutions from experience:
- If there is still a problem use a 10K (or so) pull-down resistor between RX0 and GND (test on breadboard before soldering)
- Pressing and holding (!) the boot-button while uploading on some "bad" boards
- Happened with a "normal" ESP32 board to me - just to be sure - I got an ESP8266 in an ESP32 packaging. Configuring for the ESP8266 solved the issue of uploading.
Solution 3
I have delved for a solution in this regard for weeks and it seems I have a solution.
Findings-
- FTDI module is probably faulty or not supported for each instance.
- Aithinker Board is not compatible with esspressif (use ESP32Wrover, more details below )
I have an esp32cam from Esspressif, not Aithinker.
I was trying with FT232rl , No matter what Voltage/jumpers/USB cable I used, it didn't work. Always stuck with fatal timed out error.
After many futile attempts with FTDI breakout, I gave my Arduino UNO a try (please note my UNO has mega16u2 chip as USB serial chip (top right corner just beside the oscillator) and fortunately it worked.
I have read that CP2102 is also working.
**Here are the steps to follow-**
Arduino ESP32Cam connections
3.3 Arduino --------- 3v Esp32CAM GND Arduino ------------ GND Esp32CAM RESET Arduino to Ardunio GND RX Arduino -------------- VOR Esp32CAM (this is not a mistake RX to rx & TX to tx) TX Arduino -------------- VOT Esp32CAM GPIO 0(zero)(written as IO0) Esp32CAM to GND Esp32CAM
I didn't have any need to press the reset button in any part of the operation before & during uploading.
I am assuming You have pre-installed the esp32 board manager.
Now select the correct COM port where your Uno (in this case) is plugged in.
Select the correct board as mentioned
Tools>Board>ESP32 Arduino > select ESP32 Wrover Module
Some uploading setups are to be Done (Under Tools, these will only appear when the Wrover module is selected )
Upload speed -- 115200 Flash Frequency -- 40Mhz Flash Mode -- QIO Partition Scheme --- Huge App Port ---- select the right com port for your breakout or UNO
JUST press upload and relax
After a while, you will be able to see this message
Leaving...
Hard resetting via RTS pin...
- Disconnect the Esp32Cam GPIO 0 and GND
- Power the ESP32Cam with 5/3v with external power supply (Arduino or other breakouts may not be able unless you are connected with a Powered USB Hub)
- keep TX, RX, & GND of the 2 boards connected, don't disconnect Arduino Reset and GND.
- Press Reset on ESPCAM and open Serial monitor and you will be able to see the IP address of the cam if it was configured with your wifi correctly.OR get any network scanner App on android or windows.
I hope it helped.
Solution 4
In my case I forgot to remove the SD card. Other users recommended removing unnecessary connections to the pins-- and the SD card technically uses some of those :)
![PetCheetah](https://i.stack.imgur.com/7Rh2E.jpg?s=256&g=1)
PetCheetah
Updated on June 04, 2022Comments
-
PetCheetah about 2 years
I've just recieved my very first esp32cam (AI THINKER) today and I was excited to test it, but I'm unable to upload any code to it. I'm always getting the following error:
Failed to connect to ESP32: Timed out waiting for packet header
So, the FTDI I'm using is the FT232r with the following wiring scheme
How I reproduce this error:
- Plug everything
- Order IDE to upload the sketch
- Wait for the "connecting" text
- Press the RST button
Also:
- Plug everything
- Press the RST button
- Order IDE to upload the sketch
I've already tried:
- Switching to 3.3v (plugged on 3.3v pin)
- Using external 5v power supply (plugged on 5v pin)
- Using another computer
- Swapping RX TX
- Trying in different upload speeds
- Holding RST button
- Switching board between ESP32 Wrover Module and AI Thinker ESP32
I'm I doing something wrong or there's just something faulty?
-
PetCheetah about 4 yearsI'm already connecting GPIO 0 to GND. I'll follow step by step and see if I get any advance.
-
Codebreaker007 about 4 yearsSee my complete checklist - if nothing of these steps works asume your board DOA
-
PetCheetah about 4 yearsNothing worked. It's time to assume she'd dead.. Thanks for the help
-
Richard Král over 3 yearsIf during uploading tx led on Uno doesnt shine press reset button on esp32 again Do it every time when it snuffs out