Hello to all.
Excited to receive two esp32 cam modules even though they weren’t marked AI-thinker as advertised but looked similar.
Made connections as per instructions via dfrobot ftdi adaptor using 5V connections, Tx to Rx and Rx to Tx.
Compile completed ok.
Pressed reset button, flash light came on while pressing button but…
Upload failed due to “fatal error occurred - failed to connect to esp32…”
Tried powering the esp32 with separate battery with no change.
Has anyone found a solution?
Thanks in anticipation,
Stephen
Hi Stephen,
This post seems similar ESP32 CAM Camera not Recognized
Of note further down in the comms where the “ESP32 CAM Camera not Recognized” error was resolved:
Appears to be drawing around 230mA @5V0 while streaming.
Hi Stephen
In addition to using 5V0 supply the other thing to do, if your code is not already doing this, is to disable the brownout detector on the ESP32. There is a good guide to this at
Espressif also provide some detailed programming information on their ESP32 processor at
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/index.html
John
Thanks John, will give that a go.
Stephen
Hi John. I included the lines to disable brownout but it had no effect.
Below is the print showing the error message.
Arduino: 1.8.19 (Windows 10), Board: “AI Thinker ESP32-CAM, 240MHz (WiFi/BT), QIO, 80MHz”
Sketch uses 222733 bytes (7%) of program storage space. Maximum is 3145728 bytes.
Global variables use 16128 bytes (4%) of dynamic memory, leaving 311552 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.1
Serial port COM3
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
Also 1: I noticed a couple of variations from the Random Nerd Tutorials pic online -
i.e. their version of esptool.py has … v2.6-betal tacked on the end ??
Also 2: Pushing the RST button during upload turns on the flash light on the ESP32 CAM board, on-one has mentioned this in any instructions, is this unique for my boards ?
Also 3: Are the Core Elec boards I bought truly AI-Thinker boards ?
Am I using the correct board designation in Arduino ?
My Arduino download is very recent.
There MUST be a solution to this !!
Stephen.
Thanks John, will give that a go.
Stephen
Hi Stephen,
I see John is crafting a message, and given I haven’t dived into these modules myself I look forward to see that conversation unfold.
But regarding your concern:
Yes, they are AI-Thinker SIPs, built into modules.
Hi Stephen
Board is the ESP32 AI Thinker Cam.
Camera model is also AI Thinker
#define CAMERA_MODEL_AI_THINKER
With regard to the upload, you need to have Pin 0 connected to ground during the upload. After the upload is complete, remove this ground connection and reboot.
Hi Stephen,
Just wanted to double-check a few gotchas with ESP boards that I ran into.
- Is the COM port the same one that pops up in the device manager?
- Ensuring that the ESP is in programming mode(@John76682 is spot on regarding jumping pin 0 to ground)
I’d also check out Diego’s project where he used one of these boards: ESP32 IR-Triggered Camera with Home Assistant Integration - Tutorial Australia
Was this issue affecting both ESP-CAM boards?
In regards to the extra output from the tutorial you were following it looks like a beta release was being used.
Liam
OK, here’s where I am.
I have attached a pic of the TOOLS dropdown showing the Board: and Port: values
I am using a separate 5V samsung power supply connected to the 5V and GND pins of the ESP.
I have the FTDI earthed to the ESP as well.
I have IO O grounded.
I have been following the RandomNerd Tutorial with the following title.
In it he tests the connections with a simple arduino blank code. - if it uploads then he moves on.
How to Program / Upload Code to ESP32-CAM AI-Thinker (Arduino IDE)
I cannot get it to go any further as I keep getting the fatal error message.
and Liam, yes I get the fatal error on both of the DFRobot boards.
I have been working through a tutorial with the ESP32 board and have been uploading successfully.
That’s what’s got me puzzled ???
Stephen
I recently bought an ESP WROOM 32 and it uploaded fine for weeks. Then - out of the blue - it started giving me the same upload error. I found a site that told me to hold the Reset button down and that worked fine.
I also found this one that said to install a small capacitor between the END pin and GND. I haven’t done this yet but will before I go to my final version:
[SOLVED] Failed to connect to ESP32: Timed out waiting for packet header | Random Nerd Tutorials.
Hi Stephen,
This one sounds very odd, we’ll work on getting a system set up on our end with some instructions on getting the ESP-CAM flashed.
David also had a very good method of flashing a similar ESP32 module in this topic: FireBeetle ESP32-E IoT Microcontroller with header (Supports Wi-Fi & Bluetooth) (DFR0654-F) - #3 by Liam120347
Here’s a link to his website and guide: My First IoThing | dfoley.ie - David Foley's home on the WWW
We’ll let you know how our testing goes!
Liam
Sorry “EN” pin and GND. Maybe my typo or some “brain” in the chain though there should be a D at the end.
Have you tried pressing the reset button on the ESP32 - When the upload attempt first starts & before it times out?
I find this works for me when FTDI uploads fail.
Once you get going, I suggest you swap to OTA [over the air] updates and bypass the FTDI cable connection upload - though you will still need the FTDI serial connection for debugging via a third party serial monitor - I use Tera Term.
Other than that I agree with Liam, that you need to check that the ESP32 is trying to connect to the correct COM port in the PC.
By the way, anyone wanting to get OTA working on the AI Thinker Cam is going to need to modify the boards.txt file in their Arduino files.
A good explanation of to do this, that helped me is at
Hi Brian
Probably the smart (it thinks) auto complete thing in the forum struck again.
Cheers Bob
Hi Brian, I’ve tried holding the RST button till my finger ached, to no avail.
Randon Nerd has posted numerous instructions to solve ESP32 issues and I’ve worked through the CAM relevant ones.
Also, I cannot find a pinout showing the EN for the CAM board.
Stephen.
John,
As I mentioned to Brian, I’ve been pressing the button, Momentarily, Long Press, Press before Upload, Press throughout, all that happens is the flash light on the board comes on while the button is pressed.
The COM Port matches that shown in Device Mgr., Arduino detects that automatically when opened.
OTA is deeper than I’ve dived with ESP32, at the moment I’d be happy to just blink an LED.
Stephen.
Stephen
I see you have your serial connection at 921600. I use 115200.
Maybe try a lower baud rate on the serial line and see if that helps.
John
PS Maybe no - Just checked my upload speed - it is 921600 also - 115200 for serial coms.
But maybe try a lower upload speed anyway.
Also This may sound silly - but you do have TX → RX & RX → TX?
I take it from your posts that you don’t yet have even Blink running?
Hi Brian,
I managed to get one working on our end.
To connect the board for flashing, a 5v 2A supply was connected to the 5V and the ground from the power supply to that pin
In the software setup for Arduino I started by installing the ESP32-WROOM drivers (Thats the chip fearured inside the AI-thinker module)
Files > Perferences > Then in the additional boards add ‘https://dl.espressif.com/dl/package_esp32_index.json’
Then head over to 'Tools > Board > Board Manager, and search ‘esp’
When setting up the settings in boards I selected the following:
Make sure that the COM port matches your programmer, device manager is the fastest way to check(for future readers this wont always be COM3!).
Before programming I checked all of the connections were there, notably Pin0 and GND were shorted.
I pressed tapped reset (as long as Pin0 at this point is shorted the ESP chip will enter the programming mode, you wont have to hold or press it again).
Then uploaded the code through Arduino(I just tested the Blink sketch - Pin 33 is the LED).
Once the code has uploaded you have to remove the Pin0 jumpers and press the reset button again.
Let us know how you go!
Liam.
Hi Liam,
I’ve done exactly what you said with no change.
I lowered the upload speed as per John, with no change.
The FTDI Tx LED blinks steadily, I assume it’s trying to send to the CAM but there’s no-one home except the Fatal Error.
Just to rest my mind, I connected a ESP32 board with type = DOIT ESP32 DEVKIT V1,
this took the upload immediately with only USB power and the blue LED is blinking happily.
No-one mentioned the flash light LED coming on when I press the RES button, is that normal ??
Sorry I have no good news,
What next?
Stephen.