3

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.

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Alex Bieg
  • 355
  • 2
  • 15

3 Answers3

5

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 "archive=@bundle.zip" -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.

Nas Banov
  • 28,347
  • 6
  • 48
  • 67
1

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!

panzhuli
  • 2,890
  • 6
  • 33
  • 46
-1

Roku might have changed authorization and uses Digest Auth now. You need to pass various authorization headers for it work successfully. You need to add Digest Username, Realm, nounce, uri, qop, nc, cnounce and response.

Script to upload a zip file to Roku -

curl -i -H 'Authorization:Digest username="...", realm="...", nonce="...", uri="/plugin_install", qop=auth, nc=, cnonce="", response="..."' --form archive=@example.zip --form "mysubmit=Install" "http://IP/plugin_install"
Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Shrinidhi Kulkarni
  • 129
  • 1
  • 1
  • 4