Jump to content

Recommended Posts

Posted (edited)

 

My Roku's remote control stopped working so I ordered a new one.  Since I use my Roku for almost all of my TV watching (local channels, movies, etc.), I had to find a way to control the device until the new remote got delivered.  That was the genesis of this simple little script. 

The script uses Roku's External Control Protocol (ECP), which is a set of RESTful API's that allow an application to control any Roku device that can by reached across a network.  The API's implemented in this example script are just a small subset of ECP's full capabilities.  One benefit of using ECP instead of a physical remote is that there are no distance or line-of-site restrictions.  As long as there's network connectivity to the Roku devices, you can control them from anywhere.

It was a fun little project that only took about an hour.  Even though it's a simple little script, it was invaluable while I was waiting for my new Roku remote.  If you ever find yourself without your Roku remote, you'll see.  :yes:

 

;==========================================================================
;
; DESCRIPTION
;
; This is high-level example of a simple Roku remote control using Roku's
; External Control Protocol (ECP) REST API's.
;
; There are two interesting technical aspects of the script.  The first is
; a simple implementation of the Simple Service Discovery Protocol (SSDP)
; which, in this case, finds all of the Roku devices on the current subnet.
; The second is the sending and processing RESTful HTTP API's.
;
;
; USAGE
;
; When the script starts, either enter a known Roku IP:PORT address or
; you can select one from the list after doing a successful device
; discovery.  After entering or selecting the IP:Port of the Roku device
; that you would like to communicate with, you can click on any of the
; visible Roku remote control buttons and the related command will be sent
; to that device using the ECP RESTful API's.
;
;
; NOTE
;
; Roku's default ECP port is 8060. So an example IP:Port would be something
; like "192.168.1.25:8060".
;
; I used one of the simplest Roku remote control layout images.  However,
; some Roku devices still may not recognize some of the buttons.  For
; example, the volume & power buttons are mostly recognized by Roku TV's,
; not the standalone streaming devices.  You can click the
; "Show Device Info" button, once you have a valid IP:PORT entered, to
; see what functionality your device supports.
;
;==========================================================================

 

image.png.d7da3a61e546134e676bb86bfccd0fa0.png

Roku Remote Example v1.1.0 by TheXman.zipFetching info...

 

Edited by TheXman
Updated 2023-06-11
Posted
  On 6/4/2022 at 7:27 PM, TheXman said:

Exteranl Control Protocol

Expand  

typo ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Thank you!  They typo has been corrected in the post and in the script (from where it was copied).  :)

Edited by TheXman
Posted

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Roku's External Control Protocol is not specific to any particular Roku device.  It works on any Roku device that has ECP enabled, including TV's.  If any particular ECP command is sent to a device that it does not support, the device will just ignore the command.

Edited by TheXman
Posted

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I was searching for some reference documentation....

And I found this:
https://developer.roku.com/docs/developer-program/getting-started/hello-world.md

 

nice.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)
  On 6/4/2022 at 8:24 PM, mLipok said:

was searching for some reference documentation....

Expand  

Please see my previous post, it has a link to the ECP documentation.

 

Edited by TheXman
  • 1 year later...
Posted

Thanks for this.  I've been using a Roku Remote au3 script that I downloaded from a Roku forum to control various streaming devices from a Windows 7 laptop.  However, it won't work on my Windows 11 laptop.  Stranglely enough, the compiled version still works with Windows 7, but the au3 version doesn't work anymore.  Your script works fine my Windows 7 machine; I haven't tried it yet on Win 11.

Here's where I got the original script: http://forums.roku.com/viewtopic.php?p=353412&sid=b2b387c6f19e31cb1f8208a6cbf4bbfb

but it's gone.  I attached the almost original au3 script.

rokuRemote(v2.0).au3Fetching info...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...