Git Product home page Git Product logo

Comments (9)

ricardojlrufino avatar ricardojlrufino commented on May 25, 2024

pom.xml

        <dependency>
            <groupId>com.diozero</groupId>
            <artifactId>diozero-provider-pi4j</artifactId>
            <version>0.10</version>
        </dependency>

        <dependency>
            <groupId>com.pi4j</groupId>
            <artifactId>pi4j-core</artifactId>
            <version>1.1</version>
        </dependency>

Using PI4J direct API it's working ...

Using this, I cause a strange file system error (remount in ready-only):

        <dependency>
            <groupId>com.pi4j</groupId>
            <artifactId>pi4j-core</artifactId>
            <version>1.2-SNAPSHOT</version>
        </dependency>

from diozero.

mattjlewis avatar mattjlewis commented on May 25, 2024

I believe this is a problem with pi4j itself relating to it containing a C library this is statically linked to an old version of wiringPi. There is a command line option to force it to use the dynamically linked version (Google should be able to tell you the exact command line option).
Let me know how you get on with that.
I've not yet tried pi4j 1.2-SNAPSHOT.
If you are using diozero I would recommend using the built-in provider (only include to diozero-core and tinylog). Is there a reason you need to use the pi4j provider?
Matt

from diozero.

ricardojlrufino avatar ricardojlrufino commented on May 25, 2024

I was trying to use the RFID reader. I thought it would work only using a pi4j provider. After your comment I used built-in provider and it worked

I tested using the pi4j API directly (1.2-SNAPSHOT) and it works correctly. When I use pi4j provider + pi4j 1.2-SNAPSHOT, a strange file system error occurs and hangs the raspberry

I was in doubt of which is the advantage of pi4j provider ?

from diozero.

ricardojlrufino avatar ricardojlrufino commented on May 25, 2024

PS: Actually the problem is in the pi4j, I tried to use a PWM function and the same error happened.

from diozero.

mattjlewis avatar mattjlewis commented on May 25, 2024

Great. Pi4j support in diozero largely historic; the portability of the library is based on the pluggable providers. Support via pi4j was easy and added before I developed my own portable provider that will work on any device. If you require high performance GPIO control on the Pi you would need to use pigpio or my own memory mapped implementation.
If I get a moment I will look into the pi4j problem myself. Did you find the command line flag to force loading the dynamic pi4j / wiringPi library?

from diozero.

ricardojlrufino avatar ricardojlrufino commented on May 25, 2024

"Unable to determine hardware version. I see: Hardware : BCM2835", this has been solved using 1.2-SNAPSHOT, no need flag (-Dpi4j.linking=dynamic).

I got another error: Pi4J/pi4j-v1#319 (comment)
But i'll try (PWM / SPI) as root ... when I'm home

from diozero.

mattjlewis avatar mattjlewis commented on May 25, 2024

Do you have a reason for using pi4j? You might want to try the pigpio provider, I've found it to be quite reliable and has excellent PWM support (not just on the Pi's hardware PWM pins). It does, however, also require you to run as root.

from diozero.

ricardojlrufino avatar ricardojlrufino commented on May 25, 2024

Do you have a reason for using pi4j?
I believe it is the best known, and would have better support

thanks for assist

I'm planning on integrating your library as the basis of my framework when it comes to SBC
http://opendevice.io

from diozero.

mattjlewis avatar mattjlewis commented on May 25, 2024

Great, let me know how you get on.

from diozero.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.