Share My Creation B4J WebApp to execute commands on a Raspberry Pi

B4J WebApp to execute commands on a Raspberry Pi.
To manage a Raspberry Pi via WebBrowser on devices running f.e. Windows or Android or Raspberry Pi. This app has a jQuery Mobile Interface and communicates via WebSockets.
Tested with serveral Raspberry Pi's (also accessed from public domain).

Download the B4J source here. Read readme.txt first. Example commands included in the file settings.txt.

rpiconsole.png


B4J is Great.

20150430: Project attached
 

Attachments

  • B4JHowToRPiConsole.zip
    16.1 KB · Views: 373
Last edited:

Michael1968

Active Member
Licensed User
Longtime User
Hi Rob,
use your sample and get this error when i open the bowser:

ReadSettings :: Start
ReadSettings :: End
Error occurred on line: 29 (rpiconsole).
java.lang.RuntimeException: Object should first be initialized (JavaObject).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:28)
at anywheresoftware.b4j.object.JavaObject.getCurrentClass(JavaObject.java:257)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:117)
at b4j.example.rpiconsole._websocket_connected(rpiconsole.java:324)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:563)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:221)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)


best regards
Michael
 

Michael1968

Active Member
Licensed User
Longtime User
Hi Rob,
use your sample and get this error when i open the bowser:

ReadSettings :: Start
ReadSettings :: End
Error occurred on line: 29 (rpiconsole).
java.lang.RuntimeException: Object should first be initialized (JavaObject).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:28)
at anywheresoftware.b4j.object.JavaObject.getCurrentClass(JavaObject.java:257)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:117)
at b4j.example.rpiconsole._websocket_connected(rpiconsole.java:324)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:563)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:221)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)


best regards
Michael

I have found the problem.
I have compiled the programm in debug Mode.
in release Mode it works
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi Michael,

thanks for letting me know - will exploere why this error occurs during Debug = not sure for now.
 

Beja

Expert
Licensed User
Longtime User
Hi,
Thanks and Chrome didn't allow me to download it.. would you upload it in the first post here?
 
Top