Replies: 6 comments 3 replies
-
not sure if this could be related to the maven archetype, so pinging @lburaggi and @Adito5393, but don't feel that's the problem... I'm trying to dive into it... |
Beta Was this translation helpful? Give feedback.
-
@SpamWall would it be possible to upload the full project as zip? |
Beta Was this translation helpful? Give feedback.
-
I wonder if this is because the PiGPIO daemon is running on your RPi. Check that it is running with the command
Kill the daemon with
By default, the Pi4J uses the PiGPIO library directly via C native interfaces. In this case the daemon should not be running. Thanks, Robert |
Beta Was this translation helpful? Give feedback.
-
What worked for me was just to run the jar as root aka |
Beta Was this translation helpful? Give feedback.
-
does anyone find the solution? |
Beta Was this translation helpful? Give feedback.
-
The discussion was use of sudo. It is still required that the provider pigpio requires sudo. There now are other providers that operate without using sudo. See: https://pi4j.com/documentation/providers/ |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am new to Pi4J and I am trying my first project. I installed the raspimaven-archetype archetype in IntelliJ and created a skeleton project as described here: https://github.com/Pi4J/pi4j-maven-archetype. The code for that skeleton is below. I have a Raspberry Pi Zero W. The details of the installation are below.
When I run the Java application (as sudo) it loads to the Pi and starts fine. The "Console" output is displayed as expected. It runs to this line:
DigitalOutput led = pi4j.create(ledConfig);
where it throws this error: PIGPIO ERROR: PI_INIT_FAILED; pigpio initialisation failed
When I run the jar directly from the Pi command line I get identical results. The command line invocation is:
sudo java -Dpi4j.library.path=/home/pi/my_app/lib -cp classes:lib/'*' MyApp.Main
The full stack trace is:
I have been looking all day for a solution and have found nothing that works. Does anyone have any advice?
I installed on the Pi:
Java 11:
WiringPi installed by these instructions: http://wiringpi.com/download-and-install/
Raspberry Pi Details:
Type: Pi Zero-W, Revision: 01, Memory: 512MB, Maker: Sony
*--> Raspberry Pi Zero W Rev 1.1
PiGPIOd is running: (built from scratch from here: https://github.com/joan2937/pigpio)
I am building with these entries in the POM:
Pi4J V2.0:
Code:
Beta Was this translation helpful? Give feedback.
All reactions