Don't recycle your ePaper: repurpose that old eReader
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) 26 window.mainloop()
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.
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. To install the xdotool
utility on Debian and Ubuntu, enter:
$ 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.
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.
Infos
- Home Assistant: https://www.home-assistant.io
- Debian images for Kobo Mini: https://www.dropbox.com/sh/snsdg1c5cg21kws/AACCAhhLxg5G5OmSgngw3DxYa
- "How to Jailbreak Your Kindle" by Thorin Klosowski, Lifehacker, July 21, 2016, https://www.lifehacker.com.au/2016/07/how-to-jailbreak-your-kindle
- Awesome window manager: https://awesomewm.org/
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.
News
-
Arch Linux 2023.12.01 Released with a Much-Improved Installer
If you've ever wanted to install Arch Linux, now is your time. With the latest release, the archinstall script vastly simplifies the process.
-
Zorin OS 17 Beta Available for Testing
The upcoming version of Zorin OS includes plenty of improvements to take your PC to a whole new level of user-friendliness.
-
Red Hat Migrates RHEL from Xorg to Wayland
If you've been wondering when Xorg will finally be a thing of the past, wonder no more, as Red Hat has made it clear.
-
PipeWire 1.0 Officially Released
PipeWire was created to take the place of the oft-troubled PulseAudio and has finally reached the 1.0 status as a major update with plenty of improvements and the usual bug fixes.
-
Rocky Linux 9.3 Available for Download
The latest version of the RHEL alternative is now available and brings back cloud and container images for ppc64le along with plenty of new features and fixes.
-
Ubuntu Budgie Shifts How to Tackle Wayland
Ubuntu Budgie has yet to make the switch to Wayland but with a change in approaches, they're finally on track to making it happen.
-
TUXEDO's New Ultraportable Linux Workstation Released
The TUXEDO Pulse 14 blends portability with power, thanks to the AMD Ryzen 7 7840HS CPU.
-
AlmaLinux Will No Longer Be "Just Another RHEL Clone"
With the release of AlmaLinux 9.3, the distribution will be built entirely from upstream sources.
-
elementary OS 8 Has a Big Surprise in Store
When elementary OS 8 finally arrives, it will not only be based on Ubuntu 24.04 but it will also default to Wayland for better performance and security.
-
OpenELA Releases Enterprise Linux Source Code
With Red Hat restricting the source for RHEL, it was only a matter of time before those who depended on that source struck out on their own.