Native printing to reMarkable.
Go to file
Jonas Große Sundrup d1fe37662a
socket-activate printer
Previous to this commit, the printer needs to continuously run in the
background, even if it doesn't do much most of the time, to keep the
socket open and handle incoming connections. This commit hands over
handling the open socket to systemd and the printer-code gets started by
systemd only when there is something incoming on the socket. The printer
itself then takes over the socket from systemd, handles the incoming
data and exits afterwards, returning socket management to systemd again.

This reduces running processes as well as the memory footprint of the
running system.
2020-12-29 14:30:30 +01:00
.gitignore add download_prebuilt target 2020-07-12 18:26:11 -05:00
img.jpg add image 2020-10-20 18:37:42 -05:00
install.sh socket-activate printer 2020-12-29 14:30:30 +01:00
main.go socket-activate printer 2020-12-29 14:30:30 +01:00
Makefile socket-activate printer 2020-12-29 14:30:30 +01:00
printer.service socket-activate printer 2020-12-29 14:30:30 +01:00
printer.socket socket-activate printer 2020-12-29 14:30:30 +01:00
README.md cleanup readme 2020-12-20 23:00:26 -06:00
remarkable.ppd change name in ppd 2020-12-18 01:01:16 -06:00

remarkable_printer

Print natively to your reMarkable wirelessly with no extensions or reMarkable cloud.

Quick Start

Connect the reMarkable via USB and make sure it has internet access.

Connect to the reMarkable with SSH and execute

wget -O - http://raw.githubusercontent.com/Evidlo/remarkable_printer/master/install.sh | sh

Then configure your OS to print to the reMarkable, shown below.

Adding the reMarkable as a printer

Linux/OSX (easy)

make install_config host=10.11.99.1

Linux (manual)

We will add the reMarkable as an Appsocket/JetDirect printer and use the PDF printer driver.

Linux

$ sudo system-config-printer
# Add > Network Printer > AppSocket/HP JetDirect
# Enter the address/hostname of the device (10.11.99.1 for USB connected device)
# Forward > Generic > Forward > PDF > Forward
# Set the printer name and save

OSX (manual)

See Add a network printer by its IP address. Choose HP Jetdirect for the protocol.

Windows (manual)

See here

Caveats

No authentication, so keep WiFi off while not in use.

How it works

Virtually all network printers accept raw Postscript/PDF data on TCP port 9100 via the Appsocket/HP Jetdirect protocol. Sometimes this data is preceded by a few plaintext lines telling the printer information such as the print job name and print settings.

This script simply listens on TCP 9100 and waits for a PDF header, then begins saving data to a pdf file (while also creating the accompanying .metadata file). The output filename is extracted from the print job name line, if it exists.

Testing on host

$ make printer.x86
$ ./printer.x86 -h
Usage of ./printer.x86:
  -debug
        enable debug output
  -host string
        override bind address (default "0.0.0.0")
  -port string
        override bind port (default "9100")
  -restart
        restart xochitl after saving PDF
  -test
        use /tmp as output dir

Debugging

journalctl --unit printer -f