Reading a Dashboard control on a RPi (ntcore)

I’m running the example Global Listener (from the robotpy examples) on the raspberry pi. I see the /smartdashboard key for my variables but only once (or twice). Other stuff continues to log. The robot is enabled.

I also read the variable in periodic task.vi and do see it updating regularly their (in robot global variables). I took that to mean that the dashboard is writing the value to the network table, but I’m not sure why I’m not seeing these updates on the Rpi. I also already did the inverse, updating a value on the Rpi and reading fine on the robot. Any ideas?

Are you using listener or “polling” the network table for the value directly? Our team has had issues with registering listeners, but checking the table directly works fine.

Sorry… should have read your post more thoroughly!

We have the same issue and have moved around it for now…

So I moved to the global listener example after not getting updates with the nt_client example.

NetworkTables.initialize(server=ip)
sd = NetworkTables.getTable("SmartDashboard")

while True:
    print("dsTime:", sd.getNumber("dsTime", "N/A"))

compared to the global listen (below)

NetworkTables.initialize(server=ip)


def valueChanged(key, value, isNew):
    print("valueChanged: key: '%s'; value: %s; isNew: %s" % (key, value, isNew))

NetworkTables.addEntryListener(valueChanged)

while True:
    time.sleep(1)

When I figure it out, I’ll be certain to let you know. We are just wanting to send values to tune the HSV filter from the dashboard.

What language are you running on the RoboRIO? Java, C++, or LabView? If you’re running LabView on the robot (the NT server), there’s a known issue with NT values not propagating between Java/C++/Python clients through a LabView server.

Thanks. From Java we use:

networkTable.getEntry(“Found”).getString(“Target”);

And it works fine. (Polling the value from the network tables…)

But when we register the listener like:

networkTable.addEntryListener(“Found”, (table, key, entry, value, flags) -> { // adds a listener for the network table entry
System.out.println(value.getString());
}, EntryListenerFlags.kNew | EntryListenerFlags.kUpdate);

It never gets called…

It was LabVIEW, in a custom dashboard. Can you point me towards where that is documented? Thanks.

Also, it does go through, but just that first time. After that, no update.

It’s not currently documented (we’ll get it up on screensteps soon). NI is aware but I don’t have a timeline for a fix being available. To be more specific, the issue is with the LabView server sending updates from any language client to a C++/Java/Python client. So if the dashboard you were using was LabView you’d see the same issue. LabView clients are fine, and changes made on the server also propagate correctly. So you could have the LabView robot program listen for the dashboard change and set a value in a different table as a workaround; the latter will make it to the rPi.

1 Like

Because I came up on this thread the other day, with the same exact error, I wanted to let the OP know that this should be fixed in the 2019.2.0 FRC Update available here: http://www.ni.com/download/first-robotics-software-2017/7904/en/

1 Like

Thanks for the info. We should be testing this all again soon. We haven’t yet upgraded it all.