mirror of
https://github.com/Evidlo/remarkable_printer.git
synced 2024-10-20 03:27:37 -04:00
simplify config install
This commit is contained in:
parent
4747014eae
commit
2b975d5951
18
Makefile
18
Makefile
|
@ -19,16 +19,18 @@ install: printer.arm
|
||||||
systemctl restart printer
|
systemctl restart printer
|
||||||
ENDSSH
|
ENDSSH
|
||||||
|
|
||||||
.PHONY: fetch_prebuilt
|
.PHONY: release
|
||||||
fetch_prebuilt:
|
release: printer.arm printer.x86
|
||||||
wget https://github.com/evidlo/remarkable_printer/releases/latest/download/printer.zip
|
rm -f printer.zip
|
||||||
|
zip printer.zip ./ -r
|
||||||
.PHONY: install_prebuilt
|
|
||||||
install_prebuilt: fetch_prebuilt install
|
|
||||||
|
|
||||||
.PHONY: install_config
|
.PHONY: install_config
|
||||||
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:
|
clean:
|
||||||
rm printer.x86 printer.arm
|
rm -f printer.x86 printer.arm printer.zip
|
||||||
|
|
10
README.md
10
README.md
|
@ -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.
|
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
|
## Adding the reMarkable as a printer
|
||||||
|
|
||||||
#### Linux (easy)
|
#### 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)
|
#### 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.
|
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
|
## Testing on host
|
||||||
|
|
||||||
$ make printer.x86
|
$ make printer.x86
|
||||||
|
|
BIN
img.jpg
BIN
img.jpg
Binary file not shown.
Before Width: | Height: | Size: 490 KiB After Width: | Height: | Size: 225 KiB |
1
main.go
1
main.go
|
@ -117,6 +117,7 @@ func handleRequest(conn net.Conn) {
|
||||||
// Read until start of PDF
|
// Read until start of PDF
|
||||||
for {
|
for {
|
||||||
line, err := reader.ReadString('\n')
|
line, err := reader.ReadString('\n')
|
||||||
|
debug(line)
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
fmt.Println("Invalid PDF")
|
fmt.Println("Invalid PDF")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
19
printer.conf
19
printer.conf
|
@ -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>
|
|
Loading…
Reference in a new issue