Synology DSM 7.0 & zwave USB

Hi,

DSM 7.0 is now available for some Synology NAS. I am aware that there are limitations with USB devices.

It seems that the following commands, after a reboot, will allow zwave USB sticks to work again:

modprobe usbserial
modprobe ftdi_sio
modprobe cdc-acm

Are there any positive experiences using zwave USB sticks with OpenHAB & DSM 7.0 ?

2 Likes

I am running a openhab vm on my synology with dsm 7. Works so far.

Do you you use the zwave binding ?

yes

Thanks. I will thus do the update to DSM 7.0

I did the update but I did not see the USB devices (USB or ACM) despite the use of the three commands I mentioned in my first message. Should I do something else to make them to appear ?

When I run “lsusb”, I have the following output:

DiskStation[22:39]% lsusb
|__usb1          1d6b:0002:0404 09  2.00  480MBit/s 0mA 1IF  (Linux 4.4.180+ xhci-hcd xHCI Host Controller 0000:00:15.0) hub
  |__1-1         10c4:ea60:0100 00  1.10   12MBit/s 100mA 1IF  (Silicon Labs CP2102 USB to UART Bridge Controller 0001)
  |__1-2         0463:ffff:0100 00  1.10  1.5MBit/s 20mA 1IF  (EATON Ellipse PRO P354L35PYT)
  |__1-3         1cf1:0030:0100 02  2.01   12MBit/s 100mA 2IFs (dresden elektronik ingenieurtechnik GmbH ConBee II DE2407255)
  |__1-4         f400:f400:0100 00  2.00  480MBit/s 200mA 1IF  (Synology DiskStation 6500822839CA6049)
|__usb2          1d6b:0003:0404 09  3.00 5000MBit/s 0mA 1IF  (Linux 4.4.180+ xhci-hcd xHCI Host Controller 0000:00:15.0) hub

I see the 2 USB sticks (zwave and the zigbee) but they do not appear as devices in /dev/…

Any advice ?

I made little progress: the zigbee USB stick is now recognized as /dev/ttyACM0 but the zwave stick does not appear…

just to clarify. openhab is not running directly on the syno. it is running in a virtual machine in the syno.

Thanks for the clarification. It explains why it does not work for me. It seems that my old USB zwave stick (Aeotec S2) is not recognized when running DSM 7.0. I read somewhere that the new one (GEN5) works. I will order one to test. (I should have done it months ago but moving from one USB zwave stick to another one seems a bit painful)

I confirm that the Aeotec Gen-5 is recognized when running DSM 7.0 providing you executed the three modprob commands mentioned earlier. Its device name is /dev/ttyACMx (x=1 for my setup since the Deconz USB stick appears as /dev/ttyACM0). The Aeotec S2 required extra modules that are not available today. They were available here: http://www.jadahl.com for DSM 6.2. Unfortunately, it seems that they will not be ported to DSM 7.0.

My setup: DS218+ running DSM 7.0. Openhab is hosted in a docker container with zigbee/zwave devices

But now I have to move all my zwave devices to the new USB stick…

I also have DSM 7.0 installed since the first Beta came out.
Z-Wave Stick from zwave.me and works great after the 3 commands.

Good to know ! Thx.

Hi

Do you use “execute container using high privilege” when running the docker container ?
I can not get it to work unless I do that and I did not use to need that under DSM 6.2

I changed the permissions for the zwave and zigbee devices (/dev/ttyACMx) to allow the container to get access to the devices. But you have to do it each time you unplug/plug the USB sticks and after the boot. Not really optimal. But more secure than giving privilege mode to the container.

Hi

Yes I think I did changed the permissions.
When I ssh into the NAS and do.

#####@####:~$ ls -l /dev/ttyA*
crwxrwxrwx 1 openhab openhab 166, 0 Jul 12 07:35 /dev/ttyACM0

It looks like its is changed. I also tried setting the user and group to root with full premissions this does not work either.
To map the device into the container I use an docker import file with a modified json were I added

“devices” : “/dev/ttyACM0”,

or

“devices” : [
{
“CgroupPermissions” : “rwm”,
“PathInContainer” : “/dev/ttyACM0”,
“PathOnHost” : “/dev/ttyACM0”
}
],

What did you use ?
If I create a second terminal (bash) to the container by clicking “Create” and type the ls commad I get this:

root@openhab-2-no-usb0:/openhab# ls -l /dev/
total 0
crw–w---- 1 root tty 136, 0 Jul 12 07:13 console
lrwxrwxrwx 1 root root 11 Jul 12 06:43 core → /proc/kcore
lrwxrwxrwx 1 root root 13 Jul 12 06:43 fd → /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Jul 12 06:43 full
drwxrwxrwt 2 root root 40 Jul 12 06:43 mqueue
crw-rw-rw- 1 root root 1, 3 Jul 12 06:43 null
lrwxrwxrwx 1 root root 8 Jul 12 06:43 ptmx → pts/ptmx
drwxr-xr-x 2 root root 0 Jul 12 06:43 pts
crw-rw-rw- 1 root root 1, 8 Jul 12 06:43 random
drwxrwxrwt 2 root root 40 Jul 12 06:43 shm
lrwxrwxrwx 1 root root 15 Jul 12 06:43 stderr → /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Jul 12 06:43 stdin → /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Jul 12 06:43 stdout → /proc/self/fd/1
crw-rw-rw- 1 root root 5, 0 Jul 12 06:43 tty
crw-rw-rw- 1 root root 1, 9 Jul 12 06:43 urandom
crw-rw-rw- 1 root root 1, 5 Jul 12 06:43 zero

Should I not see the /dev/ttyACM0 here ? Do you ?

I think you can make this more comfortable by using symlinks

I just have to do some configuration After DSM Update. Normal reboot is no issue.

Disclaimer: haven’t testet with DSM 7 yet, I’m still running 6.2

I have the following permission on the synology host:

*******13:00]% ll /dev/ttyACM
crw-rw-rw- 1 root root 166, 0 Jun 30 08:33 /dev/ttyACM0
crw-rw-rw- 1 root root 166, 1 Jul 6 18:30 /dev/ttyACM1

I created the container using the following command:

sudo docker run --name openhab --net=host --device=/dev/ttyACM1 -v /etc/localtime:/etc/localtime:ro -v /etc/TZ:/etc/timezone:ro -v /opt/openhab3/addons:/openhab/addons -v /opt/openhab3/conf:/openhab/conf -v /opt/openhab3/userdata:/openhab/userdata -e “EXTRA_JAVA_OPTS=-Duser.timezone=Europe/Paris” openhab/openhab:3.0.0

Within the OpenHAB container, I have the following permissions for the devices:

total 0
lrwxrwxrwx 1 root root 11 Jul 6 19:24 core → /proc/kcore
lrwxrwxrwx 1 root root 13 Jul 6 19:24 fd → /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Jul 6 19:24 full
drwxrwxrwt 2 root root 40 Jul 6 19:24 mqueue
crw-rw-rw- 1 root root 1, 3 Jul 6 19:24 null
lrwxrwxrwx 1 root root 8 Jul 6 19:24 ptmx → pts/ptmx
drwxr-xr-x 2 root root 0 Jul 6 19:24 pts
crw-rw-rw- 1 root root 1, 8 Jul 6 19:24 random
drwxrwxrwt 2 root root 40 Jul 6 19:24 shm
lrwxrwxrwx 1 root root 15 Jul 6 19:24 stderr → /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Jul 6 19:24 stdin → /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Jul 6 19:24 stdout → /proc/self/fd/1
crw-rw-rw- 1 root root 5, 0 Jul 6 19:24 tty
crw-rw-rw- 1 root root 166, 1 Jul 12 13:07 ttyACM1
crw-rw-rw- 1 root root 1, 9 Jul 6 19:24 urandom
crw-rw-rw- 1 root root 1, 5 Jul 6 19:24 zero

So I clearly see the device (ttyACM1) which is associated to the zwave USB stick.

Concerning the access rights associated to a USB device, I will investigate the solution explained here:

May be this will solve the permission issue at boot time and when you plug/unplug the USB stick. Hope it works for DSM7.0.

It looks like I go it working now. I am a bit unsure what made it work, I think there was something with the group that was wrong. I used your “sudo docker run …” command and that made the \dev\ttyACM0 work but because my openhab user does not have id 9001 I need set the -e “USER_ID=1042” -e “GROUP_ID=65539” also. When the container is created via the above commad it does

echo ‘Create user openhab with id 1042’

And a lot of other commands that I think it did not do that earlier and I think this is what makes the difference.

Thanks a lot for you help

I just tested the udev rule as mentioned earlier. It works like a charm !

Go to /lib/udev/rules.d

Create a file like “50-usb-zwave.rules”

Put this line in it:

SUBSYSTEM==“tty”, ATTRS{idVendor}==“0658”, ATTRS{idProduct}==“0200”, SYMLINK+=“ttyACM1”, MODE=“0666”

You can then plug and unplug the Aeotec Gen5 and you will see that the correct permissions have been applied. Moreover, it will always appear with the name ttyACM1 (this is important for me since I have also a zigbee USB stick and I am not sure at boot time, what will be its symbolic name: either ttyACM0 or ttyACM1. This can be done for other USB sticks but you will need to change the idVendor and the idProduct (use “lsusb -ciu” to get these ids).