Go to Post If all you have to say are demeaning and vile comments, then shut your trap and keep it to yourself. - Ryan Dognaux [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-01-2016, 21:48
JohnRLewis JohnRLewis is offline
Registered User
FRC #1294 (TopGun)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Washington
Posts: 7
JohnRLewis is an unknown quantity at this point
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?
  #2   Spotlight this post!  
Unread 16-01-2016, 21:57
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,099
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
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.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #3   Spotlight this post!  
Unread 17-01-2016, 00:19
JohnRLewis JohnRLewis is offline
Registered User
FRC #1294 (TopGun)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Washington
Posts: 7
JohnRLewis is an unknown quantity at this point
Re: Has anybody gotten NetworkTables to work on a RaspberryPi

I gave your .so a try, but get the exact same error.
  #4   Spotlight this post!  
Unread 17-01-2016, 00:32
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,099
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Has anybody gotten NetworkTables to work on a RaspberryPi

Quote:
Originally Posted by JohnRLewis View Post
I gave your .so a try, but get the exact same error.
If you are using Java, try the jar in the Java folder instead of the maven jar. That should have the ntcore library built in and automatically extract it.

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?
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.

Last edited by Thad House : 17-01-2016 at 00:36.
  #5   Spotlight this post!  
Unread 17-01-2016, 11:14
JohnRLewis JohnRLewis is offline
Registered User
FRC #1294 (TopGun)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Washington
Posts: 7
JohnRLewis is an unknown quantity at this point
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)
  #6   Spotlight this post!  
Unread 17-01-2016, 12:51
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,099
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Has anybody gotten NetworkTables to work on a RaspberryPi

Quote:
Originally Posted by JohnRLewis View Post
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)
Ah. So to fix that, you need to download the libstdc++.so.6 in the ntcore folder. Place that in /home/pi/ on your Pi, and add this line to your program start command.

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.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #7   Spotlight this post!  
Unread 17-01-2016, 17:19
krieck's Avatar
krieck krieck is offline
Registered User
AKA: Keith
FRC #2846 (Firebears)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Minnesota
Posts: 49
krieck is an unknown quantity at this point
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?
  #8   Spotlight this post!  
Unread 17-01-2016, 17:22
JohnRLewis JohnRLewis is offline
Registered User
FRC #1294 (TopGun)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Washington
Posts: 7
JohnRLewis is an unknown quantity at this point
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?
  #9   Spotlight this post!  
Unread 17-01-2016, 17:47
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 147
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
Quote:
Originally Posted by krieck View Post
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?
It's absolutely necessary: this year, networktables is implemented as a native library. We use jni to talk to it from Java.
  #10   Spotlight this post!  
Unread 17-01-2016, 17:48
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 147
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
Quote:
Originally Posted by JohnRLewis View Post
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?
It should compile against 1.3.8, but we do not distribute versions that link against those library version.
  #11   Spotlight this post!  
Unread 17-01-2016, 18:57
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,099
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Has anybody gotten NetworkTables to work on a RaspberryPi

Quote:
Originally Posted by JohnRLewis View Post
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?
So for some reason its not accepting the LD_PRELOAD paramter. Will you send me your JAR so I can test? It's working for me.

So I just tested it again, and got it to work completely. Are you sure you're setting LD_PRELOAD correctly?
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.

Last edited by Thad House : 17-01-2016 at 20:10.
  #12   Spotlight this post!  
Unread 18-01-2016, 08:52
JohnRLewis JohnRLewis is offline
Registered User
FRC #1294 (TopGun)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Washington
Posts: 7
JohnRLewis is an unknown quantity at this point
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)

Last edited by JohnRLewis : 18-01-2016 at 09:07.
  #13   Spotlight this post!  
Unread 18-01-2016, 10:36
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,099
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Has anybody gotten NetworkTables to work on a RaspberryPi

Quote:
Originally Posted by JohnRLewis View Post
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)
I get the same output too. Thats why you have to call LD_PRELOAD before you run your program. LD_PRELOAD allows you to specify a different library as the dependency. So if you LD_PRELOAD to the libstdc++.so.6 found here http://198.199.94.5/ntcore/libstdc++.so.6 it will load that one before trying to load the default one and should work.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #14   Spotlight this post!  
Unread 18-01-2016, 12:18
JohnRLewis JohnRLewis is offline
Registered User
FRC #1294 (TopGun)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Washington
Posts: 7
JohnRLewis is an unknown quantity at this point
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!
  #15   Spotlight this post!  
Unread 18-01-2016, 12:22
JohnRLewis JohnRLewis is offline
Registered User
FRC #1294 (TopGun)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Washington
Posts: 7
JohnRLewis is an unknown quantity at this point
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:55.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi