Hi there,
i have tried openems.jar in windows,ubuntu,all works fine.but when i move to raspberry 4B , there was the error:
2月 20 13:12:25 raspberrypi java[7929]: java.lang.NoClassDefFoundError: Could not initialize class com.fazecast.jSerialComm.SerialPort
2月 20 13:12:25 raspberrypi java[7929]: at com.ghgande.j2mod.modbus.net.SerialConnection.open(SerialConnection.java:90)
2月 20 13:12:25 raspberrypi java[7929]: at io.openems.edge.bridge.modbus.BridgeModbusSerialImpl.getModbusConnection(BridgeModbusSerialImpl.java:137)
2月 20 13:12:25 raspberrypi java[7929]: at io.openems.edge.bridge.modbus.BridgeModbusSerialImpl.getNewModbusTransaction(BridgeModbusSerialImpl.java:111)
2月 20 13:12:25 raspberrypi java[7929]: at io.openems.edge.bridge.modbus.api.task.AbstractTask.sendRequest(AbstractTask.java:352)
2月 20 13:12:25 raspberrypi java[7929]: at io.openems.edge.bridge.modbus.api.task.AbstractTask.lambda$0(AbstractTask.java:117)
2月 20 13:12:25 raspberrypi java[7929]: at io.openems.edge.bridge.modbus.api.task.AbstractTask.logRequest(AbstractTask.java:143)
2月 20 13:12:25 raspberrypi java[7929]: at io.openems.edge.bridge.modbus.api.task.AbstractTask.executeRequest(AbstractTask.java:116)
2月 20 13:12:25 raspberrypi java[7929]: at io.openems.edge.bridge.modbus.api.task.AbstractReadTask.execute(AbstractReadTask.java:44)
2月 20 13:12:25 raspberrypi java[7929]: at io.openems.edge.bridge.modbus.api.AbstractModbusBridge.lambda$0(AbstractModbusBridge.java:43)
2月 20 13:12:25 raspberrypi java[7929]: at io.openems.edge.bridge.modbus.api.worker.ModbusWorker.forever(ModbusWorker.java:74)
2月 20 13:12:25 raspberrypi java[7929]: at io.openems.common.worker.AbstractWorker$1.run(AbstractWorker.java:129)
2月 20 13:12:25 raspberrypi java[7929]: Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /tmp/1708405814231-libjSerialComm.so: /tmp/1708405814231-libjSerialComm.so: 无法打开共享对象文件: 没有那个文件或目录 [in>
2月 20 13:12:25 raspberrypi java[7929]: at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
2月 20 13:12:25 raspberrypi java[7929]: at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
2月 20 13:12:25 raspberrypi java[7929]: at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
2月 20 13:12:25 raspberrypi java[7929]: at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
2月 20 13:12:25 raspberrypi java[7929]: at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2394)
2月 20 13:12:25 raspberrypi java[7929]: at java.base/java.lang.Runtime.load0(Runtime.java:755)
2月 20 13:12:25 raspberrypi java[7929]: at java.base/java.lang.System.load(System.java:1953)
2月 20 13:12:25 raspberrypi java[7929]: at com.fazecast.jSerialComm.SerialPort.<clinit>(SerialPort.java:248)
2月 20 13:12:25 raspberrypi java[7929]: ... 11 more
i search for this problem and i found that it possibly means i dont have jSerialComm.so installed in my system, or jvm ? But the thing is it works fine in normal ubuntu system , but error in raspberry ubuntu system.
Anyone can help explain what this error is or how do i install this package in my raspberry system.
I am successfully running OpenEMS Backend and OpenEMS Edge on a Raspberry Pi 4 and 5, respectively.
Can you give us more information about what you are trying to do and at what point you are getting this error? Are you in the middle of installing Edge or Backend? Are you getting this error when running a particular device or controller in OpenEMS Edge? What OS are you trying to run on the Pi? Anything else you could share so that we can try and help you?
Thank u very much for ur reply,letting me know it is feasible to run openems on Raspberry Pi 4.
I am now actually trying to run OpenEMS Edge on a Raspberry Pi 4B , raspberry OS.I get this error when i was trying to use modbus/RTU to connect one electrical meter.This error happens when OpenEMS try to fetch datas by modbus via a serial port,let’s say /dev/ttyusb0 here.
To ensure that it is not a problem of this serial port , i have tested the connection and fetch datas by minicom,a tool for testing serial port,and it works,which means at least the serial port itself works fine.
Then i move to OpenEMS Edge , config modbus RTU with /dev/ttyusb0 in it , and i have written the meter before , let’s call it dds5188 . i create a new project for it . it works perfectly in my windows and another ubuntu computer,ensuring that the code is fine.
And then the bug arised like i mentioned in front . Actually i have searched a lot for the solution . I found that it is probably an error of “libjSerialComm.so”,this is a library which handles serial connection work in openEMS.People who discuss in SerialComm github issues say that they meet the same UnsatisfiedLinkError when using this library in raspberry , probly because of the different of hardware structure , checking this : https://github.com/Fazecast/jSerialComm/issues/503 and thishttps://github.com/Fazecast/jSerialComm/issues/277.
And by the way , are your raspberry’s OS the normal raspberry ubuntu ?And if it is ok,can u send me ur ems.jar for only testing.
Tell me if i have something explained unclear,
Thanks very much in advanced
Now i update the os of my raspberry to newest version which is 2023/12/29,i forget the day,and i change the user name to not “pi” , then the bug fixed.
I dont know exctly how i fix this , probably because of the user name , or the version of OS,but anyway i fix this.
By the way, the version of GLIBC now is 2.36,in newest raspberry OS.