frc::SmartDashboard::Put simply not working (C++)

I’ve been using the new shuffleboard’s functions for the entire season and all of a sudden today all of our put statements simply have just stopped functioning for no reason I can discern.

Something as simple as

int test = 0;
void Robot::TeleopPeriodic() {
	frc::SmartDashboard::PutBoolean("Test", ++test);
}

just does absolutely nothing. No new blocks appear in the shuffleboard. No new entries appear in the network tables. Nothing. Despite this, the shuffleboard continues to claim that the network tables are connected.

I have restarted everything that I’m using. I have checked to make sure I’m on the latest version (I beleived the recent WPILib update broke functionality but I’m not sure). I also went back and tried the same code with the legacy smart dashboard and recieve the same result of literally nothing.

Full code is available here.

Anyone else getting a problem?

Looking at the code, PutBoolean expects a boolean, not an integer. Try using the PutNumber method instead like so:

int test = 0;
void Robot::TeleopPeriodic() {
    frc::SmartDashboard::PutNumber("Test", ++test);
}

You can also try printing back the NT key in your code in order to check if the value is actually being pushed.

Oh excuse me I retyped that wrong. In my actual code I am using the correct function.

I don’t have experience with ShuffleBoard, but all SmartDashboard methods prefix the key you use with “/SmartDashbord”. For example with your usage of “Test”, the actual key is “/SmartDashboard/Test”. You can try using pynetworktables with this example.

Yes I’m aware of this as well. It is not entered into the table at all, under any header.

One thing you can try, is creating a new project without any other code in it. Once you do that, maybe try reflashing your radio, reflashing your Rio, reinstalling the driver station software, etc

Also, I’m guessing you already know this, but if using shuffleboard, make sure to look in the Smart Dashboard tab.

You could also try opening up Smart Dashboard and seeing if the values appear there.

Try the following:

int test = 0;
void Robot::TeleopPeriodic() {
   frc::SmartDashboard::PutNumber("Test", ++test);
   printf("Number read from NT: %d\n", frc::SmartDashboard::GetNumber("Test", 0));
}

You should be able to read this from the rio log, but I’d ssh into the robot and manually run the program to see output.

1 Like