Close
0%
0%

FLOSS Book Serving System

An open-source ereader that can display books from an open, self-hosted server

Similar projects worth following
This (still unnamed) project aims to allow book lovers to read books from an ereader they can fully customize and read books from a server they fully control.

Paying Bills

PCB Way Logo

PCBWay graciously offered to sponsor this project. They are quite thorough with their file approval process to avoid any surprises once boards ship. Thanks PCBWay!

Introduction

The goal of this project is simple: democratize e-books. instead of repeating what I've already written, read the first project log to understand the ethos of the project. I'm writing this nearly a year after publishing that project log and I can happily say I now have a proof-of-concept for a cloud-to-hardware open source e-reading solution. For granular details take a look at the project's repository.

Hardware

Below is a high level system diagram and schematic of the project.

The heart of the e-reader's hardware is the Raspberry Pi Compute Module 4. The e-paper is GDEY042T81-FT02 from Good Display, which includes a front-light and a touchscreen. The e-paper communicates to the Compute Module via SPI. The TPS61165 from Texas Instrument's drives the front-light and the Compute Module controls brightness via PWM. A 1250 mAh lithium polymer battery powers the project. BQ24075 charges the battery, BQ27441 monitors the battery's status and reports to the Compute Module via I2C, and the TPS63701 boosts battery voltage to 5V.

Now, I would be remiss if I did not mention The Open Book by Joey Castillo. The e-paper driver he released is copy-and-pasted in this project and largely reduced the hardware hurdles nee

There is also a Raspberry Pi Hat (pre Pi 5 form factor) as well, but the carrier board is the true form factor.

Software

Below is a high level system diagram for the software

Software system diagram

I mentioned in the intro that this project is a proof-of-concept and I'd say the most proof-of-concept-y component is the software. It's pretty meh honestly. One of the reasons I stopped updating the project was I effectively was writing an e-reader OS from scratch. The firmware for the peripherals in the hardware section (i.e driving the e-paper, reading the touchscreen, etc.) can be used as a known-good working example. The UI and application code... maybe don't use.

A would go into detail about the each software file but again... it's not very good so instead I'll talk about the major libraries and tech stacks used.

MuPDF

The heart of this project's application code is MuPDF. A comprehensive document rendering library that supports just about every e-book format. It reads documents from the filesystem, lays out the document for the screen dimension, and outputs a pixel map. The library also compiles to 60+ MB so centering this project on a microcontroller is out of the question. This leads us to the next part of the technical stack.

LVGL

Light and Versatile Graphic Library is designed for embedded systems. I could've used the Linux frame buffer to drive the e-paper display, but writing the GUI with LVGL allows me to easily port to a microcontroller if I can squeeze down MuPDF capabilities to a flash chip. Also, sending LVGL widgets to the e-paper display was much more straight forward than the frame buffer device.

Calibre

Just about every e-book lover reading this has heard of Calibre, an all in one e-book management software. You can read e-books, edit metadata, purchase e-books, and even self-host a book server. The latter is how Calibre comes into this project. The software allows one to run a web server that makes a book library available on a local network or on the world wide web with port forwarding. Put you don't need Calibre to serve books. In fact, there's an open spec for digital distribution.

OPDS

The Open Publication Distribution System is an open, decentralized way to present machine-readable catalogs to e-reader clients. If that went over your read, OPDS is to e-books as RSS feeds are to podcasts. That's an oversimplification, but it's my laymen explanation. OPDS is how the project fetches books from Calibre, and thus, the project can fetch books from any OPDS compatible server.

Quick Reference Guide

Front-light...

Read more »

piEreader-HAT-BOM.csv

Version 0.5.1

Comma-Separated Values - 980.00 bytes - 12/15/2023 at 02:00

Download

piEreader-carrier-board-BOM.csv

Version 0.5.1

Comma-Separated Values - 2.58 kB - 12/15/2023 at 01:56

Download

Version 3 Demo.mp4

MPEG-4 Video - 21.26 MB - 08/14/2023 at 21:21

Download

  • The Last Update

    Guyrandy Jean-Gilles07/17/2024 at 01:43 0 comments

    Last update, I talked about choosing embedded Linux over a micro-controller to continue this project and how I would be playing with Buildroot to better understand that system. I've done that and WOW! (Almost) all the firmware functionality you've ever wanted has been pre-written for you to use for free... if you figure out how to configure the kernel. Getting a bare image of Buildroot is fairly straight forward, but I got lost in configuration hell trying to setup all the peripherals on the existing prototype.

    This made me take a step back and ask why I was down this path. The whole reason I had decided on embedded Linux vs a micro-controller was adding audio to the project would require more than userspace GPIO manipulation. After investigating other commercial e-readers, almost none of them have a 3.5mm audio jack, but instead rely on connection to a Bluetooth device. This is the route I went, and by the time you're reading this, the project description will be updated with exactly how this is done.

    This is the last update because the project does everything I want it to do at this point. It can read ebooks, play audiobooks, and sync with a remote server to download books. It is by no means polished, but it's the proof of concept I wanted to make when I began this idea.

  • The Biggest Limitation to a Micro-controller Based E-reader

    Guyrandy Jean-Gilles04/17/2024 at 16:24 0 comments

    Last project log I discussed trying to reduce MuPDF to a size that could fit on memory reasonable for a micro-controller. Thankfully, the library's maintainers designed it so including or removing certain modules is as simple as changing a single configuration file. With the help of the maintainers, and their excellent documentation, I quickly realized that the size of the library is not due to the code itself but an artifact of the fonts included.

    Removing all the fonts dropped a test program (desktop, not embedded) from 40MB to 5MB with no other optimizations. Now, an e-reader with no fonts is not very useful. So I looked for small font families and slammed into a old problem. As of writing this, Unicode contains 149,878 characters. However, only 65,535 characters can be in a True Type font file. As a result, no single font family can represent all Unicode text an e-reader might encounter from an arbitrary book file.

    There are attempts to make a uniform typeface for all writing systems like Google Noto or GNU Unifont. But, for example, all the GNU Unifont OpenType fonts are ~12MB and the Google Noto fonts are ~10MB. Even ambitious projects like Joey Castillo's Babel use 2MB to represent Unicode's basic multilingual plane (65,520/149,878 characters as of version 15). EPDiy, an ESP32-based e-Reader project, requires editing the source to add or change fonts. Other generic micro-controller font libraries, like OpenFontRender for the Arduino ecosystem, MCUFont, or mcu-renderer require preprocessing the fonts on the host machine before programming the target device--almost always reducing the subset of characters that can be rendered.

    Simply put, fonts take a lot of storage. A micro-controller certainly can represent all the Unicode characters, but, given the low resource environment, it makes the most sense to limit the characters that can be rendered.

    I started down this path to decide if I should continue this project with a embedded Linux system or with a micro-controller system. Given the project's goal: democratizing e-books, supporting as many characters sets as possible is a priority. Thus embedded Linux is the better path to follow.

    My first step down this path is getting familiar with Buildroot, a tool that simplifies embedded Linux configuration. There are lots of examples for the Raspberry Pi boards, but I plan on eventually moving away from them to a custom board with a different chipset. There probably won't be any new hardware or software features for a while as I figure out Buildroot. Maybe I'll write up a getting started guide once I find a configuration I like. We'll see. Wish me luck.

  • Bringing Up Version 0.5.1

    Guyrandy Jean-Gilles03/31/2024 at 20:19 0 comments

    I sent this version to fab in November of 2023, but didn't finish bringing up major board components until recently.

    Read more »

  • GUI Based Wifi Configuration

    Guyrandy Jean-Gilles02/29/2024 at 05:42 0 comments

    Software

    Despite the title, this is a hodge-podge update. The first concrete achievement I can boast is two new additions to the status bar: a clock and a Wifi menu.

    Read more »

  • User-Defined Book Servers

    Guyrandy Jean-Gilles01/31/2024 at 02:03 0 comments

    Happy New Year! I didn't work on this project much during the holidays and I realized I've had at least one project update a month since keeping this log. So I thought I'd put together what I've been working on. This will entirely be a software update and, as of writing this, the code is still in the development branch because it's not the cleanest implementation, but it's functional.

    Read more »

  • This eReader has a Touchscreen and Backlight!

    Guyrandy Jean-Gilles12/15/2023 at 00:05 0 comments

    The new CM4 and HAT PCBs for the GDEY042T81-FT02 are in and by and large they work. I still have to troubleshoot some hardware/firmware, but the project now has portable power, a touchscreen, and backlight.

    Read more »

  • PCB Layout for GDEY042T81-FT02

    Guyrandy Jean-Gilles11/24/2023 at 19:35 0 comments

    The latest PCB revision is on it's way to fabrication and there are lots of changes to note.

    Read more »

  • Bringing Up GDEY042T81-FT02

    Guyrandy Jean-Gilles11/09/2023 at 00:35 0 comments

    I'll skip to the happy ending. I can drive the display, the back light, and can read data from the touch screen, but achieving those milestones took much much longer than it should've. This update won't have much info on the actual e-reader project but is more a rant reflection on mistakes made while bringing up GDEY042T81-FT02 so I, and hopefully you, don't repeat them. Buckle up.

    Read more »

  • The First Attempt at Portable Power

    Guyrandy Jean-Gilles11/02/2023 at 13:19 0 comments

    The boards with lithium polymer charging are back and I've got mixed news: they mostly work. I ordered two (sponsored) designs from PCBWay: a dedicated lipo charger and a eReader carrier board with integrated lipo charging.

    Read more »

  • A Much Needed Refactor

    Guyrandy Jean-Gilles10/20/2023 at 04:49 0 comments

    I'm still waiting on the latest hardware revision to manufacture, so in the mean time I've been refactoring the code to be more modular and follow separation of concerns. The requirement that forced this task was writing firmware for the GDEY042T81-FT02 touchscreen sub-assemblies from Good Display. Previously, the project relied on the structure of code from Waveshare for the GDEW042T2. Moving away from Waveshare's structure to thin abstractions will make porting Good Display's vendor code to this project much easier.

    Here's an example. The project now has an abstraction layer for the e-paper aptly called "display.c/h" that contains the following function:

    Read more »

View all 16 project logs

Enjoy this project?

Share

Discussions

Szybet wrote 07/18/2024 at 07:28 point

400x300 display... Ouch :/

Maybe you will be interested: https://github.com/Quill-OS/quill

  Are you sure? yes | no

Helen wrote 10/24/2023 at 19:07 point

This is a fantastic idea! I can't even imagine how long it took you to implement this. For a writer who constantly works with many books while creating research papers for students at https://edubirdie.com/ the ability to set up an open source e-reader and access the books from your own server would be pretty helpful. I'll keep an eye on the project updates. Good luck

  Are you sure? yes | no

Cyril Hrubis wrote 10/20/2023 at 08:19 point

Just FYI I working on widget library and software stack that runs, among other things, on 1bpp e-ink. And I do have quite a bit of apps in the development, including terminal, dictionary, music player and more. See https://github.com/gfxprim

Here is a dictionary running on RPi with waveshare e-ink shield: http://metan.ucw.cz/outgoing/gpdict-eink.jpg

Also note that gfxprim library has hardware independent driver for e-ink display and I'm going to add support for more displays. There is Linux spidev driver and Linux gpio driver and the display driver is build on the top of these two:

https://github.com/gfxprim/gfxprim/blob/master/libs/backends/linux/gp_linux_spi.h

https://github.com/gfxprim/gfxprim/blob/master/libs/backends/linux/gp_linux_gpio.h

https://github.com/gfxprim/gfxprim/blob/master/libs/backends/linux/gp_display_waveshare_7_5_v2.c

And there is also an abstraction for lazy display updates that makes slow e-ink somewhat usable with interactive work such as terminal.

  Are you sure? yes | no

Guyrandy Jean-Gilles wrote 10/20/2023 at 15:02 point

Cool project! Can the library target micro-controllers? Looks like there's a hard Linux dependency.

  Are you sure? yes | no

Cyril Hrubis wrote 10/20/2023 at 15:29 point

There is an work-in-progress port to FreeRTOS that I play with just for fun, however to be honest I think that having an Linux OS beneath make things much more easier if you want have even basic apps, such as music player and book reader. Not to mention for stuff like IRC client one needs a network stack...

  Are you sure? yes | no

Guyrandy Jean-Gilles wrote 10/20/2023 at 21:05 point

Yeah, a proper OS has made things much easier. At this stage in the project I'm trying to keep dependencies to a minimum. Thanks for sharing the library though!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates