Raspberry Pi print server: run a cloud print agent on a Pi
Turn a Raspberry Pi into a print server: install the printer in CUPS, then run the Linux agent. There is no separate Pi image. Raw jobs use lp -o raw.
For People using a Pi instead of a desktop as the print host
Overview
PrintBase does not publish a Raspberry Pi appliance image. A Pi is a Linux machine. Install the printer in CUPS until lp can print a test page, then run the Linux agent with the API key or an account login. The Pi must stay on.
Raw jobs on Linux go through lp -o raw. PDF jobs go through lp without that flag. A PDF still needs a CUPS filter that can render it. If PDF prints as garbage, fix CUPS before you blame the API.
PrintNode's public pricing page also lists the Pi as a client host. That is their client. This page is only the PrintBase Linux agent on a Pi.
Integration steps
- 01
Make CUPS print locally
lp -d QueueName test.pdf should work before the agent is involved.
- 02
Run the Linux agent
Configure the server URL if you are not using the default https://api.printbase.cloud.
- 03
Read the code
GET /v1/printers from your server. Use POST /v1/print-jobs with Authorization: Bearer and the printer_code from GET /v1/printers.
- 04
Power
A Pi that loses power is AGENT_OFFLINE. Use a supply that stays up.
Node.js
// Job printed by the agent on the Pi
const res = await fetch('https://api.printbase.cloud/v1/print-jobs', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRINTBASE_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': idempotencyKey,
},
body: JSON.stringify({
printer_code: Number(process.env.PRINTER_CODE),
content_type: 'pdf',
content: pdf.toString('base64'),
copies: 1,
}),
});
if (!res.ok) throw new Error(`PrintBase ${res.status}: ${await res.text()}`);
const job = await res.json();
// { id: "job_abc", status: "queued" }
Details for this setup
lp -o raw
That is how the agent submits raw content on Linux. The queue must accept raw. The agent prints only what you send; it does not fetch the document from the platform for you.
No desktop required
The agent is a process. A monitor is not required after setup. The agent prints only what you send; it does not fetch the document from the platform for you.
Questions
Is there an official Pi image?
No image is described in this product. Use the Linux agent. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.
Wi-Fi dropouts?
They look like AGENT_OFFLINE. Ethernet is dull and effective.
Can the Pi replace a cloud printer?
It can host the agent for printers CUPS can drive. It is still a computer you maintain.
32-bit versus 64-bit?
Use the Linux build that matches the OS you installed. Check the download page for the architectures that are actually published.
Free plan: 100 jobs a month on one computer, no card.