B4J Library [IoT] jPi4J - Raspberry Pi GPIO controller

Discussion in 'B4J Libraries & Classes' started by Erel, Feb 5, 2014.

  1. jayel

    jayel Active Member Licensed 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
     
  2. Mark Turney

    Mark Turney Active Member Licensed User

    Silly question probably, but did you enable SPI in raspi-config?
     
  3. jayel

    jayel Active Member Licensed User

    there no silly questions, just silly answers .... it worked, thanks
     
    Mark Turney likes this.
  4. Herbert32

    Herbert32 Member Licensed 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
     
  5. Erel

    Erel Administrator Staff Member Licensed User

  6. jayel

    jayel Active Member Licensed User

  7. Erel

    Erel Administrator Staff Member Licensed User

    jayel likes this.
  8. jayel

    jayel Active Member Licensed User

    Hey,

    Strange :
    Code:
    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: Jun 5, 2016
  9. Erel

    Erel Administrator Staff Member Licensed User

    I have nothing to add over the error message. It seems like this pin doesn't support pull down. For further discussion please start a new thread.
     
  10. coslad

    coslad Well-Known Member Licensed User

    Hi, new 1.1 version is released:
    Please upgrade the wrapped library to support RPI 3

    Thanks
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    Raspberry Pi 3 is already supported. Did you encounter any error?
     
  12. coslad

    coslad Well-Known Member Licensed User

    No, not error , but in the highlights is written : Added support for Raspberry Pi 3 - Model B


    And I thought were some update.
     
  13. jinyistudio

    jinyistudio Active Member Licensed User

    Hi

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

     
  14. Erel

    Erel Administrator Staff Member Licensed User

    You don't need to add any other jar. Only this library.
     
    jinyistudio likes this.
  15. jinyistudio

    jinyistudio Active Member Licensed User

    I try following to access spi in PI but it always return 12 to me !? OK or Not ok !?

    Code:
    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
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
  17. rbghongade

    rbghongade Active Member Licensed 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:;
    Code:
    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.
     
  18. rwblinn

    rwblinn Well-Known Member Licensed 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.
     
    Erel, Peter Simpson, Cableguy and 2 others like this.
  19. GanjaKyp

    GanjaKyp Member

    Not working on Linux 4.9.24-v7+ :(

    Code:
    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
     
  20. rwblinn

    rwblinn Well-Known Member Licensed User

    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice