RollCast/User Guide/Printing from another device

Printing from another device

Send jobs to this phone over the network from a script, a till or a web page.

With the print server on, this phone accepts jobs over the network and relays them to the printer it is connected to. Four ways in, each on its own port and each switched on separately in the app.

PortWhat it is
8443Paired devices. Bearer token over TLS; pair once with the QR code.
8080Browser page and JSON API. Password, not encrypted.
6310IPP, for Add Printer on Windows, macOS and Linux.
9100Raw ESC/POS, like a network printer. No password is possible.

Raw ESC/POS

Exactly what a network thermal printer accepts. The bytes are passed through untouched.

Shell
cat receipt.bin > /dev/tcp/192.168.1.20/9100

The JSON API

Content-Type decides how the body is treated, or set type= to be explicit.

Shell
curl -X POST "http://192.168.1.20:8080/api/v1/print?type=text" \
  -u "web:ABCD-EFGH-JKLM" \
  -H "Content-Type: text/plain; charset=utf-8" \
  --data-binary @receipt.txt

202 means the job is spooled and on its way, not that it is on paper: a thermal printer working through a queue can outlast any sensible timeout. Poll /api/v1/jobs if you need the outcome.

StatusMeaning
202Accepted and queued.
401 or 403Wrong password, or the device is not allowed.
404That printer is not shared.
413The document is larger than the limit.
429Too many jobs; retry after the given delay.
503The printer needs attention, for example out of paper.

CUPS

Shell
lpadmin -p RollCast -E -v ipp://192.168.1.20:6310/ipp/print -m everywhere
lp -d RollCast receipt.pdf

Tip

Ports below 1024 cannot be used by an app, so IPP is on 6310 rather than 631. Devices that discover the printer by name pick that up on their own; typed addresses need the port.