Literary Clock Made From E-reader

135,989

481

240

Introduction: Literary Clock Made From E-reader

About: I play with electronics and stuff. Also manager of the electronics workshop at the Royal Academy for Arts (KABK) in The Hague.

My girlfriend is a *very* avid reader. As a teacher and scholar of English literature, she reads eighty books per year on average.

On her wishlist was a clock for our living room. I could have bought a wall clock from the store, but where is the fun in that? Instead, I made her a clock that tells the time by quoting time indications from literary works, using an e-reader as display, because it's so incredibly appropriate :-)

It updates every minute, so for instance at 9.23 in the evening, the Kindle will read

My father met me at the station, the dog jumped up to meet me, missed, and nearly fell in front of the 9.23pm Birmingham express.

The way I made this, the Kindle can still be used as a normal e-reader. If the clock is turned on though, as an added bonus, it doubles as a literary quiz. The clock shows the quotation without the title and author of the book, so you can guess. If you want to know the answers, pressing the buttons on the side (normally used to advance pages of e-books) will reveal them.

-----

Update August 5:

Thank you all very much for all the nice compliments! Also, the feedback has been very useful. If you have any trouble making your own Kindle clock, please see the comments.

This Instructable has been featured on Hackaday, Gizmodo, The Verge and Hacker News. I am one very proud and happy maker :-)

Meanwhile, Johannes Enevoldsen made a web version of my clock, as did Davide. I am excited that my project inspired theirs.

Step 1: Tools and Materials

Really the only thing needed is an e-reader (and a USB cable to connect to it). For this project, a Kindle was donated to me by a friend. It is a Kindle 3 WiFi (nicknamed K3, or K3W). You will find many second-hand earlier models like that on eBay for instance.

You'll need a computer (any operating system), with an SSH client like vSSH and an sFTP client like Filezilla installed (both are free). It helps to have a bit of experience with Linux, because that is what the Kindle runs on.

To have the Kindle stand upright in our cupboard, I made a stand from concrete. If you want to do the same, you'll need a food container in a shape you like, cling film, styrofoam, cement, hot glue or double sided tape, and a bucket (to mix the cement).

Step 2: Jailbreaking the Kindle

In order to change the Kindle into a clock, we need to get into the system files. In order to do that, we need to open it up through a process called 'jailbreaking' (don't worry, it's not illegal if it's your property). An explanation to jailbreak the Kindle and a zip file with the necessary files can be found here. Also see this overview of all available software custom software. Find out which Kindle model you have on this page.

For this project, you only need to install the jailbreak hack and the usbnet hack, not the screen saver hack. USBNetwork will grant you remote shell access to your Kindle, either over USB or WiFi. What you will need, if you want to use the keyboard's keys, is the Launchpad hack.

Warning: I read this can potentially ruin your Kindle. Follow the instructions. Jailbreak at your own risk.

If you connect the Kindle to your computer, it will show up as an USB drive.

Basically, all you need to do is put Update_jailbreak_0.13.N_***_install.bin (where *** is your Kindle version, in my case 'k3w') in the root folder of the Kindle when it is connected to your computer.

From the README file in the zip file: "Now, eject & unplug your Kindle, and go to *[HOME] -> [MENU] > Settings -> [MENU] > Update Your Kindle*. It should be quick.” (note: that's two times clicking the menu button).

Then do the same for the USBNet and Launchpad files. You should now be able to log in to the device using SSH. On the Kindle, connect to the WiFi network. One way to find out its IP address is by logging into your WiFi router and looking it up there. Username is 'root', and the default root password for your model can be calculated.

Then install Python on the Kindle, again using the files on the excellent Mobileread.com forum (thanks VoltaX2 in the comments below).

Step 3: Making an Image for Every Single Minute of the Day

There are 1,440 minutes in a day. Compiling a list with quotes for each and every one of them from different literary works is a massive undertaking. Big relief: others already did that for us.

In 2011, newspaper The Guardian asked its readers to submit quotes from books which mention times. They wanted to build an installation for a literary festival. So they have two versions of a list on their website (1, 2).

I combined the two lists, cleaned them up, added a few times I found myself, and turned them into one CSV file.

Unfortunately the list does not cover all minutes of the day. I worked around this by using some quotes more than once, for instance if it can be used both in the AM and PM. More vague time indications can be used around a certain time, so this quote from Catcher in the Rye is used at 9.58AM: "I didn't sleep too long, because I think it was only around ten o'clock when I woke up ... "

Even with this pleasant list, two things took me an unreasonable amount of time. I needed to turn every single quotation from the list into an image. I wanted to make them fit nicely to the screen, so the font would be as large as possible for each quotation.

While scaling a text box to a certain height and width is easy to do manually in most photo editing software, it would have been an immense amount of work to create them one by one. Creating a script to do it for me however proved to be quite the task as well. In PHP (I used that programming language because it has nice functions to deal with text) I wrote a recursive function to find the best fit for each quotation, long or short. For each line, the script creates two PNG images, one with and one without metadata.

It uses the Libertine font, which I like because of its stylish look, because it is very complete (numbers, punctuation, diacritics) and because it's open source.

The other thing that took me a long time is identifying all time mentions in the quotations, because I wanted to write them in bold text. That makes the clock easier to use, especially when a quote is quite long. The problem is that in books, an impressive variation of time descriptions is used. It can be anything from '6.00 p.m.' or '18:11:00' to '0600h', 'around six o'clock', just 'at six', or 'twenty-eight minutes past eleven'. I made a script to try and find most of these variations, did the ones it couldn't find myself, and added them to the csv file.

If you want to make your own Kindle clock, you may use my scripts (find them attached below), but you can also just download all the resulting images.

Step 4: Starting and Stopping the Clock

I wanted to be able to start my literary clock by pressing the shortcut Shift+C on the small keyboard of the e-reader. Pressing it again stops the clock and turns the clock into a normal e-reader again.

First, create this folder: /mnt/us/timelit and then put the scripts I attached below in there.

The images (see previous step) go into /mnt/us/timelit/images and /mnt/us/timelit/images/metadata/

When you install the Launchpad hack, the folder /mnt/us/launchpad is created. Create a new file there called startClock.ini and put this text in there:

[Actions]
C = !sh /mnt/us/timelit/startstopClock.sh &

That creates the shortcut Shift+C. If we press that, the bash-script startstopClock.sh starts. It stops the Kindle framework (the normal user interface), prevents the Kindle from going into power save mode and creates a small file (/mnt/us/timelit/clockisticking) to indicate the clock has started.

Note: Shift+C on the Kindle is really 'press shift, let go, press c'.

If the user presses Shift+C again and the clockisticking file is already there, startstopClock.sh will remove it and restart the Kindle.

startstopClock.sh also executes another script, showMetadata.sh, to enable the keystrokes that will show the metadata (using the command /usr/bin/waitforkey). If the user pushes the 'next page' button on the sides of the Kindle, it will check if the clock is ticking and if it is, will show the same image as currently is shown (which file that is, is saved in the clockisticking file) but then with title and author at the bottom.

Changing the time on the display every minute is done by adding this line to /etc/crontab/root:

* * * * * sh /mnt/us/timelit/timelit.sh

and then restart crontab like this: /etc/init.d/cron restart

Every time it is run, timelit.sh checks if the 'clockisticking' file is created. If it is, timelit.sh proceeds to show the image for the current minute.

Note: you'll probably want to change the timezone in timelit.sh where it says 'TZ=CEST'.

Step 5: Making a Stand

I was inspired by other Instructables to make a concrete stand for my Kindle clock. I could also have made something out of wood (or even a book), but I liked to try cement because I never did before and also because I thought the grey color would go nicely with the e-reader.

I cut a piece of styrofoam the size of the e-reader, plus a little extra for the USB cable to go in. I wrapped it in cling film and a bit of clear tape, so the cement would come off easily afterwards. I taped it to the bottom of the food container using double-sided tape.

Then I mixed enough cement to fill the food container to about 5 centimeters (2") deep. I'm not sure, but I may not have used enough water, because the cement was less pourable than I had expected. I definitely should follow the concrete class before my next try :-)

I put the cement in the container using a garden shovel, tamped it a bit, and then let it dry for two days.

The next time I will try for a smoother surface by first sifting the cement to get rid of the small rocks, adding a bit more water and spend more time sanding the result. Then I will also make a small recess in the base so the USB cable goes to the back of the stand. This can be done using a straw.

Step 6: Further Ideas

The literary clock looks really nice, and the quiz part works well. My girlfriend now and then checks to see from which book a quotation is from (she usually guesses correctly :). The stand did not come out quite how I hoped, but I'm looking forward to trying making a better one.

I will probably also add a lamp, either clamped on the device or incorporated into the new base. When the clock sits in the cupboard, sometimes it is a little too dark to be able to tell the time.

Instead of getting power for a lamp separately, one could power a lamp using power from the hinge slot in the Kindle. Two slots are there for Kindle cases that have a lamp built in. You'd have to open the Kindle and do some soldering, or make your own metal clamps, but that would be sweet. One could even connect a light sensor, so the lamp will only switch on when it's getting dark.

Extra features I hope to get round to are

  • having the clock stop between 1am and 6am, to save power
  • turn of wifi for the same reason, but turning it on daily for a couple of minutes to synchronise the system clock
  • showing the percentage of the current minute that has passed as small blocks at the bottom, just like the Kindle indicates the progress the reader is making in a book
  • show a warning when the Kindle's battery is running out

(these last two could be done by overlaying small images on the larger image using the Kindle's eips command, see my scripts for examples).

Other possible ideas are

  • using keys on the Kindle to set the time
  • show a default image when the clock starts and/or when no image is found
  • using a shortcut (shift-Q for instance) to toggle quiz mode
  • have the Big Ben sound chime at the top of the hour (only during the day), as the Kindle has a nice speaker built in. Other sounds could be the sound of slamming a book shut or turning pages or even reading out a quote.

I hope you like the idea and this Instructable. Let me know if you have any questions or suggestions!

Clocks Contest

Second Prize in the
Clocks Contest

4 People Made This Project!

Recommendations

  • Make It Modular: Student Design Challenge

    Make It Modular: Student Design Challenge
  • Woodworking Contest

    Woodworking Contest
  • Tinkercad to Fusion 360 Challenge

    Tinkercad to Fusion 360 Challenge

240 Comments

0
JoeR208
JoeR208

3 years ago

It took some elbow grease to get this working on an old Kindle Paperwhite I had laying around but the result is really cool! Thanks for the inspiration and code! For anyone with a Paperwhite/Touch these are my high-level changes.

I couldn't get the script to control power, so I ran the ~ds command in the search bar to disable the screensaver.

You'll need a different javascript package too. The one that worked best for me was from this thread at MobileRead (showthread.php?t=277687).

I couldn't edit the cron root file to get this script to run at startup but I found a cool package called eventHandler on the MobileRead forums (showthread.php?t=198484) which lets you easily run a script at boot by putting in /mnt/us/scripts/startup.

Because I couldn't edit the cron root file I also couldn't get the timelit script to run every minute. My answer was to add some code to it (a while : style loop with a 60 second rest) so it updates once per minute.

Finally, I had the most frustrating time trying to get the timezone in this script working for me here in Denver instead of the default UTC. Turns out there's a bunch of great time zone data on the Kindle in /usr/share/zoneinfo which you can use to get the exact verbiage it's looking for.

For looks I went with a cheap wooden stand and a wood grain skin for the Kindle, I think it turned out quite nice! There are a few things left on the to-do list like using the PHP script to make pictures for the resolution of this device.

IMG_20180817_202549.jpg
0
tfpHumorBlog
tfpHumorBlog

Reply 3 years ago

How did you get it to display the author and the book title at the bottom? Thanks!

0
JoeR208
JoeR208

Reply 3 years ago

There are two sets of photos in the instructions. One set is just the quote, and the other includes the author and book title. I think the intent was to display that extra info when you press a button but I just liked it more as the default option. In the script, there's a line with a reference to the pictures folder, just make sure it's pointing to the one with the author and book titles.

0
faizaljamal_fj
faizaljamal_fj

Reply 7 weeks ago

Hi,
Could you please share the script files that you use to run this.
I have a Kindle 4 Touch.
I don't have any knowledge of how to do this.

I followed the instructions as per the following video.

I installed the eventHandler package after reading your comment.
I was able to jailbreak the kindle.
Create the folders and move the files to kindle
I was able to update the cron file.
But nothing happens.

Hope you can share your script files, if possible.

Regards.


0
netsua222
netsua222

Reply 3 years ago

Thanks for these tips! I'm really close to having it working on a Kindle Touch 1.

Since the script power commands didn't work, I'm guessing you also disabled the '/etc/init.d/framework stop' command. How did you handle stopping the framework from refreshing? Does the eventHandler take care of that?

Thanks!

0
notyoutoo
notyoutoo

2 months ago

To disable Wifi (to save power), I added this to /etc/crontab/root
0 1 * * * /sbin/ifdown wlan0
0 18 * * * /sbin/ifup wlan0

Then did /etc/init.d/cron restart

This shuts down the Wifi interface at 1AM every night, and doesn't bring it up again until 6PM later that day. Hopefully this saves some battery, although I'm investigating another Power Level called "Ready To Suspend" that *might* be able to save even more power, if I can extend the time in the state from the default 5 seconds to weeks.

https://www.mobileread.com/forums/showthread.php?t...
http://www.mobileread.mobi/forums/showthread.php?t...

0
steveistheman
steveistheman

Question 3 years ago

Has anyone figured out a fix for the metafile display?

So far the 'pg forward' button will work based on the author's suggestion to run

sh /mnt/us/timelit/showMetadata.sh

via command line SSH. However, this stops working as soon as I close the SSH session.

I have tried to delete the clockisticking file also with no effect.

0
Andrew Hannay
Andrew Hannay

Answer 3 years ago

I wanted to see the credits all of the time so I just renamed all of the files in the metadata folder to the same names as the main images folder by just doing a search and replace removing _credits from the end of the file name. I then deleted all the files in the images folder (or moved them to another folder) and moved the all the image files from the metadata folder into the images folder.

0
happydupa
happydupa

Reply 4 months ago

Excellent idea. Worked great. I downloaded a small program called Bulk Rename Utility (free) and it removed all the _credits in a flash. Thanks!

0
notyoutoo
notyoutoo

Reply 2 months ago

A slightly easier alternative to renaming 1000s of files is to modify the code. Where you see:
/mnt/us/timelit/images/quote_$MinuteOTheDay*

You would simply replace it with:
/mnt/us/timelit/images/metadata/quote_$MinuteOTheDay*

I actually used @fishter's shell magic to generate the random number, so my replacement was only slightly more complicated:
ThisMinuteImage=$( find /mnt/us/timelit/images/quote_${MinuteOTheDay}_${IMAGE_NUMBER}.png)

Became:
ThisMinuteImage=$( find /mnt/us/timelit/images/metadata/quote_${MinuteOTheDay}_${IMAGE_NUMBER
}_credits.png)

0
Thumb5ter
Thumb5ter

Answer 3 years ago

I don’t know if you found the answer but here’s what I did. The page turn on my kindle touch corresponds to 330 instead of what the author had for this kindle model. Run /usr/bin/waitforkey on command line and tap the page forward. It will show the keynum associated with page forward on your kindle. Use that number in showMetadata.sh.

Then delete clockisticking file. Run startStopClock.sh from command line or however you have it set up. That should work fine.

0
zenbuffy
zenbuffy

3 years ago on Step 3

Thanks for this project, I had a lot of fun doing it!

I've made some modifications to the original image generation script, so that it checks to see if the image already exists before generating a new one (which is handy if you just want to run the script to add one or two more images, since it only does the memory intensive stuff if the image isn't already there), and have uploaded that modified script to github.

https://github.com/zenbuffy/LiteraryClock

I've also added some new times to the csv file (also in github) and some new images (also in github) if anyone wants to grab some additional minutes for their clock.

Further plans include tweaking the setup a little since my kindle (and others it seems) doesn't have buttons, so the launch script idea doesn't quite work for me.

Thanks for the inspiration!

WhatsApp Image 2019-04-16 at 14.42.11.jpegWhatsApp Image 2019-04-16 at 14.42.17.jpeg
0
happydupa
happydupa

Reply 4 months ago

Hey thanks for all your work in making this project even better. I (we) really appreciate it!

0
tjaap
tjaap

Reply 2 years ago

Awesome, thanks!

0
Un1nstructble
Un1nstructble

Reply 2 years ago

Hi, from the images on your post it looks like you have this running on a Kindle 4 (non-touch)??

I have several K4NTs and have tried to install the Literary Clock however when i start it running using the command line over SSH -

sh /mnt/us/timelit/startstopClock.sh

..the Kindle goes into a reboot loop and then shows the error "Your Kindle Needs Repair" and I have to use Kubrick to unbrick it, before jailbreaking and installing all the other necessary things again.

Any help is appreciated!!

(If i get it working I am then looking to change the time images to a series of comic images as i would like the Kindle to display a randomly selected comic image twice per day instead)

0
marnone
marnone

4 months ago

Kudos- one of the best projects I have seen. Period.

0
marnone
marnone

Reply 4 months ago

Thank you so much! I am going to try to make this a background on my mac using a third party interactive background program!

0
kris.pucci
kris.pucci

Reply 2 years ago

awesome

0
msmarymak
msmarymak

Question 6 months ago on Introduction

I love this idea! Does anyone know if this will work with an old Nook? It's all I've got.