View Single Post
  #1   Spotlight this post!  
Unread 25-03-2013, 08:01
evinugur evinugur is offline
Registered User
FRC #1073
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: US
Posts: 13
evinugur is an unknown quantity at this point
Difficulties in Sending UDP Data in a NetConsole Implementation

I'm writing a program to emulate the features of NetConsole, and I'm having problems sending data down to the robot by means of the user entering a command into the terminal (i.e. ls)

I can read data fine just by listening to data on UDP Port 6666, and after doing some reading I found that the port for sending data is 6668 and I my program sends data to it via UDP.

My problem is that when I send down 6668, I get the same message on 6666, so the data sends, but the command doesn't run on the robot.

For example, if I type "ls" and send it down to 6668, I essentially get ls echoed on 6666. My data is sending, but the behavior I want is to type "ls" and then stdout should print all of the files and directories on the robot.

I can read from stdout fine (for instance when the robot boots), so perhaps my command is being listened to not actually being processed on the robot?

I think the next test I'll do is temporarily turn off the listening socket when I send a command, although that is a hacked approach...

My code is written in JavaScript for use with Node.js. The main point of this project was just so that I could run NetConsole in my tabbed Command Prompt such that I don't have to open a new window just for console output

My code can be found here:
https://github.com/FRCTeam1073-TheFo.../netconsole.js