"Could not open port, the port is busy or doesn't exist"
esptool never got as far as the chip: the operating system would not give it the serial port.
A fatal error occurred: Could not open /dev/ttyUSB0, the port is busy or doesn't exist. ([Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0') Hint: Try to add user into dialout or uucp group.
The usual causes
- Another program has the port open: the Arduino IDE's or PlatformIO's serial monitor,
idf.py monitor, a terminal like PuTTY or screen, or on Linux ModemManager. Only one program can use a serial port at a time. - The wrong port: the board shows up under a different name after a reset or on another USB socket. List the ports and plug the board out and in to see which one appears.
- Permission, on Linux: add your user to the
dialoutgroup (uucpon Arch), then log out and back in. esptool prints this hint itself when the error isPermission denied. - No driver for the USB-serial chip, so no port exists at all.
- A board that resets into a different USB device: chips with built-in USB can disappear and come back under a new port name when they reset. Try again, or enter download mode by hand.
Try it from the browser
To rule out the computer's setup (drivers, Python, the IDE's settings), try the free ESP32 web flasher in Chrome or Edge: it uses the same ROM protocol over WebSerial and needs nothing installed. If it cannot connect either, the problem is the board, the cable or the boot mode.
And once a device is flashed and installed somewhere, you should not need a cable again: Pinscope updates the firmware over the internet, with a rollback if the new build does not come back. OTA over the internet.
Related errors: Failed to connect to ESP32 · Wrong boot mode detected · Invalid head of packet. All ESP32 errors: the list. Message and hint from esptool's source (loader.py); causes from Espressif's esptool Troubleshooting guide.
More
- Remote access to an ESP32 without TLS: what it measured and what it costs
- Reaching an ESP32 web server from outside its network
- Updating ESP32 firmware over the internet, with rollback
- Guru Meditation Error: decoding the backtrace, and crashes from the field
- Remote logging: ESP_LOG without a serial cable
- Heap and stack monitoring in the field
- An ESP32 behind CGNAT, 4G or Starlink
- TLS memory usage on the ESP32, and how to reduce it
- Sharing an ESP32 sensor page with anyone, without port forwarding
- ArduinoOTA over the internet, with a rollback
- ESP32 remote access compared: port forwarding, ngrok, Cloudflare Tunnel, Tailscale
- esp_http_server slow? The 250 ms delay and the fix
- Before the first ESP32 ships: a field support checklist
- ESP32 exception decoder: a Guru Meditation backtrace to lines, in the browser