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
Yes, actually. I used your Python implementation on GitHub as a reference for the port numbers.
The only big difference between our code is that you use the broadcast address and I use the robot’s address (10.TE.AM.2) for sending out data on 6668.
I suspect that this has something to do with our underlying datagram socket (python lib vs Node.js lib), as I am able to reach the listening socket.
I’ve been meaning to write a Node.js based NetConsole for a while, so I was delighted to this today. I’ll take a look at your code in more depth sometime tomorrow. Right now, I gotta study for some mean tests I missed due to a regional.
Thanks for your reply, the more I use Node.js, the more I want more things to be supported with it
I’m thinking of a few solutions right now… because the UDP data is reaching the listener but (apparently) not the robot perhaps just turn off the listening socket when I send down data… I can’t justify doing that though, it sounds like too much of a hack.
Thanks for eventually taking the time to read my code. I appreciate it!!!