From the workshop: Arduino Uno R3 Development Board (ATmega328P) With USB Cable

View product
All articles
Technology

🔌ESP32 Not Detected or No COM Port? Fix "Failed to connect to ESP32" (Windows, Mac, Linux)

ESP32 not detected, no COM port, or "Failed to connect to ESP32: No serial data received"? A quick checklist and flowchart: data cables, CP210x/CH340 drivers, the BOOT button trick, busy ports, power and damage tests.

TThinking Robot Team 13 min read
ESP32 DevKit board connected by USB with a Windows Device Manager COM port and a troubleshooting flowchart
In this article (18)

If your ESP32 is not detected, no COM port shows up in the Arduino IDE, or the upload stops with A fatal error occurred: Failed to connect to ESP32: No serial data received., don't worry. It is the most common problem students hit with a new ESP32 board, and it is rarely a dead board.

Direct answer: an ESP32 that is not detected on a COM port is nearly always caused by a charge-only USB cable, a missing USB-to-serial driver (CP210x or CH340), or the wrong port selected in the IDE. If the port appears but the upload fails with "Wrong boot mode detected" or "No serial data received", hold the BOOT button while the IDE shows "Connecting...". Work through the checklist below in order and most boards are fixed in five minutes.

Quick fix: ESP32 not detected checklist

Causes are ordered from most to least likely.

#Likely causeHow to confirmFix
1Charge-only or broken USB cableBoard LED lights, but Device Manager does not change when you plug inUse a known data cable
2Missing driverDevice under Other devices with a yellow !Install the CP210x or CH340 driver
3Wrong port or board in the IDETools → Port shows COM1, or nothing tickedSelect the port that appears when you plug in
4Not entering download modeWrong boot mode detected or No serial data receivedHold BOOT while "Connecting..." shows
5Port in useAccess is deniedClose Serial Monitor and other serial apps
6Wires on boot pinsUpload works only with your circuit unpluggedFree GPIO 0, 2 and 12 during upload
7Weak powerBrownout detector was triggered, or a USB hubPC port directly, short cable
8Damaged boardAll of the above fail, or a chip gets hot3V3 and loopback tests below, then replace

Flowchart: check the power LED, then Device Manager, then Ports (COM & LPT), then the upload; each "no" leads to the fixFollow the questions from the top. Most boards are fixed at the second or third box.

What do the ESP32 upload error messages mean?

Each message points to a different cause, so read the red lines near the end of the output. They come from esptool, the flashing tool the Arduino IDE runs for ESP32 boards (wording varies slightly between versions):

text
A fatal error occurred: Failed to connect to ESP32: No serial data received.
A fatal error occurred: Failed to connect to ESP32: Wrong boot mode detected (0x13)! The chip needs to be in download mode.
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
A fatal error occurred: Could not open COM5, the port is busy or doesn't exist.
(could not open port 'COM5': PermissionError(13, 'Access is denied.', None, 5))

Arduino IDE 2 then adds Failed uploading: uploading error: exit status 2, which only says the upload failed.

MessageWhat it meansGo to
No serial data received (older: Timed out waiting for packet header)The ESP32 never answeredCause 4, then cable and driver
Wrong boot mode detected (0x13)The chip started your old program instead of the bootloaderCause 4 (BOOT button)
PermissionError(13, 'Access is denied.'...)Another program has the port openCause 5
FileNotFoundError(2, ...) in the bracketsThat COM port no longer existsCause 3 (select the right port)
No COM port at all, Port menu greyed outWindows cannot talk to the boardCauses 1 and 2

Espressif's esptool troubleshooting guide lists these too.

Cause 1: a charge-only USB cable

A charge-only cable has only the two power wires, so the ESP32 lights up but the PC never sees it. This is the most common reason for "ESP32 COM port not showing"; many cables bundled with power banks and cheap chargers are built this way.

Cut-away of a USB data cable with VBUS, GND, D+ and D− wires next to a charge-only cable with only VBUS and GNDBoth cables power the board. Only the one with D+ and D− wires creates a COM port.

Confirm it: open Device Manager (Windows + X → Device Manager) and watch the list while you plug the ESP32 in. If nothing appears or refreshes, the PC sees no USB device at all.

Fix it: use a cable you know transfers files, plugged straight into the laptop or the back of the desktop (not a front-panel port or unpowered hub). Need a reliable one? Get a USB data cable that matches your board's connector (micro-USB or USB-C).

Cause 2: missing CP210x or CH340 driver (Windows)

On most DevKit boards a small USB-to-serial chip handles USB, not the ESP32, and Windows needs the right driver for that chip. Read its marking with your phone camera's zoom.

Top view of an ESP32 DevKit showing the USB-to-serial chip next to the USB connector, with cards for CP2102, CH340, CH9102 and native USB boardsThe marking on the small chip near the USB port tells you which driver you need.

Chip on the boardDevice Manager name when workingWindows driver
CP2102, CP2104Silicon Labs CP210x USB to UART Bridge (COMx)Silicon Labs CP210x VCP driver
CH340C, CH340G, CH340KUSB-SERIAL CH340 (COMx)WCH CH341SER driver
CH9102F, CH343A COM port (install WCH's CH343SER driver if it shows a yellow !)WCH CH343SER
None (ESP32-S3 / C3 native USB)USB Serial Device (COMx)Built into Windows 10 and 11

Steps on Windows 10 or 11:

  1. In Device Manager, expand Ports (COM & LPT) and Other devices. A device with a yellow warning sign under Other devices means the driver is missing.
  2. Download the driver from the chip maker's page above, run its installer, then unplug and replug the board.
  3. The board should now appear under Ports (COM & LPT) with a COM number. Write it down.

Cause 3: wrong board or port selected in Arduino IDE

If the COM port is in Device Manager, the Arduino IDE must be set to that exact port and an ESP32 board.

  1. Install the board package once: Tools → Board → Boards Manager, search esp32 and install esp32 by Espressif Systems. If it is not listed, add https://espressif.github.io/arduino-esp32/package_esp32_index.json under File → Preferences → Additional boards manager URLs (official instructions).
  2. Choose Tools → Board → esp32 → ESP32 Dev Module for the common 30-pin and 38-pin ESP32-WROOM-32 boards.
  3. Choose Tools → Port and pick the COM number you noted. Not sure? Unplug the board, plug it back in and see which port is new. COM1 is usually the PC's own port, not your ESP32.
  4. If uploads start but fail halfway, set Tools → Upload Speed to 115200 instead of 921600.

Cause 4: "Wrong boot mode detected" or "No serial data received"

These errors mean the ESP32 did not enter its download (flashing) mode when the IDE tried to connect. The ESP32 reads GPIO0 as it comes out of reset: LOW means "wait for a new program", HIGH means "run the program in flash". Most boards switch modes automatically with two transistors driven by the USB chip, but on some boards and PCs the timing fails.

Timing diagram: hold BOOT so GPIO0 is low, press and release EN, then release BOOTReleasing EN while BOOT is held starts the ESP32 in download mode. Espressif calls this boot mode selection.

The fix that works on almost every board:

  1. Click Upload.
  2. When the output shows Connecting...., press and hold the BOOT button (sometimes labelled IO0).
  3. Keep holding until you see Writing at 0x... and a percentage, then release.
  4. When it says Hard resetting via RTS pin..., press EN once if your program does not start by itself.

Needing this every time means your board's auto-reset circuit is marginal; many makers fix it with a 1 µF to 10 µF capacitor between EN and GND. Espressif explains the logic in its boot mode selection guide.

Also check the ESP32's strapping pins. A module wired to them can block download mode or normal boot:

PinNeeds at resetWhat goes wrong
GPIO0LOW for download, HIGH (default) to runA module pulling it high blocks download mode
GPIO2LOW or floating for downloadSomething pulling it high blocks download mode
GPIO12 (MTDI)LOW (default) on most boardsPulled high, it selects the wrong flash voltage and the board may not boot

If the bare board uploads fine with everything unplugged, move your wiring to other pins.

Cause 5: "Access is denied" means the port is busy

Only one program can open a COM port at a time. If a Serial Monitor in another IDE window, Thonny, PuTTY or a Python script holds the port, esptool cannot open it. Close them (or restart the PC) and upload again. On Linux, Permission denied is a different problem (see the Linux notes).

Cause 6: not enough power

When the ESP32 starts its radio it draws short bursts of current that a weak port, hub or thin cable cannot supply. You may see Brownout detector was triggered repeating in the Serial Monitor, or the port may vanish and return. Plug directly into the PC, use a short cable, and disconnect motors or servos while uploading. Our ESP32 brownout fix guide covers this in detail.

Cause 7: is the ESP32 board damaged? Two quick tests

Run these before you buy a new board; they separate a dead USB chip from a dead ESP32.

Test 1: 3V3 rail. With the board on USB, measure DC volts between the 3V3 and GND pins. You should read close to 3.3 V; near 0 V means the regulator or USB power path is damaged. If any chip is too hot to touch, unplug at once.

Test 2: loopback. This checks the cable, driver and USB-to-serial chip without the ESP32.

  1. Connect a jumper wire between the TX0 (GPIO1) and RX0 (GPIO3) pins.
  2. Open the Serial Monitor at 115200 baud.
  3. Press and hold EN so the ESP32 stays in reset and lets go of those pins.
  4. Type a word and press Enter. If it comes straight back, the USB side works and the problem is boot mode, strapping pins or the ESP32 chip.
COM port?3V3LoopbackMost likely problem
YesAbout 3.3 VEchoESP32 side: boot mode, strapping pins or the chip
YesAbout 3.3 VNo echoUSB-to-serial chip or its driver
NoAbout 3.3 V—Cable data wires or USB-to-serial chip
NoAbout 0 V—No power arriving: cable, connector or regulator

If the board fails, a replacement ESP32 development board costs less than hours spent on a damaged one; our best ESP32 board for beginners in India guide helps you choose.

Hands-on: a two-minute "is it alive?" test

Once the port appears, upload this sketch. It proves the whole chain works and reports which chip you have.

cpp
void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("ESP32 is alive!");
  Serial.printf("Chip: %s, revision %d, %d cores\n",
                ESP.getChipModel(), ESP.getChipRevision(), ESP.getChipCores());
  Serial.printf("Flash size: %lu bytes\n", (unsigned long)ESP.getFlashChipSize());
  pinMode(2, OUTPUT);  // many DevKit V1 boards have a blue LED on GPIO2
}

void loop() {
  digitalWrite(2, !digitalRead(2));  // blink
  delay(500);
}

Open the Serial Monitor at 115200 baud and press EN. You should see the chip model, revision, cores and flash size (4194304 bytes, i.e. 4 MB, on most ESP32-WROOM-32 boards).

macOS and Linux notes

The causes are the same on every operating system; only the port names and permission fixes differ.

macOSLinux (Ubuntu, Mint, Raspberry Pi OS)
Port name/dev/cu.usbserial-..., /dev/cu.SLAB_USBtoUART or /dev/cu.wchusbserial.../dev/ttyUSB0 (CP210x, CH340), /dev/ttyACM0 (native USB)
List portsls /dev/cu.*ls /dev/ttyUSB* /dev/ttyACM*
DriversRecent macOS recognises most CP210x and CH340 boards; if not, install the vendor driver and allow it in System Settings → Privacy & SecurityBuilt into the kernel
Permission errorRaresudo usermod -a -G dialout $USER, then log out and back in

On macOS, choose the cu. device, not the tty. one. On Ubuntu 22.04 and later, if a CH340 port appears and then vanishes, the brltty braille-display service may be grabbing it (sudo dmesg | tail mentions brltty); removing that package fixes it if you do not use a braille display. lsusb should list 10c4:ea60 for CP210x or 1a86:7523 for CH340.

Where to go next

Frequently asked questions

Why is my ESP32 not showing up in Device Manager?

Usually because the USB cable is charge-only. If Device Manager does not change when you plug the board in, try a cable that you know transfers files. If a device appears with a yellow warning sign, install the CP210x or CH340 driver.

How do I fix "Failed to connect to ESP32: Wrong boot mode detected"?

Click Upload, and when the output shows "Connecting....", hold the BOOT button until "Writing at 0x..." appears. The chip ran the program in flash instead of entering download mode. If you need this every time, add a 1 µF to 10 µF capacitor between EN and GND and free GPIO0, GPIO2 and GPIO12.

Which driver does my ESP32 need, CP210x or CH340?

It depends on the USB-to-serial chip next to the USB port, not on the ESP32. CP2102 and CP2104 need the Silicon Labs CP210x driver, CH340 needs WCH's CH341SER driver, and CH9102 uses WCH's CH343SER. Native-USB ESP32-S3 and C3 boards need no driver on Windows 10 and 11.

Why does the COM port number keep changing?

Windows assigns COM numbers per device and USB port, so a different port or board can get a new number. Re-check Tools → Port after plugging in, or set a fixed number in Device Manager → port Properties → Port Settings → Advanced.

Can a bad USB port or hub stop an ESP32 from being detected?

Yes. Front-panel ports and unpowered hubs may not supply the current an ESP32 draws when its radio starts, so the board resets or drops off the bus. Use a port directly on the PC and a short, good-quality data cable.

T

Thinking Robot Team

Thinking Robot is a team of engineers and educators in Pune who design electronics and robotics kits and run hands-on workshops for students and schools. Spotted a mistake or have a question? Get in touch.

Filed under#ESP32#Arduino#Electronics#Tutorial

Keep learning

WhatsApp