Encountering Errors While Attempting Initiation of ESP32 with ESPHome

Docker version of ESPHome is active on my HA Server. ESP32 is connected directly to HA server via USB. Executing commands via SSH from my (Linux Mint) desktop. ESPHome appears to compile OK. However, I get errors during install. Need some advice re: correcting errors.

Error:
INFO Build Info: config_hash=0x569f7653 build_time_str=2026-04-20 21:05:25 -0500
INFO Successfully compiled program.
esptool v5.2.0
Serial port /dev/ttyUSB0:
Connecting…
ERROR Running command failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
ERROR Please try running esptool --before default-reset --after hard-reset --baud 460800 --port /dev/ttyUSB0 --chip esp32 write-flash -z --flash-size detect 0x10000 /config/.esphome/build/th/.pioenvs/th/firmware.bin 0x1000 /config/.esphome/build/th/.pioenvs/th/bootloader.bin 0x8000 /config/.esphome/build/th/.pioenvs/th/partitions.bin 0x9000 /config/.esphome/build/th/.pioenvs/th/ota_data_initial.bin locally.
INFO Upload with baud rate 460800 failed. Trying again with baud rate 115200.
esptool v5.2.0
Serial port /dev/ttyUSB0:
ERROR Running command failed: Could not open /dev/ttyUSB0, the port is busy or doesn’t exist.
([Errno 11] Could not exclusively lock port /dev/ttyUSB0: [Errno 11] Resource temporarily unavailable)

ERROR Please try running esptool --before default-reset --after hard-reset --baud 115200 --port /dev/ttyUSB0 --chip esp32 write-flash -z --flash-size detect 0x10000 /config/.esphome/build/th/.pioenvs/th/firmware.bin 0x1000 /config/.esphome/build/th/.pioenvs/th/bootloader.bin 0x8000 /config/.esphome/build/th/.pioenvs/th/partitions.bin 0x9000 /config/.esphome/build/th/.pioenvs/th/ota_data_initial.bin locally.
WARNING Failed to upload to [‘/dev/ttyUSB0’]

Are you sure that /dev/ttyUSB0 (or whatever device it’s mapped to by Docker) is your ESP32, and not some other device?

Thanks robertklep. NO. I’m not sure. A little too new to this. Will need some ‘hand holding’.

Can you show the part of your Docker setup where you configure the serial port? It’s usually below either devices or volumes if you use a Docker compose file.

Also include the output of this command (on the host, not inside the Docker container):

ls -al /dev/serial/by-id/*

(it should how which serial devices are connected to, and found by, your system)