forked from gcgarner/IOTstack
-
Notifications
You must be signed in to change notification settings - Fork 302
Closed
Description
If you have, like me, more the one usb com port connected to you Raspberry Pi you might find that the device names (e.g. /dev/ttyUSB0) can change at any moment.
I had my two devices changing twice on 3 reboots!
To solve this you need to create SYMLINK to your devices based on product id's and vendor id's and in your container(s) use this symlink to address your usb com port.
A step by step instruction can be found here:
https://www.freva.com/2019/06/20/assign-fixed-usb-port-names-to-your-raspberry-pi/
In my specific case I used
SUBSYSTEM=="tty", ATTRS{idProduct}=="7523", ATTRS{idVendor}=="1a86", SYMLINK+="ttyUSB_DEVICE1"
SUBSYSTEM=="tty", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", SYMLINK+="ttyUSB_DEVICE2"
to create virtual devices ttyUSB_DEVICE1and ttyUSB_DEVICE2.
In your docker-compose.yml or compose-override.yml you now specify the port like this:
zigbee2mqtt:
devices:
- /dev/ttyUSB_DEVICE1:/dev/ttyUSB0
Metadata
Metadata
Assignees
Labels
No labels