Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Roku hard reboots when uploading new dev app if current SceneGraph dev app is still running

We use a simple buildscript to deploy development builds to our Roku devices during development, probably similar to what the Eclipse plugin does.

It looks like this:


#!/bin/bash

# Create the zip file.
rm app.zip
zip -FS -9 -r app.zip manifest components/ images/ fonts/ source/

# Upload the zip to the Roku.
curl --user rokudev:<PIN> --anyauth -sS -F "mysubmit=Install" -F "archive=@app.zip" http://<IP>/plugin_install | grep red


This works fine with the older template apps. You can just run it any time you want, it pushes the app and automatically starts it. Speeds up our development workflow considerably.

We've noticed strange behaviour when we use this script while a development build of a SceneGraph app is running on the device. Randomly (I would estimate 1 in 5 times on average) the Roku will crash and do a hard reboot if we push while the dev app is still running. This only happens if the development app running on the device is a SceneGraph app.

The solution is simple: first press the home button on the remote and wait a few seconds, probably for the app to be closed properly and garbage collected. Once the Roku has had some time to 'get the app out of its system' we can run our build script as normal and it works fine.

It's a minor annoyance having to press the home button each time before building, but because this problem does not exist with the pre-SceneGraph apps, we are wondering if it can be solved here.

Confirmed that his happens both on Roku OS 7.2 and the latest beta 7.5 build. Tested on a Roku 3.

To temporarily work around this issue, we added a home keypress and sleep timeout to our buildscript.


#!/bin/bash

# Create the zip file.
echo "Deleting old zip..."
rm app.zip
echo "Creating new zip..."
zip -FS -9 -r app.zip manifest components/ images/ fonts/ source/

# Close any active app by pressing the home button on the Roku.
# This prevents problems with spontaneous device reboots when running and deploying SceneGraph apps.
echo "Sending home button press..."
curl -sS -d '' http://<IP>:8060/keypress/Home

# Wait for 3 seconds so the Roku can close any running app properly and go back to home.
echo "Waiting 3 seconds..."
sleep 3

# Upload the zip to the Roku.
echo "Pushing zip to Roku..."
curl --user rokudev:<PIN> --anyauth -sS -F "mysubmit=Install" -F "archive=@app.zip" http://<IP>/plugin_install | grep red
0 Kudos
2 REPLIES 2
EnTerr
Roku Guru

Re: Roku hard reboots when uploading new dev app if current SceneGraph dev app is still running

Consider moving the "sending Home" workaround before bundle creation, so ZIP delay works for you as a delay, to avoid sleeping and speed up deployment.

Also consider editing your post to put [ code] [ /code] tags around the source.

But yeah - nasty bug! 
0 Kudos

Re: Roku hard reboots when uploading new dev app if current SceneGraph dev app is still running

Post edited. Thanks for the tip.

I considered moving the home keypress before the zipping, but the amount of time it takes to zip varies depending on the app (number of files, file sizes, compression factor) and the machine the script runs on, so I opted for the more constant sleep approach.
0 Kudos