title: “Kindle Calendar and Weather Display” date: 2019-09-10 summary: Second hand Kindles are a cheap source of linux driven eink displays. They are a bit janky and hard to work with but with some effort you can get them displaying custom text and images. The classic project is a low power weather/calendar display, and thats what I did. tags: - programming draft: true

Kindle Calendar and Weather Display

Acquire a Kindle

Step 1 is to get a Kindle. I ended up buying a second hand Kindle Touch (I think from the first generation to have a touch screen) from eBay for ~£20. In hindsight I think getting a slightly later model (if you can find a cheap Paperwhite for example) might be better as they have better and more useful power saving modes.

Download software

There is quite a large community dedicated to Kindle and ereader hacking and for the Kindle they have helpfully compiled all of the useful software into one forum thread on mobiread. The following is a list of packages I used and you should ensure you download the correct version for your kindle version.

Jailbreak the kindle

Next we must open up our Kindle and allow it to run custom code.

1) Extract kindle-jailbreak-1.15.N-r16256.tar.xz (or whatever your jailbreak version is) 2) Unzip the contents of the kindle-5.4-jailbreak.zip archive to the root directory of your Kindle 3) Eject & unplug your Kindle 4) Go to [HOME] -> [MENU] > Settings -> [MENU] > Update Your Kindle

Install Dependencies

Now install Kual, MRPI, USB Networking, and SS Hack.

1) Extract KUAL and put KUAL-KDK-2.0.azw2 somewhere in the documents/ directory tree 2) Extract kual-mrinstaller-1.7.N-r16438.tar.xz and copy contents to root of Kindle 3) Extract SS Hack and copy appropriate .bin file to mrpackages directory on Kindle 3) Extract USB Network Hack and copy appropriate .bin file to mrpackages directory on Kindle 4) Eject & unplug Kindle 5) Go to KUAL -> Helpers -> Install MR Packages

USB Networking

With everything installed above you should be able to turn on USB Networking on your Kindle. This will allow you to SSH in to the kindle which is useful for debugging and necessary for the final steps of installing my own kindle weather app.

On the Kindle

You can toggle USB Networking on and off via KUAL. Whilst it is on your Kindle will not mount as a USB storage device, but you can SSH into it.

1) Go to KUAL -> USBNetwork -> * Toggle USBNetwork * 2) You can then click * Check USBNetwork Status *. A message should appear at the bottom of the screen telling you is USB networking is on or not.

On your PC

I only have instructions for Xubuntu linux. This is possible on most other OSs but you’ll have to google. I also found that doing this via the Network Manager GUI was much easier than command line as modern Ubunut no longer assigns nice names to USB networking interfaces.

1) Ensure USB Networking is on on the Kindle and plug it in via USB 2) Open your Network Manager 3) Open ‘Edit Connections’ 4) One of them should be some sort of USB or Wired Connection. Edit this connection. 3) Open the “IPv4” tab 4) Set “IPv4 Method” to “Manual” 5) Under “Addresses”, set “Address” to 192.168.15.201 and “Netmask” to 255.255.255.0 6) Click “Apply” 7) Restart the connection by disconnecting it and reconnecting it (in Network Manager, no need to physically unplug) 8) Run “ssh root@192.168.15.244” (press enter at password prompt) in terminal to access the Kindle.

Kindle calendar/weather

You are now ready to make your own weather display application!

Alternatively you can base it on mine: rhyst/kindle-weather. How this works:

On server

As this will depend heavily on your server setup the instructions are less prescriptive.

Prerequisites: - For Weather data you will need to register for a Met Office API Key - For Calendar data you will need to create a Oauth Application in the Google API Console: - Start a project in the API Console - Create new Oauth 2.0 Credentials - Configure the redirect URL as the endpoint url where you will be serving the PNG - Download the resultsing client_id.json - Optionaly set up the OAuth Consent screen and authorised domains.

1) Clone repository. 2) The Flask application is in kindle-weather/server. 3) You will need a .env file in the same dir as main.py with: MO_API_KEY={ Met Office API Key } IMAGE_NAME={ name for generated image (doesnt reeally matter) }.png 4) You will need to create a config dir in the same dir as main.py. Place your client_id.json in the config folder. 5) Serve the flask app. 6) Visit your endpoint first on a PC or phone as it will redirect you to a Google Auth page to create credentials to check your calendars.

On Kindle

1) Clone repository. 2) Connect Kindle in USB Storage mode (USB Networking off) 2) Copy kindle-weather/kindle folder to /extensions in the Kindle root 2) Ensure .env file in /extensions/kindle has correct vars for http user/pass and the URL of your image generating API. 3) Copy the following files into /extensions/kindle/bin /linkss/etc/ImageMagick-6/colors.xml /linkss/etc/ImageMagick-6/delegates.xml 4) Eject & unplug Kindle 5) Launch via KUAL -> Kindle Weather

Done!