grahl/ch

Using a Kindle as a monitoring tool (or not)

I had an old Kindle 3 lying around and really wanted to do something fun with the e-ink display in it, especially since its Linux underneath anyway.

If you browse around the web you’ll find plenty of information to get you started with the prerequisite steps of rooting the device, enabling network and ssh. Since a lot of the information is hidden in forums (ugh), I’ll point to Liraz Siri’s tutorial which covers all important points.

Developing a kindlet

Unless you want to directly work on the framebuffer you will want to create a java application which the Kindle can run, called a kindlet. I strongly suggest you follow David Given’s guide. Getting his Hello World to run consistently is a good starting point for everyone like me who only dabbles with Java. Additionally, the MobileRead wiki has additional information.

Since developing a kindlet without any resources from Amazon basically amounts to compiling, copying, opening and repeating that process it’s essential to automate that process, thus I recommend ammending Given’s excellent makekindlet script with the following  two lines (for OS X):

[...]
jarsigner -keystore $KEYSTORE -storepass password $JAR dn$USER

cp $JAR /Volumes/Kindle/documents/
diskutil eject /Volumes/Kindle 

Network communication in a Kindlet

To do anything useful in a Kindlet apparently requires one to have the ability to work with sockets, so the security settings need to be adjusted. A blog post by Alex Hutter explains how, i.e. add the following in external.policy:

grant signedBy "Kindlet" {
 permission java.net.SocketPermission "*:443-", "accept,connect,listen,resolve";
 permission java.net.SocketPermission "*:80-", "accept,connect,listen,resolve";

If you are stuck at such a point it’s often helpful to visit the crash.log in developer/APPNAME/work to point you in the right direction of the problem.

Rendering content

Now, the rest should be easy, right? Well, rendering local images worked fine with this example snippet, however any permutation of loading network resources into images went exactly nowhere, getWidth() returns 0 and no image can be rendered and that’s where I’m currently stuck and discontinuing this project.

Summary

The Kindle is NOT intended as a general use computing device. 

The quote above is from Hutter’s blog post, I don’t have much to add to that. This was a fun project but it became clear that without getting to know Java a lot better this would not be worth the effort, compared to solving the problem with an Android app, no matter how nice the display is.