Micron Document
Papyrix reader

I bought an e-reader not too long ago. It's an Xteink4 (esp32 based device with an e-ink display). I flashed it with the open source Papyrix reader firmware. The software has a built-in web server for pushing media to it, but I find it cumbersome. Oddly, no one seems to have any convenient scripts for copying stuff onto it. It's either run a clunky web server and click through a browser or pop out the SD card (watch out, it's spring loaded...) and copy stuff to it like some kind of cave man.

a script was born

I fired up a browser, viewed the source, found my way to the form it used, double checked with the source, and came up with a decent idea of how it worked. Then I fumbled around with Python for a while to tinker with the web UI. So far, I have a script that can push files to it. I still have to launch the WiFi File Transfer thing on the device, but now I can send files to it without having to fight with a web browser. An hour or three of tinkering with the source, cleaning it up, adding argument parsing, and now I have a script that can be used to send one or multiple files to the e-reader. I used it to push a bunch of files over the last few days so the interface seems totally natural to me. But probably only to me. I was documenting how to use it in a README and I realized it may not be an entirely straightforward application.

stripping seems totally sensible

I wanted to support sending a file to a specific location. The sort of thing I'd want to do if I only had one new file to copy into place in a specific location. And so that was the first thing I implemented. I had it make use of the local file path as part of the destination. This sparked the need for a second argument of what to strip off the path. Sure, I could have just added an argument for where to put the file, but I wanted the input file name to be preserved. But I didn't want to recreate my entire file hierarchy on the device, just part of it. So I added a T383838strip argument that peels away elements form the start of the input file path in choosing the target location to put the file.

This makes it possible to do something like:

T282828
upload --ip device-ip --path /mnt/some/long/path/library/fiction/asprin/myth_01_another_fine_myth.epub --strip /mnt/some/long/path/library

And the result puts the specified book under the specified author in a similar hierarchy on the device.

I also had an argument for the remote root directory, so I could also do something like:

T282828
upload --ip device-ip --path myth_01_another_fine_myth.epub --remote-root /library/fiction/asprin

recursive motive

Why two cumbersome arguments? Well, they don't both have to be used, but having them means I don't have to be in the directory with the work, and I don't have to painstakingly recreate a hierarchy to follow on the target because I can pull it from the file hierarchy AND I can trim off anything I don't want to have in it.

Or, more succinctly, I can do something like this:

T282828
find /mnt/library -exec upload --ip device-ip --path Tff7b72{Tff7b72} --strip /mnt/library --recursive


And everything get's sync'd to the device and preserves the hierarchy it's in without having to do any surgery on the paths.

what else does it do?

That's pretty much it. Just pushes a file or files to a device. I plan to add logic to read and fully synchronize content, like pull down files from the device to put them in a local library and even check file sizes and correctly resume canceled transfers without having to re-push everything. I'll also add an option to trim files from the remote device that don't exist in the library. And maybe a backup option that will make it fetch those files before deleting them.

where is it

I'm putting up next to my other project repos. For now it's just a script and a README. I'll make a proper package out of it later.

clone via reticulum from: T383838rns://2f39d6e1f8809bc8e3db071c5de9e989/public/papyrix-sync.git clone via https: T383838https://git.thatit.be/papyrix-sync.git/

And because the nomadnet and rnsgit links are different, here's the lxmf link to all the projects.

Tags: index

Tags
Navigation





created: 2026-06-01

(re)generated: 2026-07-17