openHAB3 Azul Java 11 RXTXCommDriver error - Z-Wave stick

I am trying to add an aeotec Z-Wave stick to my openHAB.

The Z-Wave stick is “Aeotec Z-Stick S2”. Aeotec say the “S2” represents the fact it was the 2nd edition of Z-Stick, not S2 security.
The stick is model DSA02203-ZWAU (921.42MHZ) is (in 2021) discontinued, but aeotec list 2 support articles here: Z-Stick S2 : Aeotec Help Desk.

My openHAB is openHAB 3.0.1 running on MacMini (M1 chip). I installed the M1 (arm64) native Java 11 runtime environment (JRE) from https://www.azul.com/downloads/zulu-community/?version=java-11-lts&os=macos&architecture=arm-64-bit&package=jre

I identified what serial port the stick uses by comparing the content of the /dev folder before and after the stick being plugged in:

To save including all 350 entries in /dev, let me filter out the two new entries to show the 2 entries created when I plug in the stick:

Before plugging Z-Wave stick in:

john@Johns-Mac-mini /dev % ls -l cu.*
crw-rw-rw-  1 root  wheel    9,   5  8 Mar 17:46 cu.Bluetooth-Incoming-Port
crw-rw-rw-  1 root  wheel    9,   1  8 Mar 17:46 cu.debug-console
crw-rw-rw-  1 root  wheel    9,   3  8 Mar 17:46 cu.wlan-debug
john@Johns-Mac-mini /dev % ls -l tty.usb*
zsh: no matches found: tty.usb*

after plugging Z-Wave stick in:

john@Johns-Mac-mini /dev % ls -l cu.*    
crw-rw-rw-  1 root  wheel    9,   5  8 Mar 17:46 cu.Bluetooth-Incoming-Port
crw-rw-rw-  1 root  wheel    9,   1  8 Mar 17:46 cu.debug-console
crw-rw-rw-  1 root  wheel    9,   7  9 Mar 04:41 cu.usbserial-0001
crw-rw-rw-  1 root  wheel    9,   3  8 Mar 17:46 cu.wlan-debug
john@Johns-Mac-mini /dev % ls -l tty.usb*
crw-rw-rw-  1 root  wheel    9,   6  9 Mar 04:41 tty.usbserial-0001
john@Johns-Mac-mini /dev %

I note that the added /dev entries BOTH have permissions of crw-rw-rw-. The final rw means anyone can read and write to the port, independant of the fact they have a user and group of root and wheel.

crw-rw-rw-  1 root  wheel    9,   6  9 Mar 04:41 tty.usbserial-0001
crw-rw-rw-  1 root  wheel    9,   7  9 Mar 04:41 cu.usbserial-0001

I think this means the java process should be able to read and write to/from the serial port without further ado.

I added the Z-Wave Binding (binding-zwave) version 3.0.1.

I added a Thing “Z-Wave Serial Controller”, and set the Serial Port to ‘/dev/tty.usbserial-0001’ and clicked save in the top right hand corner of the ‘Z-Wave Serial COntroller’ screen. I also tried ‘/dev/cu.usbserial-001’. Same result for both: In the shell running openHAB, I get:

java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver

This logs to the console again and again. I removed the Thing I created above, and the logging to the console stops.

Looking at gatekeeper6838’s suggestion from [SOLVED] OH3: zwave binding Z-Wave Serial Controller Aeotec Z-Stick Gen5 remains offline - #32 by gatekeeper6838

On my MacMini, /var/lock does not exist:

sudo ls -al /var/lock
ls: /var/lock: No such file or directory

SO I looked at this thread: [SOLVED] No access to USB zwave stick - #10 by sihui

and sought how to install RXTX java extension on my mac. I followed this short tutorial: RXTX for Mac OS X

But in the GUI, the Thing I create is still showing offline, and the RXTXCommDriver error is stil logging to the console when ever the Thing exists.

How can I get my Z-Wave stick working in openHAB3? I am considering installing openHAB2.5 instead, as this problem appears to have started only with 3.

Thanks in advance.

Hi @autefrum ,

I’m trying to do an install and have come across the exact same issue. Have you figured this out? Doesn’t seem like too many M1 Mac users. Appreciate any help because I did pretty much all what you did before finding this post!

Thanks!

Not yer, have no got the z-wave stuff working at this stage. Have bought a rabpberry pi and just installed openhab 3 using openhabian, so will be trying that approach next. The raspberry pi is powerfull enough, and will be a better solution than the overkill of a mac mini.

There’s no ARM64 binaries included for RXTX.
To fix it, install rosetta 2, install java as x64 instead of arm64, and run openhab again - making sure it uses the java from that x64 install.

I followed this way to install brew x64, and then Zulu java:

Make sure rosetta is installed: softwareupdate --install-rosetta
Install brew x64 mode: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Install zulu java x64 mode: arch -x86_64 /usr/local/bin/brew install --cask zulu

Make sure openhab is using the java from that install…

ps. if you don’t have write access to the USB port, try adding your user to the wheel group.

Update; for the openhab scripting language to work properly, and perhaps more, you need Zulu 11, not 17 (currently latest).
I uninstalled zulu, added cask versions arch -x86_64 /usr/local/bin/brew tap homebrew/cask-versions
and added latest zulu@11 arch -x86_64 /usr/local/bin/brew install --cask zulu@11
to fix.