### About & Hints

The B4J-Bridge is an essential tool to remote debug B4J applications.
Reference: https://www.b4x.com/android/forum/threads/remote-debugging-with-b4j-bridge.38804/
The following hints are gathered by mainly using the Raspberry Pi (RPi) running Raspian.
Install
Create a B4J folder, set as default, delete any previous versions, then download the B4J-Bridge:
mkdir /home/pi/b4j
cd /home/pi/b4j
rm b4j-bridge.jar
wget http://www.b4x.com/b4j/files/b4j-bridge.jar
Alternative to wget
Transfer (via f.e. WinSCP) the B4J-Bridge from a development device to the RPi folder /home/pi/b4j.
Run
To run as root (do not forget esp, when using Pi4j) when logged in as user Pi:
sudo -jar b4j-bridge.jar
If the path to java is set in the environment path, then call
sudo java -jar b4j-bridge.
It is useful to run the B4J-Bridge from a dedicated terminal, like f.e. from the development device using Putty.
When doing so, the output of the running application can be watched.
Note
If not running as sudo and Pi4j is used, an error message like below will occur in the B4J IDE Log when trying to run the application.
wiringPiSetup: Must be root. (Did you forget sudo?)
Logging
The B4J-Bridge terminal screen, displays (logs) information, like
sudo java -jar b4j-bridge.jar
B4J-Bridge v1.00
Waiting for connections (port=6790)...
My IP address is: 192.168.0.23
Connected!
Starting program
ProcessCompleted
Starting program
Temp Folder
When the B4J-Bridge is running, the B4J application jar file is stored in a temp folder on the RPi.
Example: \home\pi\b4j\tempjars\AsyncInput2.
Notes
• Testing various B4J applications, ensure to cleanup this folder from time-to-time.
• Using settings files (or other required files to run) or www folder, ensure to copy these to the tempjars folder.
Check Running
If the B4J-Bridge is running as a process, then check if the process is running by
ps -ef | grep b4j-bridge
B4J-Bridge v2.20 FTP Server
Disable the FTP server with the -disableftp parameter:
sudo java -jar b4j-bridge -disableftp

Changed: 2018-05-08 09:59, Category: B4J-Bridge, File: T6C164M1209.htm, ID: 1209