ESPHOME on Synology NAS

Hi, I tried to install ESPHome in a docker container on a Synology NAS and everything worked pretty well but I can’t figure out how to flash devices using USB. I added --device=/dev/ttyUSB0 in my config but it doesn’t work.

Can someone please support me?

Thank you in advance!

I use ESPHome in a docker container too:
First build a simple code and “Download Binary”, then use this binary to flash your ESP with your PC… and then next updates you can build and upload with OTA!, very easy.:wink:

Antoni

1 Like

This.

  1. compile your project (option in “3 dots” menu)
  2. use esphome flasher to flash your device

Sorry maybe my previous post was ambiguous.

The issue is that docker container can’t see any device connected via USB. So after compiling I see an error message.

I don’t use any USB to flash…

That’s why we suggested only to compile. That should create .bin firmware image and download it via browser . You can then flash on your pc using the flasher tool I linked.
At least this is how the hassio addon works.
I needed to do the same because I couldn’t be bothered to pass through a usb on my vm hypervisor.

1 Like

Thank you!

Solved!

Hey np!
After you flashed the 1st tiome via USB on your pc esphome should flash OTA after that.

Hey @Jokerigno can I bother you with docker run command for Synology that you used? Or point somewhere where I can get one.

Found so far 3 and all look a bit strange in relation to using host/brudgge and -v command for volume mapping, etc…

I tried many times before found the right command.

Maybe the last one (the good one) is this:

sudo docker run --rm -v /volume1/docker/homeassistant-esphome:/config -it esphome/esphome:latest

1 Like

Thanks!!! Ended up with this

sudo docker run -d --name esphome --net=host -p 6052:6052 -p 6123:6123 -v /volume1/docker/home-assistant/esphome:/config esphome/esphome
2 Likes

--net=host overrides -p 6052:6052 -p 6123:6123. If you use --net=host, it’s recommended to remove the port mappings from your run command. The only reason to specify ports and not use host networking is if you have another program on the NAS or docker container that uses the same ports as ESPHome and you need to specify a different port. Or if you’re security conscious/paranoid and want to ensure the container can only communicate through a bridge on that port only.

EDIT: A reason to use --net=host is discovery might require the use of multicast/broadcast to find components and devices. specifying ports could prevent ESPHome or HA from properly discovering these devices.

In my case, I just use --net=host

1 Like

Thanks for the info. I use both configurations, depending on what I wand to achieve. For this I use ‘–net=host’ + of course ports defined as I wrote above. I know that it doesn’t do anything extra as those ports are automatically seen on the local network, but it helps to easily see all ports for all docker containers in overview, if you have all ports for every container listed like that.
You can think of it as well documented setup instead of just working setup :grin:
And specifying port translation can of course do no harm :wink:
EDIT: if you match identical port numbers.

Hi - I also just installed ESPhome in Docker on Synology and everything looks fine. However nothing happens when I try to open the page. If I write the IP address of my synology and port 6052 I get a blank page. Any idea what I am doing wrong?

I installed the drivers on my synology that work with USB devices. Go here and download the .spk file for your particular NAS. It worked great!
I mostly use the download binary method for first flash since my NAS is upstairs in a closet but this is still a good secondary method for me. For example, I am trying to flash an ESP32 with the BLE tracker component. It won’t update OTA (because it has to change a partition size) and I don’t know the correct command to get it to work. So I can simply go plug the ESP32 into the NAS and have ESPHome do it!

Did you open the ports?
-p 6052:6052

I’ve installed HomeESP on Synology DSM 7.0.
It seems to work ok because I compile and download .bin file and flash via ESPHome flasher.
ESPHome flasher shows me a logs, Home Assistant discovered new device but in HomeESP Frontend all devices are unavailable (marked on red).

Do you know what is a reason?

That solve all my problems.

1 Like