Syncs KOReader reading progress from a PocketBook to Calibre-Web Automated (CWA) without Wi-Fi on the e-reader: the progress goes over Bluetooth Low Energy to an iPhone app, which pushes it to CWA whenever it has Internet.
About 30 times less battery than leaving Wi-Fi on to sync: Wi-Fi left on adds 19 % to the e-reader's draw while reading; BLE sync adds under 1 % (measured).
%%{init: {"theme": "base", "themeVariables": {"primaryTextColor": "#063F3F", "lineColor": "#0A6E6E", "clusterBkg": "#D3ECE9", "clusterBorder": "#5FA8A3", "titleColor": "#063F3F", "edgeLabelBackground": "#D3ECE9"}}}%%
flowchart LR
subgraph reader["PocketBook · KOReader"]
plugin["<b>pigeon.koplugin</b><br/>queues progress<br/>scans, connects, writes"]
end
subgraph phone["iPhone · Pigeon app"]
gatt["<b>GATT service</b><br/>stores progress"]
end
subgraph server["Server · CWA"]
kosync["<b>/kosync</b>"]
end
plugin -- "BLE" --> gatt
gatt -- "HTTPS: GET, then PUT if newer" --> kosync
classDef step fill:#0A6E6E,stroke:#063F3F,color:#FFFFFF
class plugin,gatt,kosync step
The e-reader is the BLE central because its kernel cannot advertise (see docs/hardware.md). The iPhone app exposes the service and keeps it alive in the background.
cwasync already syncs to CWA over Wi-Fi, but only while the e-reader has Wi-Fi: either left on while reading, or turned on by hand (and an iPhone hotspot enabled by hand when away from home). This project removes both:
-
Battery. Measured on a PocketBook Verse Pro, then scaled to an hour of reading at one page a minute:
Extra draw Per hour of reading Wi-Fi left on ( cwasync)+16 mA, all the time ≈ 16 mAh, +19 % BLE sync, every 20 pages +19 mA for 30 s per sync ≈ 0.5 mAh, under +1 % No radio stays on: Bluetooth is switched on for about 30 s per sync, then fully off (
netagent bt offstops the chip), and Wi-Fi stays off. Figures are orders of magnitude from one run; method in docs/battery.md. -
Works anywhere the iPhone is. The phone brings the Internet connection; no hotspot to enable.
-
Offline-safe. Progress waits on the e-reader until the iPhone acknowledges it, then on the iPhone until CWA is reachable.
Download both files from the latest release.
KOReader plugin. Unzip pigeon.koplugin.zip into koreader/plugins/ on the e-reader, then restart KOReader.
iOS app. Pigeon-unsigned.ipa is unsigned: install it with AltStore or Sideloadly, which sign it with your Apple account. With a free account the signature lasts 7 days; AltStore renews it automatically. You can also build from Xcode (ios/Pigeon.xcodeproj).
Open the app once, tap the gear and enter your CWA URL, username and password. The password stays in the iOS Keychain and never goes over Bluetooth.
Read as usual. The plugin syncs:
- every N pages (default 20, set in Pigeon › Sync every N pages, 0 to disable);
- when you close a book and when the e-reader wakes up;
- on demand with Pigeon › Sync now, or a gesture bound to Pigeon: sync now.
A sync takes about 30 s. Manual syncs show Synchronisé à HH:MM; any sync that cannot reach the iPhone shows iPhone introuvable and keeps the progress for the next attempt.
Leave the app in the background. iOS relaunches it when the e-reader writes, even after it has been suspended, but never after a force-quit from the app switcher.
- Same book identity as CWA. The plugin sends KOReader's
partial_md5_checksum,progressandpercentage, computed like CWA's owncwasync.koplugin. - Late relays never overwrite newer reads. CWA timestamps progress on receipt, so the app first
GETs the server's progress and onlyPUTs if its own is newer. - Read time survives a wrong e-reader clock. The app dates each read as
received_at − (sent_at − captured_at), using only the gap between the two e-reader timestamps. - Nothing is lost. The plugin keeps the latest progress per book until the app acknowledges the write.
| Service | 947694FE-0425-4E30-84BC-FB783E781EAD |
progress characteristic |
1FD42B59-27A4-49F9-B36B-C1D0F9C445B2, write with response, unencrypted |
One JSON object per write (long write, kept under 512 bytes):
{"v":1,"document":"9e107d9d…","progress":"/body/DocFragment[12]/…","percentage":0.4567,
"device":"PocketBook Verse Pro","device_id":"…","title":"Dune","author":"Frank Herbert",
"captured_at":1794680000,"sent_at":1794680582}No encryption: the kernel cannot resolve the iPhone's rotating address, so a bond would never be reused, and reading positions are not sensitive.
| Path | What |
|---|---|
pigeon.koplugin/ |
KOReader plugin (main.lua) and the BLE sender it runs in the background (pigeon.sh, gatttool) |
ios/ |
SwiftUI app; ios/cwa-check/run.sh checks the CWA upload logic against a fake server |
docs/hardware.md |
What the PocketBook can and cannot do over Bluetooth |
tools/power-test.sh |
Battery test behind docs/battery.md |
CI builds the plugin zip and an unsigned IPA on every push. Pushing a v* tag publishes both as a release.
A weekly job compares the CWA files this project mirrors (cwasync.koplugin, progress_syncing) with the versions pinned in .github/upstream.lock, and opens an issue when they change. After checking compatibility, pin the new versions with .github/scripts/upstream-check.sh --update.
- Force-quitting the iOS app stops syncing until it is reopened (iOS rule).
- In a place with many Apple devices, the iPhone may fall outside the 8 candidates the e-reader tries. An iPhone advertising the Pigeon service in the background comes first.
- Progress only flows from the e-reader to CWA; pulling progress read elsewhere is not implemented.


