Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically Upload Roku Channel without Eclipse Plugin

Tags:

roku

I was wondering if it was possible to upload the zip file of a channel to a roku device using a terminal. It seems like it should be possible because there is a plugin available for Eclipse, but my goal is to not use Eclipse if possible. Any help would be appreciated.

like image 622
Alex Bieg Avatar asked Sep 17 '26 13:09

Alex Bieg


2 Answers

Why, yes - build & deploy to Roku device is quick and easy, so even a makefile feels like overdoing it. Here is a script i was using for Mac OSX:

#!/bin/bash
#ROKU_DEV_TARGET=192.168.1.25   # Roku 2XS
ROKU_DEV_TARGET=192.168.1.28   # put YOUR roku IP here

# wake up/interrupt Roku - workaround for fw5.4 crash
curl -sS -d '' http://$ROKU_DEV_TARGET:8060/keypress/Home
curl -sS -d '' http://$ROKU_DEV_TARGET:8060/keypress/Home

# build. zip _must_ change for Roku to accept re-deploy (grr!)
cd -- "$(dirname "$0")"
touch timestamp
zip -FS -9 -r bundle * -x run extras

# deploy
curl -f -sS --user rokudev:nuisance --anyauth -F "mysubmit=Install" -F "[email protected]" -F "passwd=" http://$ROKU_DEV_TARGET/plugin_install  \
| python -c 'import sys, re; print "\n".join(re.findall("<font color=\"red\">(.*?)</font>", sys.stdin.read(), re.DOTALL))'

I'd store it as a script file named run (marked as executable with chmod +x run; see https://stackoverflow.com/a/29710607/226086 for more, like "why not .sh", which was my initial inclination), so that can start it with double-click from Finder too. Or from TextWrangler with cmd-R, as was my case.

PS. i was not even copying the same run file to every project but linking to it - but i forgot if it was soft-link or hard-link that worked with a newer TextWrangler.

like image 79
Nas Banov Avatar answered Sep 22 '26 22:09

Nas Banov


You can certainly use a terminal if your machine and the Roku are on the same wireless network.

  1. Enable Developer mode on your Roku, press: Home 3 times, Up 2, Right, Left, Right, Left, Right. That will bring up a developers screen where you can see your IP address and can set a password.
  2. In your ENV path (.bash_profile or whatever), create a ROKU_DEV_TARGET and USERPASS variable. Set the IP address of the Roku to the ROKU_DEV_TARGET and the password to USERPASS. make sure you reload your terminal window so these env variables are available. Test by typing ECHO $ROKU_DEV_TARGET and you should see your IP address there.
  3. Next, you need a makefile. You can use the one provided by Roku. Download the Roku SDK and check out the examples/source/app.mk. You can see it uses the variables we've set above.
  4. Copy the app.mk file into your repo, then browse to that directory in your Terminal. run make install and it should be able to install to your roku.

NOTE: You may have to mess with the DISTREL, COMMONREL, SOURCEREL paths in the app.mk depending on the setup of your repo.

Helpful hint: in another terminal window, type telnet $ROKU_DEV_TARGET 8085 to see the console logging from the roku.

Good luck!

like image 41
panzhuli Avatar answered Sep 22 '26 22:09

panzhuli