B4J Library [IoT] jPi4J - Raspberry Pi GPIO controller

jayel

Active Member
Licensed User
Longtime User
When I try to run in debug mode I get a error and the program stops : unable to open SPI device.

Any ideas?

John
 

Mark Turney

Active Member
Licensed User
Longtime User
Silly question probably, but did you enable SPI in raspi-config?
 

Herbert32

Active Member
Licensed User
Longtime User
actual Version ?

in first Thread i see 1.50

but here i see 1.60

which information is true ? if second, where can i download?

thx in advance
 

jayel

Active Member
Licensed User
Longtime User
Hey,

Strange :
B4X:
pin5.Initialize("pin5",5)
    pin5.SetPinPullResistance("PULL_DOWN")
    pin5.Name = "Detectie binnen-buiten"
    jo = pin5
    jo.RunMethod("setDebounce", Array(25))

I get this error :

PULL_UP works???

Why doesn't PULL_DOWN work ?

Greets

John
 
Last edited:

coslad

Well-Known Member
Licensed User
Longtime User
No, not error , but in the highlights is written : Added support for Raspberry Pi 3 - Model B


And I thought were some update.
 

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi

Which jar does i need to download(include) if i want to use following code to access SPI ?

 

jinyistudio

Well-Known Member
Licensed User
Longtime User
I try following to access spi in PI but it always return 12 to me !? OK or Not ok !?

B4X:
Sub WiringPiSPISetup(Channel As Int, Speed As Int) As Int
   Dim jo As JavaObject
   Return jo.InitializeStatic("com.pi4j.wiringpi.Spi").RunMethod("wiringPiSPISetup", Array As Object(Channel, Speed))
End Sub

Sub WiringPiSPIDataRW(Channel As Int, Data() As Byte, Len As Int) As Int
   Dim jo As JavaObject
   Return jo.InitializeStatic("com.pi4j.wiringpi.Spi").RunMethod("wiringPiSPIDataRW", Array As Object(Channel, Data, Len))
End Sub
 

rbghongade

Active Member
Licensed User
Longtime User
Dear Erel,
It seems the library is not compatible with Raspberry Pi Zero W. Maybe pi4J library at http://pi4j.com is not updated. I get the following error message:;
B4X:
Unable to determine hardware version. I see: Hardware    : BCM2835
,
- expecting BCM2708 or BCM2709. Please report this to projects@drogon.net
Let us hope this problem is sorted out.
Just reporting.
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Answer related to Post#137.
Hi,

also stumbled recently about this issue. After various testing (based on thread discussions), resolved by [status 20170506]:
Note: To check the RPi CPU use command "cat /proc/cpuinfo". See at the bottom under hardware ie hardware : BCM2835.
 

Ilya G.

Active Member
Licensed User
Longtime User
Not working on Linux 4.9.24-v7+

B4X:
Unable to determine hardware version. I see: Hardware   : BCM2835
,
- expecting BCM2708 or BCM2709.

To rwblinn, after updating pi4j-core, pi4j-device, pi4j-gpio-extension doesn't work with jDHT library
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Not working on Linux 4.9.24-v7+

Thanks for the info. I can not verify as do not have Linux 4.9.24-v7+ - can only test on a RPi.
Note: Tested jDHT 1.0 again with success under Raspbian GNU/Linux 8 (jessie) with hardware BCM2835 (RPi 3) & DHT11 - just to go for sure.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…