ZWave binding won't work through a symlink?

I’ve got OH 2 running off a recent Openhabian install on a Raspberry Pi 3.

I noticed that sometimes the Aeon Labs Z-Stick gets a new USB port when you plug it in, and the binding gets confused and nothing works. Which is not a surprise, as it’s suddenly using the old port.

So, I dug around in udev and wrote a udev rule that creates a symlink to whatever the real port is. No matter what ttyUSBx my zstick gets, there’s always a symlink to /dev/ttyUSBx called “zstick” there in dev.

If I set the binding to use /dev/zstick as the port, the binding can never read from the stick and it goes offline, taking my zwave items with it.

If I set the binding to /dev/ttyUSBx, whatever that might be, the stick works.

Has anyone else done this, and gotten it to work? Can this be fixed? Using the symlink would be handy.

I can’t answer your specific question but if you stop OH before removing the dongle and starting OH again after then it will not move ports in you.

I did this when i ran my OH on rpi3 and it worked fine. Have you added the new dev to /etc/default/openhab2 ?

I just found that suggestion elsewhere. My /etc/default/openhab2 now has:

EXTRA_JAVA_OPTS="-Dgnu.io.rxts.SerialPorts=/dev/ttyUSB0:/dev/tty/USB1:/dev/ttyPLM:/dev/ttyZSTICK"

The Insteon PLM module works as /dev/ttyPLM, but the Zstick won’t take /dev/ttyZSTICK. The udev rules are creating those correctly and the point at the right place.

I’m using /dev/ttyUSB0 for the zstick, and it works fine that way.

Until I get this sussed out, @rlkoshak’s work-arund will do, but I’m confused why the symlink won’t work.

I thought I’d reply to this one so it can be marked solved too; I started a newer thread which did get resolved.

You can see both typos I made in the EXTRA_JAVA_OPTS there:

It’s “-Dgnu.io.rxtx…” and it’s /dev/ttyUSB1 without the extra /.

Fixing those gets the symlinks working for me, and made my ID problems go away forever.

1 Like