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:
# 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 "firstname.lastname@example.org" 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.
# 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 "email@example.com" http://<IP>/plugin_install | grep red
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.