Skip to content

Commit 77cf0a9

Browse files
authored
Merge pull request #85 from Pi4J/release/V4.0.0
DRAFT: Release notes V4 and interview Nick
2 parents f2a607e + 31c1b03 commit 77cf0a9

File tree

29 files changed

+399
-488
lines changed

29 files changed

+399
-488
lines changed

content/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Welcome to Pi4J
44

55
## Welcome to Pi4J
66

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

99
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**.
1010

@@ -28,6 +28,8 @@ The Pi4j project has evolved in all these years as the whole Java eco-system and
2828
* 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/).
2929
* [V3.X.X](/about/info-v3): Based on Pi4J 2.8.0 and Java 21.
3030
* Please [read this blog post for more info](/blog/2025/20250211-welcome-java-21/).
31+
* [V4.X.X](/about/info-v4): Based on Pi4J 3.0.3 and Java 25, introducing the [FFM plugin](/documentation/providers/ffm/).
32+
* Please [read this interview with Nick Gritsenko (aka DigitalSmile) for more info](/blog/2025/2025????-interview-nick-ffm/).
3133

3234
### Project Mission/Goals
3335

content/about/info-v4.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: 'What''s New in V4'
3+
weight: 23
4+
tags: ["FFM API"]
5+
---
6+
7+
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/).
8+
9+
## FFM Plugin
10+
11+
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.
12+
13+
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/).
14+
15+
## Sources
16+
17+
The Pi4J V4 source code is available in this GitHub repository: [`pi4j/pi4j` GitHub Repository](https://github.com/Pi4J/pi4j)
18+
19+
```shell
20+
git clone https://github.com/Pi4J/pi4j
21+
```

content/about/release-notes.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ weight: 40
55

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

8+
## V4
9+
10+
Requires Java 25, see [What's New in V4](/about/info-v4/) for more info.
11+
12+
### 2025-02-20 - V4.0.0
13+
14+
This is a big release 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).
15+
16+
This is the most tested release of Pi4J yet! The `pi4j-test` module has been reworked by [@taartspi](https://github.com/taartspi) to provide a smoke test approach with a fixed hardware setup that uses, for instance, input GPIOs to validate output GPIOs and PWM. Check [Hardware Testing](/architecture/about-the-code/hardware-testing/) for more info and how to setup.
17+
18+
Some highlights of all the changes in this release:
19+
20+
* [Issue #454](https://github.com/Pi4J/pi4j/issues/454): Implement new FFM API approach. First big pull request by [@DigitalSmile](https://github.com/DigitalSmile): [#458](https://github.com/Pi4J/pi4j/pull/458) with more for further improving, finetuning, and testing.
21+
* 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.
22+
* [Issue #478](https://github.com/Pi4J/pi4j/issues/478): Race condition in GpioDDigitalInput causes monitor thread to exit
23+
* BoardInfo: added CM5 Lite, and 500 Plus
24+
* Bump Docker builder to JDK 25
25+
* Nexus staging plugin replaced with Central Publishing plugin
26+
* Rework of the [pi4j-test](https://github.com/Pi4J/pi4j/tree/develop/pi4j-test) module to provide an easy SmokeTest approach with a fixed hardware test setup.
27+
* Various LinuxFS plugin improvements.
28+
* Overall code fixes, improvements, new helper methods, cleanup, etc..
29+
* Complete removal of serial support, use jSerialComm instead of Pi4J for serial communication, as [explained here](https://www.pi4j.com/documentation/io-types/serial/).
30+
31+
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).
32+
33+
Detailed list of all the changes: https://github.com/Pi4J/pi4j/compare/3.0.3...4.0.0
34+
835
## V3
936

1037
Requires Java 21, see [What's New in V3](/about/info-v3/) for more info.

content/architecture/about-the-code/build-instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Build Instructions
33
weight: 30
44
---
55

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

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

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

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

2424
---
2525

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
2-
title: Download/Install
2+
title: Download the Sources
33
weight: 20
44
---
55

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

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

1212
```
1313
[INFO] Executed tasks
1414
[INFO] ------------------------------------------------------------------------
15-
[INFO] Reactor Summary for Pi4J :: Parent POM 2.0-SNAPSHOT:
15+
[INFO] Reactor Summary for Pi4J :: Parent POM 4.0.0-SNAPSHOT:
1616
[INFO]
1717
[INFO] Pi4J :: Parent POM ................................. SUCCESS [ 0.972 s]
1818
[INFO] Pi4J :: DOCKER :: Docker Parent POM .............. SUCCESS [ 0.290 s]
@@ -30,27 +30,3 @@ You can build the project from sources available on [GitHub](https://github.com/
3030
[INFO] BUILD SUCCESS
3131
[INFO] ------------------------------------------------------------------------
3232
```
33-
34-
## Example application
35-
36-
### Building the example application
37-
38-
* Checkout the project [Pi4J V2+ - Telegraph Demo Project](https://github.com/Pi4J/pi4j-demo-telegraph)
39-
* Select JDK 21, e.g. `sdk use java 21.0.6-zulu`
40-
* In the root of pi4j-demo-telegraph run `mvn clean install`
41-
* Check the directory target\distribution --> this contains all the files to be copied to the Raspberry Pi
42-
43-
```
44-
/target/distribution/pi4j-core-2.0-SNAPSHOT.jar
45-
/target/distribution/pi4j-demo-telegraph-1.0-SNAPSHOT.jar
46-
/target/distribution/pi4j-library-pigpio-2.0-SNAPSHOT.jar
47-
/target/distribution/pi4j-plugin-pigpio-2.0-SNAPSHOT.jar
48-
/target/distribution/pi4j-plugin-raspberrypi-2.0-SNAPSHOT.jar
49-
/target/distribution/run.sh
50-
/target/distribution/slf4j-api-2.0.0-alpha0.jar
51-
/target/distribution/slf4j-simple-2.0.0-alpha0.jar
52-
```
53-
54-
### Running on the Raspberry Pi
55-
56-
* After copying all files from target/distribution to a Raspberry Pi, start `./run.sh`
Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
11
---
2-
title: Hardware testing
2+
title: Hardware Testing
33
weight: 50
44
---
55

6-
{{% notice warning %}}This is an experimental project which will need a lot of love... The new Raspberry
7-
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
8-
Arduino Due... To be further investigated!{{% /notice %}}
9-
10-
To minimize the required time and efforts to test a new release, V2+ aims to include an automated test which performs
11-
I/O testing on each I/O interface on each model of RPi. Ideally this would happen as part of the unit testing sequence
12-
for each code commit or at least as part of the release cycle.
13-
14-
To achieve this, an Arduino Due board with lots of on board I/O capability is being used. The
15-
[firmware that gets loaded onto the Arduino board](https://github.com/Pi4J/pi4j/tree/master/pi4j-test-harness/src/main/arduino)
16-
listens on the serial port for instructions on which pins to use and what type of test to perform. The
17-
"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).
18-
19-
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)
20-
includes test classes that instrument the test harness and perform live I/O testing between the SBC (or other hardware)
21-
and the Arduino Test Harness.
22-
23-
To be able to fully test all board types, a custom PCB needs to be created to perform all the interconnects between
24-
the Raspberry Pi 26-pin/40-pin headers, and the Arduino board. This way enough test harnesses could be build for each
25-
Raspberry Pi model and have a permanent setup for on-demand testing. This of course is a huge effort just by itself,
26-
and perhaps too ambitious -- but seeking a means to reach automated testing is really needed for the long term.
27-
28-
![](/assets/architecture/hardware-testing.jpg)
6+
{{< github-readme "https://github.com/Pi4J/pi4j/blob/develop/pi4j-test/README.md" >}}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Ideas For The Future
3+
weight: 999
4+
---
5+
6+
You can find more info on these pages about some of ideas for the future:
7+
8+
{{% children %}}

content/architecture/advanced/annotated-provisioning.md renamed to content/architecture/future-ideas/annotated-provisioning.md

File renamed without changes.

content/architecture/advanced/dependency-injection.md renamed to content/architecture/future-ideas/dependency-injection.md

File renamed without changes.

content/architecture/advanced/remote-support.md renamed to content/architecture/future-ideas/remote-support.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
title: 'Remote support'
33
---
44

5-
One of the big features on the wish-list for V2+: native support for remote I/O capability. Predominantly to support
6-
the ability for a user to perform development work on their desktop/laptop and be able to run their project with
7-
remote support slaving the I/O to a daemon running on the Raspberry Pi (or other supported SBC).
8-
95
{{% notice warning %}}TO BE DECIDED: the V2+ codebase does support this currently by using the PiGpio daemon.
106
This may be an OK place to start for the first release, but a separate Pi4J daemon may be ideal for a long term
117
solution to capture some of the edge cases and provide remote I/O capability no matter which underlying I/O library
12-
is being used. {{% /notice %}}
8+
is being used. {{% /notice %}}
9+
10+
One of the big features on the wish-list for V2+: native support for remote I/O capability. Predominantly to support
11+
the ability for a user to perform development work on their desktop/laptop and be able to run their project with
12+
remote support slaving the I/O to a daemon running on the Raspberry Pi (or other supported SBC).

0 commit comments

Comments
 (0)