Dear Mr. Rui.
I have been trying your ESP32-CAM Tutorial continuously for almost last 2 Months. I did exactly same wiring and followed all steps exactly as given in the tutorial.
Suspecting the problem in the board, I also changed the board but every time I am getting the same error / message.
The screen shot of the error message is given below for your reference. Due to this repeated failure I am totally disappointed. Can you please help me to resolve this issue for ever.
I am not Able to insert the image. Please let me know how to do that.
How ever the text message is as below:
\"a fatal error occurred :Failed to Connect to ESP32: Timed out waiting for packet header Sketch uses 2233502 bytes (71%) of program storage space. Maximum is 3145728 bytes.Global variables use 50692 bytes (15%) of dynamic memory, leaving 276988 bytes for local variables. Maximum is 327680 bytes.esptool.py v2.6-beta1Serial port COM7 Connecting........_____....._____....._____....._____....._____....._____....._____ A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header Invalid library found in C:\\Users\\APTE\\Documents\\Arduino\\libraries\\audioutils: no headers files (.h) found in C:\\Users\\APTE\\Documents\\Arduino\\libraries\\audioutilsInvalid library found in C:\\Users\\APTE\\Documents\\Arduino\\libraries\\colorutils: no headers files (.h) found in
Hello Dattatraya, thank you for following our ESP32-CAM projects:
- ESP32-CAM Video Streaming and Face Recognition with Arduino IDE
- ESP32-CAM Video Streaming Web Server
This means that when you try to upload a new sketch to your ESP32-CAM, the Arduino IDE fails to connect to your board, and you get the following error message:
"Failed to connect to ESP32: Timed out waiting for packet header"
At the moment, I can’t reproduce that error on my end… But it basically means:
- Wrong wiring (TX and RX swapped)
- ESP not in flashing mode (GPIO 0 not connected to GND, and you didn’t restart the board before trying to upload a new sketch)
- Not enough power (your ESP32-CAM crashes)
I’ve tried the ESP32-CAM sketches with multiple boards and it always worked for me, but that happens if you don’t follow the exact instructions or don’t have enough power reaching your board.
I’m currently trying to put together a comprehensive ESP32-CAM troubleshooting guide that should be available in a week or so…
Regards,
Rui
Dear Mr. Rui.
Thank you very much for your prompt response. You might have seen it is showing following message alos –
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header Invalid library found in C:\\Users\\APTE\\Documents\\Arduino\\libraries\\audioutils: no headers files (.h) found in C:\\Users\\APTE\\Documents\\Arduino\\libraries\\audioutilsInvalid library found in C:\\Users\\APTE\\Documents\\Arduino\\libraries\\colorutils: no headers files (.h) found in"
1. What will be the reason for this ?
2. Can you please send me the link for proper library.
3. it should be #include “esp_camera.h” or #include <esp_camera.h>.
4. I observed that “esp_camera.h” is not appearing in my entire list of library. Where this will be present ?
5. Is it required to power the board with 5 V ? and where this 5 V is to be connected (Should it be to VCC – near to UOR Pin?)
Waiting for your reply
With Worm Regards
D. V. Apte
Baroda – Gujarat State- India
Hello again! I understand that this issue is frustrating and many readers are experiencing it, but did you read my full answer above?
When you try to upload a new sketch to your ESP32-CAM, the Arduino IDE fails to connect to your board, and you get the following error message:
“Failed to connect to ESP32: Timed out waiting for packet header”
I can’t reproduce that error on my end… But it basically means:
- Wrong wiring (TX and RX swapped)
- ESP not in flashing mode (GPIO 0 not connected to GND, and you didn’t restart the board before trying to upload a new sketch)
- Not enough power (your ESP32-CAM crashes)
The libraries are properly installed and the sketch is also correct. The problem is in your hardware and that’s why you can’t upload the sketch.
Can you try to power your board with 5V? In the 5V pin and repeat the process?
Sir,
I have read your Tutorial and replies very carefully 2-3 times. I also tried with separate 5 V Supply ( By making Arduino and external power source ground common) but the error is the same.
I’m not sure then… It can be a small mistake that you are doing or it’s simply a problem with your ESP32-CAM. Unfortunately I can’t replicate that error on my end, so I’m not sure what’s happening…
Mr. Rui I am very happy to inform you that after my struggle for around 2 months I have resolved this issue and could load the program and see the video on browser and mobile. Here I would like to share my experience as below –
I am using FTDI programmer to program ESP CAM. In your tutorial you have shown that the vcc pin of FTDI Should be connected to 3.3V Pin of ESP CAM. but I could get the reasult when I connected the VCC Pin of FTDI to the vin / 5 V pin of the ESP CAM.
Can you please explain me why this has happened.
With Worm Regards
D. V. Apte
Baroda – India.
Thanks for letting me know, I’ll be updating the post soon to include those debugging information. In my case, it always works at 3.3V and it’s safer for the ESP32-CAM pins, but for some reason som programmers don’t supply enough current in the 3.3V pin and it gives that error.
Thanks for letting me know what worked for you!