NetworkTable Troubles

Hello, my team is trying to use NetworkTables for our robot this year, and we have run into a couple of issues. Specifically, we are trying to have a SmartDashboard widget write data to NetworkTables for the robot to access (our dashboard will process images and send data to the robot-theoretically). To test this out, I wrote a simple program following the example online that seems to work fine:

import edu.wpi.first.smartdashboard.robot.Robot;
import edu.wpi.first.wpilibj.networktables.NetworkTable;


public class NetworkTablesDesktopClient {

	/**
	 * @param args
	 */
	public static void main(String] args) {
		new NetworkTablesDesktopClient().run();

	}

	static void run() {

		NetworkTable.setTeam(2557); //sets our team number
		NetworkTable table = (NetworkTable) Robot.getTable(); 

		while (true) {
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
			table.putNumber("Q", 11); //puts the number "11" into a key called "Q"
			
			
			System.out.println(table.getNumber("Q")); //Gets the value "Q" that we put in earlier
		}
		
	}

}

When we run java program, it successfully prints the “Q” value that we put into the table earlier. But when looking at the NetworkTable via Tableviewer, no “Q” value shows up.

We took two computers and ran Tableviewer, and both of them were able to see values that we put in via Tableviewer, but neither could see the values put in by the java program above. Any help is much appreciated! (Just for clarification, this program is just a standalone program at the moment, it has not been implemented into a SmartDashboard widget yet)
Thank you.

There is a problem with the desktop client jar. It was stuck in server mode and didn’t have entry points to switch to client mode.

The mid season Java update has fixes for this. I haven’t had time to verify it myself but it is in the release notes.

Try setting client mode as shown in the example on this page. I tested these programs shown and they worked reliably. Try getting this working, then take it from there.

http://wpilib.screenstepslive.com/s/3120/m/7912/l/80205-writing-a-simple-networktables-program-in-c-and-java-with-a-java-client-pc-side

Brad