following is my main codes. Blinkstick.jar,hidapi-1.1.jar download library from http://arvydas.github.io/blinkstick-processing/
Use OpenJDK 11.0.1-BellSoft
I debug mode with b4j-bridge. I get follow messages when i running jo.InitializeStatic("blinkstick.BlinkStick").RunMethod("findFirst", Null) in the raspberry pi ? but windows 10 is OK
Waiting for debugger to connect...
Program started.
OpenJDK Server VM warning: You have loaded library /tmp/libhidapi-jni-6417314661532003353684.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Error occurred on line: 37 (jyBlinkstick)
java.lang.ClassCastException: class java.lang.UnsatisfiedLinkError cannot be cast to class java.lang.Exception (java.lang.UnsatisfiedLinkError and java.lang.Exception are in module java.base of loader 'bootstrap')
at anywheresoftware.b4a.BA.setLastException(BA.java:377)
at b4j.example.jyblinkstick._findfirst(jyblinkstick.java:111)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessor
Impl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.example.main.main(main.java:29)
B4X:
'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#AdditionalJar: BlinkStick.jar
#AdditionalJar: hidapi-1.1.jar
#end region
Sub Process_Globals
Dim bs1 As jyBlinkstick
Dim timer1 As Timer
Dim flow As Boolean
End Sub
Sub AppStart (Args() As String)
bs1.Initialize(Me,"bs1","1")
If bs1.findfirst=1 Then
Log($"serial : ${bs1.BlinkStick(0).Serial}"$)
Log($"Version : ${bs1.BlinkStick(0).version}"$)
Log($"Product : ${bs1.BlinkStick(0).Product}"$)
Log($"Manufacturer : ${bs1.BlinkStick(0).Manufacturer}"$)
Log($"info1 : ${bs1.BlinkStick(0).InfoBlock1}"$)
Log($"info2 : ${bs1.BlinkStick(0).InfoBlock2}"$)
Log($"Mode2 : ${bs1.BlinkStick(0).Mode}"$)
timer1.Initialize("timer1",1000)
timer1.Enabled=True
flow=False
End If
StartMessageLoop
End Sub
Sub timer1_tick
If flow Then
bs1.BlinkStick(0).setIndexedColor16(0,0,0,0,0)
Else
bs1.BlinkStick(0).setIndexedColor16(0,0,Rnd(1,255),Rnd(1,255),Rnd(1,255))
End If
flow = Not(flow)
End Sub
Use OpenJDK 11.0.1-BellSoft
I debug mode with b4j-bridge. I get follow messages when i running jo.InitializeStatic("blinkstick.BlinkStick").RunMethod("findFirst", Null) in the raspberry pi ?
Waiting for debugger to connect...
Program started.
OpenJDK Server VM warning: You have loaded library /tmp/libhidapi-jni-6417314661532003353684.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Error occurred on line: 37 (jyBlinkstick)
java.lang.ClassCastException: class java.lang.UnsatisfiedLinkError cannot be cast to class java.lang.Exception (java.lang.UnsatisfiedLinkError and java.lang.Exception are in module java.base of loader 'bootstrap')
at anywheresoftware.b4a.BA.setLastException(BA.java:377)
at b4j.example.jyblinkstick._findfirst(jyblinkstick.java:111)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessor
Impl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.example.main.main(main.java:29)
Last edited: