HI
I’m currently trying to move/integrate node_red within docker and home assistant. I was able to install home assistant, node red, esp home and portainer from docker-compose.yaml file. However the problem is that Portainer do not recognize any of the containers same with esp home that cannot access the usb ports.
@bdollerup Thank you for an answer. Names are correct in my original file, I had problem copying it and made mistake. I apologize. I installed everything just running command docker compose up -d. All of it is running at the same RPI. How could I check it or change it? I’m still experimenting with it so can easily start from scratch
Your first time you ran it in privileged mode, which is why it saw everything, and your compose you are using now does not have privileged mode, as it has “privileged: false”.
Privileged mode is not necessary for portainer if you map the docker sock volume. Based on your compose above use this instead
Thank You for your time! It worked but only when I did privileged to True
Could you also maybe point me out how can I share my usb devices from RPI to docker, so I can set up esp?
That’s odd the volume mapping for /var/run/docker.sock didn’t work for portainer. You should avoid using the privileged mode in docker when possible, and I generally stick to the official install directions for each container on how to define the docker parameters when I can, and only modify them if absolutely necessary and the changes are fully understood. If you are using privileged mode for portainer make sure you set a strong password and I would definitely not expose portainer outside the lan or through any proxies.
For ESP, I don’t use it myself, but, unlike portainer, its install directions actually say to use privileged mode. Privileged mode in this case for ESP would be needed to access the usb hardware on the host, which will be necessary for flashing. Portainer does not need access to any hardware mappings on the host so that is why priviledged shouldn’t be needed (although you might have some other config on your OS that is blocking it from working right I am not aware of) . Also, if someone hacks your network, they can do much more damage with access to portainer versus ESP, as portainer can be used to create any other docker process they want with full access to your system.
On another note, with portainer working, you can actually use it instead of the command line to install and manage all your containers, including ESPhome. I use portainer too, and the only thing I use the command line for now is to manage and update portainer itself. Here is how you can use docker compose inside of the portainer’s “stack” feature. It is a nice feature as you can quickly and easily make changes to your compose, and just click the button to “update the stack” to redeploy the container, versus needing to use the command line for docker compose.
Thank you for all those information supported with extra resources! I changed privileged mode to false on portainer However esphome still cant detect my esp connected to raspberry, even though if I do lsusb on raspberry system it recognize connection…
UPDATE: I did mapping with -device option ttyUSB0 and it worked now Bluetooth and google home integration left…and few other things, but this is a step ahead after weeks of struggle!