Releases: Pi4J/pi4j-v2
2.7.0
- Libraries are loaded depending on the platform, by calling
BoardInfoHelper.runningOnRaspberryPi()
. BoardModel
has 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
warn
levels to reduce toinfo
where more applicable.
- Issue #383: Increase amount of write bytes to SPI devices over 65535.
spiWrite
has 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.
A lot of changes and... support for Raspberry Pi 5!
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!
Warning, the new GpioD Provider needs the latest Raspberry Pi OS version (Debian GNU/Linux 12 (bookworm)
)
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, commit ed208f2.
- Fix for: I2C interface should use a restart between the write and read operation. Pull request #333.
- 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: 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.
2.4.0
- Extended LinuxFS plugin
- PWM provider
- First set of implementations for Digital Input and Output
- To be further extended, see #307
- Don't re-initialize pigpio twice, thus use singleton
- Implement blink method in DigitalOutputBase
- Added testcases for I2CRegisterDataReader, I2CRegisterDataWrite
- Fix I2C write register: multi byte register may fail with large data
- Fix mock SPI.transfer() functionality
- Add readEntireMockBuffer() method to class MockSpi
- Fix for data read over I2C becomes out of sync over a slower wireless network
- Use Socket#setSoTimeout to timeout read requests of GPIO socket implementation
Thanks to @GeVanCo, @MMMMMNG, @IAmNickNack, @savageautomate, @eitch, @taartspi, @FDelporte
2.3.0 - SPI and PiGPIO Improvements
- 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
2.2.1 - SPI improvements
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
2.2.0
Thanks to all contributors, multiple improvements were added:
- 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