B4J Question Pi4J broken - any alternative

JordiCP

Expert
Licensed User
Longtime User
An alternative, if you have a Raspberry Pi3, is to use android Things + B4A.
The pity is that it does not work (as far as I know) with older raspberry Pi models
 
Upvote 0

alvinmb

Member
Licensed User
Longtime User
I'm using a raspberry pi zero W with the latest builds. I have also tried it on a raspberry pi 2. I also have tried the 1.2 snapshot build, and I still have the problem. This issue was reported mid last year with no fix from the author of pi4j library. It looks like the issue is to do with pi4j static linking and not using the latest library. Hence by inquiries if an alternative library exists.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've tested it with a RPi 3 running the newest image. I did see this error. It was resolved by updating to the latest version of Pi4J.

I've updated the package.

To complete this thread:
1. Pi4J library (the one wrapped by jPi4J) is not broken for several months. Library author explanation: https://www.raspberrypi.org/forums/viewtopic.php?t=182191#p1194857
2. You can use Android Things as an alternative.

If you have any specific question or issue then please start a new thread.
 
Upvote 0

alvinmb

Member
Licensed User
Longtime User
When you say the latest version of Pi4J do you mean the 1.2 snapshot from the pi4J web site or a version from another source?
 
Upvote 0

alvinmb

Member
Licensed User
Longtime User
I updated my pi4j to the 1.2 Snapshot.

This seems to have fixed my issue for my Raspberry Pi 3 Model B.
However the issue still occurs on my Raspberry Pi Zero W.
Looking at solutions the suggestion is that you set the linking = dynamic switch when you run the jar file.
How can you do this when using B4j and the debug. Do any options exist to modify the run command when it calls the .jar file?


sudo java -Dpi4j.linking=dynamic -jar
 
Upvote 0
Top