Releases: Pi4J/pi4j
4.0.1 FFM plugin bug fix release
This is a bug fix release, mainly related to the new FFM plugin introduced in V4.0.0.
- Add FFM to the distribution module.
- Improvements in the one-time generation of BuildInfo within ContextBuilder.
- Wiring and README updates related to the smoke tests in the
pi4j-testmodule. - @DigitalSmile added as author in the parent
pom.xml. - Fix for issue #620: shutdown sequence to close the file descriptor as the last step.
- Fix for issue #622: 5th and following inputs don't trigger event listeners in ffm-plugin.
- Fix GPIO listener missing RISING events when timestamp LSB is zero.
- Shell script added to run the smoketest in
pi4j-test/assets/runSmoketest.sh.
Thanks to contributions by @DigitalSmile, @taartspi, @eitch, @fdelporte, detailed bug investigations by @relaxmax01 and @DieterHolz, and assistance from Copilot.
Detailed list of all the changes: 4.0.0...4.0.1
4.0.0 FFM plugin and Java 25
This is a big release with almost 400 commits and 300+ files added/changed...! Pi4J V4 introduces the new FFM plugin and bumps the Java version to 25. The FFM plugin uses the new Foreign Function & Memory API (FFM) to access the GPIOs. The FFM API was introduced in Java 22 with JEP 454.
This is the most tested release of Pi4J yet! The pi4j-test module has been reworked by @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 for more info and how to set up.
Some highlights of all the changes in this release:
- Issue #454: Implement new FFM API approach. First big pull request by @DigitalSmile: #458 with more to further improve, finetune, and test.
- Consistent use of
bcm,channel,bus,chipwhen initializing an IO instead of the sometimes confusingpinoraddress. With related changes in the Pi4J registry to be able to correctly remove and reuse IO instances. - Issue #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 module to provide an easy SmokeTest approach with a fixed hardware test setup.
- 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.
Thanks to contributions by @DigitalSmile, @IAmNickNack, @stefanhaustein, @taartspi, @eitch, @fdelporte.
Detailed list of all the changes: 3.0.3...4.0.0
3.0.3
Work is ongoing to extend Pi4J with a plugin based on the FFM API (Foreign Function & Memory API). To make this possible, some changes have been made to the core code in preparation for this new plugin. And of course more improvements and bug fixes...
- Board models: Added CM5 Lite board codes.
- Replace Nexus Staging plugin with Central Publishing plugin.
- Refactored
Registryto useIOTypefor managing addresses, ensuring better segregation of address spaces between IO types. Updated related methods and internal data structures accordingly. - Introduced the ability to shutdown and unregister IO instances using the instance itself, complementing the existing ID-based method. Updated related methods, tests, and documentation to reflect the new functionality.
- Ensure proper removal of IO instance during shutdown in DefaultRuntimeRegistry.
- PWM IO Change Float to Integer and remove float related conversions.
- Gate digital output event creation on listener / binding presence.
- Move PWM chip detection to BoardInfo to make it usable for all plugins.
- Unit test improvements.
- LinuxFS plugin:
- I2C: Improvements in
registerRead. - SPI: SPI write now supports larger buffers by creating multi ioctl spi writes.
- PWM: When the RP1 chip is found, PWM provider will use the RP1 architected address of PWM0 to determine the correct pwmChipx to use. This change will effect Raspberry Pi 5 and Compute Module 5 using updated kernel.
- I2C: Improvements in
- GpioD plugin:
- Introduced a volatile
runningflag to properly manage the lifecycle of the input listener thread. Enhanced shutdown logic to ensure threads are safely and consistently terminated. Fix for Issue #478. - Make GpioLine Closeable.
- Introduced a volatile
Thanks to contributions by @IAmNickNack, @stefanhaustein, @taartspi, @eitch, @fdelporte.
All changes: 3.0.2...3.0.3
3.0.2
- Board model can now be forced to allow the use of Pi4J on other/unrecognized boards. See Overriding the Detected Board for more info.
BoardInfoHelper.usesRP1()has been improved as more boards use this RP1 (5, 500, Compute 5), and even more are expected in the future.- Issue #455: GpioDDigitalInput may never start monitoring line events. Fixed by simplifying and improving the wait for the input listener loop to exit on shutdown.
- APIdia badge and link added to README.md
- Pull request #461: Removal in the core code of the SpiChipSelect to enforce a PiGpio limitation of the values 0, 1, or 2.
Thanks to contributions by @ylexus, @taartspi, @eitch, @fdelporte.
All changes: 3.0.1...3.0.2
3.0.1
This is the first release of Pi4J that requires Java runtime 21 or higher. Check the blog post Pi4J welcomes Java 21 to understand why we needed this change to prepare the project for the future...
Because of a last-minute change to improve the detection of Raspberry Pi 5, 500, and Compute 5, release 3.0.0 has been skipped.
- Bump the Java version to 21 and update many dependencies, such as the Maven plugin.
- Added JNA dependency (needed for Java 21).
- Added Maven wrapper.
- Improved lifecycle shutdown handling for registry elements: Updated the
Lifecycleinterface to clarify shutdown behavior and added tests to ensure proper element recreation after shutdown. These enhancements make the shutdown process more robust and intuitive. - Issue #308: Remove serial support from Pi4J. All serial methods are marked as
@Deprecated(forRemoval = true). We advise using jSerialComm for all serial communication. - Pull request #438: Extra unit test for shutdown and re-creation of a DigitalInput.
- Issue #439: Allow Specifying GPIO Chip for GpioDContext. For more info on how to use, see Specifying the GPIO Chip.
- Pull request #449: Fixes a minor bug in DigitalOutput where pulseAsync ignored the given state and always pulsed high.
- Pull request #452: PWM linuxfs failed if the first interface call was off().
- Pull request #453 for issue #296: Generic BoardModels (with and without RP1) have been added, with a new method
BoardInfoHelper.current().setBoardModel(BoardModel.GENERIC);to make it possible to use Pi4J on other types of boards, see Overriding the Detected Board. The goal of the Pi4J project is still to focus on the Raspberry Pi. However, this should allow testing the library's compatibility with other boards with similar architecture. We are excited to hear from the community about possible improvements to this approach.
Thanks to contributions by @stefanhaustein, @Haruka0522, @mpilone, @dariuszzbyrad, @taartspi, @eitch, @fdelporte.
All changes: 2.8.0...3.0.1
2.8.0
- Several code and JavaDoc improvements by adding the checkstyle plugin.
- Improvements in loading the Mock providers to build and test Pi4J on a Raspberry Pi.
- Issue #421: Unable to detect board type. Several improvements have been integrated in the board detection to prevent errors when reading the board code.
- Added to
BoardModel:- Issue #406: Old boards not auto detected. Missing codes have been added for Model 1 boards.
- The Raspberry Pi Compute 5. Only the board code
c04180for the 4Gb has been confirmed by Jeff Geerling. The other types are not documented yet. We assume they area04180,b04180, andd04180, similar to the Compute 4, but will adjust whenever more info is available. - The Raspberry Pi 500 with the board code
d04190, again confirmed by Jeff who received an evaluation device. - The Raspberry Pi 5 with 16GB memory with the board code
e04171(thanks again Jeff).
- Added to
BoardReading:- Pull request #432: Add Support for Throttled State Parsing and Retrieval
- Improvements in the LinuxFS provider (for Raspberry Pi 5):
Thanks to contributions by @mpilone, @cniesen, @geerlingguy, @dariuszzbyrad, @taartspi, @eitch, @fdelporte.
Special thanks to Dariusz Zbyrad for joining the project and improving the Maven builds with a wrapper for more consistency, for example, in the pi4j-example-devices repository, and other contributions. And also special thanks to Mike Pilone for the initial work for LinuxFS SPI.
All changes: 2.7.0...2.8.0
2.7.0
- Libraries are loaded depending on the platform, by calling
BoardInfoHelper.runningOnRaspberryPi(). BoardModelhas been extended with 2Gb Raspberry Pi 5, Raspberry Pi Pico 2, and extra board codes for the Compute Module 4.- Allowing configuration of the shutdown hook. It's disabled by default.
- Issue #354: Gracefully handle UnsatisfiedLinkError on newAutoContext.
- Issue #368: Mock providers don't seem to be loaded on an non-RPi system.
- Issue #369: WARN noise in the log about Ignoring providers on every startup.
- Removed unnecessary String concatenations in logging statements.
- Reduced log output and reviewed
warnlevels to reduce toinfowhere more applicable.
- Issue #383: Increase amount of write bytes to SPI devices over 65535.
spiWritehas been modified to write data in chunks of 4096 bytes so it can handle larger messages. - Issue #388: I2C writeRead method compares written to writeOffset instead of writeSize.
Because of the changes in the loading of the mock providers, if you want to load them on a Raspberry Pi board, you need to use the following context builder:
var pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().build();Thanks to contributions by @ylexus, @mores, @taartspi, @eitch, @fdelporte.
All changes: 2.6.1...2.7.0
2.6.1
This is a minor bug fix release to allow a smoother integration in a Spring Boot Starter by allowing to run on PC for testing without initialization errors and with reduced logging of the I2C Mock plugin.
- Issue #354: Gracefully handle UnsatisfiedLinkError on newAutoContext when not running on a Raspberry Pi, for instance, when testing on Windows or macOS.
- Clean up of logs in
MockI2C.java.
All changes: 2.6.0...2.6.1
PWM and I2C Improvements
- New hardware PWM provider added to the GpioD plugin, see:
- Various improvements in the I2C implementation in both core and plugins, see:
- Dependency bumps in the pom file, see pull request #337.
- New BoardInfo included to detect type of Raspberry Pi board, providing a lot of info about the board, SoC, pins, etc., see:
- Documentation: Using Board Info.
- Example implementation and visualization on api.pi4j.com.
- Fix for "IOBase constructor do not update the fields id, name & description".
- Issue #257: IOAlreadyExistsException when reopening Serial-connection.
- Issue #244: Multiple SPI throws IOAlreadyExistsException.
- Several code improvements and clean-up.
Thanks to contributions by @fusetim, @taartspi, @eitch, @fdelporte.
Make sure to also read the interviews with Robert von Burg and Tom Aarts.
All changes: 2.5.1...2.6.0
Correct native code for GpioD
Sorry! Because of a configuration error, the wrong native code is included in 2.5.0 for the new GpioD Provider. But thanks to the lightning fast action of Robert von Burg we have a fixed version for you to enjoy :-)`
For all other info about the changes in 2.5, see the release notes of 2.5.0.