r/pocketbook

Learning EPUB and e-ink by replacing the PocketBook SDK with pure Go

Learning EPUB and e-ink by replacing the PocketBook SDK with pure Go

Hello,

I wanted to learn how an EPUB becomes pages on a screen, and whether PocketBook's SDK could be replaced with pure Go, without cgo.

Claude Code wrote the code. My part was steering it so the code stays easy to follow, and having it write documentation that teaches each part . I'm sharing it because I learned a lot.

- Device: instead of libinkview, a static Go binary draws into /dev/fb0, triggers e-ink refreshes with MXCFB ioctls, and talks to the firmware over System V message queues and shared memory.

- EPUB: a small layout engine with a CSS cascade, hyphenation, bidi, CJK, tables, MathML, SVG and pagination.

It's not meant for production: use KOReader for that. Nothing in a book is executed or fetched (no JS, no WebAssembly), so it's reasonably safe to try.

Code: https://github.com/CedricHerzog/inkshelf

u/Agreeable_Eye7556 — 4 days ago

What is a good bluetooth page turner without one of those clips?

I have a pretty thick case so I don't think a remote with a clip would work. For my other eReader, I bought a tolino flip, but it's unfortunately not compatible with Pocketbook.

reddit.com
u/the-bi-frost — 5 days ago
▲ 18 r/pocketbook+2 crossposts

Free2 remote working with KOReader on PocketBook Verse Pro color (fix: firmware update + volume key mapping)

I got a Free2 remote working with KOReader on my PocketBook Verse Pro. Sharing the steps in case it helps someone else.

The problem

In the native PocketBook reader, the Free2 connected but disconnected after ~3 pages, and then skipped 2-3 pages on the next press.

In KOReader it showed up as a connected HID device in the Bluetooth settings, but KOReader received no input at all.

The fix

Update the Free2 firmware to version F2-462clj. I connected the remote to a PC and used the manufacturer’s desktop app to update it: https://hanlinyue.com.cn/1768540873343

Remap the buttons in the desktop app so they send Volume Up and Volume Down instead of the default keys. This is what makes the remote visible to KOReader.

Tell KOReader what those keys mean. Create the file koreader/settings/event_map.lua with:

return

{

[103] = "LPgBack",

[105] = "LPgBack",

[104] = "LPgBack",

[114] = "LPgBack",

[165] = "LPgBack",

-- înainte

[106] = "LPgFwd",

[108] = "LPgFwd",

[109] = "LPgFwd",

[115] = "LPgFwd",

[163] = "LPgFwd",

[57] = "LPgFwd",

[28] = "LPgFwd",

}

Restart KOReader completely, connect the remote, and the buttons turn pages.

Notes

115 and 114 are the Linux key codes for Volume Up and Volume Down. The same trick works for other cheap Bluetooth page turners (I used the same file for an AB Shutter 3), you only need to know which key code the remote sends.

I haven’t tested whether the native PocketBook reader behaves better after the firmware update, so the page skipping there may still be a firmware issue on PocketBook’s side.

Swap the two codes if you want the buttons reversed.

PS : the app is in Chinese but I can change it to English

Hope this saves someone a few hours!

u/Dear_Storage7405 — 5 days ago

Where to buy books?

I'm planning to get a Verse Pro, this week, to replace my deprecated Kindle. I get most of my books via Libby, but if I want to buy some books I gather Pocketbook can't access Amazon? Where would I buy from?

Sorry to be so naive.

reddit.com
u/Full-Photo5829 — 14 days ago