I’m hoping someone can help me as this problem is driving me nuts.
I’m running an ubuntu 22.04 server and have installed esphome using the docker image with the following compose file
version: "3"
name: home
services:
homeassistant:
image: lscr.io/linuxserver/homeassistant:latest
container_name: homeassistant
network_mode: host
environment:
- PUID=1010 # homeassistant
- PGID=1010 # homeassistant
- TZ=Australia/Sydney
volumes:
- /opt/docker/appdata/home-assistant:/config
devices:
- /dev/ttyUSB0:/dev/ttyUSB0 #optional
restart: unless-stopped
esphome:
image: ghcr.io/esphome/esphome
container_name: esphome
network_mode: host
user: 1011:1011 # esphome
environment:
PLATFORMIO_CORE_DIR: .plattformio
PLATFORMIO_GLOBALLIB_DIR: .plattformioLibs
volumes:
- /opt/docker/appdata/esphome:/config
- /etc/localtime:/etc/localtime:ro
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
restart: unless-stopped
After running the compose file I am able to login to the web interface of esphome without issue. I am not setting up an HTTPS connection so I have connected my device to my home server via usb. I add new device, enter a name, and then select the option to ‘plug into the computer running the ESPHome dashboard. I see a USB Serial /dev/ttyUSB0 option and click on it. It then goes through the installation and compiling process then I get the following:
========================= [SUCCESS] Took 28.44 seconds =========================
INFO Successfully compiled program.
esptool.py v4.6.2
Serial port /dev/ttyUSB0
ERROR Running command failed: Could not open /dev/ttyUSB0, the port doesn't exist
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 460800 --port /dev/ttyUSB0 --chip esp8266 write_flash -z --flash_size detect 0x0 /config/.esphome/build/ag-pro/.pioenvs/ag-pro/firmware.bin locally.
INFO Upload with baud rate 460800 failed. Trying again with baud rate 115200.
esptool.py v4.6.2
Serial port /dev/ttyUSB0
ERROR Running command failed: Could not open /dev/ttyUSB0, the port doesn't exist
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 115200 --port /dev/ttyUSB0 --chip esp8266 write_flash -z --flash_size detect 0x0 /config/.esphome/build/ag-pro/.pioenvs/ag-pro/firmware.bin locally.
So far I have tried adding the esphome used to the dialout group and rebooted the system with no luck.
I’m also confident that the device is on ttyUSB0 since the ESPHome docker container won’t be created properly unless the device is attached at the time.
Any help would be great. I’m really a noob with all this.