Zwave port change

I am running a pi with the Z-Wave ZME_UZB1 Me USB Stick and did not have big problems yet.
However, recently I have experienced that the USB stick used a different port after a power failure in our neighborhood (I did not even touch the pi, nor the stick :wink:
Usually it’s ttyACM0:
[ 5.443830] cdc_acm 1-1.5:1.0: ttyACM0: USB ACM device

After the power failure I got:
openhab.log: Serial Error: Port /dev/ttyACM0 does not exist
and:
[51029.137224] cdc_acm 1-1.5:1.0: ttyACM1: USB ACM device

After a reboot it was fine again.
How to make sure that this does not happpen again!?

Check out the wiki for simlinks -: https://github.com/openhab/openhab/wiki/symlinks

Thanks, Chris.
I will give it a try :smile:

I guess I need some help with it.
I created
/etc/udev/rules.d/50-usb-serial.rules

with (according to my devices) - which I know from lsusb and dmesg
SUBSYSTEM==“tty”, ATTRS{idVendor}==“0658”, ATTRS{idProduct}==“0200”, SYMLINK+=“USB_zwave”, GROUP=“dialout”, MODE=“0666”
SUBSYSTEM==“tty”, ATTRS{idVendor}==“0a5c”, ATTRS{idProduct}==“2122”, SYMLINK+=“USB_bt”, GROUP=“dialout”, MODE=“0666”

I also changed openhab.cfg accordingly:
zwave:port=/dev/USB_zwave

Finally I added to /etc/init.d/openhab (as parameter below JAVA_ARGS_DEFAULT="-Dosgi.clean=true
-Dgnu.io.rxtx.SerialPorts=/dev/USB_bt:/dev/USB_zwave

But I get an error in the openhab.log:
Serial Error: Port /dev/USB_zwave does not exist

But I can see it:
lrwxrwxrwx 1 root root 7 Jan 1 1970 /dev/USB_zwave -> ttyACM0

Did I miss something obvious?

The owner of the Symlink above is root:root, but the ttyACM0 itself belongs to the dialout group.
I cannot change the group to dialout for the Symlink - might this be the problem?
By the way:
In the beginning I did not have access to ttyACM0 (as openhab), so I added the openhab user to the dialout group.
This fixed the problem with the device itself.
So what’s the problem with the Symlink then?

Does anybody have an idea how to solve my issue above?

I have the same error in my log, my USB is on port /dev/ttyUSB0, which is how it is listed in the openhab.cfg and I am getting the same error in my log as well, “Port /dev/ttyUSB0 does not exist”. I can see it:
crw-rw---- 1 root dialout 188, 0 Dec 1 21:01 ttyUSB0

That makes at least three of us - I too get this error. If I change openhab.cfg back to
zwave:port=/dev/ttyACM0

then habmin shows devices fine.

Shame 3 months and no solutions here.

I’m not sure this is an issue with openhab. This sort of issue is more a system issue with the environment so it’s not easy to suggest how to help, and there’s nothing that can be done in openhab itself if the operating system is changing the port ids…

Symlinks are the solution under linux at least, but I agree - they aren’t easy to configure, and in my experience, aren’t always successful.

I appreciate the message and I don’t want to get off topic or a tangent. When I cat sudo cat USB_zwave and move in front of a zwave motion sensor, I see output coming through to the console. So, it seems the OS and symlink are directing output properly? My guess is that some property/configuration/?? in openhab isn’t properly reading from this symlink.

I added -Dgnu.io.rxtx.SerialPorts=/dev/USB_zwave but it seems that kind of property isn’t enough/working…

I’m not an expert in this, so sorry if this is a stupid statement - if you are using ‘cat USB_zwave’, rather than /dev/USB_zwave, then maybe the command line arg shouldn’t have the /dev on the front?

At the end of the day, there’s not much that we can change in OH. The zwave binding uses a serial driver, and the serial driver is reading the command line parameters directly, so all you can change in OH is the command line parameter, and the port setting in the config file.

Having just dealt with this issue, I wanted to post my solution which seems missing in this thread. In addition to the udev rule to add a symlink to whatever the node gets named you need to convince openhab that the new serial link is a valid port. By default it only wants to see tty* nodes. So add it to the extra java opts:

/etc/default/openhab2:
EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/USBzwave"

Putting that under /etc/init.d/openhab2 didn’t work on my install.

2 Likes

shadowmites’s solution worked for me. Thanks!