I’m happy to report that my test setup using ser2net and socat is successful. I’m posting my configs here for future reference (and for anyone else that might find it helpful).
Main Server
OS: FreeBSD 12.0
Install/Setup OpenHAB and Socat
pkg install -y socat openhab2 openhab2-addons
sysrc openhab2_java_opts="-Djava.net.preferIPv4Stack=true -Dgnu.io.rxtx.SerialPorts=/dev/cuau0" openhab2_enable="YES" socat_enable="YES" socat_daemonuser="root"
Setup socat
using /usr/local/etc/socat-instances.conf
(this is FreeBSD specific). 192.168.0.61 is IP of RaspberryPI 3.
[zstick]
flags="pty,link=/dev/cuau0,user=uucp,group=dialer,mode=777,raw tcp:192.168.0.61:3333"
There was one slight issue with permissions for /var/spool/lock
. OpenHAB was unable to create lock files in that directory. This was fixed by opening up the permissions to rwx for all users.
chmod 777 /var/spool/lock
A better approach might be to add the openhab
user to the dialer
group on the OS level.
Start services
service socat start
service openhab2 start
RaspberryPI 3
OS: FreeBSD 12 for RPI3
Extract and write OS image to SD card (/dev/daX)
fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/12.0/FreeBSD-12.0-RELEASE-arm64-aarch64-RPI3.img.xz
unxz FreeBSD-12.0-RELEASE-arm64-aarch64-RPI3.img.xz | dd of=/dev/daX bs=10M
Install/Setup ser2net
pkg install -y ser2net
sysrc ser2net_enable="YES"
Setup ser2net
by putting this line into /usr/local/etc/ser2net.conf
. Where /dev/cuaU0
is the device name of the z-stick
3333:raw:0:/dev/cuaU0:115200 8DATABITS NONE 1STOPBIT
Start services
service ser2net start
OpenHAB
Then just follow the tutorial at https://www.openhab.org/docs/tutorial/configuration.html, add your Z-Wave Serial Controller by pointing to /dev/cuau0
.