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

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

Introduction

NOTE: This is my best attempt to explain the project, but it's moving fast an constantly breaking. Read the project logs as I'll update them more frequently than this description. For the most up-to-date info, check the project's repository. Particularly the dev branch.

The goal of the project is simple: democratize e-books. Instead of repeating what I've already written, read the first project log to understand the ethos of this project.

Hardware Stack

If you read the note above, you know this project is moving fast. If you read the project log, you know I'm still trying to decide what hardware platform to use. Most versions are designed around the Raspberry PI HAT and carrier board, but there is a repository with code that runs on both the Raspberry Pi and Pine A64-LTS with no hardware changes.

The project works with two different e-papers: GDEW042T2 and GDEY042T81. Both are 4.2" displays and 4 color grayscale. The project also includes a touchscreen and backlight. FT6336 controls the touchscreen and TPS61165 controls the backlight. The carrier board PCB includes lithium ion battery charging and boosting using the BQ24075 (charger),  BQ27441-G1 (fuel gauge), and TPS63701 (5V boost).

Software Stack

MuPDF

The heart of this project 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 eReader 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. The first commercial book marketplace I plan to integrate with is Libreture, a bookshop and e-book cloud library.

Conclusion

I'll repeat the above disclosure: all of the above is probably out of date by the time you're reading this. Check the project logs and project repository for the latest info.

piEreader-HAT-BOM.csv

Version 0.5.1

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

Download

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

Download

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

Download

  • 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 »

  • Touchscreen Assemblies Have Arrived!

    Guyrandy Jean-Gilles09/29/2023 at 06:46 0 comments

    I ordered GDEY042T81-FT02 earlier in September and didn't expect it to ship for ages, but they've arrived in just 2 weeks! I also ordered the DESPI-C03 development board also made by Good Display to ease development.

    Read more »

View all 15 project logs

Enjoy this project?

Share

Discussions

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