Release Notes

All releases of Pi4J V.2 are listed on github.com/Pi4J/pi4j-v2/releases.

2024-03-18 - V2.5.0

With over 100 commits from multiple branches, this is a major release with many improvements! With many thanks to the core team (Robert von Burg, Tom Aarts), and a major addition of Alexander Liggesmeyer, Pi4J is again lifted to a higher level!

You can find out more about Alexander in this blog post.

Changes in 2.5.0

  • A new GpioD Provider adds support for the Raspberry Pi 5.
    • Issues #321, #320, #317
    • This new GpioD provider interfaces directly with the Raspberry Pi’s gpiochip device, located at /dev/gpiochip.... It leverages the native libgpiod library, which is developed as a part of the Linux kernel. Libgpiod is currently the recommended way to control GPIO pins. Therefore, using this provider is also recommended.
    • This new provider can be used without the need to start a Pi4J application with sudo, so also fixes #212 when you only need DigitalInput and/or DigitalOutput.
  • Better handling of mock Plugins: Plugins can now define if they are mocks, and these are not auto-detected anymore. The default target for the Pi4J library is the Raspberry Pi, and thus auto-detecting mocks on the Pi, which are only for tests is counterintuitive.
  • Extended Providers with a priority: this priority helps to determine which Provider should be loaded, when multiple Providers with the same IOType are being loaded by different plugins. This change enforces that a given IOType can only have one Provider loaded at runtime preventing errors when, for instance, two I2C providers are loaded at the same time, concurrently writing to the I2C bus.
  • Fix for: LinuxFile reused scratch buffers ensuring size was usable. But the limit value cannot be modified so later usage failed as an intended overwrite. Pull request #331.
  • Fix for: I2C interface should use a restart between the write and read operation. Pull request #333.
  • Fix for: LinuxFile reused scratch buffers ensuring size was usable, but the limit value cannot be modified so later usage failed as an intended overwrite. Commit ed208f2.
  • Fix for: Shutting down pool executor too early. Commit 7909a2d.
  • ProviderProxyHandler got removed, simplifying provider loading, thus no more reflection on the instances.
  • You can now add and remove IO instances at runtime.
  • You can now easily switch a GPIO from output to an input and vice versa, see issue #26, extending on the work by @MEBoo, in pull request #1.
  • A race condition got fixed in the default runtime registry.
  • Proper life cycle management got added for of all threads in Pi4J.

All changes: https://github.com/Pi4J/pi4j-v2/compare/2.4.0...2.5.0

Known Issue

  • java.io.IOException: Remote I/O error java.base/java.io.RandomAccessFile.writeBytes(Native Method). Using linuxfs-i2c, dependent upon i2c operations this exception can occur: If the program initially uses read or write, and later uses readRegister or writeRegister there is no exception. However, if the program initially uses readRegister or writeRegister subsequent write or read may encounter this exception. For more info and the temporary fix, check #335.

2023-10-24 - V2.4.0

Thanks to @GeVanCo, @MMMMMNG, @IAmNickNack, @savageautomate, @eitch, @taartspi, @FDelporte.

All changes: https://github.com/Pi4J/pi4j-v2/compare/2.3.0...2.4.0

2023-02-06 - V2.3.0

  • Improvements for PIGPIO.gpioCfgInterfaces by @bwaldvogel.
  • New i2c interface to support multibyte register address by @taartspi.
  • Fix in LinuxFsI2C byte array offset by @harlanhu.
  • Remove unused JNA references by @taartspi.

All changes: https://github.com/Pi4J/pi4j-v2/compare/2.2.1...2.3.0

2022-10-17 - V2.2.1

Multiple fixes by @taartspi:

  • Better error message when mixing 32- and 64-bit artifacts
  • SPI improvements:
    • Add missing initialization in constructor
    • Track weather the user set the mode or bus config values to improve the use of SPI flags

All changes: https://github.com/Pi4J/pi4j-v2/compare/2.2.0...2.2.1

2022-08-30 - V2.2.0

What an amazing achievement! No major issues were found in the previous release, but several small fixes were added by more people than ever before in the Pi4J-history. This is a real confirmation of the openness of this project and how a community can work together to further improve a project.

A big thank you to everyone who experimented with Pi4J, took part in the discussions, filed an issue, created a merge request, added examples,…!

New example implementations

Thanks to the work of FHNW students and @taartspi, the list of available example implementations has become larger and larger. We even moved them to their own section of this documentation website! Take a look at Example implementations if you need a quick-start to use a buzzer, camera, LED strip, TCA9548, MCP4725,… or any of the other examples.

Changes in V2.2.0

Multiple improvements were added in this release (and others are already in progress for the next one!):

  • by @taartspi to improve SPI initialization, see #229
  • by @haumacher regarding the use of ByteBuffers, see #185
  • by @savageautomate regarding the polarity of digital output, see #93
  • by @gugrim to ensure positive values are returned from reading unless at end of file, see #164
  • by @eitch to also export LinuxFS I2C in module-info.java
  • by @eitch to also copy native libs to distribution zip
  • by @hagen to be able to configure sample rate and peripheral in PiGpio
  • by Saskia Bikle to add an implementation of deregistration/shutdown for IO’s
  • by @savageautomate to add a new value “flags” too SPI implementation

All the differences can be checked by comparing with the previous release 2.1.1 via this link.

Earlier release notes

Release notes of the previous releases of Pi4J V.2 are available on github.com/Pi4J/pi4j-v2/releases.