ESP32 Camera: Failed uploading: uploading error: exit status 2

I am getting this error when trying to upload code for the esp32 camera, note that I uploaded code once to the camera before. I changed the wires but nothing changed, also I tried pressing the reset button when I got reconnecting and also tried disconnecting and then connecting the 5V wire. I am uploading the code using the arduino uno. please can anyone help with this? Thanks!

I moved your topic to an appropriate forum category @mok02.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

I only use the MB board so I can upload over USB.

Hi @mok02.

Please provide a precise and detailed description of the exact connections you have made between the Uno and the ESP32 Camera.

The UDR(receiver) on the esp32 is connected to the Tx on the Arduino UNO
The UDT(transmitter) on the esp32 is connected to the Rx on the Arduino UNO
The 5V on the esp32 is connected to the 5V on the Arduino UNO
The GND next to the 5V on the esp32 is connected to the GND next to the 5V on the Arduino UNO
The Reset pin on the Arduino UNO is connected to the GND on the Arduino UNO next 13 Digital pin
IO0 on the esp32 is connected to the GND pin next to it on the esp32

I tried flipping the transmitter/receiver and also another connections but this is the one that I was able to upload to the camera once before

I would suggest to collect the following adapter (Fig-1: ESP32-CAM-MB) to program the ESP32-CAM directly fom Arduino IDE.
image
Figure-1:

Unintuitively, this is wrong.

The reason is that the purpose of this circuit is to connect the USB to serial bridge chip on the UNO (e.g., ATmega16U2) to the ESP32. The labels on the pins on the UNO are in relation to the pins on its primary ATmega328P microcontroller chip, not the USB to serial bridge chip. The bridge chip has an RX-TX, TX-RX connection to the ATmega328P, so the pin labeled "RX" on the UNO is actually connected to the TX pin on the bridge chip, and the pin labeled "TX" on the UNO is connected to the RX pin on the bridge chip.

So in order to make a RX-TX, TX-RX connection between the bridge chip and the ESP32, you must make connections between the pins that are labeled as described in this table:

UNO ESP32-CAM
RX U0R
TX U0T

Other than that, the other connections are correct.


However, I should warn you that connecting the RX pin of the UNO directly to the U0R pin on the ESP32-CAM is not a great idea. The ESP32 runs at 3.3 V (there is a voltage regulator on the board that reduces the 5 V input from the 5 V pin to 3.3 V before feeding it to the ESP32) so you should really only subject the GPIO pins to 3.3 V maximum. The UNO runs at 5 V and so the signals transmitted from the USB to serial bridge chip use 5 V logic levels. So you are subjecting the U0R pin of the ESP32 to 5 V, which is above its maximum rating:

https://docs.espressif.com/projects/esp-faq/en/latest/hardware-related/hardware-design.html#what-is-the-voltage-tolerance-of-gpios-of-esp-chips

What is the voltage tolerance of GPIOs of ESP chips?

The voltage tolerance of GPIO is 3.6 V. If the voltage exceeds 3.6 V, please add a voltage divider to protect GPIO pins from damage.

Maybe you can get away with 5 V, but it is also possible you could do permanent physical damage to the ESP32.