Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


SumnerBoy

2079 posts

Uber Geek
+1 received by user: 306

ID Verified
Lifetime subscriber

#273356 18-Aug-2020 10:28
Send private message

Fairly specific question, but I am in the process of moving all my self-hosted services to a docker swarm (running on 3 x NUCs). I am trying to get openHAB running with the Z-Wave binding, which needs access to a Z-Wave USB stick. I have plugged this into one of the NUCs and given that node a label in the cluster, and configured the openHAB stack to only run on that node. I am deploying with Ansible so the idea is if that NUC dies I can move the Z-Stick to another node, update the label and openHAB should spin up on the new node with very little downtime.

 

However, I can't figure out how to allow the /dev/ttyACM0 device to be visible inside the openHAB container. I have tried a myriad of different things but nothing is working. I was hoping that someone on here might have solved this problem already?!

 

I have tried setting up a UDEV rule which maps the USB device to /dev/zwave and than add a docker volume to the openHAB stack via;

 

 

services:
  app:
    image: openhab/openhab:latest
    env_file: /var/data/config/openhab/openhab.env
    volumes:
      - /var/data/openhab/addons:/openhab/addons
      - /var/data/openhab/conf:/openhab/conf
      - /var/data/openhab/userdata:/openhab/userdata
      - /etc/localtime:/etc/localtime:ro
      - /dev/zwave:/dev/zwave              # <------------ zwave usb stick mounted as a volume in the container
    networks:
      - internal
    deploy:
      placement:
        constraints: [node.labels.zwave_usb == true]

 

 

I have given the device 666 permissions also. Running out of ideas...whenever openHAB starts it just doesn't *see* the device.

 

 


Create new topic
Chippo
129 posts

Master Geek
+1 received by user: 52

Trusted

  #2543508 18-Aug-2020 10:31
Send private message

In my case using a conbee 2 Zigbee stick and passing it to Home Assistant - but it should be similar.

 

I'm passing the full USB device through, rather than what the host it seeing it as:

 

devices: - /dev/ttyUSB0

 

Should also note that I didn't have to make any permission changes on the device

 

 





I work for a global Data Protection Software company - But my opinions are my own.




SumnerBoy

2079 posts

Uber Geek
+1 received by user: 306

ID Verified
Lifetime subscriber

  #2543509 18-Aug-2020 10:32
Send private message

Are you running docker in *swarm* mode?


Chippo
129 posts

Master Geek
+1 received by user: 52

Trusted

  #2543511 18-Aug-2020 10:34
Send private message

No, just a single docker node





I work for a global Data Protection Software company - But my opinions are my own.




SumnerBoy

2079 posts

Uber Geek
+1 received by user: 306

ID Verified
Lifetime subscriber

  #2543513 18-Aug-2020 10:37
Send private message

Ok, unfortunately --devices isn't supported in *swarm* mode.


Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.