![]() |
Driver Station Custom UDP (Python/C++)
I don't think my plans to switch us back over to Python will work out but in case they do, I'm curious as to if anyone has some insight on an issue we were having regarding UDP DS communcation. (This has nothing to do with the robotpy libs; more of a general networking question). My dashboard is written in C++ and the robot code is in Python. Back in week 2, I'd have some times where I'd plug the robot in and everything would work fine and other times where the two wouldn't talk to each other unless i restarted everything. I think it had something to do with the port getting blocked on the roboRIO side. Does this code have any issues in terms of networking theology
For the code itself its pretty simple, the python should act as a server and listen on port 5805- whenever it receives a connection it will expect the auton mode, defense, and position and will feed back exactly what it was sent. The return packet is than displayed to confirm that the data being communicated is valid. The entry point for the C++ code is startThread() Python (RIO side) Code:
def server_thread_run(self, som,thingy):Code:
#include "tcpsocketconn.h" |
Re: Driver Station Custom UDP (Python/C++)
I know we had troubles connecting to the robot in our first event, I suspect because of mDNS issues. Our DS would connect, but networktables wouldn't. Switched to static IPs + dashboard hack, no issues.
The reason I say mDNS is that it seems like once it gets resolved, it doesn't seem to actually cache the values. A second query to a name takes just as long as the first, and it's often a few seconds. I haven't done any deep analysis on it, but I'm tired of it so I just use static IPs. |
Re: Driver Station Custom UDP (Python/C++)
Unlikely that it was an mDNS issue since the DS was connected fine. From my experience working with other teams with mDNS, it was usually an all or nothing scenario (33, for example, ALWAYS worked in the pits and NEVER worked on the field. This dashboard is sometimes working in the pits and was never tested on the field)
If the process is killed when deploying code, could the old running code still have that port occupied? |
Re: Driver Station Custom UDP (Python/C++)
That was not my team's experience. The DS would connect fine, but the pynetworktables2js + IP camera would not connect.
|
Re: Driver Station Custom UDP (Python/C++)
Quote:
|
Re: Driver Station Custom UDP (Python/C++)
Quote:
|
Re: Driver Station Custom UDP (Python/C++)
Quote:
And this was on the field, the pits worked marginally better. |
Re: Driver Station Custom UDP (Python/C++)
Quote:
|
| All times are GMT -5. The time now is 21:39. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi