I’ve seen a number of projects posted using the Amazon Kindle as a “standalone” wireless display and decided it was time to join the party. I picked up a secondhand kindle from eBay for £20 and got cracking.

First step was rooting/jailbreaking the kindle. Pretty easy using the instructions from http://www.mobileread.com/forums/showthread.php?t=88004

I then enabled SSH over WiFi so I didn’t have to mess around booting into diagnostics mode and plugging in to USB every time I wanted to make changes.

Lees-Air:~ leetickett$ ssh root@192.168.0.229

Welcome to Kindle!

#################################################
#  N O T I C E  *  N O T I C E  *  N O T I C E  # 
#################################################
Rootfs is mounted read-only. Invoke mntroot rw to
switch back to a writable rootfs.
#################################################
[root@kindle root]#

The most helpful project to get me started was https://github.com/antimega/kindleframe it uses PhantomJS and pngcrush on a linux server to prepare the image. Handily I already have a Centos server I could easily use for this. I tweaked Chris’ script a little- starting with the shell script called by cron;

#!/bin/sh
cd /var/www/html
phantomjs update.js
convert morning.png -resize 80% screenshot.png
convert morning.png -rotate 90 screenshot.png
pngcrush -c 0 -nofilecheck screenshot.png screenshot_crush.png

Then update.js. I had to tackle a few issues;

  • Cycling between different pages (achieved by dividing the current minute by 5 and choosing a URL based on the remainder)
  • My SSRS report takes 15 seconds to run (using setTimeout(takeScreenShot, 20000); ensures the report has loaded before the screenshot is taken)
  • My SSRS report requires authentication (simply adding page.settings.userName = ‘x’; and page.settings.password = ‘y’;)
var page = require('webpage').create();
var d = new Date();
var n = d.getMinutes();
var url = '';
var px_top = 120;
var px_left = 10;
if (n%5==0)
{
 url = 'http://pvoutput.org/intraday.jsp?id=26603&sid=24317';
}
else if (n%5==2)
{
 url = 'http://pvoutput.org/list.jsp?id=26603&sid=24317';
}
else
{
 url = 'http://192.168.0.188/ReportServer/Pages/ReportViewer.aspx?%2fTEL+Wall+Thing%2fWallDash&rs:Command=Render';
 page.viewportSize = {
  width: 1920,
  height: 1080
 };
 page.settings.userName = 'xxx';
 page.settings.password = 'yyy';
 px_top = 45;
 px_left = 470;
}
page.open(url, function () {
	page.clipRect = { top: px_top, left: px_left, width: 1000, height: 750 }; 
	page.evaluate(function() {
    	document.body.bgColor = 'white';
	});
        var elapsed = 0;
	setTimeout(takeScreenShot, 20000);
	function takeScreenShot() {
            	page.render('screenshot.png');
            	phantom.exit();
    	}
});

Then added the script to cron to run every minute and voila.

Once SSH’ed onto the kindle you’ll need to;

mntroot rw

Then proceed to create the script to grab the image and display it (I also added a few lines to display the battery %age in the bottom corner);

#!/bin/sh
cd /var/tmp/root
rm screenshot_crush.png
eips -c
eips -c
wget http://user:pass@tickett.dyndns.com:777/html/screenshot_crush.png
eips -g screenshot_crush.png
local batt=$(cat /sys/devices/system/yoshi_battery/yoshi_battery0/battery_capacity)
batt=${batt%%\%*}
eips 1 39 "$batt"

I’ve setup port forwarding on my firewall to allow traffic through on an obscure port, added a .htpasswd and you’ll notice i’m using an external domain name in my script (i’ve substituted something fictitious)- this allows me to use the display anywhere with an internet connection (literally anywhere as I can tether to my mobile phone).

And here it is;

IMAG1435

IMAG1433

IMAG1432

Here’s how the SSRS report looks in it’s full glory (you can see the area i’ve chosen to display on the kindle);

wall_dash

I’ve chosen not to kill powerd and framework for now, so the kindle will still go to sleep. The next step- if I ever get round to it, will be trying to save power by sleeping or disabling WiFi between updates. I’ve found a little bit of information on how this might be possible (http://www.mobileread.com/forums/showthread.php?t=221497) but still some way off.

I will no doubt add some additional screens (weather forecast, router traffic, network monitoring etc), and it would be nice to have a way of scrolling between images using one of the kindle keys.

Wouldn’t it be great if you could buy something like this off the shelf? Why should we have to hack an existing device? I stumbled across an interesting kickstarter campaign doing exactly this, unfortunately it’s a tiny 2″ screen (https://www.kickstarter.com/projects/914874115/displio-wifi-display-that-tracks-whats-important-t)- maybe one day!

I’m also in the market for a bigger device (i’d love to replace the 21″ monitor which sits on my wall) but for a portable option 9″ or 10″ would probably suffice. A real shame the Kindle DX was discontinued, that would have been perfect (although could do with losing the keyboard). Also looks like a few similar devices; Asus eeeReader DR900, Onyx BOOX M96 (they seem quite expensive and I haven’t looked into whether they have been (or even need to be) rooted, or how easily something similar could be achieved on Android).

Other similar projects worth a look;

http://www.shatteredhaven.com/2012/11/1347365-kindle-weather-display.html
https://randomcoderdude.wordpress.com/2015/01/31/using-the-kindle-as-an-information-display
https://github.com/ufuchs/weather-on-kindle4nt
http://hackaday.com/2015/02/16/wi-fi-connected-e-ink-display/