The print queue that reported success and printed nothing
There is a Canon imageRUNNER ADVANCE C5550 on my floor. I could reach its web interface, so I expected adding it to my Arch machine to be straightforward. CUPS accepted the queue and reported every test job as completed, but the copier printed nothing.
Finding out what it speaks
I started by checking which ports the copier exposed:
for p in 631 9100 515 80 443; do
timeout 2 bash -c "echo > /dev/tcp/10.0.0.50/$p" 2>/dev/null \
&& echo "$p OPEN" || echo "$p closed"
done
Port 631 was closed, so I could not use IPP for a driverless setup. The desktop print dialog had not found the machine either. Port 9100 was open, so I tried a raw socket queue.
Next I used SNMP to check which document formats the copier could handle:
snmpget -v1 -c public 10.0.0.50 1.3.6.1.2.1.1.1.0
snmpwalk -v1 -c public 10.0.0.50 1.3.6.1.2.1.43.15.1.1.2
The first returns Canon iR-ADV C5550 /P. The second returns a column of bare
integers, which decode through the PrtInterpreterLangFamilyTC enum: 3 is
PCL, 6 PostScript, 47 PCL-XL, and 54 PDF.
PDF is the useful one. If the copier renders PDF natively, CUPS can hand it PDF
and skip rasterising entirely, which means the Generic PDF PPD that ships with
cups-filters is all the driver I need — no proprietary Canon package:
sudo lpadmin -p iR-ADV-C5550 \
-v socket://10.0.0.50:9100 \
-P /usr/share/ppd/cupsfilters/Generic-PDF_Printer-PDF.ppd \
-o PageSize=Letter -o Duplex=DuplexNoTumble -o ColorModel=color -E
The queue appeared idle with no errors. I sent a test page, and CUPS moved it to the completed list, but nothing came out of the copier.
Completed means transmitted
A socket:// queue sends the job over a TCP connection to port 9100. The
backend can report whether the transfer succeeded, but it gets no job ID or
confirmation that the document printed.
For a raw queue, “completed” means that the job was transmitted. CUPS cannot distinguish a copier that accepted and printed the job from one that accepted and discarded it.
The copier’s own job log showed why it had discarded mine:
5015 Error 09/14/2026 10:56:03 AM Printer Print <user> 0 0 0 x 0 #701
Canon's #701 is "the Department ID does not exist, or the PIN is incorrect".
The copier had Department ID Management enabled — the accounting feature that
makes a shared machine demand an ID and PIN before it will do anything. My job
arrived with no credentials, so it was logged and binned. Zero pages.
The TCP transfer had succeeded, so CUPS had no error to report.
The credentials go in the job
Canon’s Windows and macOS drivers have a Department ID field. The generic Linux PPD has no equivalent, so I needed to add the credentials to the job’s PJL header.
Canon accepts them through a proprietary extension:
@PJL COMMENT CANPJL SET USERID = 1234567
@PJL COMMENT CANPJL SET USERPWD = 1234
USERID is the Department ID and USERPWD is the PIN. I found these in a
support-forum post about an imageRUNNER 4570. They are not documented in Canon’s
published PJL reference, so I needed to test them on this copier.
Since CUPS would report success either way, I needed a way to verify the result on the device.
Verifying the print with SNMP
This copier exposes its lifetime page count over SNMP:
snmpget -v1 -c public -Ovq 10.0.0.50 1.3.6.1.2.1.43.10.2.1.4.1.1
The counter comes from the copier and records printed pages. Checking it before and after the test would tell me more than the queue status.
I read the counter, sent a PDF with the PJL header, and read it again.
%-12345X@PJL JOB NAME="cups-test"
@PJL COMMENT CANPJL SET USERID = 1234567
@PJL COMMENT CANPJL SET USERPWD = 1234
@PJL ENTER LANGUAGE = PDF
...pdf bytes...
%-12345X@PJL EOJ
%-12345X
The counter rose from 455686 to 455687. Printer status changed to printing(4)
and back to idle(3), while hrPrinterDetectedErrorState remained 00 00. The
copier had printed the requested sheet, confirming that the commands worked.
Making it permanent
A one-off script is not a print queue. To get this into normal lp and the GTK
print dialog, the header has to be prepended to every job, which means a CUPS
backend.
The backend is a shell script at /usr/lib/cups/backend/canondept, used with a
canondept://host:9100 device URI. It adds the PJL header and pipes the job
into the stock socket backend:
{
printf '%s%%-12345X@PJL JOB NAME="%s"\r\n' "$ESC" "$jobname"
printf '@PJL COMMENT CANPJL SET USERID = %s\r\n' "$deptid"
printf '@PJL COMMENT CANPJL SET USERPWD = %s\r\n' "$pin"
printf '@PJL ENTER LANGUAGE = PDF\r\n'
if [ -n "$file" ]; then cat "$file"; else cat; fi
printf '%s%%-12345X@PJL EOJ\r\n%s%%-12345X' "$ESC" "$ESC"
} | DEVICE_URI="socket://$host:$port" /usr/lib/cups/backend/socket \
"$job" "$user" "$title" "$copies" "$opts"
This reuses CUPS’s existing retry, timeout, and connection handling.
The credentials file and backend permissions need care:
The credentials do not go in the device URI. It is tempting to write
canondept://host?pin=1234 and read it back from $DEVICE_URI. Don't: lpstat -v is readable by every local user, so that publishes the PIN to anyone with a
shell on the box. A separate 0600 root:root file keyed by hostname costs ten
lines and keeps it out of reach.
The backend must be 0700 root:root. CUPS uses the file’s permissions to
decide whether to run it as root. If it is readable by group or other, CUPS runs
it as lp instead. This backend needs root to read the credentials file; with
broader permissions, it starts but cannot load those credentials.
CUPS discovers backends at startup, so I needed systemctl restart cups after
installing the new script.
What this setup does not give you
The Generic PDF PPD covers duplex, colour, paper size and resolution. It does not
cover finishing — no stapling, no hole-punch, no secure print, none of the things
a copier of this class can physically do. Those live in Canon's UFR II driver
(cnrdrvcups-lb in the AUR), which also has a proper Department ID field and
would make the whole backend unnecessary. It is a much heavier install, and if
all you want is paper with your document on it, the generic route is fine.
Department ID accounting also records who printed each job. The backend passes
the title and username through @JOBN and @USER, so the copier’s
administrator can see the filenames. Rename a document before printing if its
filename contains something private.
Checking the device
The device’s job log explained the failure as soon as I checked it. I had spent too long treating a successful transfer as evidence that printing worked.
For a raw port 9100 queue, I now check the device’s job log and page counter when a job disappears. This is the counter OID I used:
snmpget -v1 -c public -Ovq <printer> 1.3.6.1.2.1.43.10.2.1.4.1.1