Print Daemon (papermintd)
🌿 Print Daemon (papermintd)
Section titled “🌿 Print Daemon (papermintd)”papermintd is a lightweight native HTTP microservice daemon built on Tokio and Axum. It runs as a local background service on POS terminals, kiosks, or kitchen display systems, allowing web applications, mobile devices, and browser-based point-of-sale software to print via standard JSON HTTP requests.
Why Use a Print Daemon?
Section titled “Why Use a Print Daemon?”Web browsers (Chrome, Safari, Firefox) run in a sandboxed security model that prevents web pages from opening raw TCP sockets to Port 9100 or claiming raw USB devices.
papermintd runs locally (e.g. http://localhost:8080) as a print sidecar:
- Your web app or Electron POS makes a simple
fetch('http://localhost:8080/api/print'). papermintdreceives the JSON ticket, compiles it into ESC/POS or StarPRNT bytes in ~10μs, and delivers it over USB, TCP, or Serial.- Your web app can query real-time sensor telemetry (
paper empty,cover open) viaGET /api/status.
Running the Daemon
Section titled “Running the Daemon”# Launch with default port (8080)cargo run --package papermint-daemon
# Launch with custom host and portPORT=9100 HOST=0.0.0.0 cargo run --package papermint-daemonComplete API Reference
Section titled “Complete API Reference”For the full list of endpoints, request models, and curl examples, see the Daemon REST API Reference.