stuthemonkey
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2011
08:12 AM
Roku control via netcat
I'm in the process of setting up a bunch of roku's and I want to write a batch file for windows that will automatically make a stack of roku's run a specific channel.
From a mac I can run this command: echo -e 'POST /launch/dev HTTP/1.1\r\n\r\n' | nc 192.168.0.71 8060 and it works perfectly to startup the channel with an ID of dev.
However I have been unable to use netcat for windows to do the same thing. I know the format of the command will need to be a little different for windows. However I have not been able to figure out what i'm doing wrong. Can someone translate that command to one that will run in windows?
Here is the version of netcat for windows I'm using. http://joncraton.org/blog/46/netcat-for-windows
From everything I have tried half the time I get netcat to crash. Other times I get no output, but nothing I try actually makes the roku do anything. So I know all my attempts to make the command work in windows is just malformed.
Thanks for any help anyone can provide.
From a mac I can run this command: echo -e 'POST /launch/dev HTTP/1.1\r\n\r\n' | nc 192.168.0.71 8060 and it works perfectly to startup the channel with an ID of dev.
However I have been unable to use netcat for windows to do the same thing. I know the format of the command will need to be a little different for windows. However I have not been able to figure out what i'm doing wrong. Can someone translate that command to one that will run in windows?
Here is the version of netcat for windows I'm using. http://joncraton.org/blog/46/netcat-for-windows
From everything I have tried half the time I get netcat to crash. Other times I get no output, but nothing I try actually makes the roku do anything. So I know all my attempts to make the command work in windows is just malformed.
Thanks for any help anyone can provide.
2 REPLIES 2
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2011
09:51 AM
Re: Roku control via netcat
The problem is trying to get those CR/LFs into an echo command. I tried a few things without much luck. The easiest thing to do is to put the POST into a text file and then redirect it into netcat. The text file would look like:
If you work from the command line in Windows a lot you may want to do yourself a favor and look into Take Command. The free light version, TCC/LE, is probably all you'd ever need and is a vast improvement over cmd.exe.
With TCC/LE the command would look like:
Hope this helps!
-JT
POST /launch/dev HTTP/1.1Note that there is a blank line after the POST line. Then you redirect that file (I called it launch.txt) into netcat:
nc 192.168.0.71 8060 < launch.txt
If you work from the command line in Windows a lot you may want to do yourself a favor and look into Take Command. The free light version, TCC/LE, is probably all you'd ever need and is a vast improvement over cmd.exe.
With TCC/LE the command would look like:
echo POST /launch/dev HTTP/1.1%=r%=n | nc 192.168.0.71 8060
Hope this helps!
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
donbga
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2012
07:51 PM
Re: Roku control via netcat
Thanks for the tip on Take Command. I've been looking for something like this!