OpenZwave help

Hello,

I have spent countless hours trying to set up my sigma zwave stick in home assistant and I have hit a wall. I would appreciate any suggestions.

My setup:
I am running Alpine Linux in ESXi as my docker host. On the Alpine host I am running HA in a docker container.

Steps:
I plugged the sigma zwave stick into my esxi box. ESXi recognizes it and it appears in the dropdown for USB passthrough in my guest OS settings (Alpine). I then reboot Alpine and find out that it can now see the sigma stick as /dev/bus/usb/002/004

:zap: root@alpine  /var/lib/docker/volumes/home-assistant_data/_data  lsusb
Bus 002 Device 002: ID 0e0f:0003
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 004: ID 0658:0200
Bus 002 Device 003: ID 0e0f:0002
Bus 002 Device 001: ID 1d6b:0001

0658:0200 is the sigma stick address. Permissions appear to match how I am running HA. I then restart my HA docker container with a --device argument and map /dev/bus/usb/002/004 to the same path in the docker container.

I then use HA UI to set up zwave. I pass it the above path and it detects a zwave device and starts it up. Unfortunately I get errors about the fact that it can’t access the serial port or initialize the manger.

2018-12-14 19:20:40 WARNING (MainThread) [homeassistant.components.zwave] Z-Wave not ready after 300 seconds, continuing anyway,
2018-12-14 19:20:40 INFO (MainThread) [homeassistant.components.zwave] final network state: 1 Driver failed,
2018-12-14 19:20:40 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved,
Traceback (most recent call last):,
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run,
    result = self.fn(*self.args, **self.kwargs),
  File "/usr/src/app/homeassistant/components/zwave/__init__.py", line 703, in _finalize_start,
    network.set_poll_interval(polling_interval, False),
  File "/usr/local/lib/python3.6/site-packages/openzwave/network.py", line 894, in set_poll_interval,
    self.manager.setPollInterval(milliseconds, bIntervalBetweenPolls),
  File "/usr/local/lib/python3.6/site-packages/openzwave/network.py", line 564, in manager,
    raise ZWaveException(u"Manager not initialised"),
openzwave.object.ZWaveException: 'Zwave Generic Exception : Manager not initialised',

Z-Wave Notification DriverFailed : {'notificationType': 'DriverFailed', 'homeId': 0, 'nodeId': 255}

Any ideas? And before anyone asks, I have no idea why it doesn’t generate a /dev/tty* entry. I figure it may be an alpine linux peculiarity. It certainly sees it in lsusb.

Add the user running home Assistant to dialout

sudo adduser homeassistantuser dialout

U might want to add flags to docker

-e PGID=1000 -e PUID=1000

Those both values need to match the I’d of user Hass …

U can check this with user id (homeassistantuser I’d)

Check your /var/logs/syslog for any errors a tty device should show up for the stick for serial communication. Otherwise it won’t work.

Thanks for the suggestion, but /dev/bus/usb/002/004 is already in the dialout group, as is my HA user.

Still getting the following in zwave log.

2018-12-14 20:07:17.820 Always, OpenZwave Version 1.4.3254 Starting Up
2018-12-14 20:07:18.399 Info, Setting Up Provided Network Key for Secure Communications
2018-12-14 20:07:18.399 Info, mgr,     Added driver for controller /dev/bus/usb/002/004
2018-12-14 20:07:18.399 Info,   Opening controller /dev/bus/usb/002/004
2018-12-14 20:07:18.400 Info, Trying to open serial port /dev/bus/usb/002/004 (attempt 1)
2018-12-14 20:07:18.400 Error, ERROR: Failed to set serial port parameters
2018-12-14 20:07:18.400 Error, ERROR: Failed to open serial port /dev/bus/usb/002/004
2018-12-14 20:07:18.400 Warning, WARNING: Failed to init the controller (attempt 0)
2018-12-14 20:07:23.400 Info,   Opening controller /dev/bus/usb/002/004
2018-12-14 20:07:23.400 Info, Trying to open serial port /dev/bus/usb/002/004 (attempt 1)
2018-12-14 20:07:23.400 Error, ERROR: Failed to set serial port parameters
2018-12-14 20:07:23.400 Error, ERROR: Failed to open serial port /dev/bus/usb/002/004
2018-12-14 20:07:23.400 Warning, WARNING: Failed to init the controller (attempt 1)
2018-12-14 20:07:28.400 Info,   Opening controller /dev/bus/usb/002/004
2018-12-14 20:07:28.400 Info, Trying to open serial port /dev/bus/usb/002/004 (attempt 1)
2018-12-14 20:07:28.400 Error, ERROR: Failed to set serial port parameters
2018-12-14 20:07:28.400 Error, ERROR: Failed to open serial port /dev/bus/usb/002/004
2018-12-14 20:07:28.400 Warning, WARNING: Failed to init the controller (attempt 2)
2018-12-14 20:07:33.400 Info,   Opening controller /dev/bus/usb/002/004
2018-12-14 20:07:33.400 Info, Trying to open serial port /dev/bus/usb/002/004 (attempt 1)
2018-12-14 20:07:33.401 Error, ERROR: Failed to set serial port parameters
2018-12-14 20:07:33.401 Error, ERROR: Failed to open serial port /dev/bus/usb/002/004
2018-12-14 20:07:33.401 Warning, WARNING: Failed to init the controller (attempt 3)
2018-12-14 20:07:38.401 Info,   Opening controller /dev/bus/usb/002/004
2018-12-14 20:07:38.401 Info, Trying to open serial port /dev/bus/usb/002/004 (attempt 1)
2018-12-14 20:07:38.401 Error, ERROR: Failed to set serial port parameters
2018-12-14 20:07:38.401 Error, ERROR: Failed to open serial port /dev/bus/usb/002/004
2018-12-14 20:07:38.401 Warning, WARNING: Failed to init the controller (attempt 4)
2018-12-14 20:07:38.401 Detail, contrlr, Notification: DriverFailed

Firstof9, I am getting a continuous stream of these…

40 Dec 14 15:20:08 alpine auth.err getty[17378]: tcgetattr: I/O error^M
 41 Dec 14 15:20:08 alpine kern.warn kernel: [404227.338674] ttyS ttyS0: tty_port_close_start: tty->count = 1 port count = 2
 42 Dec 14 15:20:18 alpine daemon.info init: process '/sbin/getty -L 115200 ttyS0 vt100' (pid 17378) exited. Scheduling for restart.
 43 Dec 14 15:20:18 alpine daemon.info init: starting pid 17389, tty '/dev/ttyS0': '/sbin/getty -L 115200 ttyS0 vt100'

All on ttyS0. Unsure if it is related.

I would not assume the device /dev/bus/usb/002/004 provides a serial interface. Have you tried the typical /dev/ttyACM0 or the symlink such as /dev/serial/by-id/usb-0658_0200-if00?

I do not have a ttyACM0 or a serial folder in my alpine linux /dev dir.

Well, I’m not familiar with Alpine linux and how it creates devices, but I think you’ll need the serial devices. The Sigma USB devices have two interfaces, one is the serial port which is what OZW uses to talk to it, the other is something called a ‘CDC Data’ interface. lsusb -v shows that info.

Did you install libusb and eudev packages? Here’s some random Dockerfile I found using alpine and openzwave. https://github.com/ruimarinho/docker-openzwave/blob/master/Dockerfile

Thanks. I installed both those packages and restarted. Same issue. I get the usb device in dmesg, but it is only listed by id. Still shows in lsusb (-v doesn’t show any additional output). Still no mapping to a /dev/tty*

What version of ESXi?

You may need to disable the newer usb driver:

esxcli system module set -m=vmkusb -e=FALSE

Do I need to reboot ESXi after running that, or will that re-activate the module?

Yes you have to restart the hypervisor.

No Joy. The sigma zwave stick was detected my ESxi as a “Sigma modem” with that module change, but after activating the passthrough, Alpine still just detects it as /dev/bus/usb/002/004. No reference to a /dev/tty entry in dmesg, just references it by id.

hmm, the cdc_acm.ko module isn’t in the version of alpine I am using. I have seen other os’s detect it using this driver. Is there a way to get this manually?

What kernel package do you have installed? It’s included in linux-vanilla. https://pkgs.alpinelinux.org/contents?file=cdc-acm.ko&path=&name=&branch=edge

Ha, exactly my thought. I had virtual hardened. Just got finished installing vanilla and it created /dev/ttyACM0 right away…

smacks head.

Wish I had figured that out days ago :slightly_smiling_face:

I wonder if I can copy that module over to my old VM and load it with modprobe to avoid setting up docker again on a new VM.

Anyway, thanks everyone for your input.