Go to Post sometimes you have to dig through the trash and clean off the layers of dirt and grime in order to find diamonds in the rough. - Travis Hoffman [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-04-2016, 20:42
codetheweb's Avatar
codetheweb codetheweb is offline
Registered User
FRC #3299 (The Warehouse Crew)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Chaska
Posts: 6
codetheweb is an unknown quantity at this point
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)
.
Reply With Quote
  #2   Spotlight this post!  
Unread 01-04-2016, 22:40
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,041
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
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?
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #3   Spotlight this post!  
Unread 01-04-2016, 22:56
codetheweb's Avatar
codetheweb codetheweb is offline
Registered User
FRC #3299 (The Warehouse Crew)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Chaska
Posts: 6
codetheweb is an unknown quantity at this point
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-04-2016, 23:12
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,041
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
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.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #5   Spotlight this post!  
Unread 01-04-2016, 23:13
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,041
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
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.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #6   Spotlight this post!  
Unread 02-04-2016, 11:37
codetheweb's Avatar
codetheweb codetheweb is offline
Registered User
FRC #3299 (The Warehouse Crew)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Chaska
Posts: 6
codetheweb is an unknown quantity at this point
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!
Reply With Quote
  #7   Spotlight this post!  
Unread 02-04-2016, 11:48
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 988
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Smart Dashboard not connecting to robot (Python)

Quote:
Originally Posted by codetheweb View Post
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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