Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   TX1 pynetworktables not connecting to SmartDashboard (http://www.chiefdelphi.com/forums/showthread.php?t=154754)

Anon10W1z 04-02-2017 18:38

TX1 pynetworktables not connecting to SmartDashboard
 
Our team is trying to get our Jetson TX1 to connect to the SmartDashboard network table using pynetworktables. It is unable to connect with the following code:

Code:

from networktables import NetworkTables
import logging

logging.basicConfig(level=logging.DEBUG)
NetworkTables.setIPAddress('10.32.56.2')
NetworkTables.setClientMode()
NetworkTables.initialize()
table = NetworkTables.getTable('SmartDashboard')
while True:
    print table.getNumber('gyro', 0)

as we get a constant output of 0. The SmartDashboard is updating, as we can see through the OutlineViewer and SmartDashboard. We are using static IP's. We are able to ping the roboRIO from the Jetson, so we are unsure what we are doing wrong.

virtuald 05-02-2017 12:28

Re: TX1 pynetworktables not connecting to SmartDashboard
 
Quote:

Originally Posted by Anon10W1z (Post 1640475)
Our team is trying to get our Jetson TX1 to connect to the SmartDashboard network table using pynetworktables. It is unable to connect with the following code:

Code:

from networktables import NetworkTables
import logging

logging.basicConfig(level=logging.DEBUG)
NetworkTables.setIPAddress('10.32.56.2')
NetworkTables.setClientMode()
NetworkTables.initialize()
table = NetworkTables.getTable('SmartDashboard')
while True:
    print table.getNumber('gyro', 0)

as we get a constant output of 0. The SmartDashboard is updating, as we can see through the OutlineViewer and SmartDashboard. We are using static IP's. We are able to ping the roboRIO from the Jetson, so we are unsure what we are doing wrong.

I would add a sleep between each iteration of your while loop. Are there any log messages that you see on the console? The messages you should see are listed at http://robotpy.readthedocs.io/en/sta...ynetworktables

Anon10W1z 06-02-2017 02:13

Re: TX1 pynetworktables not connecting to SmartDashboard
 
Quote:

Originally Posted by virtuald (Post 1640684)
I would add a sleep between each iteration of your while loop. Are there any log messages that you see on the console? The messages you should see are listed at http://robotpy.readthedocs.io/en/sta...ynetworktables

We will test this tomorrow, thanks!


All times are GMT -5. The time now is 22:36.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi