B4J Library [IoT] jPi4J - Raspberry Pi GPIO controller

jayel

Active Member
Licensed User
Longtime User
I have now used the piface library and this on works :
B4X:
Dim PFace as PiFace

PFace.initialize(0x40,0)
Pface.GetSwitch(0).AddListener("Pin1")

Ok, but how can I set debounce with this library.
 

Gary Miyakawa

Active Member
Licensed User
Longtime User
I was having the same issue with the latest Raspian code. I updated my B4J jPi4J from Erel's msg #154. Put them in the right spot and it's working fine now.

Thank you for the fix!

Gary Miyakawa
 
Hi all!
First of all, I love your job Erel...
I receive this error using Pin 7 as input.
(Programming via Netbeans and C++ works well, with B4J no).

Raspberry Pi 3
jPi4J 2.00

B4X:
Private Col4 As GpioPinDigitalInput
Col4.Initialize("Col4",7)
B4X:
java.lang.RuntimeException: Unable to open GPIO direction interface for pin [7]: File o directory non esistente
 

jinyistudio

Well-Known Member
Licensed User
Longtime User
I have get this message. Where can i get latest version of Pi4J ? My version is 1.50
 

rasaliad

Member
Licensed User
Longtime User
Hi community

I have a raspberry pi 400, it is a Pi4 i think.

When compile my app with jPi4J, the one in the first post, I get the following error, What I need to do, to solve the problem.

Thanks in advanced


WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
WARNING: package com.sun.glass.ui.win not in javafx.graphics
WARNING: package com.sun.prism.d3d not in javafx.graphics
WARNING: Unknown module: javafx.swt specified to --add-opens
Waiting for debugger to connect...
Program started.
Unable to determine hardware version. I see: Hardware : BCM2711
,
- expecting BCM2708, BCM2709 or BCM2835.
If this is a genuine Raspberry Pi then please report this
to projects@drogon.net. If this is not a Raspberry Pi then you
are on your own as wiringPi is designed to support the
Raspberry Pi ONLY.
 

rasaliad

Member
Licensed User
Longtime User
Hi MbedAndroid thanks,

I did what the link said, and check that the version is 2.52, but the error persist.

WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
WARNING: package com.sun.glass.ui.win not in javafx.graphics
WARNING: package com.sun.prism.d3d not in javafx.graphics
WARNING: Unknown module: javafx.swt specified to --add-opens

Waiting for debugger to connect...
Program started.
Unable to determine hardware version. I see: Hardware : BCM2711
,
- expecting BCM2708, BCM2709 or BCM2835.
If this is a genuine Raspberry Pi then please report this
to projects@drogon.net. If this is not a Raspberry Pi then you
are on your own as wiringPi is designed to support the
Raspberry Pi ONLY.
 

MbedAndroid

Active Member
Licensed User
Longtime User
the 4b has indeed a BCM2711. I'm using the PI4j on a Pi3+, Pi2B and PiZero without issues.
I'm afraid the the 4B isnt supported, as you say the wiring SPI is already at 2.52,
 

FrankDelporte

New Member
WiringPi which is used by Pi4J to interface with the GPIOs has been deprecated and the last version was indeed 2.52.
But in Pi4J V1.3 (for Java 8) and V1.4 (for Java 11) you can easily update to a non-official WiringPi version 2.60 which supports Raspberry Pi 4, CM4 and 400.
See https://pi4j.com/1.3/dependency.html
 

gazaduk

Member
Licensed User
Longtime User
Hi All, Has anyone managed to get the jPi4J library working on a Raspberry PI CM4 module? I'm in the process of updating a project from a PI2 to a CM4 module and am getting the same error as rasaliad (Post 172).

After trying everything to the best of my knowledge I have come to the conclusion the B4J jPi4J library needs updating to either the unofficial version https://pi4j.com/1.3/index.html or the new version 2 https://pi4j.com/about/new-in-v2/

If this is the case would it be possible to update the library to cover the new devices?

Thanks in advance.
 

gazaduk

Member
Licensed User
Longtime User
Yes tried it and still the same error. I'm fairly sure the error is coming from the B4J library not the PI side.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…