I can't upload code to my ESP32 using an arduino UNO R3

Hi, so I was trying to upload code to my AI thinker ESP32 cam using an arduino uno as a bridge but for some reason it doesnt work AT ALL, and the reason i didnt just use a USB-TTL board is because i forgot and im not waiting for shipment, so i followed several tutorials and asked several AI bots but nothing gave me a solution, i dont know what im doing wrong in these connections:
Arduino GND -----> ESP32 GND

Arduino 5V ------> ESP32 5V

Arduino GND ------> Arduino RST

ESP32 GND -------> IO0

ESP32 UOT -------> Arduino pin 1

ESP32 UOR --------> voltage divider ------> Arduino pin 0

and my voltage divider setup is:

Arduino GND ------> 2 1K resistors -----> Arduino pin 0 -------> 1k resistor ------> ESP32 UOR

so i tried several things, 1: tried switching switching pin 1 and pin 0 with each other because i noticed that when i didnt cross the communication pins the ESP32 was printing stuff in the serial terminal from the previous code i uploaded which i THINK isnt supposed to happen, and yes i uploaded code using this way beffore but for some reason it doesnt work now, also crosssing the pins did stop the serial terminal from printing stuff but it didnt work. 2: i tried multimeter testing my voltage divider and i noticed that when i crossed my communcation pins the UOR pin on the esp recieved 0.15v, while when didnt cross them the pin recieved 2.9v-3.05v , and the voltage divider is working since when i removed the GND from the divider circuit the pin went up to 4.7v and when i kept the gnd and removed the arduino pin 0 the UOR went down to 0. 3: the UOT pin was measured at 3.2-3.3v so i think its working fine. 4: i checked the GND to RSt connection and the uno's LEd does blink a bit when i short them together, same with the GND to IO0 connection since i said earlier the esp was printing stuff in the serial monitor when i connected UOR to pin 0 and UOT to pin, so when i connected the GND to IO0 and pressed RST on the esp is printer out this :
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download

5:i tried crossing the communication pins and they DID stop printing out stuff in the serial monitor but it didnt work still.

So what could be causing this problem? and if there is another easier way to upload code to the ESP32 WITHOUT using a USB-TTL board pls tell me

Hi @omareldeeb.

I'm not sure I understood correctly what you mean by "doesn't work". Please provide a more detailed description of what you mean in a reply on this forum topic to help us to understand it.

Make sure to include the following information:

  • What did you do?
  • What were the results you expected from doing that thing?
  • What were the results you observed that did not match your expectations?

If you encountered any errors or warnings, please provide the full and exact text of those messages.

It is expected that you will see the output from the sketch in Serial Monitor. So that was actually proof you had the connections correct. Change the connections back to how you had them originally:

oh yeah srry forgot to mention exactly what it does, so the esp32 is powered up and getting power normally, but when i try to upload stuff using the setup i mentioned it prints out this:

Sketch uses 999553 bytes (31%) of program storage space. Maximum is 3145728 bytes.
Global variables use 58752 bytes (17%) of dynamic memory, leaving 268928 bytes for local variables. Maximum is 327680 bytes.
esptool v5.3.1
Serial port COM5:
Connecting......................................

A fatal error occurred: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool latest documentation
Failed uploading: uploading error: exit status 2

uhhm you know what i will just get a USB-TTL, i was just extremly impatient cause i didnt want to wait for shipment, im getting this one

Just to make sure you understand. You are using the UNO 's USB to TTL converter and disabling the Atmega328p, so it should be RX <-> RX and TX <-> TX

So as far as i can tell, nothing. (although i would have aimed the arrows in the opposite direction when describing the voltage divider, but for the connection that doesn't matter at all.

Yes that is supposed to happen, and confirms that at least the TX line is working as it should.

I actually just have a version of BLINK running on an UNO while i use it as a USB to TTL converter and don't reset the UNO continuously, That works perfectly.

Perfect, it is in the right mode.

There is a good chance that the UNO's USB to TTL converter can not handle the default upload speed of the ESP32, which is set to 912600 bps, which is quite high and not perfectly aligned for a 16MHz clock, try lowering it to 115200
(Tools -> Upload Speed)

That is my best bet !
Also (this popped in my head just now) make sure the Serial monitor is closed while you attempt the upload !

There is OTA uploads, but it still requires you to upload sketch supporting that Over The Air Upload handling (and WiFi connections) initially so that doesn't help you now.

Please for future reference show the exact board you are using, The exact board settings you are using, ESP32 Arduino core version, and maybe a picture of your UNO. A genuine UNO uses an Atmega 16u2 as a USB to TTL converter, but many clones use cheaper solutions like a CH340

I'm a bit nervous about that one. I have an adapter that looks exactly like this. Mine has the PL2303HXA chip. In response to this chip being counterfeited, the manufacturer Prolific changed their Windows driver so that the chip could no longer be used:

There are newer models of the PL2303 that are supported, so this is not to say that all PL2303 chips are unusable. Certainly if you purchase a product with a PL2303 from a reputable source you will be certain to get something working. But there is less certainty when buying a suspiciously cheap item from a random seller on an online marketplace. That said, Amazon has a very strict system of enforcing customer satisfaction on sellers, which makes it less viable to sell problematic products like the PL2303HXA-based adapter I have. So maybe you will be OK. However, I did just find a listing for an adapter like this on Amazon and it says "PL2303HX".

If I was to buy an adapter from a random seller on an online marketplace, I would go for one with the FTDI FT232R chip, like this:

The CH340 is also generally a good bet for a USB to serial bridge chip. We have had some problems with bad CH340 chips over the last few years, but I did a shopping spree of buying the most sketchy looking products on Amazon specifically trying to get one of the bad chips, and all the products I received had good chips. So maybe the people selling the bad CH340 are avoiding Amazon and instead selling on other marketplaces which aren't so strict about enforcing customer satisfaction on sellers.

Regardless of which chip your adapter uses, I do recommend you get one which uses the standard "FTDI header" pinout:

  • DTR or RTS
  • RX
  • TX
  • VCC
  • CTS
  • GND

That will allow you to plug the adapter right in to boards that use this standard pinout such as the Arduino Pro Mini. If you get an adapter with a non-standard pinout, you would need to use a mess of jumper wires to adapt it to the standard pinout. Some adapters don't even break out the DTR or RTS pin, without which you will need to manually reset the microcontroller at just the right time on every upload. The FT232R-based adapter in the picture I shared above has that standardized pinout. Unfortunately a lot of the adapters that use CH340 and other chips have a non-standard pinout.