Close
0%
0%

DIY ePUB Reader

ESP32 + ePaper = Kindle

Public Chat
Similar projects worth following
I've been working on this for a while - it's an ePUB reader for the ESP32. Seems to work with a variety of ePUB files that I've downloaded from Gutenburg and supports PNGs and JPGs in the content. Layout is pretty naive at the moment but could be easily improved.

What is it? It's a DIY ePub reader for the ESP32.

It will parse ePub files that can be downloaded from places such as Project Gutenberg.

It has limited support for formating - the CSS content of the ePub file is not parsed, so we just use the standard HTML tags such as <h1>,<h2> etc.. and <b> and <i>.

I've only included 4 font styles - regular, bold, italic and bold-italic. I've also only generated glyphs for Latin characters and punctuation.

Why did you build it?

It seemed like a nice challenge - ePub files are not the most friendly format to process on an embedded device. Making it work in a constrained environment is good fun.

Can you contribute/help?

Yes - please try the project out on any e-paper boards that you have and open up pull requests if you get it working with any fixes.

And if you find bugs, feel free to report (or better yet, fix!) them :)

How to get it?

Make sure you clone recursively - the code uses git submodules.

git clone --recursive git@github.com:atomic14/esp32-ereader.git

What boards does it work on?

This Firmware can be build currently for 3 different environments:

Lilygo and M5 are the easiest options to start with since the hardware part is already solved. The benefit of M5 EPD is that it comes with an SD Card reader. Is possible also to upload the ePub books in the SPIFFs section of the ESP32 but there is limited space.


But it should work on any eInk display provided it has:

  • PSRAM - parsing the ePub files needs a fair amount of memory
  • 3 Buttons - these buttons can be active high or low
    • UP - moves up in the list of ePubs or to the previous page when reading
    • DOWN - moves down in the list of ePubs or to the next page when reading
    • SELECT - opens the ePub currently selected ePub file or goes back to the ePub list from reading mode
  • An SD Card - you can jury rig an SPI sd card using the instructions (check related YouTube videos)
  • [Optional] A battery if you want it to be portable

Porting to other boards

All the configuration is in platformio.ini using pre-processor directives. If you do add a new board then please create a new section in platofmrio.ini with the appropriate pre-processor directives for your board and open a pull request to add it to the project - I'm happy to answer any questions on this.

The important settings are the following:

The first two settings come from the vroland/epdiy library and defined the ePaper display that is being used.

; Setup display format and model via build flags
-DCONFIG_EPD_DISPLAY_TYPE_ED047TC1
-DCONFIG_EPD_BOARD_REVISION_LILYGO_T5_47

The second three settings are the pins that are used for the buttons. Change these to match your board.

; setup the pins to use for navigation
-DBUTTON_UP_GPIO_NUM=GPIO_NUM_34
-DBUTTON_DOWN_GPIO_NUM=GPIO_NUM_39
-DBUTTON_SELECT_GPIO_NUM=GPIO_NUM_35

There is also a setting to tell the code if the buttons are active high or low.

; buttons are low when pressed
-DBUTONS_ACTIVE_LEVEL=0

We have the pins for the SD card. I've got a video on how to hack an SD Card and connect it as a SPI device here

; setup the pins for the SDCard
-DSD_CARD_PIN_NUM_MISO=GPIO_NUM_14
-DSD_CARD_PIN_NUM_MOSI=GPIO_NUM_13
-DSD_CARD_PIN_NUM_CLK=GPIO_NUM_15
-DSD_CARD_PIN_NUM_CS=GPIO_NUM_12

And finally we have the ADC channel that the battery voltage divider is connected to:

; the adc channel that is connected to the battery voltage divider - this is GPIO_NUM_35
-DBATTERY_ADC_CHANNEL=ADC1_CHANNEL_0

How does it work?

Epub files are a bit of a pain to parse. Despite the file extension epub, they are actually zip archives containing multiple files. To read the file I'm using a nice zip library from here: lbernstrone/miniz. This library has been modified to work...

Read more »

  • 1 × Select one of this 3 options Note that EPDiy controller needs a supported epaper and hardware buttons + SD Card reader
  • 1 × LilyGo-EPD47 or ESP32 based ePaper display board (Does not have an SD Card reader)
  • 1 × M5 epaper or Comes with a built-in SD card reader
  • 1 × EPDiy board (V6 version is better) Needs to be ordered in PCBWay or JLCPCB

  • New epdiy version 7

    Martin Fasani10/29/2023 at 07:38 0 comments

    New version of epdiy board v7 is about to be merged:

    https://github.com/vroland/epdiy/pull/251

    This uses faster esp32S3 with 8 MB PSRAM and the new LCD module. Before this version it used a quite hacky I2S method to send parallel data (I2S is usually used for Audio)

    I‘ve tested this and I can say that is the fastest Espressif parallel epaper controller to date. So I‘ve though it would be great to make a custom PCB and add an SDCard to it. Then we could have a great hardware for this project.

    I’m fabricating currently a custom epdiy v7 PCB (still no MicroSD support) that you can find in Tindie

View project log

  • 1
    Pull the repository and library dependencies
    git clone --recursive https://github.com/atomic14/diy-esp32-epub-reader.git
    
  • 2
    Select the platform io environment you want to build (lilygo_t5_47, m5_epaper or epdiy)

    Editing the default_envs = epdiy or building for that environment

    Editing the default_envs = ENVIRONMENT
    or building for that environment directly
  • 3
    Only if the supported hardware has no SD-Card reader, add some ePubs to the /data directory and upload them with Platformio
    pio run -t uploadfs

View all 4 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

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