simplify config install

This commit is contained in:
evan 2020-03-11 02:45:44 -05:00
parent 4747014eae
commit 2b975d5951
5 changed files with 18 additions and 30 deletions

View file

@ -19,16 +19,18 @@ install: printer.arm
systemctl restart printer
ENDSSH
.PHONY: fetch_prebuilt
fetch_prebuilt:
wget https://github.com/evidlo/remarkable_printer/releases/latest/download/printer.zip
.PHONY: install_prebuilt
install_prebuilt: fetch_prebuilt install
.PHONY: release
release: printer.arm printer.x86
rm -f printer.zip
zip printer.zip ./ -r
.PHONY: install_config
install_config:
sudo cat printer.conf >> /etc/cups/printers.conf
sudo lpadmin -p reMarkable \
-E \
-o printer-error-policy=abort-job \
-v socket://$(host) \
-m lsb/usr/cupsfilters/Generic-PDF_Printer-PDF.ppd
clean:
rm printer.x86 printer.arm
rm -f printer.x86 printer.arm printer.zip

View file

@ -12,15 +12,15 @@ Assuming you have Go installed, simply run (with reMarkable connected via USB)
This will install and start the printer service on the reMarkable.
If you don't have go, you can download and unzip the precompiled binary from the releases page to this directory then run the above command.
If you don't have go, you can download and unzip the precompiled release from the releases page to this directory then run the above command.
## Adding the reMarkable as a printer
#### Linux (easy)
Modify printer.conf and change 10.11.99.1 to your reMarkable's address/hostname, then run
Set `10.11.99.1` to your device's address or hostname.
make install_config
make install_config host=10.11.99.1
#### Linux (manual)
@ -38,6 +38,10 @@ Linux
See [Add a network printer by its IP address](https://support.apple.com/guide/mac-help/add-a-printer-on-mac-mh14004/mac). Choose `HP Jetdirect` for the protocol.
#### Caveats
No authentication, so keep WiFi off while not in use.
## Testing on host
$ make printer.x86

BIN
img.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 KiB

After

Width:  |  Height:  |  Size: 225 KiB

View file

@ -117,6 +117,7 @@ func handleRequest(conn net.Conn) {
// Read until start of PDF
for {
line, err := reader.ReadString('\n')
debug(line)
if err == io.EOF {
fmt.Println("Invalid PDF")
os.Exit(1)

View file

@ -1,19 +0,0 @@
<Printer reMarkable>
UUID urn:uuid:77d88be7-90e7-3118-7e09-b994d16aa1b6
Info Generic PDF
Location
MakeModel Generic PDF Printer
DeviceURI socket://10.11.99.1:9100
State Idle
StateTime 1583907058
ConfigTime 1583907058
Type 4124
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>