[SOLVED] Z-wave stick in docker container on a synology

Tags: #<Tag:0x00007fe732f174f0>
  • Platform information:
    • Hardware: HPE ProLiant MicroServer Gen8 | Intel Core i3 | 12GB RAM
    • OS: Synology DSM 6.1.3
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 2.1.0
  • Issue of the topic: I have run OpenHAB 2.1.0 in a Docker container on a synology DSM and when i will add the z-wave stick i get the status error OFFLINE - COMMUNICATION_ERROR zwave.thingstate.serial_notfound

This is my docker run command:
sudo docker run --name openHAB2test -u root --net=host -e “EXTRA_JAVA_OPTS=-Dgnu.io.rxtx.SerialPorts=-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0” -v /etc/localtime:/etc/localtime:ro -v /etc/TZ:/etc/timezone:ro -v /volume1/docker/openHAB2test/addons/:/openhab/addons -v /volume1/docker/openHAB2test/conf/:/openhab/conf -v /volume1/docker/openHAB2test/userdata/:/openhab/userdata --device=/dev/ttyACM0 --privileged=true openhab/openhab:2.1.0-amd64-debian

Maybe someon has the same issue, i also tried to add sudo adduser openhab dialout and sudo adduser openhab tty

But this not solved the problem for me.

in the shell of openhab i can find the /dev/ttyACM0 folder.

Kind regards,
Martin

hi martin, i don’t use docker but i do use a z-stick on a synology.

What I had to do to get it working is detailed here:-

Hope it helps.

my result of ls -l is crw------- 1 root root 166, 0 Nov 5 14:47 /dev/ttyACM0

then you possibly need to create the two files it details. That’s what I needed for my own setup (tho as I said, that’s not with docker).

I have now added these 2 scribts on the syno, in the docker container i have now the same rights (crw-rw---- 1 root dialout 166, 0 Feb 26 09:40 /dev/ttyACM0) but i have not the openhab user on the synology, the openhab user is only in the container, in the docker container i have added the user to the groups, but the problem is the same, i will try today to give the stick on the synology full acces ( chmod 777 /dev/ttyAM0)

chmod 777 /dev/ttyAM0 on the synology solved my problem :slight_smile:
Now the z-wave stick works in Docker

2 Likes

Does this work for you even after a restart of the Synology host or do you have to execute the chmod command after every DSM reboot?

That’s what I’m experiencing . Any solution to make it persistent?

This was working, but when i has stopped the container and startet it, the zwave stick was not working anymore, then you need to restart the synology, than i had to run the commando always after a DSM reboot.
It was a great experience with docker, but there were always such small issues.
It was never so easy to expand the system with new sticks etc., so i have installed openhab on a raspberry pi.

Thx for your reply @mpuff

Just stopping and starting the container works for me.
But after each DSM restart I have to execute the chmod command again.
So I think I have to start looking for some config to make this persistent. Maybe udev rules are a way to go…

So just for reference, this is what works for my setup now for several hours with some restarts

Hi all,

I am also struggling with the Aeotec Gen5 USB stick.
chmod 777 /dev/ttyACM0 helps for me; but doing that after each restart is not a solution.

The udev rule is great - but somehow it is not working for me. After each restart the stick is still dev/ttyACM0 and not “USBzwave”
I did not create the homeautomation group and therefore removed the “GROUP=homeautomation” part in the rules-file.

Is this necessary? If yes; how do I add user root the group? Any other hints what I might do wrong?

Thanks in advance

Hello,
I probably have the same problem that was solved here a year and a half ago.
Unfortunately my technical understanding is at the level that is assumed here.
Perhaps I may go back and check again (ah, I forgot to say that I am trying out Openhab3/Mileston 2 in the container):

Basically I don’t know how I can enter the CMOD command in the Docker App in the DSM? It looks like this for me:

on my Raspberry (= openhab2 productive system) I go in via Putty … but here on the Synology I can’t find the right port … if it is one of these … it wouldn’t work:

grafik

I am stuck as “stuck”

are you passing it through to the container? you need to have the permissions set via ssh on the Syno not the docker.

then SSH to your syno and be sure the /dev/ttyACM is owned by the user that the docker openhab runs as:

ll /dev/ttyACM0
crwxrwxrwx 1 docker-rw openhab 166, 0 Nov 20 19:58 /dev/ttyACM0

my docker containers run as docker-rw (probably the same for you)

Mmmh, still have problems … I have now logged in with the user who also has docker permission

But CMOD still won’t work:
grafik

its “chmod”

oh, silly me … but no difference:
grafik

are you root?
do a reboot with the stick attached and try again

its ttyACM0 not AM0

Okay, now it works … i’ve walked this path:

1a) give “high priority” zu Container:
grafik
1b) be sure that the Openhab-Admin-User have has the correct permissions on the Synology:

1c) restart synology NAS
2) SSH to NAS with a AdminUser with appropriate access rights to the “Docker” folder:

b) CHMOD per SSH:
grafik
do not be confused - I mistyped my password once

  1. a) Try to find the Thing and creation (OH3 Mileston 2):

b) entry for “serial port” added and saved

Thing created and here we go:

1 Like