Problems uploading to ESP32 Camera with Arduino IDE - SOLVED

Hello. Pulling hair out here trying to upload to an ESP32-CAM and could really do with some help...

I get the following error:

Sketch uses 693449 bytes (22%) of program storage space. Maximum is 3145728 bytes.
Global variables use 37536 bytes (11%) of dynamic memory, leaving 290144 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.2.1
Serial port COM6
Connecting...Traceback (most recent call last):

File "esptool.py", line 34, in
File "esptool_init_.py", line 1004, in main
File "esptool_init
.py", line 646, in main
File "esptool_init_.py", line 895, in get_default_connected_device
File "esptool\loader.py", line 631, in connect
File "esptool\loader.py", line 572, in _connect_attempt
File "esptool\loader.py", line 435, in sync
File "esptool\loader.py", line 365, in command
File "esptool\loader.py", line 317, in write
File "serial\serialwin32.py", line 325, in write
serial.serialutil.SerialTimeoutException: Write timeout
[18120] Failed to execute script 'esptool' due to unhandled exception!
An error occurred while uploading the sketch

The board is ESP32-CAM like the one here:

I have tried the following:

Uninstall/reinstall IDE
v1.8 and v2 IDEs
Different usb cables
Different PC and laptop
Buying another ESP32-CAM board
Uninstalling/reinstalling CH340 driver
Selecting generic ESP32 Dev board instead of AI Thinker ESP32-CAM board in the IDE
Praying

I have read upload baud rate could be an issue, but with the AI board selected the option to change speed vanishes from the menus.

Any help would be much appreciated

Thanks!

Welcome to the forum

Your topic was MOVED to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE

In case anyone has the same problem as me, I have got the camera working now....I removed the programming board and used an FTDI instead.

Not sure what the deal is with the programming board, but at least it's working.

If it is any consolation I can't program my ESP32CAM with the board either

I don' t see the RST and DTR transistor on the programming board, are they underneath?

This topic has reminded me to try again. Initially I had no luck but then I read the advice on ESP32Cam motherboard - ESP32 Forum
regarding different models of the ESP32CAM

I tried this

I can still use it with my other esp32cam modules but I have to hold the program button whilst connecting the USB to upload sketches

and I have successfully uploaded a sketch to the ESP32CAM

Note that the code will not run unless you remove the power and power the board up again after the upload and that you cannot upload 2 sketches in succession without removing the power and holding down the programming button whilst applying power again

The RST push button is probably just an off/on temporary switch but it should work.

Should work for what ?

There's nothing on the underside.

Have you tried the "hold the programming button down whilst connecting the USB" solution ?

Instead of connecting/disconnecting

That might work if you use the reset button on the camera, which is awkward to get to, but it does not work if you use the reset button on the "motherboard", which is not wired in parallel with the one on the camera

So the reset button on the programming board does not restart the cam board ?

That's correct, not sure what the RST button on the programming board does, nothing shows up on the serial monitor and it certainly doesn't reset the camera board.

I tried the trick having buttons pressed while plugging in the USB but no joy. Same with pressing them at various points during the uploading process.

You only need to hold the button marked IO0 whilst plugging in the USB, not both of them

What I have is a button on each board, both marked RST so I tried holding each while plugging in.

I did try shorting I00 to ground too while starting and programming, but nope.

Forget about the RST buttons

Does your camera "motherbaord" have a button like this ?
image
If so, that is the one to hold down whilst plugging in the USB

1 Like

OK, problem solved!

My "Otherboard" is different, and turns out to be a complete Friday afternoon job doomed never to work.

It only has one button, mislabled as RST but its intention was to be an "IO0" button as per your photo.

However, following the traces and buzzing it shows that one side of the button goes to ground and the other side of the button goes to, er, ground, Instead of GPIO 0:

The photo shows the trace going to that first pin, which corresponds to ground pin on the camera board, instead of the 3rd from top pin which would be GPIO0. The other side of the button also goes to ground.

The fact that me trying manually to short GPIO 0 to ground during startup failed also suggests something else is wrong with the board too, which would not be a surprise.

I shall be writing to the managing director of the manufacturer and expect him to take my complaint very seriously.

Thanks all for your help with this one!

I guess it's decorative...

Very helpful thank you I'll have to check that too I've had the same issues