openHAB crashes when accessing ZWave stick on Synology DS212+

  • Platform information:
    • Hardware: Synology DS212+, MARVELL Kirkwood 88F6282 CPU (ARMv5)
    • OS: DSM 6.1.4-15217 Update 5
    • Java Runtime Environment: SE Embedded Runtime Environment (8.0_151-b12) (from Oracle)
    • openHAB version: 2.2.0.010, installed from package openHAB-2.2.0.010-syno-noarch-0.001.spk

I’m new to openHAB and trying to get it to run properly on my Synology DiskStation DS212+. So far everything went well, openHAB is running very stable with astro, WeatherUnderground and ntp bindungs.
But if I try to configure and use the ZWave binding with a USB ZWave controller ZMEEUZB1 then openHAB just crashes with a Java exception :astonished:

I searched online and made all the suggested modifications to access a ZWave USB stick on Linux in general and a Synology DiskStation in special.

  • created the groups dialout, uucp and tty and added the openhab user to them
  • the USB stick is visible as “/dev/ttyACM0” and should be accessible with the openhab user
crw-rw---- 1 openhab dialout 166, 0 Jan 23 14:33 /dev/ttyACM0
  • created a rules file in “/lib/udev/rules.d/”:
ACTION=="add", KERNEL=="ttyACM[0-9]*", MODE="0660", OWNER="openhab", GROUP="dialout"
  • made “/var/lock/” and “/run/lock” accessible in a script at boot time:
  chown -R root.uucp /run/lock
  chmod -R g+w /run/lock
  chown -R root.uucp /var/lock
  chmod -R g+w /var/lock
  • allowed Java access to the serial port in “/volume1/@appstore/openHAB/runtime/bin/setenv”. It shows up in the crash report, so it seens that the options has been included:
EXTRA_JAVA_OPTS=-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0

The full crash log can be downloaded from my Dropbox hs_err_pid15741.log, but the (maybe) relevant lines from the 70K+ crash log are posted below.

It seems to me that the transition from Java code to the native library to access the serial port is not working properly:

'java/lang/UnsatisfiedLinkError': unsupported JNI version 0x00000002 required by /volume1/@appstore/openHAB/userdata/tmp/libNRJavaSerial_HF_openhab_0/libNRJavaSerial_HF.so
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x4d8c7c1c, pid=15741, tid=0x4d4ef470
#
# JRE version: Java(TM) SE Embedded Runtime Environment (8.0_151-b12) (build 1.8.0_151-b12)
# Java VM: Java HotSpot(TM) Embedded Client VM (25.151-b12 mixed mode linux-arm )
# Problematic frame:
# C  [libNRJavaSerial.so+0x9c1c]  JNI_OnLoad+0x28

0x4d8c7bf4: JNI_OnLoad+0 in /volume1/@appstore/openHAB/userdata/tmp/libNRJavaSerial_openhab_0/libNRJavaSerial.so at 0x4d8be000

Stack: [0x4d4a0000,0x4d4f0000],  sp=0x4d4ecd78,  free space=307k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libNRJavaSerial.so+0x9c1c]  JNI_OnLoad+0x28

Internal exceptions (10 events):
Event: 7283.590 Thread 0x4c2e0000 Exception <a 'java/util/zip/ZipException'> (0x42cb33d8) thrown at [/HUDSON/workspace/8-2-build-elinux-arm-sflt/jdk8u151/9699/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 7293.600 Thread 0x4c2e0000 Exception <a 'java/util/zip/ZipException'> (0x42fffa00) thrown at [/HUDSON/workspace/8-2-build-elinux-arm-sflt/jdk8u151/9699/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 7303.610 Thread 0x4c2e0000 Exception <a 'java/util/zip/ZipException'> (0x4307cf88) thrown at [/HUDSON/workspace/8-2-build-elinux-arm-sflt/jdk8u151/9699/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 7313.620 Thread 0x4c2e0000 Exception <a 'java/util/zip/ZipException'> (0x430e9e80) thrown at [/HUDSON/workspace/8-2-build-elinux-arm-sflt/jdk8u151/9699/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 7323.630 Thread 0x4c2e0000 Exception <a 'java/util/zip/ZipException'> (0x432a8590) thrown at [/HUDSON/workspace/8-2-build-elinux-arm-sflt/jdk8u151/9699/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 7333.640 Thread 0x4c2e0000 Exception <a 'java/util/zip/ZipException'> (0x432da500) thrown at [/HUDSON/workspace/8-2-build-elinux-arm-sflt/jdk8u151/9699/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 7343.650 Thread 0x4c2e0000 Exception <a 'java/util/zip/ZipException'> (0x4334f5a8) thrown at [/HUDSON/workspace/8-2-build-elinux-arm-sflt/jdk8u151/9699/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 7353.659 Thread 0x4c2e0000 Exception <a 'java/util/zip/ZipException'> (0x43e875c8) thrown at [/HUDSON/workspace/8-2-build-elinux-arm-sflt/jdk8u151/9699/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 7363.669 Thread 0x4c2e0000 Exception <a 'java/util/zip/ZipException'> (0x43ecde40) thrown at [/HUDSON/workspace/8-2-build-elinux-arm-sflt/jdk8u151/9699/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 7372.297 Thread 0x4de11c00 Exception <a 'java/lang/UnsatisfiedLinkError': unsupported JNI version 0x00000002 required by /volume1/@appstore/openHAB/userdata/tmp/libNRJavaSerial_HF_openhab_0/libNRJavaSerial_HF.so> (0x44243e08) thrown at [/HUDSON/workspace/8-2-build-elinux-arm-sflt/j

Dynamic libraries:
4d8be000-4d8ca000 r-xp 00000000 09:02 595117     /volume1/@appstore/openHAB/userdata/tmp/libNRJavaSerial_openhab_0/libNRJavaSerial.so
4d8ca000-4d8d9000 ---p 0000c000 09:02 595117     /volume1/@appstore/openHAB/userdata/tmp/libNRJavaSerial_openhab_0/libNRJavaSerial.so
4d8d9000-4d8da000 r-xp 0000b000 09:02 595117     /volume1/@appstore/openHAB/userdata/tmp/libNRJavaSerial_openhab_0/libNRJavaSerial.so
4d8da000-4d8db000 rwxp 0000c000 09:02 595117     /volume1/@appstore/openHAB/userdata/tmp/libNRJavaSerial_openhab_0/libNRJavaSerial.so

VM Arguments:
jvm_args: -Dopenhab.home=/volume1/@appstore/openHAB -Dopenhab.conf=/volume1/@appstore/openHAB/conf -Dopenhab.runtime=/volume1/@appstore/openHAB/runtime -Dopenhab.userdata=/volume1/@appstore/openHAB/userdata -Dopenhab.logdir=/volume1/@appstore/openHAB/userdata/logs -Dfelix.cm.dir=/volume1/@appstore/openHAB/userdata/config -Djetty.host=0.0.0.0 -Djetty.http.compliance=RFC2616 -Dorg.ops4j.pax.web.listening.addresses=0.0.0.0 -Dorg.osgi.service.http.port=8080 -Dorg.osgi.service.http.port.secure=8443 -Djava.awt.headless=true -Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0 -Djava.endorsed.dirs=/var/packages/java8/target/ejdk1.8.0_151/linux_arm_sflt/jre/jre/lib/endorsed:/var/packages/java8/target/ejdk1.8.0_151/linux_arm_sflt/jre/lib/endorsed:/volume1/@appstore/openHAB/runtime/lib/endorsed -Djava.ext.dirs=/var/packages/java8/target/ejdk1.8.0_151/linux_arm_sflt/jre/jre/lib/ext:/var/packages/java8/target/ejdk1.8.0_151/linux_arm_sflt/jre/lib/ext:/volume1/@appstore/openHAB/runtime/lib/ext -Dkaraf.instances=/volume1/@appstore/openHAB/userdata/tmp/instances -Dkaraf.home=/volume1/@appstore/openHAB/runtime -Dkaraf.base=/volume1/@appstore/openHAB/userdata -Dkaraf.data=/volume1/@appstore/openHAB/userdata -Dkaraf.etc=/volume1/@appstore/openHAB/userdata/etc -Dkaraf.logs=/volume1/@appstore/openHAB/userdata/logs -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/volume1/@appstore/openHAB/userdata/tmp -Djava.util.logging.config.file=/volume1/@appstore/openHAB/userdata/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true 
java_command: org.apache.karaf.main.Main
java_class_path (initial): .:/var/packages/java8/target/ejdk1.8.0_151/linux_arm_sflt/jre/lib:/volume1/@appstore/openHAB/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.1.3.jar:/volume1/@appstore/openHAB/runtime/lib/boot/org.apache.karaf.jaas.boot-4.1.3.jar:/volume1/@appstore/openHAB/runtime/lib/boot/org.apache.karaf.main-4.1.3.jar:/volume1/@appstore/openHAB/runtime/lib/boot/org.osgi.core-6.0.0.jar
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=/var/packages/java8/target/ejdk1.8.0_151/linux_arm_sflt/jre
CLASSPATH=.:/var/packages/java8/target/ejdk1.8.0_151/linux_arm_sflt/jre/lib:/volume1/@appstore/openHAB/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.1.3.jar:/volume1/@appstore/openHAB/runtime/lib/boot/org.apache.karaf.jaas.boot-4.1.3.jar:/volume1/@appstore/openHAB/runtime/lib/boot/org.apache.karaf.main-4.1.3.jar:/volume1/@appstore/openHAB/runtime/lib/boot/org.osgi.core-6.0.0.jar
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/var/packages/java8/target/ejdk1.8.0_151/linux_arm_sflt/jre/bin
LD_LIBRARY_PATH=:/volume1/@appstore/openHAB/userdata/lib:/volume1/@appstore/openHAB/runtime/lib
SHELL=/bin/sh

---------------  S Y S T E M  ---------------
OS:Linux
uname:Linux 2.6.32.12 #15217 Wed Dec 20 17:36:30 CST 2017 armv5tel
libc:glibc 2.15 NPTL 2.15 
rlimit: STACK 8192k, CORE infinity, NPROC 3962, NOFILE 1024, AS infinity
load average:2.27 1.52 1.41

CPU:total 1 (initial active 1) (ARMv5)

/proc/cpuinfo:
Processor	: Feroceon 88FR131 rev 1 (v5l)
BogoMIPS	: 1985.74
Features	: swp half thumb fastmult edsp 
CPU implementer	: 0x56
CPU architecture: 5TE
CPU variant	: 0x2
CPU part	: 0x131
CPU revision	: 1

Hardware	: Synology 6282 board
Revision	: 0000
Serial	: 0000000000000000

Memory: 4k page, physical 511372k(31908k free), swap 2097080k(2059392k free)

vm_info: Java HotSpot(TM) Embedded Client VM (25.151-b12) for linux-arm-sflt JRE (1.8.0_151-b12), built on Sep  5 2017 23:49:10 by "java_re" with gcc 4.7.2 20120731 (prerelease)

I’m no Jave expert, how may this be solved? :face_with_raised_eyebrow:
I also installed the Jadahal UsbSerialDrivers DSM 6.1 (for Domoticz), but it did not change anything.

Interestingly, I am facing the same behaviour with that stick on my raspberry. Maybe there is a faulty series of this stick on the market?

The stick is fine, it just did not work with an ARM-based Synology NAS. I now use the same stick with an Intel-based Synology, and it works like a charm :slight_smile:

Interesting, thanks for letting me know. I am unsuccessful with this stick on two rpi installations. Interestingly, it worked for a week or so, but then it went back to repeatedly crashing with no apparent reason.