allfro / device-mapping-manager

58 stars 9 forks source link

Add support for USB TTY devices #4

Closed tedivm closed 1 year ago

tedivm commented 1 year ago

I'm trying to get Docker Swarm working with zigbee2mqtt. To get the zigbee radios working in swarm their documentation recommends a method that came from this github issue. That solution doesn't work anymore, but it led me to your container.

First off, I super appreciate that you built this! It is going to make some IOT stuff a lot easier.

The problem I'm running into is that the program currently skips over my USB radio. I'm using a HUSBZB (on a Nortek device that has it and a zwave controller), which exposes the devices on /dev/ttyUSB0 and /dev/ttyUSB1 (which I've mapped with some udev rules to /dev/zigbee-serial and /dev/zwave-serial)

2023/07/11 02:56:53 686570ecb1719d1d14cbebfe1f056ba83c1f55278d59dcc861eece6c721553c5/122087 requested a volume mount for /dev/zigbee-serial at /dev/zigbee-serial
2023/07/11 02:56:53 The cgroup path for process 122087 is at /host/sys/fs/cgroup/system.slice/docker-686570ecb1719d1d14cbebfe1f056ba83c1f55278d59dcc861eece6c721553c5.scope
2023/07/11 02:56:53 aborting: device is neither a character or block device
2023/07/11 02:56:53 unsupported device type... aborting

I am an absolute newbie when it comes to Go, otherwise I would try resolving this myself. I'm super happy to test out branches or dev code on my local machine.

allfro commented 1 year ago

I’m guessing it’s because the device paths are symlinks to the original devices? Have you tried volume mounting the original /dev/ttyUSB* paths for testing purposes? Could you do an ls -l for the devices in question?

allfro commented 1 year ago

I just made a change to the repo. Download it and build and see if it works for you.

tedivm commented 1 year ago

Thank you, it works perfectly now!