"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

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