|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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)
|
|
#2
|
||||
|
||||
|
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? |
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
||||
|
||||
|
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.
|
|
#5
|
||||
|
||||
|
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.
|
|
#6
|
||||
|
||||
|
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! |
|
#7
|
|||
|
|||
|
Re: Smart Dashboard not connecting to robot (Python)
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|