![]() |
Network Table Viewer / GRIP issue
Hello!
I'm trying to use the Network Table Viewer in server mode to display contour values from GRIP on my machine but whenever I try to start the Network Table Viewer in server mode using: java -jar OutlineViewer.jar and then use 127.0.0.1 as the host/address I get the following error: platform: /Mac OS X/x86_64/ NT: ERROR: bind() failed: Address already in use (workspac:102) The Network Table Viewer comes up but only display ">Root" which is empty. The GRIP documentation states that the Network Table Viewer can be used in server mode to display values on my local machine. Its there something else I need to do to get the Network Table Viewer working in server mode on my machine? Thanks! David |
Re: Network Table Viewer / GRIP issue
That error is printed out by OutlineViewer, not GRIP, right? Are you sure you're not running another instance of OutlineViewer?
|
Re: Network Table Viewer / GRIP issue
Hi Thomas.
That's correct. The error is coming from the Outline Viewer and not GRIP. I do not seem to have this problem on Windows, only Mac. I do have FRCSim installed on the Mac but it is current not running. David |
It sounds like something else on your computer is using port 1735. You're going to have to track down what it is and shut that program down. StackOverflow has an article on how to list open ports: http://stackoverflow.com/questions/4...rt-on-mac-os-x.
|
Re: Network Table Viewer / GRIP issue
I did a lsof -i:1735 which turned out to be a hung java process. Went to Activity Monitor and killed it.
Outline Viewer runs fine now - can view data from GRIP. Thanks! David |
Re: Network Table Viewer / GRIP issue
I'm trying to mock up some code to read the Network Table using the "desktop" package of networktables.jar, e.g., NetworkTables-3.0.0-20151121.170557-4-desktop-development.jar but I am not able to read values from the table. I'm running the Outline Viewer and can see the values there, but not in my own code.
NetworkTable table = NetworkTable.getTable("/GRIP/myContoursReport"); System.out.println(table.containsKey("area")); Output: platform: /Mac OS X/x86_64/ false Is there anything special I need to do in my client code to initialize NetworkTable? Thanks! David |
Re: Network Table Viewer / GRIP issue
I think you need to leave out the leading slash.
PHP Code:
|
Re: Network Table Viewer / GRIP issue
Quote:
Quote:
|
Re: Network Table Viewer / GRIP issue
Thanks Thomas and Peter for the replies.
I grabbed the latest networkltables jar: NetworkTables-3.0.0-20160115.192917-3-desktop.jar, started up the outline viewer choosing localhost and server, fired up GRIP and could see the Contours report being published via the outline viewer: /Root/GRIP/myContoursReport/area etc... But then had the same result in my java code with the addition of an additional error: Code is in main(): NetworkTable table = NetworkTable.getTable("GRIP/myContoursReport"); System.out.println(table); System.out.println(table.containsKey("area")); Output is: platform: /Mac OS X/x86_64/ NetworkTable: /GRIP/myContoursReport false NT: ERROR: bind() failed: Address already in use (workspac:102) If I put back the old networktables jar the error goes away but I still can't read data from the network table. David |
What code are you using for setup? Are you putting ntcore into client mode, and set up the team correctly? Relevant documentation is here: http://first.wpi.edu/FRC/roborio/rel...workTable.html.
|
Re: Network Table Viewer / GRIP issue
Hi Fred.
I've added NetworkTable.setClientMode() as well as NetworkTable.setTeam(1518) to my code and verified that GRIP is set to team 1518 as well. I've also switched back to a Windows box which also has the "desktop" build of networktables.jar but I'm still not reading from the table: NetworkTable.setClientMode(); NetworkTable.setTeam(1518); NetworkTable table = NetworkTable.getTable("GRIP/myContoursReport"); System.out.println(table); System.out.println(table.containsKey("area")); Output: platform: /Windows/amd64/ NetworkTable: /GRIP/myContoursReport false |
David, you'll need to set the ip to wherever you're actually running the NetworkTables server. It looks like you're not running a robot currently, but using OutlineViewer as the server, right? If that's the case, you'll want to point NetworkTables at 127.0.0.1, not call setTeam.
|
Re: Network Table Viewer / GRIP issue
I appreciate the help but unfortunately it's still not working in "desktop" mode, e.g., not on RoboRIO after setting IP address, e.g., NetworkTable.setIpAddress(), setting client mode and not setting team.
Running Outline Viewer in "server" mode, IP 127.0.0.1. Running GRIP and can see contour values in Outline Viewer. Running the following code in main(): NetworkTable.setIPAddress("127.0.0.1"); NetworkTable.setClientMode(); //NetworkTable.setTeam(1518); NetworkTable table = NetworkTable.getTable("GRIP/myContoursReport"); System.out.println(table); System.out.println(table.containsKey("area")); Output: platform: /Mac OS X/x86_64/ NetworkTable: /GRIP/myContoursReport false |
Re: Network Table Viewer / GRIP issue
Can you post your full program? Is your posted code running in some kind of loop so NT actually has time to connect? Note all the NT calls are non-blocking so if your main() code just simply runs these statements and exits it probably never even had a chance to connect. NT will print "CONNECTED" when it successfully connects to the server.
|
Re: Network Table Viewer / GRIP issue
I was just printing out values once in main(). I added a loop and a delay and now see the "NT connected" message and can now read values from the network table.
Thanks for the help! David |
| All times are GMT -5. The time now is 00:40. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi