[cups-devel] job status monitoring for AppSocket

Sam Hanes sam at maltera.com
Tue Jul 12 06:50:00 PDT 2016

Hi All,

I have an HP LaserJet printer with an EIO JetDirect card set up in CUPS 
via AppSocket (socket://printer:9100). It prints fine, but CUPS marks 
the job completed as soon as it finishes sending the PostScript data. I 
want it to report the printing status page-by-page and not mark the job 
completed until the last page is in the output tray. Extensive 
Google-ing hasn't revealed a documented way of getting that in CUPS.

Based on my reading of the printer's manuals, the correct way to do job 
status monitoring for jobs submitted via AppSocket is the USTATUS 
mechanism in HP's Printer Job Language (PJL). I've tried grepping the 
CUPS sources for various PJL-related strings, but nothing turned up that 
looks like it handles PJL USTATUS messages. All I see are things related 
to setting job options via PJL and the PPD `*JCL` mechanism.

I'm using CUPS 1.7.2-0ubuntu1.7 installed from APT on Ubuntu 14.04, but 
I repeated my search on git master as of 0f2f21a with the same results.

I also did a similar search in the sources of HPLIP, HP's official CUPS 
driver. Their 'hp' backend does do a few things with PJL USTATUS, but it 
doesn't report page progress and doesn't seem to handle reporting job 
completion correctly.

I'm therefore assuming that CUPS doesn't currently support job status 
reporting for printers using the `socket` backend unless it's supplied 
by the driver, and HP doesn't supply it. Am I missing something?

I've started playing around with implementing a filter that adds a PJL 
wrapper to the job, handles USTATUS reports via `cupsBackChannelRead`, 
and passes them on with 'PAGE:' and 'STATUS:' messages. Is that the 
correct approach for adding this kind of thing?

Right now I'm writing it as a port monitor since that sounds like the 
right kind of filter based on what little documentation exists, but 
since the built-in BCP and TBCP port monitors handle encoding and not 
status monitoring I'm not sure. Should this be a port monitor or a 
regular filter? If it should be a regular filter, how should I set that 
up in the PPD?

Is this something that should be contributed to CUPS proper?

The work-in-progress filter can be found here:

Sam Hanes
sam at maltera.com

More information about the cups mailing list