None of the below is particularly original. That’s kind of the point.
Paper
I’m addicted to paper. When reviewing documents I prefer to print them out and scribble on them. That’s all well and good in an office located on a planet with infinite trees, but I find myself in neither of those situations.
As a programmer, I also find it useful to scribble things down on paper, point at various scribble marks and ask people questions. I do enjoy making carefully perfected, data generated, diagrams with arcane tools. But scribbling is a necessary precursor.
I’ve had my eye on the ReMarkable Tablet for a while. It’s a tablet computer with a pressure-sensitive pen input and an e-ink screen, about A5 size. The makers of this device are as resolute about what it is meant to be, as what it isn’t. It is meant to provide an experience as close as possible to writing on paper. It isn’t meant to be almost anything else.
The main interface is a blank piece of paper. You can choose whether you want it lined squared or a dozen other backgrounds. You can choose what kind of pen or pencil you want to use. You can turn the page back and forth. These are collected into multi-page documents (called ‘notebooks’).
It takes the ‘paper’ abstraction as a hard limit. All other features could in theory be done with paper, scissors, glue and a printer.
You can insert pages; select, cut and paste bits of drawings; read and draw on PDFs; and download your files. That’s really about all there is to it.
It would be tempting to add all kind of features, but they haven’t and, as far as I tell, won’t. I respect them for that.
Paper trail
Working from home, with neither a printer nor colleagues to hand, traditional group scribbling sessions were out of the window.
And with dozens of assorted documents to read, I found myself increasingly thinking about the ReMarkable. Walking the familiar journey from “that’s an extravagence” to “I’m going to get one, aren’t I?”.
Reader, I was.
I’ve wanted an e-ink screen attached to some kind of computer and pen for a longer time than I’ve known about the ReMarkable. A big part of the attraction was that whilst the software was purist (even puritanical) about what it does and doesn’t do, they haven’t hidden the fact that it’s a full little linux computer running under the hood. It’s open for connections by default, no tweaking required.
A community of enthusiasts and hackers has sprung up to make all kinds of modifications and hacks. I made a bargain with myself: I can use it for my daily notebook and for reading as it was designed, but only if I try, at least once, to do something weird with it too.
So bargin duly struck, I found myself buying one. I got a refurbished version 1 model.
I must say, they succeeded brilliantly in their stated aims. It gets as close to writing on paper as I can imagine. I’m reviewing and highlighting documents far more happily than on a laptop screen. I recommend it, if you buy into the minimalist value proposition.
The clock started ticking on the less serious side of the deal.
Pipes
One of the things that any UNIX enthusiast will tell you is that “everything is a file”. This is one of those day-to-day things about working with Unix-like operating systems like Linux or Mac OS. You use exactly the same code to read from a file on disk as you can a stream of data (whether that’s the output of another program, a stream of random numbers, or the data coming from a sensor).
Another feature, called ‘pipes’, allow you to send this data between programs and files in any combination. It’s a powerful abstraction.
I had a an idea.
What’s life for?
I must confess at this point that a large part of the reason I did this was to see what I could hack together.
I’m not the only person to have had the idea of trying to replicate the ReMarkable screen on my computer screen so I could scribble. There is an official screen-sharing app, but you need to sign up for an account, and I didn’t on principle. There are also a couple of live-streaming open source packages too. reStream is good at sharing the screen. I used it for a bit, but it was too slow and, at the latest software update got even slower.
In any case, I didn’t need to replicate the entire contents of the screen. I just needed to share a live ephemeral scribble on a video call long enough for someone to point out what I forgot.
I also had a priority that the parent of a young child will recognise: the need for a small project that I could complete in one evening and give a sense of achievement. Whilst I did get enough functionality working in one evening to take the following picture, I did take a week of evenings to get it to the point where I’d like to share it. But the project was as much about the journey as the destination.
Bringing abstractions together
So we have two abstractions. Paper and pipes. I spent a few hours trying to hack things together and it was absurdly easy.
The Python script listens for a web browser to connect via a websocket (which is a data pipe designed to send live data from a server to a web browser). When this happens it makes an SSH conection (a data pipe designed to allow one machine to send instructions and data back and forth between computers). Within that SSH session it listens on the data file, which gets live data from the pen digitiser. The binary sensor data is decoded into X, Y and pressure messages, sent to the browser.
There was a bit of tinkering to do with smoothing out the points.
It works!
It works quite well. I can connect (via wifi) and get a browser window up. My drawing is repeated in the browser. For bonus points there’s a hover indicator so I can point at stuff.
I’m astounded at how little code it takes to make this all work. But the code only works because it’s dealing with ancient concepts and a tower of other people’s code making them work. It was incredibly satisfactory to take disparate parts and join them together using the same set of abstractions.
There are a million other things I could add, including allowing colleagues to draw on the screen and have it replicarted both ways. But I think I’ll take a leaf out of the ReMarkable team’s notebook, and keep it simple.
Try it out
Feel free to try it out. All it needs is Python 3 (with a couple of dependencies) and a little SSH setup. Nothing to install on the tablet itself.
Gitlab repo: https://gitlab.com/afandian/pipes-and-paper/