Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Smart Dashboard not connecting to robot (Python) (http://www.chiefdelphi.com/forums/showthread.php?t=146555)

codetheweb 01-04-2016 20:42

Smart Dashboard not connecting to robot (Python)
 
(I'm not completely sure if this is an issue related to Python, so that's why it's not in the sub-forum.)

Python code running on the robot posts values to the SmartDashboard network table; but it never appears in the SmartDashboard or the newer SFX. The connection indicator also is red in both programs. I can verify the values are getting published by opening OutlineViewer. I've tried getting the dashboards to work with 2 different computers, and neither work (but both work for controlling the robot).

I've recently updated the pyfrc version, and upgraded to the pre-release version of pynetworktables.

I'm really stumped at this point, as it does not seem to be a problem with the code, computer, or network. Any tips on what to try?

Here's the relevant code:
Code:

import wpilib

from wpilib import SmartDashboard

class MyRobot(wpilib.SampleRobot):
    def robotInit(self):
        SmartDashboard.putString("Hello", "World")

if __name__ == "__main__":
    wpilib.run(MyRobot)

.

virtuald 01-04-2016 22:40

Re: Smart Dashboard not connecting to robot (Python)
 
I wouldn't use the alpha version of pynetworktables, it's alpha for a reason and should only be used if you require LabVIEW support.

I just tried running a recent version of SmartDashboard and it was able to communicate with pynetworktables (alpha and non-alpha) running locally and show a variable incrementing periodically.

Are you trying to connect to the pyfrc simulator or on the roborio? In principle it should work on the roborio as long as you set the team information correctly, but if you want it to connect to the simulator you need to give it special arguments to tell it to connect to 127.0.0.1.

Have you tried disabling your firewall?

codetheweb 01-04-2016 22:56

Re: Smart Dashboard not connecting to robot (Python)
 
The firewall is disabled. I'm trying to run it on the roboRio. The team number is set in the Smart Dashboard. I'll try connecting directly to the roboRio via Ethernet tomorrow, but after that I'm out of ideas.

virtuald 01-04-2016 23:12

Re: Smart Dashboard not connecting to robot (Python)
 
Is there any output at the console for either your robot code (use the Driver Station Console Viewer) or for SmartDashboard (you have to execute it via 'java -jar SmartDashboard.jar' to see the output). If there are any error message there, that could be constructive.

virtuald 01-04-2016 23:13

Re: Smart Dashboard not connecting to robot (Python)
 
Another thing you can try is compile a very simple C++ or Java program and install that on the roborio and see if it works. I would be very surprised if it did, but you never know.

codetheweb 02-04-2016 11:37

Re: Smart Dashboard not connecting to robot (Python)
 
Using the log from the Smart Dashboard, I was able to see that it was trying to connect to 10.32.99.2, when the roboRio's IP was actually 10.32.99.61. I logged into the router and changed the default assignment, and it works now!

Thanks for your help!

RufflesRidge 02-04-2016 11:48

Re: Smart Dashboard not connecting to robot (Python)
 
Quote:

Originally Posted by codetheweb (Post 1566426)
Using the log from the Smart Dashboard, I was able to see that it was trying to connect to 10.32.99.2, when the roboRio's IP was actually 10.32.99.61. I logged into the router and changed the default assignment, and it works now!

Thanks for your help!

You didn't have the "use mDNS" checkbox checked. You should either set the roboRIO to a static IP of 10.32.99.2 from the roboRIO webdashboard (make sure to set your DS static too to work at the event: http://wpilib.screenstepslive.com/s/...g-at-the-event) or check the "use mDNS" checkbox in the properties otherwise it won't work at the event where the assignment you made in the router isn't there.


All times are GMT -5. The time now is 09:21.

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