Can't find zwave usb device running in docker container

After a final crash on my RPi w. OH2 I decided to bite the bullet and move on to OH3. To avoid the issues I have had on the Pi, I decided to go for a NUC with Docker which is already in use for Influx an Grafana. The problem is that OH doesn’t “see” the Aeotec zwave-device. I understand from the documentation that you have to allow permissions for the openhab container to access the usb/serial device, so I tried the following:

> docker exec -d openhab /bin/chmod o+rw /dev/ttyACM0

But nothing pops up in the inbox. The command below shows that the device is connected and identified by Ubuntu:

> udevadm info /dev/ttyACM0
E: ID_MODEL_FROM_DATABASE=Aeotec Z-Stick Gen5 (ZW090) - UZB

I also tried setting the device directly in the docker-compose file, but still no luck.
Any ideas on how to move forward?

openhab:
    image: "openhab/openhab:3.1.0"
    restart: always
    network_mode: host
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/timezone:/etc/timezone:ro"
      - "./openhab_addons:/openhab/addons"
      - "./openhab_conf:/openhab/conf"
      - "./openhab_userdata:/openhab/userdata"
    ports:
      - 8080:8080
      - 8443:8443
    environment:
      OPENHAB_HTTP_PORT: "8080"
      OPENHAB_HTTPS_PORT: "8443"
      EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"
      USER_ID: "997"
      GROUP_ID: "997"
    devices:
      - "/dev/ttyACM0:/dev/ttyACM0:rwm"
  • Platform information:
    • Hardware: Intel NUC
    • OS: Ubuntu 20.4.1 with Docker and Docker compose
    • openHAB version: 3.1.0

Does User ID 997 have read & write access to the host port?

Yes I think so - user/group 997 is the openhab user:

> id openhab
uid=997(openhab) gid=997(openhab) groups=997(openhab)

Isn’t that what the “docker exec…” command is supposed to do?

Not if the underlying user on the OS does not already have the needed access.

Ok, gave that a try:

> ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Jul 31 10:01 /dev/ttuACM0
> usermod -a -G dialout openhab
> id openhab
uid=997(openhab) gid=997(openhab) groups=997(openhab),20(dialout)

Didn’t work. nothing in the inbox so as a last resort I tested chmod 777 /dev/ttyACM0, but nothing.
Am I missing something fundamental here?

I use Docker run instead of Docker-compose & “cheat” by running in privileged mode which gives access to all ports & devices.

I tried privileged in compose and it didn’t work either. Would you mind sharing your run-command? Maybe there is something wrong with my zwave-stick :thinking:

Fist step. Are you sure the stick is at /dev/ttyACM0? What is the output of sudo dmesg | grep tty ? The stick may be somewhere else.

Thanks for trying. sudo dmesg | grep tty returns nothing. udevadm info /dev/ttyACM0, which I thought verified that I used the correct port returns:

...
E: ID_MODEL_FROM_DATABASE=Aeotec Z-Stick Gen5 (ZW090) - UZB
...
1 Like

No guarantees, but you can try this. The backslashes are for readability since it is all on one line. the backslashes remove the line breaks for the OS.

docker run --init -d \
  --name openhab \
  --privileged \
  --restart=unless-stopped \
  -v /etc/localtime:/etc/localtime:ro \
  -v /etc/timezone:/etc/timezone:ro \
  -v ./openhab_addons:/openhab/addons \
  -v ./openhab_conf:/openhab/conf \
  -v ./openhab_userdata:/openhab/userdata \
  -e USER_ID=997 \
  -e GROUP_ID=997 \
  -e OPENHAB_HTTP_PORT=8080 \
  -e OPENHAB_HTTPS_PORT=8443 \
  -e "EXTRA_JAVA_OPTS=-Duser.timezone=Europe/Berlin" \
  --network=host \
  openhab/openhab:3.1.0

1 Like

Thanks, but still no luck. This might be a bigger issue - I found this thread on the subject: Z-Wave USB stick not working after OH 3.1 update