What does "Failed to connect to ESP32" mean and how do I fix it?

This message usually means your computer can see the ESP32 serial port, but the ESP32 did not enter the bootloader when the upload started.

Quick fixes (try in this order)

  1. Use a known good data USB cable. Charge-only cables are extremely common.
  2. Select the right port. In Arduino IDE, go to Tools > Port and pick the one that appears when the ESP32 is plugged in.
  3. Unplug and replug the board, then try upload again.
  4. Close Serial Monitor and any other app using the port.

Manual bootloader mode (most common solution)

Many ESP32 boards require you to press the BOOT button at the start of an upload.

  1. Click Upload in Arduino IDE.
  2. When it says "Connecting..." press and hold BOOT.
  3. Release BOOT when the upload actually starts (you will see progress).

If your board has an EN or RST button, tapping it right before upload can also help.

Driver and USB chip issues

ESP32 boards often use USB chips like CP2102, CH340, or CH9102. If the port does not show up reliably, install the correct driver for your board.

Avoid wiring that blocks boot

If you have sensors or modules connected, disconnect them for the first upload. Some pins can prevent boot if they are held high or low at reset.

Bottom line

Most "Failed to connect to ESP32" errors are fixed by selecting the correct port and using the BOOT button during upload. Start with the cable and port, then try manual bootloader mode.

Related: How do I select the correct board and port in Arduino IDE? · Why can't I upload code? · Why won't my board show up in COM ports?