In your client code you should specify the IP address and also set up for client mode. Try this:
- Start the NetworkTableServer
- Start up SmartDashboard with -ip 127.0.0.1
- Run the client code below
Code:
import edu.wpi.first.wpilibj.networktables.NetworkTable;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
public class NetworkingOne {
public static void main(String[] args) {
NetworkTable.setClientMode();
NetworkTable.setIPAddress("127.0.0.1");
SmartDashboard.putNumber("set value", 0);
double num = SmartDashboard.getNumber("set value");
NetworkTable.getTable("SmartDashboard").putNumber("share value", num);
}
}