Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Queues using NetworkTables (http://www.chiefdelphi.com/forums/showthread.php?t=112441)

fovea1959 31-01-2013 08:09

Queues using NetworkTables
 
has anyone seen an implementation of queueing data from robot to DS using NetworkTables? I'm looking for a way to get logging data from the robot to the DS; can't use a single value, because I don't want to overwrite the value on the robot until I know the DS has grabbed the previous value and logged it.

Alan Anderson 31-01-2013 11:48

Re: Queues using NetworkTables
 
It might be simpler for you to open your own TCP connection and send the logging data that way.

fovea1959 31-01-2013 13:20

Re: Queues using NetworkTables
 
I agree with that (the DS side becomes 'netcat'), but I keep coming back to according to the FMS White Paper:
Quote:

The ports that the teams are able to access on the playing field are as follows:
  • TCP 1180: This port is typically used for camera data from the robot to the DS when the camera is connected to port 2 on the 8-slot cRIO. This port is bidirectional on the field.
  • TCP 1735: SmartDashboard, bidirectional
  • UDP 1130: Dashboard-to-Robot control data, directional
  • UDP 1140: Robot-to-Dashboard status data, directional
  • HTTP 80: Camera connected via switch on the robot, bidirectional
  • HTTP 443: Camera connected via switch on the robot, bidirectional

What ports on the DS would be accessible from the robot?

Alan Anderson 31-01-2013 15:58

Re: Queues using NetworkTables
 
I suggest TCP on port 1180. It's not likely that you'll want to plug the camera directly into the cRIO and forward packets to the Driver Station through it, so that port is available for other purposes.

fovea1959 31-01-2013 22:38

Re: Queues using NetworkTables
 
so we'd have to have the cRIO do the TCP listen/accept...

udp would be easier....

Alan Anderson 01-02-2013 00:00

Re: Queues using NetworkTables
 
UDP would certainly be easier, and it's what I would use myself. But it sounded like you were concerned about possibly missing information, and UDP gives you no guarantee that transmitted data actually gets received. If you don't want the possibility of lost data, you'd need to implement your own buffered acknowledge/timeout/retry scheme.

fovea1959 01-02-2013 09:29

Re: Queues using NetworkTables
 
I'm not worried so much about dropped UDP packets as I would be about designing something using NetworkTables that definitely will drop data. If you write to a NetworkTable variable with two values quickly, someone else watching that variable is not really likely to the first update unless they are polling the variable really really fast.

Two UDP writes quickly shouldn't be a big deal.

But it still comes back to what UDP port can I listen on on the DS? None available!

Alan Anderson 01-02-2013 10:29

Re: Queues using NetworkTables
 
Quote:

Originally Posted by fovea1959 (Post 1225788)
But it still comes back to what UDP port can I listen on on the DS? None available!

Port 1140 is defined for exactly the purpose you are looking for.

fovea1959 01-02-2013 10:52

Re: Queues using NetworkTables
 
oh! I was misinterpreting that document! I thought it meant that the WPI provided Dashboard framework listened on UDP 1140; I didn't realize that was reserved for team's custom code... I take it that we can have code on the bot listening on UDP 1130, also, then.

Logging gets *real* easy, then. Robot UDP send to a netcat running on DS. Done.

where does the WPI provided dashboard receive it's information? Is that TCP/1735?

I need to fire up Wireshark :)

Greg McKaskle 01-02-2013 12:02

Re: Queues using NetworkTables
 
Yes, Network Tables was done over TCP using port 1735 I think.

Greg McKaskle

Joe Ross 01-02-2013 12:11

Re: Queues using NetworkTables
 
Quote:

Originally Posted by fovea1959 (Post 1225829)
Logging gets *real* easy, then. Robot UDP send to a netcat running on DS. Done.

If that's all you wanted, netcat does the same thing for TCP.

fovea1959 06-02-2013 02:26

Re: Queues using NetworkTables
 
ok, but what what TCP port can I listen on on the DS then?

Alan Anderson 06-02-2013 08:00

Re: Queues using NetworkTables
 
Unless you're already using it explicitly for something else, TCP port 1180 is available.

RufflesRidge 06-02-2013 08:05

Re: Queues using NetworkTables
 
Quote:

Originally Posted by fovea1959 (Post 1228600)
ok, but what what TCP port can I listen on on the DS then?

1180 is open unless you plan to plug a camera into Port 2 of an 8-slot cRIO.

fovea1959 06-02-2013 09:13

Re: Queues using NetworkTables
 
That doc is pretty taciturn, it doesn't say whose ports (Robot or DS) it's talking about, and whether or not they are in use by the FIRST/WPI/NI framework.
Quote:

TCP 1180: This port is typically used for camera data from the robot to the DS when the camera is connected to port 2 on the 8-slot cRIO. This port is bidirectional on the field.
  • FMS will pass traffic to and from the robots TCP/1180 port. Correct?
  • That port is free for my robot code to listen on if I have a 4-slot cRIO (or an 8 slot with no camera)?


Quote:

TCP 1735: SmartDashboard, bidirectional
  • FMS will pass traffic to and from the robot's TCP/1735 port. Correct?
  • That port is not free for my robot code to listen on, it already in use by the FIRST framework. Correct?

Quote:

UDP 1130: Dashboard-to-Robot control data, directional
  • FMS will pass traffic to the robots UDP/1180 port, correct?
  • FMS will not pass traffic to the DS UDP/1180, correct?
  • That port is free for my robot code to listen on. Correct?

Quote:

UDP 1140: Robot-to-Dashboard status data, directional
  • FMS will pass traffic to the DS UDP/1140 port, correct?
  • FMS will not pass traffic to the robot UDP/1180, correct?
  • That port is free for my driver station code to listen on. Correct?

Quote:

HTTP 80: Camera connected via switch on the robot, bidirectional
  • FMS will pass traffic to and from the camera's TCP/80 port [10.xx.yy.11]. Correct?
  • If I don't have a camera, I can put another device on the robot at 10.xx.yy.11 listening on port 80, and can pass traffic to and from it.
  • If I do have a camera, then I obviously cannot use it for my own code. Correct?

Quote:

HTTP 443: Camera connected via switch on the robot, bidirectional
  • FMS will pass traffic to and from the camera's TCP/443 port [10.xx.yy.11]. Correct?
  • If I don't have a camera, I can put another device on the robot at 10.xx.yy.11 listening on port 443, and can pass traffic to and from it.
  • If I do have a camera, then I obviously cannot use the port for my own code. Correct?


All times are GMT -5. The time now is 12:05.

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