Replies: 8 comments 3 replies
-
Might be able to help...
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply!!
This is a Raspberry Pi 4 project, Debian, 64 bit. I Build with IdeaJ, and run the generated jar files on the RPI through SSH. IdeaJ runs very slow on RPI. So the library files (*.so) are still in the distribution directory, I didn’t find any instruction to copy them or install diozero. After I started to run the code and ran into the exception, I copied on library file to /bin/linux-aarch64, as the exception reported that diozero looks there of it. But I continue to get exceptions.
I don’t use Maven. Strictly source built by IdeaJ.
I didn’t clone from GitHub, I downloaded the zip file. Any difference?
Thanks for any help.
Arie.
… On Apr 14, 2023, at 3:10 PM, E. A. (Ed) Graham, Jr. ***@***.***> wrote:
Might be able to help...
Are you attempting to build/use this project on Windows or desktop Linux?
There are no GPIO chips for desktop systems
You can use the remote options from https://www.diozero.com/concepts/remotecontrol.html <https://www.diozero.com/concepts/remotecontrol.html>
Are you using the library "as-is" (e.g. as a Maven/Gradle dependency?)
If so, what do the dependency declarations look like?
Are you using a git clone of the project?
If so, what command are you trying to build with?
How is this being used in your project?
—
Reply to this email directly, view it on GitHub <#159 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACHWSYVR4ROWIFDLMJCLVMLXBHDMNANCNFSM6AAAAAAW6YPTRM>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
Thank you again Matthew,
I did run the installation script bellow, and still get the exception:
2023-04-17 09:35:10 [main] com.diozero.sbc.DeviceFactoryHelper.initialise()
DEBUG: Using native device factory class DefaultDeviceFactory
2023-04-17 09:35:10 [main] com.diozero.internal.provider.builtin.DefaultDeviceFactory.start()
DEBUG: Using chardev GPIO implementation
2023-04-17 09:35:10 [main] com.diozero.util.LibraryLoader.loadLibrary()
DEBUG: Looking for lib '/lib/linux-aarch64/libdiozero-system-utils.so' on classpath
2023-04-17 09:35:10 [main] com.diozero.util.LibraryLoader.loadLibrary()
DEBUG: Looking for lib 'diozero-system-utils' on library path
2023-04-17 09:35:10 [main] com.diozero.util.LibraryLoader.loadLibrary()
ERROR: Error loading library 'diozero-system-utils' from system library path: java.lang.UnsatisfiedLinkError: no diozero-system-utils in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'com.diozero.internal.provider.builtin.gpio.GpioChip com.diozero.internal.provider.builtin.gpio.NativeGpioDevice.openChip(java.lang.String)'
at com.diozero.internal.provider.builtin.gpio.NativeGpioDevice.openChip(Native Method)
at com.diozero.internal.provider.builtin.gpio.GpioChip.lambda$openAllChips$1(GpioChip.java:65)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at com.diozero.internal.provider.builtin.gpio.GpioChip.openAllChips(GpioChip.java:67)
at com.diozero.internal.provider.builtin.DefaultDeviceFactory.start(DefaultDeviceFactory.java:108)
at com.diozero.sbc.DeviceFactoryHelper.initialise(DeviceFactoryHelper.java:86)
at com.diozero.sbc.DeviceFactoryHelper.getNativeDeviceFactory(DeviceFactoryHelper.java:108)
at com.diozero.api.DigitalInputDevice.<init>(DigitalInputDevice.java:147)
at com.diozero.devices.Button.<init>(Button.java:183)
at com.aaswdev.sw.keysys.platform.components.Switch.<init>(Switch.java:103)
at com.aaswdev.sw.keysys.platform.components.Switch.create(Switch.java:74)
at com.aaswdev.sw.test.TestGpio.main(TestGpio.java:70)
^
Arie.
… On Apr 17, 2023, at 5:11 AM, Matthew Lewis ***@***.***> wrote:
Which ZIP file? The bin.zip <https://search.maven.org/remotecontent?filepath=com/diozero/diozero-distribution/1.3.5/diozero-distribution-1.3.5-bin.zip> referenced in the docs on diozero.com?
Did you download version 1.3.5?
Trying to get a clear picture of your steps here - as stated by EAGrahamJr, ideally you would use Maven or Gradle to manage the dependencies for you.
Regardless, assuming you have manually added all dependencies the library will be automatically loaded for you from within the diozero-core JAR file itself.
It could be that you are missing the gpio chardev library that diozero requires (it is normally installed by default).
Please run:
sudo apt update
sudo apt -y install i2c-tools libi2c-dev gpiod libgpiod2 libgpiod-dev libpigpiod-if-dev libpigpiod-if2-1
—
Reply to this email directly, view it on GitHub <#159 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACHWSYUFW4CYVJGI3QUBAATXBUXPTANCNFSM6AAAAAAW6YPTRM>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
Sorry, forgot to mention:
The last three lines of the exception report are my code trying to construct my switch device based on your button; I could have used the DigitalInputDevice directly, I know, but it would have caused the same exception.
… On Apr 17, 2023, at 9:47 AM, Arie Avnur ***@***.***> wrote:
Thank you again Matthew,
I did run the installation script bellow, and still get the exception:
2023-04-17 09:35:10 [main] com.diozero.sbc.DeviceFactoryHelper.initialise()
DEBUG: Using native device factory class DefaultDeviceFactory
2023-04-17 09:35:10 [main] com.diozero.internal.provider.builtin.DefaultDeviceFactory.start()
DEBUG: Using chardev GPIO implementation
2023-04-17 09:35:10 [main] com.diozero.util.LibraryLoader.loadLibrary()
DEBUG: Looking for lib '/lib/linux-aarch64/libdiozero-system-utils.so' on classpath
2023-04-17 09:35:10 [main] com.diozero.util.LibraryLoader.loadLibrary()
DEBUG: Looking for lib 'diozero-system-utils' on library path
2023-04-17 09:35:10 [main] com.diozero.util.LibraryLoader.loadLibrary()
ERROR: Error loading library 'diozero-system-utils' from system library path: java.lang.UnsatisfiedLinkError: no diozero-system-utils in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'com.diozero.internal.provider.builtin.gpio.GpioChip com.diozero.internal.provider.builtin.gpio.NativeGpioDevice.openChip(java.lang.String)'
at com.diozero.internal.provider.builtin.gpio.NativeGpioDevice.openChip(Native Method)
at com.diozero.internal.provider.builtin.gpio.GpioChip.lambda$openAllChips$1(GpioChip.java:65)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at com.diozero.internal.provider.builtin.gpio.GpioChip.openAllChips(GpioChip.java:67)
at com.diozero.internal.provider.builtin.DefaultDeviceFactory.start(DefaultDeviceFactory.java:108)
at com.diozero.sbc.DeviceFactoryHelper.initialise(DeviceFactoryHelper.java:86)
at com.diozero.sbc.DeviceFactoryHelper.getNativeDeviceFactory(DeviceFactoryHelper.java:108)
at com.diozero.api.DigitalInputDevice.<init>(DigitalInputDevice.java:147)
at com.diozero.devices.Button.<init>(Button.java:183)
at com.aaswdev.sw.keysys.platform.components.Switch.<init>(Switch.java:103)
at com.aaswdev.sw.keysys.platform.components.Switch.create(Switch.java:74)
at com.aaswdev.sw.test.TestGpio.main(TestGpio.java:70)
^
Arie.
> On Apr 17, 2023, at 5:11 AM, Matthew Lewis ***@***.*** ***@***.***>> wrote:
>
>
> Which ZIP file? The bin.zip <https://search.maven.org/remotecontent?filepath=com/diozero/diozero-distribution/1.3.5/diozero-distribution-1.3.5-bin.zip> referenced in the docs on diozero.com <http://diozero.com/>?
> Did you download version 1.3.5?
> Trying to get a clear picture of your steps here - as stated by EAGrahamJr, ideally you would use Maven or Gradle to manage the dependencies for you.
> Regardless, assuming you have manually added all dependencies the library will be automatically loaded for you from within the diozero-core JAR file itself.
> It could be that you are missing the gpio chardev library that diozero requires (it is normally installed by default).
> Please run:
>
> sudo apt update
> sudo apt -y install i2c-tools libi2c-dev gpiod libgpiod2 libgpiod-dev libpigpiod-if-dev libpigpiod-if2-1
> —
> Reply to this email directly, view it on GitHub <#159 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACHWSYUFW4CYVJGI3QUBAATXBUXPTANCNFSM6AAAAAAW6YPTRM>.
> You are receiving this because you authored the thread.
>
|
Beta Was this translation helpful? Give feedback.
-
Can you run these commands for me please (renaming the diozero-core JAR file name to match yours). uname -m
dpkg --print-architecture
grep arm_64 /boot/config.txt
java -cp diozero-core-1.3.5.jar com.diozero.sbc.LocalSystemInfo |
Beta Was this translation helpful? Give feedback.
-
Sure, thanks:
bc.LocalSystemInfo
System properties:
java.specification.version: 18
sun.jnu.encoding: UTF-8
java.class.path: diozero-core-1.3.5.jar
java.vm.vendor: Oracle Corporation
sun.arch.data.model: 64
java.vendor.url: https://java.oracle.com/ <https://java.oracle.com/>
java.vm.specification.version: 18
os.name: Linux
sun.java.launcher: SUN_STANDARD
user.country: US
sun.boot.library.path: /opt/java/jdk-18.0.2.1/lib
sun.java.command: com.diozero.sbc.LocalSystemInfo
jdk.debug: release
sun.cpu.endian: little
user.home: /home/arha
user.language: en
sun.stderr.encoding: UTF-8
java.specification.vendor: Oracle Corporation
java.version.date: 2022-08-18
java.home: /opt/java/jdk-18.0.2.1
file.separator: /
java.vm.compressedOopsMode: 32-bit
line.separator:
sun.stdout.encoding: UTF-8
java.vm.specification.vendor: Oracle Corporation
java.specification.name: Java Platform API Specification
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
java.runtime.version: 18.0.2.1+1-1
user.name: arha
path.separator: :
os.version: 5.15.84-v8+
java.runtime.name: OpenJDK Runtime Environment
file.encoding: UTF-8
java.vm.name: OpenJDK 64-Bit Server VM
java.vendor.url.bug: https://bugreport.java.com/bugreport/ <https://bugreport.java.com/bugreport/>
java.io.tmpdir: /tmp
java.version: 18.0.2.1
user.dir: /home/arha/Projects/KeyGpio2/diozero-distribution-1.3.5
os.arch: aarch64
java.vm.specification.name: Java Virtual Machine Specification
native.encoding: UTF-8
java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
java.vm.info <http://java.vm.info/>: mixed mode, sharing
java.vendor: Oracle Corporation
java.vm.version: 18.0.2.1+1-1
sun.io.unicode.encoding: UnicodeLittle
java.class.version: 62.0
macOS? false, Linux? true, Windows? false
debian version 11 (bullseye)
CPU Temperature: 35.537
… On Apr 18, 2023, at 12:30 AM, Matthew Lewis ***@***.*** ***@***.***>> wrote:
Can you run this command for me please (renaming the diozero-core JAR file name to match yours).
java cp diozero-core-1.3.5.jar com.diozero.sbc.LocalSystemInfo
—
Reply to this email directly, view it on GitHub <#159 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACHWSYUSZR3EGD7TQ62LGW3XBY7KRANCNFSM6AAAAAAW6YPTRM>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
Hi Matthew,
I looked again, closer, and found out that it was loading the wrong utils library, AMD instead of AARCH64. Copied the other lib file to /lib64, and now I get another exception:
java.lang.NullPointerException: inStream parameter is null
at java.base/java.util.Objects.requireNonNull(Objects.java:233)
at java.base/java.util.Properties.load(Properties.java:408)
at com.diozero.internal.board.GenericLinuxArmBoardInfo.<init>(GenericLinuxArmBoardInfo.java:83)
at com.diozero.internal.board.GenericLinuxArmBoardInfo.<init>(GenericLinuxArmBoardInfo.java:69)
at com.diozero.internal.board.GenericLinuxArmBoardInfo.<init>(GenericLinuxArmBoardInfo.java:65)
at com.diozero.sbc.UnknownBoardInfo.get(UnknownBoardInfo.java:52)
at com.diozero.sbc.LocalBoardInfoUtil.lambda$resolveLocalBoardInfo$1(LocalBoardInfoUtil.java:73)
at java.base/java.util.Optional.orElseGet(Optional.java:364)
at com.diozero.sbc.LocalBoardInfoUtil.resolveLocalBoardInfo(LocalBoardInfoUtil.java:73)
at com.diozero.sbc.LocalBoardInfoUtil.initialiseLocalBoardInfo(LocalBoardInfoUtil.java:63)
at com.diozero.sbc.LocalBoardInfoUtil.lookupLocalBoardInfo(LocalBoardInfoUtil.java:85)
at com.diozero.internal.spi.BaseNativeDeviceFactory.lookupBoardInfo(BaseNativeDeviceFactory.java:70)
at com.diozero.internal.spi.BaseNativeDeviceFactory.getBoardInfo(BaseNativeDeviceFactory.java:79)
at com.diozero.internal.provider.builtin.DefaultDeviceFactory.start(DefaultDeviceFactory.java:113)
at com.diozero.sbc.DeviceFactoryHelper.initialise(DeviceFactoryHelper.java:86)
at com.diozero.sbc.DeviceFactoryHelper.getNativeDeviceFactory(DeviceFactoryHelper.java:108)
at com.diozero.api.DigitalInputDevice.<init>(DigitalInputDevice.java:147)
at com.aaswdev.sw.keysys.platform.components.Switch.<init>(Switch.java:104)
at com.aaswdev.sw.keysys.platform.components.Switch.create(Switch.java:75)
at com.aaswdev.sw.test.TestGpio.main(TestGpio.java:70)
It looks like it can’t find the file /soc_mapping.properties
I found it in the source distribution, should I really copy it to the rood directory? Is that correct?
Thanks again,
Arie.
… On Apr 18, 2023, at 11:23 AM, Arie Avnur ***@***.*** ***@***.***>> wrote:
Sure, thanks:
bc.LocalSystemInfo
System properties:
java.specification.version: 18
sun.jnu.encoding: UTF-8
java.class.path: diozero-core-1.3.5.jar
java.vm.vendor: Oracle Corporation
sun.arch.data.model: 64
java.vendor.url: https://java.oracle.com/ <https://java.oracle.com/>
java.vm.specification.version: 18
os.name: Linux
sun.java.launcher: SUN_STANDARD
user.country: US
sun.boot.library.path: /opt/java/jdk-18.0.2.1/lib
sun.java.command: com.diozero.sbc.LocalSystemInfo
jdk.debug: release
sun.cpu.endian: little
user.home: /home/arha
user.language: en
sun.stderr.encoding: UTF-8
java.specification.vendor: Oracle Corporation
java.version.date: 2022-08-18
java.home: /opt/java/jdk-18.0.2.1
file.separator: /
java.vm.compressedOopsMode: 32-bit
line.separator:
sun.stdout.encoding: UTF-8
java.vm.specification.vendor: Oracle Corporation
java.specification.name: Java Platform API Specification
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
java.runtime.version: 18.0.2.1+1-1
user.name: arha
path.separator: :
os.version: 5.15.84-v8+
java.runtime.name: OpenJDK Runtime Environment
file.encoding: UTF-8
java.vm.name: OpenJDK 64-Bit Server VM
java.vendor.url.bug: https://bugreport.java.com/bugreport/ <https://bugreport.java.com/bugreport/>
java.io.tmpdir: /tmp
java.version: 18.0.2.1
user.dir: /home/arha/Projects/KeyGpio2/diozero-distribution-1.3.5
os.arch: aarch64
java.vm.specification.name: Java Virtual Machine Specification
native.encoding: UTF-8
java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
java.vm.info <http://java.vm.info/>: mixed mode, sharing
java.vendor: Oracle Corporation
java.vm.version: 18.0.2.1+1-1
sun.io.unicode.encoding: UnicodeLittle
java.class.version: 62.0
macOS? false, Linux? true, Windows? false
debian version 11 (bullseye)
CPU Temperature: 35.537
> On Apr 18, 2023, at 12:30 AM, Matthew Lewis ***@***.*** ***@***.***>> wrote:
>
>
> Can you run this command for me please (renaming the diozero-core JAR file name to match yours).
>
> java cp diozero-core-1.3.5.jar com.diozero.sbc.LocalSystemInfo
> —
> Reply to this email directly, view it on GitHub <#159 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACHWSYUSZR3EGD7TQ62LGW3XBY7KRANCNFSM6AAAAAAW6YPTRM>.
> You are receiving this because you authored the thread.
>
|
Beta Was this translation helpful? Give feedback.
-
Hi Matt,
I hope you can have a bit more patience with me. Now, I can’t find diozero-sampleapps-1.3.5.jar. Nohere, not on GitHub, not on your diozero site, nor from the jar-download site where I found the rest of the diozero jars….
Arie.
… On Apr 18, 2023, at 12:30 AM, Matthew Lewis ***@***.*** ***@***.***>> wrote:
Can you run this command for me please (renaming the diozero-core JAR file name to match yours).
java cp diozero-core-1.3.5.jar com.diozero.sbc.LocalSystemInfo
—
Reply to this email directly, view it on GitHub <#159 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACHWSYUSZR3EGD7TQ62LGW3XBY7KRANCNFSM6AAAAAAW6YPTRM>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
I greatly appreciate this project. Its time for a Java GPIO library. However, trying to use it, I get an exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'com.diozero.internal.provider.builtin.gpio.GpioChip com.diozero.internal.provider.builtin.gpio.NativeGpioDevice.openChip(java.lang.String)'
A bunch of ".so" native libraries are under a resources directory, and still, it looks at /lib, and should search at /lib/linux-aarch64/.
I realize that this is a "beginner" issue, but I didn't see any installation script or something like that for copying those libraries.
Confused.
Any hint?
Thanks in advance.
Arie.
Beta Was this translation helpful? Give feedback.
All reactions