Re-purpose an eReader

My daughter and I looked at trying to re-purpose an old eReader. Our goal was to make a kitchen kiosk display that would show us items of daily interest. For us that included news, stocks and weather data that we pulled from the Internet, along with some local data from Arduino, Raspberry Pi and a Home Assistant nodes.

In this blog we’ll look at:

  • How to install a different OS on the eReader
  • Using Linux on an eReader
  • Python eReader considerations
  • Kiosk mode Web Browser pages

Opening up the eReader

For our project we used a Kobo mini, so the procedure to load a new OS will vary somewhat based on the eReader manufacturer.

Once you open up the eReader, you’ll have access to an microSD inside the unit.

I would highly recommend keeping the original SD in case that you ever need to roll back to the original setup.

For eReaders there are two main OS choices, Android or Linux. For our project we felt that Linux would be a cleaner option. Images can be downloaded from: https://www.dropbox.com/sh/snsdg1c5cg21kws/3LfelXgbGe.

If you are trying to re-purpose other brands of eReaders there appears to be lots of how to guides, for example for Kindle see: https://www.lifehacker.com.au/2016/07/how-to-jailbreak-your-kindle .

Installing Debian Linux

Once you’ve downloaded your required OS you’ll need to put in on a micro-SD chip.

There are a number of different tools to move and copy images, because I’m a Raspberry Pi user I like to use the Raspberry Pi Imager (rpi-imager). The rpi-imager utility runs on Linux, Windows and Mac OS. To install it on Linux:

sudo snap install rpi-imager

Using rpi-imager, select the “use custom” option.

Depending on your eReader and the OS you might be ready to go. Unfortunately for our Kobo mini installation we needed to another step. The added step that we needed to do moved some files from the original SD chip on to our new SD chip. This added step gave us a clean double-boot install so we could either run the original Kobo software or boot into Debian Linux. Our added steps were:

# insert the original microsd
sudo dd if=/dev/mmcblk0 bs=512 skip=1024 count=1 of=/home/you/path/to/image/original.img
# insert the new microsd with the debian image on it
sudo dd if=/home/ian/Desktop/kobo/original.img bs=512 seek=1024 count=1 of=/dev/mmcblk0

To setup the Wifi we needed to boot into the Kobo system and configure our network settings. Once that was complete we were able to have Wifi networking on the Linux side.

Linux on the eReader

The first step is to enable the Wifi, this option should be on the main menus.

eReaders have great battery life when they are used as an eReader, however when they are 100% on Wifi their battery life will be more like a standard tablet, with 5-6 hours of life.

The eReader has a floating keyboard so you can do some work directly on the unit, but doing an ssh connection from a PC is definitely easier.

The menuing on the eReader will vary based on the OS that is loaded. On our Kobo, the Debian OS used the awesome window manager. To add items into the menus look for the file: .config/awesome/rc.lua . We added two extra entries, one for a Python app and the second for a Browser kiosk app :

-- This is in the /awesome/rc.lua menu file
-- ...

menuapps = {
   { "MyApp","/my_path/g4.py"},
   { "MyWebpage","/my_path/mywebpage.sh"},
   { "Firefox", "firefox" },
   { "FBReader", "fbreader" },
   { "Calculator", "xcalc" }
}

Python on an eReader

For our first Python test app we wanted to :

  • 100% fill the eReader screen
  • Find different Font sizes that worked well on an eReader
  • Have a large “Close” button.
# Simple Tkinter Clock
#
from Tkinter import *
import time

def update_clock():
        now = time.strftime("%H:%M")
        lbl_time.configure(text=now)
        today = time.strftime("%A %B %d")
        lbl_date.configure(text=today)
        window.update()
        window.after(5000, update_clock)

window=Tk()

lbl_time=Label(window, text="", font=("Helvetica", 128))
lbl_time.pack()
lbl_date=Label(window, text="", font=("Helvetica", 64))
lbl_date.pack()
btn=Button(window, text="Close",font=("Helvetica", 32),bg='grey', command=window.destroy)
btn.pack()

window.title('Kitchen Kiosk')
window.geometry("800x600+0+0")
window.attributes("-fullscreen", True)
window.after(1000, update_clock)
window.mainloop()

We found that it took a bit of time to play with font sizing and gray tones before we had something that we liked. Our final Python app used weather data from our Home Assistant Node and we built some custom gauges.

Kiosk Browser App

Our second app showed a custom web page that collected data from a Raspberry Pi and our Home Assistant node.

The plan was to show the data on the web browser in full screen or kiosk mode on the eReader.

To run Firefox in kiosk mode:

firefox --kiosk http://mysite/thepage.htm

On our eReader the browser was iceweasel, which is a lighter weight browser which unfortunately does not support kiosk mode. A workaround for browsers that don’t support kiosk mode is to use xdotool which allows you to simulate mouse and keyboard actions. We wrote a script that opened iceweasel and then re-positioned the window:

#!/bin/bash
# mywebpage.sh - open web browers to our page and go full screen

iceweasel http://192.168.0.111:8080/ &
sleep 15
xdotool key F11

Final Comments

The Debian OS that we loaded on our eReader was fairly old and it didn’t support Python 3.7 or Firefox, but we found alternatives and we still could make it work.

If your applications doesn’t need to be constantly updated, for example only check weather and stocks every 15 minutes or so, then you could turn on the Wifi, get the data, then turn off the Wifi. This could greatly increase the battery life on the eReader.

5 thoughts on “Re-purpose an eReader

  1. Marek, This is an awesome project!
    Congratulations! I am able to set this up on the Tolino Shine from 2014. I have two questions:
    1. How can I chsnge the screen resolution to 758 x 1024 Pxl?
    2. Can you give me user:password to ssh into the device?

    Kindest regards, Friedhelm

    Like

      1. Hi Pete, great advices, thank you:
        1. ssh – works fine.
        2. Screen size configuration – unfortunately I can’t find any entry related to screen size definiton, can you give some more hints?

        Thanks again, Friedhelm

        Like

      2. Hi, unfortunately we gave our old eread to a neighbour kid, so I don’t have a test system anymore.

        I was looking at some of my notes. I might look at the Debian menu option. Also I found this thread:

        https://spacebums.co.uk/awesome-window-manager-part-4/

        Another good place to check would be:

        ~/.scripts/awesome_display_layout.sh

        A side comment. We found working on the eRead to be awkward. So we did all our testing on a linux laptop and then we used scp to move files back and forth. I can’t remember if we ssh-ed with the -X option, but this would display the X apps on our laptop.

        I hope that this helps.
        Cheers
        Pete

        Like

Leave a comment