Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2f9b7a2
Release notes V4 and interview Nick (WIP)
FDelporte Sep 22, 2025
d15495b
Release notes V4 and interview Nick (WIP)
FDelporte Sep 22, 2025
14998ce
Release notes V4 and interview Nick (WIP)
FDelporte Sep 22, 2025
5eba1a3
Release notes V4 and interview Nick (WIP)
FDelporte Sep 22, 2025
b3171e8
Merge branch 'main' into release/V4.0.0
FDelporte Sep 22, 2025
85606cf
Release notes V4 and interview Nick (WIP)
FDelporte Sep 23, 2025
16a29cb
Merge branch 'main' into release/V4.0.0
FDelporte Sep 23, 2025
abc5baf
Merge
FDelporte Sep 23, 2025
efad347
Interview improvements
FDelporte Sep 30, 2025
315deb7
Added some information on permissions.
DigitalSmile Oct 2, 2025
42b1c08
Remove double content
FDelporte Oct 6, 2025
933395b
Add Devoxx
FDelporte Oct 10, 2025
456bee5
Merge branch 'main' into release/V4.0.0
FDelporte Oct 10, 2025
45067ba
Merge branch 'main' into release/V4.0.0
FDelporte Oct 10, 2025
92d626d
Replace content on the website with README content from GitHub
FDelporte Oct 10, 2025
7182614
Added checker tool info for I2C, SPI, PWM, Serial
FDelporte Oct 13, 2025
845351a
Merge branch 'main' into release/V4.0.0
FDelporte Oct 13, 2025
c7a7c53
Merge branch 'main' into release/V4.0.0
FDelporte Oct 13, 2025
c6eb6d2
Bump Java version to 25
FDelporte Oct 13, 2025
c7cb653
Reworking example code to match V4: IO paramater changes
Nov 12, 2025
ff79915
Merge branch 'main' into release/V4.0.0
Nov 12, 2025
16976bf
Prepare V4 release notes
FDelporte Dec 5, 2025
0ddf246
Add link to DigiKey PWM article
FDelporte Jan 19, 2026
e996f2e
V4 release notes
FDelporte Jan 20, 2026
a7f654c
Update serial example
FDelporte Jan 20, 2026
a20bf0c
Extend interview
FDelporte Jan 20, 2026
d5dea89
Merge branch 'main' into release/V4.0.0
Jan 20, 2026
9863e23
Interview Nick typos
Jan 20, 2026
7d1b0a1
Link to JBang blog
FDelporte Jan 27, 2026
02d5173
Improve FFM page
FDelporte Jan 28, 2026
cb8377c
Merge branch 'main' into feature/readme-include
Jan 29, 2026
4444a31
Merge branch 'feature/readme-include' into release/V4.0.0
Jan 29, 2026
0f54978
Extending V4 info
Jan 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Welcome to Pi4J

## Welcome to Pi4J

**Latest release: V3.0.3 (2025-09-23, see [Release Notes](/about/release-notes/)).**
**Latest release: V4.0.0 (2025-??-??, see [Release Notes](/about/release-notes/)).**

This project is 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**.

Expand All @@ -28,6 +28,8 @@ The Pi4j project has evolved in all these years as the whole Java eco-system and
* In 2.5.0, support for the Raspberry Pi 5 was added. Because of the new [GPIO chip RP1](https://www.raspberrypi.com/documentation/microcontrollers/rp1.html), a new GPIO Provider was needed. See the [this interview](/blog/2024/20240318_interview_alexander_liggesmeyer/).
* [V3.X.X](/about/info-v3): Based on Pi4J 2.8.0 and Java 21.
* Please [read this blog post for more info](/blog/2025/20250211-welcome-java-21/).
* [V4.X.X](/about/info-v4): Based on Pi4J 3.0.3 and Java 25, introducing the [FFM plugin](/documentation/providers/ffm/).
* Please [read this interview with Nick Gritsenko (aka DigitalSmile) for more info](/blog/2025/2025????-interview-nick-ffm/).

### Project Mission/Goals

Expand Down
21 changes: 21 additions & 0 deletions content/about/info-v4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: 'What''s New in V4'
weight: 23
tags: ["FFM API"]
---

Versions 4.0.0 is based on 3.0.3 (released on 2025-09-23), but bumps the **Java version to 25** and has a new plugin that uses the Foreign Function & Memory (FFM) API. See the [release notes](/about/release-notes/???).

## FFM Plugin

The goal of this bump to V4 is to enable the use of the Foreign Function & Memory (FFM) API in Pi4J. This FFM API has been introduced in OpenJDK 22 and simplifies the use of native libraries in Java. And native libraries are "the heart" of the Pi4J project as they provide the connection between your Java code and the hardware.

Thanks to the contributions by [Nick Gritsenko (aka DigitalSmile)](https://github.com/DigitalSmile) in [pull request #458](https://github.com/Pi4J/pi4j/pull/458), a complete new plugin got added to Pi4J. Read more about the work by Nick in this [interview](/blog/2025/2025????-interview-nick-ffm/).

## Sources

The Pi4J V4 source code is available in this GitHub repository: [`pi4j/pi4j` GitHub Repository](https://github.com/Pi4J/pi4j)

```shell
git clone https://github.com/Pi4J/pi4j
```
27 changes: 27 additions & 0 deletions content/about/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ weight: 40

All releases of Pi4J V2+ are listed on [github.com/Pi4J/pi4j/releases](https://github.com/Pi4J/pi4j/releases).

## V4

Requires Java 25, see [What's New in V4](/about/info-v4/) for more info.

### 2025-0123 - V4.0.0

This is a big one with almost 400 commits and 300+ files added/changed...! **Pi4J V4 introduces the new [FFM plugin](/documentation/provider/ffm) and bumps the Java version to 25**. The FFM plugin makes use of the now Foreign Function & Memory API (FFM) to access the GPIOs. The FFM API got introduced in Java 22 with [JEP 454](https://openjdk.org/jeps/454).

This is also the first release of Pi4J that has been so extensively tested as it contains a complete new plugin (FFM) and a lot of the existing code has been refactored and improved. To simplify the testing process, an inexpensive hardware setup has been created to run automated "Smoke Tests" in combination with a [set of tests in the 'pi4j-test' module in the core project](https://github.com/Pi4J/pi4j/blob/develop/pi4j-test/src/main/java/com/pi4j/test/Main.java). This test is documented [on the page "Hardware Testing"](/architecture/about-the-code/hardware-testing/) and the goal is to have the same test setup for all core developers and is easy to create by anyone who wants to run these tests. Because these tests require hardward and must be run on a Raspberry Pi, they cannot be executed as unit tests.

Some highlights of all the changes:

* [Issue #454](https://github.com/Pi4J/pi4j/issues/454): Implement new FFM API approach. First big pull request: [#458](https://github.com/Pi4J/pi4j/pull/458) with more for further improving, finetuning, and testing.
* Consistent use of `bcm`, `channel`, `bus`, `chip` when initializing an IO instead of the sometimes confusing `pin`or `address`. With related changes in the Pi4J registry to be able to correctly remove and reuse IO instances.
* [Issue #478](https://github.com/Pi4J/pi4j/issues/478): Race condition in GpioDDigitalInput causes monitor thread to exit
* BoardInfo: added CM5 Lite, and 500 Plus
* Bump Docker builder to JDK 25
* Nexus staging plugin replaced with Central Publishing plugin
* Rework of the [pi4j-test](https://github.com/Pi4J/pi4j/tree/develop/pi4j-test) module.
* Various LinuxFS plugin improvements.
* Overall code fixes, improvements, new helper methods, cleanup, etc..
* Complete removal of serial support, use jSerialComm instead of Pi4J for serial communication, as [explained here](https://www.pi4j.com/documentation/io-types/serial/).

Thanks to contributions by [@DigitalSmile](https://github.com/DigitalSmile), [@IAmNickNack](https://github.com/IAmNickNack), [@stefanhaustein](https://github.com/stefanhaustein), [@taartspi](https://github.com/taartspi), [@eitch](https://github.com/eitch), [@fdelporte](https://github.com/fdelporte).

Detailed list of all the changes: https://github.com/Pi4J/pi4j/compare/3.0.3...4.0.0

## V3

Requires Java 21, see [What's New in V3](/about/info-v3/) for more info.
Expand Down
10 changes: 5 additions & 5 deletions content/architecture/about-the-code/build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Build Instructions
weight: 30
---

Building the Pi4J Project is simple and requires minimal effort. Pi4J is primarily built using Apache Maven and Java 21.
Building the Pi4J Project is simple and requires minimal effort. Pi4J is primarily built using Apache Maven and Java 25.
Pi4J can be built directly on your host computer or inside a Docker container where all toolchains and dependencies are
already installed, configured and cached.

Expand All @@ -16,10 +16,10 @@ already installed, configured and cached.

In order to build Pi4J, the host system must have the following toolchains pre-installed.

| Name | Version | URL |
| :--- | :--- | :-- |
| Java Development Kit (JDK) | 11.0.7 (_or newer_) | https://openjdk.java.net/ |
| Apache Maven | 3.6.3 (_or newer_) | https://maven.apache.org/download.cgi |
| Name | Version | URL |
| :--- |:--------------------| :-- |
| Java Development Kit (JDK) | 25 (_or newer_) | https://openjdk.java.net/ |
| Apache Maven | 3.9.11 (_or newer_) | https://maven.apache.org/download.cgi |

---

Expand Down
34 changes: 5 additions & 29 deletions content/architecture/about-the-code/download-sources.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Download/Install
title: Download the Sources
weight: 20
---

You can build the project from sources available on [GitHub](https://github.com/Pi4J/pi4j).

* Checkout the project [pi4j](https://github.com/Pi4J/pi4j)
* Use a JDK version 21 or newer, e.g. `sdk use java 21.0.6-zulu`
* In the root of pi4j run `mvn clean install`
* Checkout the `develop` branch of the [pi4j repository](https://github.com/Pi4J/pi4j).
* Use a JDK version 25 or newer, e.g. `sdk use java 25.0.1-zulu`.
* In the root of the `pi4j directory, run `mvn clean install`.

```
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Pi4J :: Parent POM 2.0-SNAPSHOT:
[INFO] Reactor Summary for Pi4J :: Parent POM 4.0.0-SNAPSHOT:
[INFO]
[INFO] Pi4J :: Parent POM ................................. SUCCESS [ 0.972 s]
[INFO] Pi4J :: DOCKER :: Docker Parent POM .............. SUCCESS [ 0.290 s]
Expand All @@ -30,27 +30,3 @@ You can build the project from sources available on [GitHub](https://github.com/
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
```

## Example application

### Building the example application

* Checkout the project [Pi4J V2+ - Telegraph Demo Project](https://github.com/Pi4J/pi4j-demo-telegraph)
* Select JDK 21, e.g. `sdk use java 21.0.6-zulu`
* In the root of pi4j-demo-telegraph run `mvn clean install`
* Check the directory target\distribution --> this contains all the files to be copied to the Raspberry Pi

```
/target/distribution/pi4j-core-2.0-SNAPSHOT.jar
/target/distribution/pi4j-demo-telegraph-1.0-SNAPSHOT.jar
/target/distribution/pi4j-library-pigpio-2.0-SNAPSHOT.jar
/target/distribution/pi4j-plugin-pigpio-2.0-SNAPSHOT.jar
/target/distribution/pi4j-plugin-raspberrypi-2.0-SNAPSHOT.jar
/target/distribution/run.sh
/target/distribution/slf4j-api-2.0.0-alpha0.jar
/target/distribution/slf4j-simple-2.0.0-alpha0.jar
```

### Running on the Raspberry Pi

* After copying all files from target/distribution to a Raspberry Pi, start `./run.sh`
26 changes: 2 additions & 24 deletions content/architecture/about-the-code/hardware-testing.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
---
title: Hardware testing
title: Hardware Testing
weight: 50
---

{{% notice warning %}}This is an experimental project which will need a lot of love... The new Raspberry
Pi Pico with a lot of GPIOs for a very low price, seems even to be a better fit for this project compared to the
Arduino Due... To be further investigated!{{% /notice %}}

To minimize the required time and efforts to test a new release, V2+ aims to include an automated test which performs
I/O testing on each I/O interface on each model of RPi. Ideally this would happen as part of the unit testing sequence
for each code commit or at least as part of the release cycle.

To achieve this, an Arduino Due board with lots of on board I/O capability is being used. The
[firmware that gets loaded onto the Arduino board](https://github.com/Pi4J/pi4j/tree/master/pi4j-test-harness/src/main/arduino)
listens on the serial port for instructions on which pins to use and what type of test to perform. The
"Test Harness" project also includes a [Java library that is used to communicate with the Arduino and instrument tests](https://github.com/Pi4J/pi4j/tree/master/pi4j-test-harness/src/main/java).

Next, a given [I/O provider plugin](https://github.com/Pi4J/pi4j/tree/master/plugins/pi4j-plugin-pigpio/src/test/java/com/pi4j/plugin/pigpio/test)
includes test classes that instrument the test harness and perform live I/O testing between the SBC (or other hardware)
and the Arduino Test Harness.

To be able to fully test all board types, a custom PCB needs to be created to perform all the interconnects between
the Raspberry Pi 26-pin/40-pin headers, and the Arduino board. This way enough test harnesses could be build for each
Raspberry Pi model and have a permanent setup for on-demand testing. This of course is a huge effort just by itself,
and perhaps too ambitious -- but seeking a means to reach automated testing is really needed for the long term.

![](/assets/architecture/hardware-testing.jpg)
{{< github-readme "https://github.com/Pi4J/pi4j/blob/develop/pi4j-test/README.md" >}}
8 changes: 8 additions & 0 deletions content/architecture/future-ideas/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Ideas For The Future
weight: 999
---

You can find more info on these pages about some of ideas for the future:

{{% children %}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
title: 'Remote support'
---

One of the big features on the wish-list for V2+: native support for remote I/O capability. Predominantly to support
the ability for a user to perform development work on their desktop/laptop and be able to run their project with
remote support slaving the I/O to a daemon running on the Raspberry Pi (or other supported SBC).

{{% notice warning %}}TO BE DECIDED: the V2+ codebase does support this currently by using the PiGpio daemon.
This may be an OK place to start for the first release, but a separate Pi4J daemon may be ideal for a long term
solution to capture some of the edge cases and provide remote I/O capability no matter which underlying I/O library
is being used. {{% /notice %}}
is being used. {{% /notice %}}

One of the big features on the wish-list for V2+: native support for remote I/O capability. Predominantly to support
the ability for a user to perform development work on their desktop/laptop and be able to run their project with
remote support slaving the I/O to a daemon running on the Raspberry Pi (or other supported SBC).
2 changes: 1 addition & 1 deletion content/architecture/pi4j-logo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: The Pi4J Logo
weight: 999
weight: 998
---

{{% notice tip %}}
Expand Down
Loading