OH3: Systeminfo not working with armbian

openHAB 3.0.0 Build #2071
Platform: Odroid C4 with Armbian Focal mainline kernel 5.9.y
Problem: System Info Binding not working. ERROR: Could not initialize class oshi.jna.platform.linux.Udev

When I create a System Info thing on the local machine I get the following errors in the log.

Unable to load library ‘udev’:

libudev.so: cannot open shared object file: No such file or directory

libudev.so: cannot open shared object file: No such file or directory

/lib/aarch64-linux-gnu/libudev.so.1.6.17: wrong ELF class: ELFCLASS64

Native library (linux-arm/libudev.so) not found in resource path (/usr/share/openhab/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.2.7.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.jaas.boot-4.2.7.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.main-4.2.7.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.specs.activator-4.2.7.jar:/usr/share/openhab/runtime/lib/boot/osgi.core-6.0.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/istack-commons-runtime-3.0.8.jar:/usr/share/openhab/runtime/lib/jdk9plus/jakarta.xml.bind-api-2.3.2.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.activation-1.2.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.annotation-api-1.3.1.jar:/usr/share/openhab/runtime/lib/jdk9plus/jaxb-runtime-2.3.2.jar:/usr/share/openhab/runtime/lib/jdk9plus/txw2-2.3.2.jar)

This versions of OSGi are installed:
57 │ Active │ 80 │ 4.2.7 │ Apache Karaf :: OSGi Services :: Event
76 │ Active │ 80 │ 4.14.0 │ Apache XBean OSGI Bundle Utilities

Running OH 2.5.10 on the same platform everything is working well.

I tried to install the udef package with the following command:

sudo apt-get install -y udev:armhf

But when I do a restart afterwards the system does not start anymore.
Maybe someone has an idea?
Thanks

Looks like there is a mixture of 32-bit and 64-bit binaries.
armhf is 32 bit.
The file /lib/aarch64-linux-gnu/libudev.so.1.6.17 seems to be 64 bit.

What is installed on your system ?
What is the output of

file /bin/ls

What is the output of

cat /proc/cpuinfo
1 Like

Nothing is installed. Just used the script of the following post to install OH3, zulu (zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf), frontail and samba:

Output is:

file /bin/ls

/bin/ls: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=168521274d24d03cbab1365c28dc20078bf46835, for GNU/Linux 3.7.0, stripped

cat /proc/cpuinfo

processor : 0
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd05
CPU revision : 0

processor : 1
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd05
CPU revision : 0

processor : 2
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd05
CPU revision : 0

processor : 3
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd05
CPU revision : 0

Thank you for the tip.
The script installs 32 libraries at the beginning. See here:

sudo dpkg --add-architecture armhf
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y libc6:armhf libstdc++6:armhf zlib1g:armhf

This seem to cause the errors.
I now installed zulu11 64 bit with openhabian-config. The version is:

openjdk version “11.0.9” 2020-10-20 LTS
OpenJDK Runtime Environment Zulu11.43+88-CA (build 11.0.9+11-LTS)
OpenJDK 64-Bit Server VM Zulu11.43+88-CA (build 11.0.9+11-LTS, mixed mode)

Now OH3 and systeminfo seem to work fine.
I think 64 bit java was not officially supported unter OH2, some libaries might not work?
I will give it a try with OH3…

1 Like

Dear Colleagues,

I just installed OH 3 on my Rasp using 32 version and now I can’t get systeminfo working. Please find more details and let me know your feeling/comments how to solve it.

2021-07-03 22:09:32.549 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'systeminfo:computer:openHABianDevice': Unable to load library 'udev':
libudev.so: n�o � poss�vel abrir arquivo compartilhado: Arquivo ou diret�rio inexistente
libudev.so: n�o � poss�vel abrir arquivo compartilhado: Arquivo ou diret�rio inexistente
Native library (linux-arm/libudev.so) not found in resource path (/usr/share/openhab/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.jaas.boot-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.main-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.specs.activator-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/osgi.core-7.0.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/istack-commons-runtime-3.0.10.jar:/usr/share/openhab/runtime/lib/jdk9plus/jakarta.xml.bind-api-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.activation-1.2.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.annotation-api-1.3.1.jar:/usr/share/openhab/runtime/lib/jdk9plus/jaxb-runtime-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/txw2-2.3.3.jar)
java.lang.UnsatisfiedLinkError: Unable to load library 'udev':
libudev.so: n�o � poss�vel abrir arquivo compartilhado: Arquivo ou diret�rio inexistente
libudev.so: n�o � poss�vel abrir arquivo compartilhado: Arquivo ou diret�rio inexistente
Native library (linux-arm/libudev.so) not found in resource path (/usr/share/openhab/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.jaas.boot-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.main-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.specs.activator-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/osgi.core-7.0.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/istack-commons-runtime-3.0.10.jar:/usr/share/openhab/runtime/lib/jdk9plus/jakarta.xml.bind-api-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.activation-1.2.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.annotation-api-1.3.1.jar:/usr/share/openhab/runtime/lib/jdk9plus/jaxb-runtime-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/txw2-2.3.3.jar)
	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:302) ~[?:?]
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:455) ~[?:?]
	at com.sun.jna.Library$Handler.<init>(Library.java:192) ~[?:?]
	at com.sun.jna.Native.load(Native.java:596) ~[?:?]
	at com.sun.jna.Native.load(Native.java:570) ~[?:?]
	at oshi.jna.platform.linux.Udev.<clinit>(Udev.java:37) ~[?:?]
	at oshi.hardware.platform.linux.LinuxDisks.getDisks(LinuxDisks.java:102) ~[?:?]
	at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getDiskStores(LinuxHardwareAbstractionLayer.java:78) ~[?:?]
	at org.openhab.binding.systeminfo.internal.model.OSHISysteminfo.initializeSysteminfo(OSHISysteminfo.java:105) ~[?:?]
	at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.instantiateSysteminfoLibrary(SysteminfoHandler.java:124) ~[?:?]
	at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.initialize(SysteminfoHandler.java:111) ~[?:?]
	at jdk.internal.reflect.GeneratedMethodAccessor83.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
	Suppressed: java.lang.UnsatisfiedLinkError: libudev.so: n�o � poss�vel abrir arquivo compartilhado: Arquivo ou diret�rio inexistente
		at com.sun.jna.Native.open(Native Method) ~[?:?]
		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191) ~[?:?]
		at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:455) ~[?:?]
		at com.sun.jna.Library$Handler.<init>(Library.java:192) ~[?:?]
		at com.sun.jna.Native.load(Native.java:596) ~[?:?]
		at com.sun.jna.Native.load(Native.java:570) ~[?:?]
		at oshi.jna.platform.linux.Udev.<clinit>(Udev.java:37) ~[?:?]
		at oshi.hardware.platform.linux.LinuxDisks.getDisks(LinuxDisks.java:102) ~[?:?]
		at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getDiskStores(LinuxHardwareAbstractionLayer.java:78) ~[?:?]
		at org.openhab.binding.systeminfo.internal.model.OSHISysteminfo.initializeSysteminfo(OSHISysteminfo.java:105) ~[?:?]
		at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.instantiateSysteminfoLibrary(SysteminfoHandler.java:124) ~[?:?]
		at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.initialize(SysteminfoHandler.java:111) ~[?:?]
		at jdk.internal.reflect.GeneratedMethodAccessor83.invoke(Unknown Source) ~[?:?]
		at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
		at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
		at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
		at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
		at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
		at java.lang.Thread.run(Thread.java:829) [?:?]
	Suppressed: java.lang.UnsatisfiedLinkError: libudev.so: n�o � poss�vel abrir arquivo compartilhado: Arquivo ou diret�rio inexistente
		at com.sun.jna.Native.open(Native Method) ~[?:?]
		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204) ~[?:?]
		at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:455) ~[?:?]
		at com.sun.jna.Library$Handler.<init>(Library.java:192) ~[?:?]
		at com.sun.jna.Native.load(Native.java:596) ~[?:?]
		at com.sun.jna.Native.load(Native.java:570) ~[?:?]
		at oshi.jna.platform.linux.Udev.<clinit>(Udev.java:37) ~[?:?]
		at oshi.hardware.platform.linux.LinuxDisks.getDisks(LinuxDisks.java:102) ~[?:?]
		at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getDiskStores(LinuxHardwareAbstractionLayer.java:78) ~[?:?]
		at org.openhab.binding.systeminfo.internal.model.OSHISysteminfo.initializeSysteminfo(OSHISysteminfo.java:105) ~[?:?]
		at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.instantiateSysteminfoLibrary(SysteminfoHandler.java:124) ~[?:?]
		at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.initialize(SysteminfoHandler.java:111) ~[?:?]
		at jdk.internal.reflect.GeneratedMethodAccessor83.invoke(Unknown Source) ~[?:?]
		at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
		at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
		at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
		at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
		at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
		at java.lang.Thread.run(Thread.java:829) [?:?]
	Suppressed: java.io.IOException: Native library (linux-arm/libudev.so) not found in resource path (/usr/share/openhab/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.jaas.boot-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.main-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.specs.activator-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/osgi.core-7.0.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/istack-commons-runtime-3.0.10.jar:/usr/share/openhab/runtime/lib/jdk9plus/jakarta.xml.bind-api-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.activation-1.2.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.annotation-api-1.3.1.jar:/usr/share/openhab/runtime/lib/jdk9plus/jaxb-runtime-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/txw2-2.3.3.jar)
		at com.sun.jna.Native.extractFromResourcePath(Native.java:1095) ~[?:?]
		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:276) ~[?:?]
		at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:455) ~[?:?]
		at com.sun.jna.Library$Handler.<init>(Library.java:192) ~[?:?]
		at com.sun.jna.Native.load(Native.java:596) ~[?:?]
		at com.sun.jna.Native.load(Native.java:570) ~[?:?]
		at oshi.jna.platform.linux.Udev.<clinit>(Udev.java:37) ~[?:?]
		at oshi.hardware.platform.linux.LinuxDisks.getDisks(LinuxDisks.java:102) ~[?:?]
		at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getDiskStores(LinuxHardwareAbstractionLayer.java:78) ~[?:?]
		at org.openhab.binding.systeminfo.internal.model.OSHISysteminfo.initializeSysteminfo(OSHISysteminfo.java:105) ~[?:?]
		at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.instantiateSysteminfoLibrary(SysteminfoHandler.java:124) ~[?:?]
		at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.initialize(SysteminfoHandler.java:111) ~[?:?]
		at jdk.internal.reflect.GeneratedMethodAccessor83.invoke(Unknown Source) ~[?:?]
		at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
		at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
		at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
		at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
		at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
		at java.lang.Thread.run(Thread.java:829) [?:?]
openhabian@openHABianDevice:/mnt/OHBackupDrive $ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Hardware        : BCM2835
Revision        : a02082
Serial          : 0000000064fc86e1
Model           : Raspberry Pi 3 Model B Rev 1.2

What is the output of:

file /bin/ls

and

dpkg -l |grep udev

openhabian@openHABianDevice:~ $ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=67a394390830ea3ab4e83b5811c66fea9784ee69, stripped
openhabian@openHABianDevice:~ $ ^C
openhabian@openHABianDevice:~ $ dpkg -l |grep udev
ii  libgudev-1.0-0:armhf           232-2+rpi1                          armhf        GObject-based wrapper library for libudev
ii  libudev0:armhf                 175-7.2                             armhf        libudev shared library
ii  libudev1:armhf                 241-7~deb10u7+rpi1                  armhf        libudev shared library
ii  udev                           241-7~deb10u7+rpi1                  armhf        /dev/ and hotplug management daemon
openhabian@openHABianDevice:~ $


Try to

  • edit /etc/default/openhab

  • add/make sure that EXTRA_JAVA_OPTS contains "-Djna.library.path=/lib/arm-linux-gnueabihf/"

  • restart openhab