Can I reference / use the same /dev/ttyUSB0 from two separate Docker Containers?

Hi all,

I’m pretty new to Docker. I am using it for Node-Red, Home Assistant and other stuff

Can I reference / use the same /dev/ttyUSB0 from two separate Docker Containers ? I have a Solar Inverter connected to my PC via a USB to RS485 cable. I want to pull data and also configure the Inverter from both Node-Red and Home Assistant, if possible.

Thanks in advance

1 Like

hello

I think you can mount Node-Red, Home Assistant, which is being used as docker, with /dev/tyUSB0 device

node-red example)

docker run -d --name=node-red --device=/dev/ttyUSB0:/dev/ttyUSB0 nodered/node-red

Like the command above, mount the container with the --device option

Regards,
limsangwoons

I know I CAN do this, but will each Docker Container be each able to read from the same /dev/ttyUSB0 ?

Hi.

I understand your question. I’ll keep looking for it
It seems difficult to mount 2 services with /dev/tyUSB0 and use each. I think it’s hard to set up with docker itself…

Or why don’t we mount each of ttyUSB0’s specific routes and services through the -v option?

I’ll keep looking for it

Regards,
limsangwoons

1 Like