Pi4J intended to provide a friendly object-oriented I/O API and implementation libraries for Java Programmers to access the full I/O capabilities of the Raspberry Pi platform. This project abstracts the low-level native integration and interrupt monitoring to enable Java programmers to focus on implementing their application business logic.
Questions tagged [pi4j]
59 questions
0
votes
0 answers
JSerialComm not receiving/sending data in ttyAMA0
I implemented a code that maintains Serial communications to different ports.
However, the same code is working perfectly with USB port /dev/ttyUSB0, but not working on port /dev/ttyAMA0 (This port is operating if I use PI4J library)
Baud rates…

Rami Khawaly
- 126
- 3
- 14
0
votes
1 answer
Process to download Pi4j snapshot from Nexus repository?
Sorry I am new to this specific scenario. I would like to use these newest Pi4j libraries found at this link:
https://oss.sonatype.org/content/groups/public/com/pi4j/pi4j-core/2.0-SNAPSHOT/
but its a ton of separate files unlike when I download the…

cawdeen
- 3
- 1
0
votes
1 answer
How to send orders and connect to a Raspberry Pi through a React App?
I have built a react app and I must connect and send orders to a Rasberry Pi.

Mahmoud Almahroum
- 11
- 1
0
votes
0 answers
Raspberry Pi simple java application (LED) using Netbeans and Pi4J library not woking after building
Is there someone who can help me with this issue? When I run the Java Application directly on Netbeans, it works 100% fine. I can control the LED. But when I build the project and run the built jar file, the application appears but it seems like it…

Paulo Pacardo Rellon
- 33
- 9
0
votes
1 answer
Sudo java -jar vs java -jar
I have a server running on Java using the library Pi4j to control the RaspberryPi's GPIOs and a file on which I write the current GPIOs' statuses. When I run the code from IntelliJ IDE everything works just fine.
But when I create the .jar file and…

CrystalSpider
- 377
- 7
- 16
0
votes
1 answer
The four-legged spider experiment
let me start saying that I'm new to neural networks, Machine Learning etc, and so far I have just made few very simple experiments to learn so please be patient with me also If I ask very naive or long questions.
My favorite coding language is java…

Stefano Falconetti
- 29
- 1
- 8
0
votes
1 answer
how to control relay with raspberry using pi4j
sorry for my english but i recently write code in java about controlling relay by raspberry but my code doesnt work , i used gpio_00 as output the problem is when i initialize it the relay led stay on even when i change stat to low here my…

hadj chaib
- 21
- 1
0
votes
1 answer
Communication between Java, Dynamixel AX-12A and Raspberry Pi 3
Good Evening
We're working with PI4J and we are tring to transcribe this python code to Java:
from time import sleep
from serial import Serial
import RPi.GPIO as GPIO
class Ax12:
# important AX-12 constants
AX_START = 255
AX_GOAL_LENGTH…

Gilmar Jeronimo
- 3
- 3
0
votes
1 answer
getting NoClassDefFound for com/pi4j/io/i2c/I2CFactory
I know this question has been asked before but I tried the solutions given in other Threads with no success.
Exception in thread "main" java.lang.NoClassDefFoundError: com/pi4j/io/i2c
/I2CFactory at…

Jan Kressin
- 115
- 1
- 9
0
votes
1 answer
NoClassDefFoundError: com/pi4j/io/I2CFactory$UnsupportedBusNumberException
I am trying to run java code on a Raspberry Pi model 3, downloaded from a PC eclipse development environment to access a 9DoF device on the I2C bus using the pi4j library. I get the following error:
java -classpath .:classes:/opt/pi4j/lib/'*' -jar…

gjwo
- 175
- 13
0
votes
1 answer
Compilation using Pi4j
I run into the following problem: Upon running of the GPIO-example for my device built-in in Pi4J, I get an JNI error, followed by a NoClassDefFoundError for the com/pi4j/io/gpio/GpioProvider.
After some searching (both here and other websites) I…

Wouter Pol
- 1,031
- 1
- 8
- 16
-1
votes
1 answer
Pi4J Event Listener standalone application
Hi i want to build an application which listens to state changes of a gpio pin on a raspberry pi. How can i create a java application that never terminates but does nothing but listen. The listening is done by the…
-1
votes
2 answers
Raspberry Pi Java Pi4j gpio isn't working for me, works with python though
I am an old java programmer, translating code from Desktop to Raspberry Pi, with the aim of embedding software in a hardware interface.
I wired a 16*2 character LCD display, which worked with Python code, however when I use pi4j libraries to access…

tietaja
- 21
- 3
-1
votes
2 answers
Is there any better option that PI4J to write/read from UART in raspbian?
i'm looking for a better way for UART I/O in my raspberryPI in the linux side where i'm using Java.
now i'm using PI4J (wiringPI) but i'm facing few problems, i noticed many missing messages.
Also it's limited to 57600 baud rate and i wish to use…

Rami Khawaly
- 126
- 3
- 14