Up to Date

Create a kiosk display from an old eReader to show data culled from home automation, Raspberry Pis, and Arduinos.

My daughter and I looked at trying to repurpose an old eReader. Our goal was to make a kitchen kiosk display that would show 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, Home Assistant, and Raspberry Pi nodes (Figure 1).

F01-er_data.tif
Figure 1: Sources of data for an eReader in kiosk mode.

In this article, we look at how to install Linux on an eReader and look at eReader Python apps and kiosk-mode web browser pages.

Getting Started

For this project, we used a Kobo Mini eReader, so the procedure to load a new operating system will vary somewhat according to the eReader model and manufacturer you use.

First, crack open the eReader. The operating system (OS) and data are stored on a microSD card (Figure 2). You should keep the original SD in case you ever need to roll back to the original setup.

F02-opened_ereader.tif
Figure 2: The microSD in the Kobo Mini eReader.

eReaders have two main OS choices: Android or Linux. For the requirements of this project, we determined that Linux would be a cleaner option. A Debian image for Kobo eReaders can be found online. If you are trying to repurpose other brands of eReaders, some good how-to guides are available (e.g., for Kindle eReaders ).

Installing Debian Linux

A number of different tools can help you move and copy OS images. Raspberry Pi users like to use the Raspberry Pi Imager (rpi-imager) utility, which runs on Linux, Windows, and macOS. To install it on Linux, enter:

sudo snap install rpi-imager

The Use custom option lets you put the Debian Linux image on an SD card (Figure 3).

F03-pi_imager.tif
Figure 3: Make an eReader-bootable SD card with the Raspberry Pi Imager utility.

Depending on your eReader and the OS you are using, you might be ready to go after the new microSD card is installed into the eReader. Unfortunately, for our Kobo Mini installation we needed to take another step that moved some files from the original SD chip to the new SD chip:

# insert the original microsd
sudo dd if=/dev/mmcblk0 bs=512 skip=1024 count=1 of=/your_path/original.img
# insert the new microSD with the Debian image
sudo dd if=/your_path/original.img bs=512 seek=1024 count=1 of=/dev/mmcblk0

This added step provides all the files required for a clean double-boot installation (Figure 4).

F04-ereader_boot.tif
Figure 4: The eReader can now dual-boot to either the original Kobo software or Debian Linux.

eReader Setup

Now that the OS is installed, you should be able to enable WiFi from the main menus (Figure 5). eReaders have great battery life when they are used as an eReader; however, when they use WiFi 100 percent of the time, their battery life is more like that of a standard tablet.

F05-eread_page.tif
Figure 5: Linux on eReader.

The eReader has a floating keyboard, so you can work directly on the unit; however, an SSH connection from a PC is definitely easier.

The next step is to add custom apps to the eReader menus. Although we did all our programming remotely, this step allowed us to run and test the apps without an SSH connection.

The menuing on the eReader will vary according to the OS being used. On the Kobo, the Debian OS used the Awesome window manager. Awesome menus are defined in the file .config/awesome/rc.lua. Figure 6 shows two extra entries: one for a Python app and the second for a browser kiosk script.

F06-menu0.tif
Figure 6: Adding apps to the eReader menus.

Python on an eReader

The first Python test was to create a full-screen date/time app (Listing 1). This test app showed that fast screen updates were not possible and that it’s important to use large buttons for any type of screen access (even to close the app).

Listing 1: Python Test App

01 # Simple Tkinter Clock
02 #
03 from Tkinter import *
04 import time
05
06 def update_clock():
07 now = time.strftime("%H:%M")
08 lbl_time.configure(text=now)
09 today = time.strftime("%A %B %d")
10 lbl_date.configure(text=today)
11 window.update()
12 window.after(5000, update_clock)
13
14 window=Tk()
15
16 lbl_time=Label(window, text="", font=("Helvetica", 128))
17 lbl_time.pack()
18 lbl_date=Label(window, text="", font=("Helvetica", 64))
19 lbl_date.pack()
20 btn=Button(window, text="Close",font=("Helvetica", 32),bg='grey', command=window.destroy)
21 btn.pack()
22
23 window.title('Kitchen Kiosk')
24 window.attributes("-fullscreen", True)
25 window.after(1000, update_clock)

Once the basics were worked out, we created a Python app that showed weather data from a Home Assistant node (Figure 7). It took a bit of time to play with font sizing and gray tones before we had something that we liked.

F07-ereader_gauges.tif
Figure 7: Weather data on an eReader.

Kiosk-Mode Browser

Another approach for viewing data is to use the eReader as a web client and use another node as the data collector and web server (in this case, a Raspberry Pi). To maximize the eReader screen, the web browser can be used in full-screen or kiosk mode.

To run Firefox in kiosk mode, enter:

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

For this project, we used Iceweasel, which is a lighter weight browser than Firefox; however, it does not support kiosk mode. A workaround for such browsers is to use xdotool to simulate mouse and keyboard actions. Install the xdotool utility on Debian and Ubuntu via

$ sudo apt-get install xdotool

The following script opens Iceweasel and then sends the F11 key to open the browser page in full-screen mode:

#!/bin/bash
# open a web browser to our page and go full screen
#
iceweasel http://our_webserver:80/ &
sleep 15 ; # wait for things to come up
xdotool key F11

The Kobo screen is 800x600, so we had to play with the presentation and font sizes. Figure 8 shows an example web page with local weather and stock market information. 

F08-ereader_web1.tif
Figure 8: eReader in Kiosk mode.

Final Comments

It’s always nice to reuse or repurpose older equipment. We found that for projects that don’t need a fast screen update, an eReader can be an excellent viewer for data fed from a Raspberry Pi or Arduino.

Battery life can be increased by toggling the WiFi on and off when you need to refresh the data.

Listings for this article can be found here.