gareth_iowc Posted January 28, 2018 Share Posted January 28, 2018 (edited) hi all, So i have RF link running on a arduino mega 2560 and tested it on a windows pc in domoticz and it's working great. Having trouble getting it connected to my docker container in unraid. dmesg | tail [ 1298.319801] usb 1-1.1: USB disconnect, device number 3 [ 1303.099442] usb 1-1.1: new full-speed USB device number 5 using ehci-pci lsusb Bus 001 Device 005: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter i have tried --device=/dev/bus/usb/001/005:/dev/ttyS0 --device=/dev/bus/usb/001/005 but cant see it shown as a usb device or a serial port in the container - docker exec -it domoticz dmesg | grep tty console [tty0] enabled docker exec -it domoticz lsusb Bus 005 Device 001: ID 1d6b:0003 Bus 003 Device 001: ID 1d6b:0001 Bus 002 Device 002: ID 8087:0024 Bus 001 Device 001: ID 1d6b:0002 Bus 001 Device 004: ID 0781:5581 Bus 001 Device 005: ID 1a86:7523 Bus 001 Device 002: ID 8087:0024 Bus 002 Device 003: ID 0424:2660 Bus 004 Device 001: ID 1d6b:0002 Bus 002 Device 001: ID 1d6b:0002 Bus 005 Device 002: ID 0411:0240 any ideas? thanks Edited January 28, 2018 by gareth_iowc Quote Link to comment
saarg Posted January 28, 2018 Share Posted January 28, 2018 (edited) 5 minutes ago, gareth_iowc said: hi all, So i have RF link running on a adruino mega and tested it on a windows pc in domoticz and it's working great. Having trouble getting it connected to my docker container in unraid. dmesg | tail [ 1298.319801] usb 1-1.1: USB disconnect, device number 3 [ 1303.099442] usb 1-1.1: new full-speed USB device number 5 using ehci-pci lsusb Bus 001 Device 005: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter i have tried --device=/dev/bus/usb/001/005:/dev/ttyS0 --device=/dev/bus/usb/001/005 but cant see it shown as a usb device or a serial port in the container - docker exec -it domoticz dmesg | grep tty console [tty0] enabled docker exec -it domoticz lsusb Bus 005 Device 001: ID 1d6b:0003 Bus 003 Device 001: ID 1d6b:0001 Bus 002 Device 002: ID 8087:0024 Bus 001 Device 001: ID 1d6b:0002 Bus 001 Device 004: ID 0781:5581 Bus 001 Device 005: ID 1a86:7523 Bus 001 Device 002: ID 8087:0024 Bus 002 Device 003: ID 0424:2660 Bus 004 Device 001: ID 1d6b:0002 Bus 002 Device 001: ID 1d6b:0002 Bus 005 Device 002: ID 0411:0240 any ideas? thanks I guess you open it as a device in domoticz normally? If you don't get a device when connecting the usb, you might need a driver for it to load the device node. Since this is a usb to serial device, it's going to be ttyUSB0. Does it work if you load the correct module? modprobe ch341 Edited January 28, 2018 by saarg Quote Link to comment
gareth_iowc Posted January 28, 2018 Share Posted January 28, 2018 25 minutes ago, saarg said: I guess you open it as a device in domoticz normally? If you don't get a device when connecting the usb, you might need a driver for it to load the device node. Since this is a usb to serial device, it's going to be ttyUSB0. Does it work if you load the correct module? modprobe ch341 ah ok so i changed my config to - --device=/dev/bus/usb/001/005:/dev/ttyUSB0 After making that change i can now see an option in the port selection menu - "dev/ttyUSB0" Is there anyway to check comms as i'm not sure it's working. i have tried to add a temperature sensors like i did on windows and nothing is coming up. sorry how is the modprobe ch341 command executed? Quote Link to comment
gareth_iowc Posted January 29, 2018 Share Posted January 29, 2018 Nas:~# dmesg | grep tty [ 0.000000] console [tty0] enabled Nas:~# docker exec -it domoticz dmesg | grep tty console [tty0] enabled Quote Link to comment
wisebear Posted February 12, 2018 Share Posted February 12, 2018 (edited) I am also having issues with Arduino mega 2560 driver in unRAID. I can't load ch341 module. root@unRAID:~# modprobe ch341 modprobe: FATAL: Module ch341 not found in directory /lib/modules/4.14.13-unRAID Any ideas what else to try? Edited February 12, 2018 by wisebear Quote Link to comment
gareth_iowc Posted February 12, 2018 Share Posted February 12, 2018 (edited) Couldn’t get it to work and tried everything I could find. i could pass the device up the container doesn’t know what it is. built a Ubuntu vm and passed the mega to that and is been working great Edited February 12, 2018 by gareth_iowc Quote Link to comment
saarg Posted February 12, 2018 Share Posted February 12, 2018 @gareth_iowc @wisebear If it's not found, then make a request to include it. It's in the kernel, so they just have to enable it when compiling the kernel. Quote Link to comment
mgranger Posted March 18, 2018 Share Posted March 18, 2018 I am trying to use a Aeon Labs Aeotec Z-Wave Z-Stick, Gen5 but can't seem to get my devices hooked up. I put this in the privileged line --device=/dev/ttyACM0 But it doesn't seem to be working here is some lines in my log file �[39m�[31m2018-03-18 14:52:29.936 Error, ERROR: Failed to open serial port /dev/ttyACM0 �[39m�[32m2018-03-18 14:52:29.936 Always, �[39m�[32m2018-03-18 14:52:29.936 Always, Dumping queued log messages �[39m�[32m2018-03-18 14:52:29.936 Always, �[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[32m2018-03-18 14:52:29.936 Always, �[39m�[32m2018-03-18 14:52:29.936 Always, End of queued log message dump �[39m�[32m2018-03-18 14:52:29.936 Always, �[39m�[31m2018-03-18 14:52:34.936 Error, ERROR: Cannot open serial port /dev/ttyACM0. Error code 13 �[39m�[32m2018-03-18 14:52:34.936 Always, �[39m�[32m2018-03-18 14:52:34.936 Always, Dumping queued log messages �[39m�[32m2018-03-18 14:52:34.936 Always, �[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[32m2018-03-18 14:52:34.937 Always, �[39m�[32m2018-03-18 14:52:34.937 Always, End of queued log message dump �[39m�[32m2018-03-18 14:52:34.937 Always, �[39m�[31m2018-03-18 14:52:34.937 Error, ERROR: Failed to open serial port /dev/ttyACM0 �[39m�[32m2018-03-18 14:52:34.937 Always, �[39m�[32m2018-03-18 14:52:34.937 Always, Dumping queued log messages �[39m�[32m2018-03-18 14:52:34.937 Always, �[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[32m2018-03-18 14:52:34.937 Always, �[39m�[32m2018-03-18 14:52:34.937 Always, End of queued log message dump �[39m�[32m2018-03-18 14:52:34.937 Always, �[39m2018-03-18 14:52:34.937 �[1;31mError: OpenZWave: Driver Failed!!�[0;0m 2018-03-18 14:54:29.969 New sensors allowed for 5 minutes... 2018-03-18 14:54:44.740 New sensors allowed for 5 minutes... 2018-03-18 14:55:58.836 New sensors allowed for 5 minutes... 2018-03-18 14:56:16.068 New sensors allowed for 5 minutes... 2018-03-18 14:56:16.068 OpenZWave: Node Include command initiated... What am I doing wrong? Quote Link to comment
saarg Posted March 18, 2018 Share Posted March 18, 2018 54 minutes ago, mgranger said: I am trying to use a Aeon Labs Aeotec Z-Wave Z-Stick, Gen5 but can't seem to get my devices hooked up. I put this in the privileged line --device=/dev/ttyACM0 But it doesn't seem to be working here is some lines in my log file �[39m�[31m2018-03-18 14:52:29.936 Error, ERROR: Failed to open serial port /dev/ttyACM0 �[39m�[32m2018-03-18 14:52:29.936 Always, �[39m�[32m2018-03-18 14:52:29.936 Always, Dumping queued log messages �[39m�[32m2018-03-18 14:52:29.936 Always, �[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[32m2018-03-18 14:52:29.936 Always, �[39m�[32m2018-03-18 14:52:29.936 Always, End of queued log message dump �[39m�[32m2018-03-18 14:52:29.936 Always, �[39m�[31m2018-03-18 14:52:34.936 Error, ERROR: Cannot open serial port /dev/ttyACM0. Error code 13 �[39m�[32m2018-03-18 14:52:34.936 Always, �[39m�[32m2018-03-18 14:52:34.936 Always, Dumping queued log messages �[39m�[32m2018-03-18 14:52:34.936 Always, �[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[32m2018-03-18 14:52:34.937 Always, �[39m�[32m2018-03-18 14:52:34.937 Always, End of queued log message dump �[39m�[32m2018-03-18 14:52:34.937 Always, �[39m�[31m2018-03-18 14:52:34.937 Error, ERROR: Failed to open serial port /dev/ttyACM0 �[39m�[32m2018-03-18 14:52:34.937 Always, �[39m�[32m2018-03-18 14:52:34.937 Always, Dumping queued log messages �[39m�[32m2018-03-18 14:52:34.937 Always, �[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[39m�[32m2018-03-18 14:52:34.937 Always, �[39m�[32m2018-03-18 14:52:34.937 Always, End of queued log message dump �[39m�[32m2018-03-18 14:52:34.937 Always, �[39m2018-03-18 14:52:34.937 �[1;31mError: OpenZWave: Driver Failed!!�[0;0m 2018-03-18 14:54:29.969 New sensors allowed for 5 minutes... 2018-03-18 14:54:44.740 New sensors allowed for 5 minutes... 2018-03-18 14:55:58.836 New sensors allowed for 5 minutes... 2018-03-18 14:56:16.068 New sensors allowed for 5 minutes... 2018-03-18 14:56:16.068 OpenZWave: Node Include command initiated... What am I doing wrong? I bet you are on unraid 6.5. Then you need to add the below in your go file to change permissions of /dev/ttyACM0 so it's possible to open by domoticz. chmod 777 /dev/ttyACM0 This is a bug in docker CE and will be fixed in 18.03. Then we just have to hope @limetech adds it to a release in the near future. Here is the issue if anyone is interested. https://github.com/docker/docker-ce/pull/450 1 Quote Link to comment
Diggewuff Posted March 24, 2018 Share Posted March 24, 2018 (edited) On 18.3.2018 at 8:59 PM, saarg said: I bet you are on unraid 6.5. Then you need to add the below in your go file to change permissions of /dev/ttyACM0 so it's possible to open by domoticz. chmod 777 /dev/ttyACM0 This is a bug in docker CE and will be fixed in 18.03. Then we just have to hope @limetech adds it to a release in the near future. Here is the issue if anyone is interested. https://github.com/docker/docker-ce/pull/450 I have a 3D Printer connected as /dev/ttyACM0, and it isn't always turned on, it constantly connects and disconnects. Therefore adding chmod 777 /dev/ttyACM0 isn't doing the job for me. Is there any workaround which makes chmod 777 /dev/ttyACM0 persistent trough reconnects and not only trough reboots? Edited March 25, 2018 by Diggewuff Quote Link to comment
Iceman24 Posted April 15, 2018 Share Posted April 15, 2018 On 9/10/2016 at 8:22 AM, saarg said: If the container doesnt start, you don't have the device. You might have to use VM in stead and pass the USB device through. I'm looking to do the same. Trying to pass the stick to a Docker through unRAID seems very tricky and annoying to keep that way. Are you saying you can avoid this headache my installing a Linux VM instead, passing the stick to the VM (which works reliably?), then installing HASS on VM and then Docker can easily see that device because it is already in the system it is in? The HASS install on Linux, could it be via Docker or would it have to be installed without Docker? Quote Link to comment
jaminben Posted May 4, 2019 Share Posted May 4, 2019 On 2/25/2017 at 12:15 AM, poldim said: Just sharing what I've done: Inserted my Z Wave stick into my UNRAID server. Went to the main UNRAID log and found this: Feb 24 08:52:12 ChiRAID kernel: usb 5-1: new full-speed USB device number 4 using uhci_hcd Feb 24 08:52:12 ChiRAID kernel: cdc_acm 5-1:1.0: ttyACM0: USB ACM device Feb 24 08:52:12 ChiRAID kernel: usbcore: registered new interface driver cdc_acm Feb 24 08:52:12 ChiRAID kernel: cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters Found that the system is referring to the stick as ttyACM0 per above. Went into Home assistant docker settings, enabled advanced view, and made the following changes: Extra Parameters: --device=/dev/ttyACM0 Privileged: ON Followed instructions on setting up z-wave stick by adding the required code to the yaml file: zwave: usb_path: /dev/ttyACM0 Brand new to Unraid and been scratching my head for a couple of hours trying to make a USB 433Mhz Transceiver work with Domoticz... until I found your post Works great thanks to you... I did however leave Privileged Off. Many Thanks Quote Link to comment
Rick_Sanchez Posted January 9, 2021 Share Posted January 9, 2021 You can make the assignment permanent with these instructions: http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/ Quote Link to comment
jj_uk Posted June 22, 2021 Share Posted June 22, 2021 On 1/9/2021 at 11:49 AM, Rick_Sanchez said: You can make the assignment permanent with these instructions: http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/ Will these changes survive following an unraid version update? Quote Link to comment
Rick_Sanchez Posted June 23, 2021 Share Posted June 23, 2021 On 6/22/2021 at 2:04 PM, jj_uk said: Will these changes survive following an unraid version update? That's a great question that maybe one of the dev's can answer. This would depend if /etc/udev/ is overwritten during the update process. Quote Link to comment
Squid Posted June 23, 2021 Share Posted June 23, 2021 Any path not in /boot or /mnt/diskX or /mnt/user is lost on a reboot. Any changes made elsewhere must be reapplied at boot time either via user scripts or the go file Quote Link to comment
jj_uk Posted June 23, 2021 Share Posted June 23, 2021 So if I add this to the go file, will that work at restart? echo "SUBSYSTEM==\"tty\", ATTRS{idVendor}==\"0451\", ATTRS{idProduct}==\"16a8\", ATTRS{serial}==\"serial num removed\", SYMLINK+=\"zigbee2mqtt\"" > /etc/udev/rules.d/99-usb-serial.rules Quote Link to comment
jj_uk Posted June 24, 2021 Share Posted June 24, 2021 I've changed my USB stick to a ZZH and it's using ttyUSB0. Problem is, my docker cannot access it. I believe its something to do with permissions: # ls -l /dev/ttyUSB0 crw-rw---- 1 root dialout 188, 0 Jun 24 20:32 /dev/ttyUSB0 I'm not sure what to do to allow the docker (zigbee2mqtt) to access the device. My docker extra params has --device=/ttyUSB0 Earlier in this thread, its mentioned that: "For these devices all needed is to add the user running the software in the container to the dialout group." But I don't know how to do that. Quote Link to comment
Rick_Sanchez Posted January 8, 2022 Share Posted January 8, 2022 On 6/23/2021 at 5:53 PM, jj_uk said: So if I add this to the go file, will that work at restart? echo "SUBSYSTEM==\"tty\", ATTRS{idVendor}==\"0451\", ATTRS{idProduct}==\"16a8\", ATTRS{serial}==\"serial num removed\", SYMLINK+=\"zigbee2mqtt\"" > /etc/udev/rules.d/99-usb-serial.rules This is how I keep mine persistent: Part 1: # lsusb for vendor:product idProduct # udevadm info -a -n /dev/ttyUSB0 | grep '{serial}' | head -n1 where USB0 is the device you are looking for # OR; udevadm info -a -n /dev/bus/usb/000/000 | grep '{serial}' | head -n1 if you can't find the USB device, search if it's in the BUS # nano /etc/udev/rules.d/99-usb-rules.rules make your own rules folder Part 2: # cp /etc/udev/rules.d/99-usb-rules.rules /boot/config/rules.d/99-usb-rules.rules copy your rules to the boot config # nano /boot/config/go # add and save --> cp /boot/config/rules.d/99-serial-rules.rules /etc/udev/rules.d/99-serial-rules.rules # chmod 644 /etc/udev/rules.d/99-serial-rules.rules Quote Link to comment
TRusselo Posted February 2, 2023 Share Posted February 2, 2023 (edited) the best method to passthrough usb to docker is via device by-id open unraid terminal type ls -l /dev/serial/by-id you will get output of your devices with names copy the whole BLUE name of your device go to your docker and edit config add /dev/serial/by-id/ before pasting the name from above. eg /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_dcf756dbb712ec118bca20c7bd930c07-if00-port0 then add :/dev/zigbee to the end - this is the container mount point so you end up with this in your Docker Host config: /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_dcf756dbb712ec118bca20c7bd930c07-if00-port0:/dev/zigbee if anywere inside your docker program it asks for the device location you would set it to : /dev/zigbee Edited February 19, 2023 by TRusselo 1 2 Quote Link to comment
GameKing505 Posted February 3, 2023 Share Posted February 3, 2023 On 2/2/2023 at 12:53 PM, TRusselo said: the best method to passthrough usb to docker is via device by-id open unraid terminal type ls -l /dev/serial/by-id you will get output of your devices with names copy the whole BLUE name of your device go to your docker and edit config add /dev/serial/by-id/ before pasting the name from above. eg /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_dcf756dbb712ec118bca20c7bd930c07-if00-port0 I have the exact same device as your screenshot and am passing it through the exact same way (by the /dev/serial/by-id path) and it's still not registering in my docker app (Home Assistant). Any ideas why that would be? I've been pulling my hair out over this for a while. At first I thought it was passing through correctly since "lsusb" output in the docker container included the device, but then I noticed that even when I wasn't passing it through explicitly in the unraid UI, lsusb still listed the zigbee dongle. Quote Link to comment
TRusselo Posted February 16, 2023 Share Posted February 16, 2023 On 2/3/2023 at 3:26 PM, GameKing505 said: I have the exact same device as your screenshot and am passing it through the exact same way (by the /dev/serial/by-id path) and it's still not registering in my docker app (Home Assistant). Any ideas why that would be? I've been pulling my hair out over this for a while. At first I thought it was passing through correctly since "lsusb" output in the docker container included the device, but then I noticed that even when I wasn't passing it through explicitly in the unraid UI, lsusb still listed the zigbee dongle. try adding :/dev/zigbee to the end of the VALUE /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_dcf756dbb712ec118bca20c7bd930c07-if00-port0:/dev/zigbee Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.