Unable to bind Z-wave modem in LXC container

liquidox

Renowned Member
Sep 21, 2016
37
4
73
80
I have an Aeon Labs Z-wave Gen 5 (http://aeotec.com/z-wave-usb-stick) stick plugged into the host:
Code:
crw-rw---- 1 root dialout 166, 0 Sep 20 18:53 /dev/ttyACM0

I have tried to make this device available in one of my LXC containers as such:
Code:
lxc.cgroup.devices.allow: c 166:* rwm
lxc.mount.entry = /dev/ttyACM0 dev/ttyACM0 none bind,optional

However, nothing appears on the LXC container (Arch Linux). I appear to be having this exact problem:
http://serverfault.com/questions/663433/how-to-connect-a-dev-usb-modem-in-an-lxc-container

The solution there is regarding creating the device using touch. I have done so on the host:
Code:
 touch /var/lib/lxc/107/rootfs/dev/ttyACM0

But no luck, the device refuses to appear within the container (after reboot as well of course).

Any ideas and/or help would be much appreciated!
 
Thank you thank you thank you!

This was the key:
Code:
lxc.mount.entry = /dev/ttyACM0 dev/ttyACM0 none  bind,create=file 0 0

Finally I can move on!

I've followed you steps and see the device under /dev/ttyACM0 now, however when trying to initialise with openzwave control panel, i've receiving this error, don't suppose you can help?

2017-01-05 14:12:15.077 Always, OpenZwave Version 1.4.2315 Starting Up
2017-01-05 14:16:07.072 Info, Setting Up Provided Network Key for Secure Communications
2017-01-05 14:16:07.072 Warning, Failed - Network Key Not Set
2017-01-05 14:16:07.072 Info, mgr, Added driver for controller /dev/ttyACM0
2017-01-05 14:16:07.072 Info, Opening controller /dev/ttyACM0
2017-01-05 14:16:07.072 Info, Trying to open serial port /dev/ttyACM0 (attempt 1)
2017-01-05 14:16:07.072 Error, ERROR: Cannot open serial port /dev/ttyACM0. Error code 13
2017-01-05 14:16:07.072 Error, ERROR: Failed to open serial port /dev/ttyACM0
2017-01-05 14:16:07.072 Warning, WARNING: Failed to init the controller (attempt 0)
2017-01-05 14:16:12.072 Info, Opening controller /dev/ttyACM0
2017-01-05 14:16:12.073 Info, Trying to open serial port /dev/ttyACM0 (attempt 1)
2017-01-05 14:16:12.073 Error, ERROR: Cannot open serial port /dev/ttyACM0. Error code 13
 
I've followed you steps and see the device under /dev/ttyACM0 now, however when trying to initialise with openzwave control panel, i've receiving this error, don't suppose you can help?
You must be close, this feels like a permission issue, running as root?
 
Hey, that was it, i googled on this topic and had to add my hass user to "dialout" group. At least i thought that fixed things but i still can't get anything to show up in HA!

I have installed openzwave admin panel and i see the device there but it was "last heard" some time ago now, does that mean the connection there has dropped, is there a way to reestablish it?

Sorry i know this may be offtopic from this thread now but it still might be related :D

On the topic of the zstick itself, i removed it to pair my switch device, and when i reconnected it was ACM1, so i've had to change all my configs around, is it possible to fix it to ACM0 ?
 
The zwave admin panel has quite some features, did you stop HASS before using the panel as well? Not sure it even starts then anyway. The device you're talking about is the Stick itself or an actual Zwave device?

I've had the same issue regarding ACM1 renaming, it can happen on server restarts, but I haven't had it in a long time. I never remove the Z-stick, I wouldn't know why.
 
Hey, yea it turned out that i had HASS running :)

Regarding the ACM1 naming, i had to take it out to pair a device, maybe this isn't needed but that what it said in the manual :)
 
Sounds strange, I don't think this is needed at all, I don't even get it, the Z-stick should be connected/powered, your Z-wave panel opened, and then do the pairing live, it will show up, should anyway!
 
Sounds strange, I don't think this is needed at all, I don't even get it, the Z-stick should be connected/powered, your Z-wave panel opened, and then do the pairing live, it will show up, should anyway!

How do I do live pairing? All instructions I've read for the zstick say you need to press buttons on it and put it next to the device being paired
 
How do I do live pairing? All instructions I've read for the zstick say you need to press buttons on it and put it next to the device being paired
I added a Aeotec Zwave door sensor a few weeks ago again, never removed the Z-stick, just a bit of a hassle to get it to work in the first place, but it involved the Openzwave controller software and Z-stick running.
 
Having the same trouble as everyone, but not able to resolve, have tried everything in this thread and now tearing my hair out! Has anyone managed to get it into a Ubuntu16_04 container, wondering if this is my issue?

Basically at the top of my conf file have:
Code:
lxc.cgroup.devices.allow: c 166:* rwm
lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file

Tried following from this blog as well: https://deviantengineer.com/2016/11/lxc-passthrough/ but still nothing showing up when
Code:
ls /dev/
.
Might try an Arch Linux container, see if I can get that working :(
 
Did you take a look at my post? Try those steps and if does not work also post the output of the commands.

Regards, Jonas
 
Did you take a look at my post? Try those steps and if does not work also post the output of the commands.

Regards, Jonas
Hi Jonas,
Did follow yours as well, here's my outputs, pretty similar to yours:
Code:
root@proxmox:~# lsusb
Bus 003 Device 003: ID 0658:0200 Sigma Designs, Inc.
root@proxmox:~# ls -l /dev/bus/usb/003/003
crw-rw-r-- 1 root root 189, 258 May 25 17:17 /dev/bus/usb/003/003
root@proxmox01:~# nano /etc/pve/nodes/proxmox/lxc/111.conf
# Pasted in top of file
lxc.cgroup.devices.allow: c 189:258 rwm
lxc.mount.entry: /dev/bus/usb/003/003 dev/bus/usb/003/003 none bind,optional,create=file
root@proxmox:~# ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 May 25 17:17 /dev/ttyACM0
root@proxmox:~# nano /etc/pve/nodes/proxmox/lxc/111.conf
# Pasted just below other two lines:
lxc.cgroup.devices.allow: c 166:* rwm
lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file

So my full conf file is:
Code:
lxc.cgroup.devices.allow: c 189:258 rwm
lxc.mount.entry: /dev/bus/usb/003/003 dev/bus/usb/003/003 none bind,optional,create=file
lxc.cgroup.devices.allow: c 166:* rwm
lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
arch: amd64
cpulimit: 1
cpuunits: 1024
hostname: openhab
memory: 1024
net0: bridge=vmbr0,hwaddr=3A:63:37:34:30:39,ip=dhcp,name=eth0,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-111-disk-1,size=8G
swap: 1024

But when I restart the CT 111 I don't see /dev/ttyACM0 :
Code:
root@openhab:~# ls /dev
console  core  fd  full  hugepages  initctl  log  lxc  mqueue  null  ptmx  pts  random  shm  stderr  stdin  stdout  tty  tty1  tty2  urandom  zero

Am I doing something wrong?
 
Got it working! When I was shutting down the container, I was just sshing and 'shutdown -r now'. But when I shutdown, then started from proxmox web gui, after starting up shows the device!! Previously if I made a mistake in conf file if I restarted in the container it would break it, so not sure why that made a difference. Thanks for the awesome work everyone!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!