Has anyone tried to use pi4j on the new Raspberry Pi 3 B+?
The RPi 3B+ requires the use of wiringPi version 2.46, released sometime after March 14, 2018 and the latest version of Raspbian "stretch".
The pi4j 1.2 jar files include the library libpi4j.so which is the embedded copy of wiringPi v2.44 which does not include the fixes for the 3B+.
When I try to run the statement:
protected GpioController gpio = GpioFactory.getInstance();
I get the following exception:
OpenJDK 64-Bit Server VM warning: You have loaded library /tmp/libpi4j6824788762589179225.so which might have disabled stack guard. The VM will try to fix the stack guard now.It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.Apr 07, 2018 9:26:14 PM com.pi4j.util.NativeLibraryLoader loadSEVERE: Unable to load [libpi4j.so] using path: [/lib/raspberrypi/static/libpi4j.so]java.lang.UnsatisfiedLinkError: /tmp/libpi4j6824788762589179225.so: /tmp/libpi4j6824788762589179225.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)at java.lang.ClassLoader$NativeLibrary.load(Native Method)at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)at java.lang.Runtime.load0(Runtime.java:809)at java.lang.System.load(System.java:1086)at com.pi4j.util.NativeLibraryLoader.loadLibraryFromClasspath(NativeLibraryLoader.java:148)at com.pi4j.util.NativeLibraryLoader.load(NativeLibraryLoader.java:97)at com.pi4j.wiringpi.Gpio.<clinit>(Gpio.java:189)at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:69)at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:51)at com.pi4j.platform.Platform.getGpioProvider(Platform.java:125)at com.pi4j.platform.Platform.getGpioProvider(Platform.java:118)at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:109)at com.pi4j.io.gpio.impl.GpioControllerImpl.<init>(GpioControllerImpl.java:56)at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:91)at com.lebruns.steven.epaper.WaveshareEP_SPI.<init>(WaveshareEP_SPI.java:110)at com.lebruns.steven.epaper.WaveshareEPDisplay.<init>(WaveshareEPDisplay.java:20)at com.lebruns.steven.epaper.Waveshare27BFrame.<init>(Waveshare27BFrame.java:23)at com.lebruns.steven.epaper.epaper.main(epaper.java:29)Exception in thread "main" java.lang.UnsatisfiedLinkError: com.pi4j.wiringpi.Gpio.wiringPiSetup()Iat com.pi4j.wiringpi.Gpio.wiringPiSetup(Native Method)at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:69)at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:51)at com.pi4j.platform.Platform.getGpioProvider(Platform.java:125)at com.pi4j.platform.Platform.getGpioProvider(Platform.java:118)at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:109)at com.pi4j.io.gpio.impl.GpioControllerImpl.<init>(GpioControllerImpl.java:56)at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:91)at com.lebruns.steven.epaper.WaveshareEP_SPI.<init>(WaveshareEP_SPI.java:110)at com.lebruns.steven.epaper.WaveshareEPDisplay.<init>(WaveshareEPDisplay.java:20)at com.lebruns.steven.epaper.Waveshare27BFrame.<init>(Waveshare27BFrame.java:23)at com.lebruns.steven.epaper.epaper.main(epaper.java:29)
Running gpio from v2.44, the error message displayed is:
Oops - unable to determine board type... model: 13
gpio version 2.46 runs with no problems.
Is my exception problem due to pi4j 1.2-snapshot using an older version of wiringPi? Or, is this a problem due to something else?
Are there any plans for spinning a new version of pi4j that uses the updated v2.46 of wiringPi?
Is there a way to force pi4j to use an external version of wiringPi?
Please note that I am doing my development on a Linux Mint laptop using Eclipse and debugging remotely on my Raspberry Pi. When I started this project, I needed to use pi4j 1.2 in order to develop on a Raspberry Pi 3. This added the requirement to use Java 8. At that time, I could not find a version of Eclipse compiled for the Raspberry Pi that supported Java 8. Now that I am starting to use a Raspberry Pi 3 B+, I am seeing this exception problem with a new set of code.