Synology DSM 7.0 & zwave USB

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).

I also have a rflink gateway that needs a ch341.ko driver therefore I had to install the drivers described here: GitHub - robertklep/dsm7-usb-serial-drivers: Synology DSM 7 USB serial drivers
This fixed the loading both of the drivers after a restart for me.
The rules for setting access rights are also needs as @gd35 describes.

Thanks for the info. It should work with the Aeotec S2.

I recently updated my synology with DSM 7.0.1-42218 and my USB sticks (Aeotec S2 + conbee) do not work anymore… I did all the steps I mentioned in my previous posts but nothing works this time.

When I run the lsusb command, I got this:

|__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-2         0463:ffff:0100 00  1.10  1.5MBit/s 20mA 1IF  (EATON Ellipse PRO P354L35PYT)
  |__1-3         05e3:0610:9224 09  2.10  480MBit/s 100mA 1IF  (GenesysLogic USB2.0 Hub ffffffd6ffffffa3ffffffebffffffc0) hub
    |__1-3.3     0658:0200:0000 02  2.00   12MBit/s 100mA 2IFs ( ffffffd1ffffffb2ffffffdbffffffad)
    |__1-3.4     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
  |__2-1         0bc2:231a:0710 00  3.00 5000MBit/s 896mA 1IF  (Seagate Expansion NAAR8ZK1)
  |__2-3         05e3:0612:9224 09  3.00 5000MBit/s 0mA 1IF  (GenesysLogic USB3.0 Hub ffffffd6ffffffa3ffffffebffffffcb) hub

I have the two devices created with the correct permissions

/dev/ttyACM1
/dev/ttyACM2

But OpenHab (in a container managed by Docker) cannot access the zwave device…

Are there anybody having the same problem ?

Eventually, it works but it seems that the new version of DSM does not really take into account my "50-usb-zwave.rules” file in /lib/udev/rules.d

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

So the devices do no appear with the correct names. I have had to modify the environment variables in the two containers (Deconz and OpenHAB) to provide the correct ones. But there is a chance to have different device names in a next reboot of my synology…

I have something similar.

I could map the devicenames with the 99-rules and access this names directly at the Synology console.

But if I try to map my devices via the json-import at the Docker-UI, Docker removes the device section at any startup. No chance to map the sys-link device names to UI. If I run the Container privileged, I could access the device by system name /dev/ttyacm0 at least.

I did no progress on this issue waiting a reboot of my synology to try to see what is the cause of the problem. I am thinking to move OpenHAB from my Synology to a rpi4 in a din box installed in the electrical board of my house.
Updating OpenHAB with newer version will be much easier by the way.

Hi

I have had some issues with using the “docker run” command.
I then switched to create the docker container from the command line and run it from the Web UI this has worked better. I use this command.

sudo docker create --name openhab-3.1 --no-healthcheck --net=host --device=/dev/ttyACM0 --device=/dev/ttyUSB0 -v /etc/localtime:/etc/localtime:ro -v /etc/TZ:/etc/timezone:ro -v /volumeUSB1/usbshare/docker/openhab-3.1/addons:/openhab/addons -v /volumeUSB1/usbshare/docker/openhab-3.1/conf:/openhab/conf -v /volumeUSB1/usbshare/docker/openhab-3.1/userdata:/openhab/userdata -e "EXTRA_JAVA_OPTS=-Duser.timezone=Europe/Copenhagen" -e "JAVA_HOME=/usr/lib/jvm/default-jvm" -e "OPENHAB_HTTP_PORT=8089" -e "OPENHAB_HTTPS_PORT=8449" -e "USER_ID=1042" -e "GROUP_ID=65539" openhab/openhab:3.1.0

The “–no-healthcheck” can be removed I added it to try and reduce the disk activity and allow hibernation of the disks.
You properly need to change the USER_ID and GROUP_ID to match your system.

Thanks to have shared this. I used “run” instead of “create”. I have had to stop the container and then run it with the UI. I will use this command when I will update OpenHAB with the next milestone version.

By the way, is there something specific to use the HomeKit service while running OpenHAB within a docker container ? I have the known issue of the HomeKit service that stopped working after a couple of days. I tried the solution mentioned in the community forum, but the problem is still not solved. I have to restart the HomeKit bundle on a regular basis.

For the new update on DSM 7 and missing the ttyACM0 a nice tutorial is written by Marius Bogdan Lixandru, see Synology: How to Add USB Support on DSM 7 – Marius Hosting