![]() |
Has anybody gotten NetworkTables to work on a RaspberryPi
I'm trying to get NetworkTables to work on a RaspberryPi. But the native libraries do not work. The NetworkTables-3.0.0-SNAPSHOT-arm.jar file contains a Linux.arm libntcore.so, but it will not load:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/pi/libntcore.so: /home/pi/libntcore.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1929) at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1814) at java.lang.Runtime.load0(Runtime.java:809) at java.lang.System.load(System.java:1083) at org.usfirst.frc.team1294.vision.Application.main(A pplication.java:80) Which pretty much means that the native binary was compiled for the architecture of the RoboRio, and is not compatible with the RaspberryPi. I tried getting the NetworkTables source to compile on the RPi. But was getting too many errors that I did not understand. Has anyone gotten NetworkTables to work on a RaspberryPi? |
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
I am working on setting up a build server for a Raspberry Pi 2 build. It can be found here. http://198.199.94.5/ntcore/. Use the latest/arm-linux-gnueabihf/ binaries. Note this will only work with Pi 2's. Pi 1's are much harder to get working with.
Note to use this, you will need to grab the libstdc++.so.6, and set LD_LIBRARY_PATH to include the path that file is in before running your program. I have not actually tested this on a Pi 2, however I did test it on a BeagleBone Black and a CHIP and it worked on both. I will test the Pi 2 tonight. The reason the RoboRIO libraries do not work is that the RoboRIO is Arm vfp, whereas Raspberry Pis and BeagleBone Blacks are Arm Hard Float. |
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
I gave your .so a try, but get the exact same error.
|
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
Quote:
If that doesn't work, when you try and run the project, there should be a line that gets printed that starts with "Platform:". What does that string say? Looking at the source code again, it does look like you should just be able to put libntcore.so in /home/pi/. Does that work? |
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
I created a new super simple java app to rule out anything else. I did not add any dependencies to NetworkTables. Inside my main method, I have a single line:
System.loadLibrary("ntcore"); I thought I was getting the identical error, on closer inspection, I am getting the following now: Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/pi/libntcore.so: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/pi/libntcore.so) at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1929) at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1847) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1119) at org.usfirst.frc.team1294.vision.Application.main(A pplication.java:14) |
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
Quote:
env LD_PRELOAD=/home/pi/libstdc++.so.6 . So your command to run would become env LD_PRELOAD=/home/pi/libstdc++.so.6 java myapp.jar, replacing myapp.jar with whatever your app is. |
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
Is the native library necessary for NetworkTables to execute?
Previous year's network table JAR did not contain native libraries. My latest copy of the jar contains an *.so file for Linux ARM, but none for any other operating systems or architectures. Can we simply ignore this file? Or, can we just remove the native library from the JAR before deploying to a Raspberry Pi? |
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
Same error.
When I run the following: strings /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 | grep CXXABI I get: CXXABI_1.3 CXXABI_1.3.1 CXXABI_1.3.2 CXXABI_1.3.3 CXXABI_1.3.4 CXXABI_1.3.5 CXXABI_1.3.6 CXXABI_1.3.7 CXXABI_1.3.8 CXXABI_TM_1 CXXABI_ARM_1.3.3 which is missing the 1.3.9 that the error message is asking for. Is CXXABI_1.3.9 a requirement? Or would it compile against 1.3.8? |
Quote:
|
Quote:
|
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
Quote:
So I just tested it again, and got it to work completely. Are you sure you're setting LD_PRELOAD correctly? |
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
Here is my jar, but I suspect that it is going to work for you too.
https://github.com/JohnRudolfLewis/n...ntcoreblah.jar I believe there is a difference between our environments. On your Pi, when you run ldd libntcore.so, how does your output differ from mine below? pi@raspberrypi:~ $ ldd libntcore.so ./libntcore.so: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./libntcore.so) ./libntcore.so: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./libntcore.so) linux-vdso.so.1 (0x7eded000) /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76f6d000) libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76e7a000) libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76e4d000) libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76d10000) /lib/ld-linux-armhf.so.3 (0x54aef000) libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76c95000) |
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
Quote:
|
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
I believe I am following your instructions properly, this is the command I am running to launch my jar:
env LD_PRELOAD=/home/pi/libstdc++.so.6 java -jar ntcoreblah.jar But I still get the error. Is my syntax wrong? Is there yet another dependency that I need to preload? Is there something I need to install on my Pi in order for that environment variable to take effect? Thank you so much for continuing to reply and not giving up on me! |
Re: Has anybody gotten NetworkTables to work on a RaspberryPi
D'oh.... I already had a version of libstdc++.so.6 in my folder from some previous troubleshooting. When I did a wget on your version, it was not overwriting it for some reason. Gah... I feel like an idiot. Error resolved.
THANK YOU so much for spending so much time with me on this. |
| All times are GMT -5. The time now is 13:13. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi