Printer status feedback

I’ve been asked about this, so here is a brief summary of the current abilities and limitations of Fedora 8 regarding printer status feedback i.e. getting errors and warnings (paper out, low ink, that sort of thing) to the person who needs to know.

The task breaks down into two parts:

  1. Getting the status from the printer to the local CUPS server
  2. Notifying the local user (or admin) about the issue

CUPS implements IPP, which incorporates a mechanism for storing and advertising this sort of information in a printer attribute named printer-state-reasons. This is a text string containing comma-separated keywords describing the severity and type of problem. CUPS maintains its own list of printer state reasons for each printer it manages. The first part of the printer status feedback task is to get the status from the printer into the local CUPS server’s printer-state-reasons attribute for that printer.

For locally connected printers it is up to the backend (e.g. usb, or hp for HPLIP) and/or the driver (e.g. the gutenprint IJS plug-in) to discover any problems with the printer. Currently on Fedora 8 this is limited to the hp backend, which can report all sorts of errors and warnings including paper-out and ink-low. The usb backend is capable of discovering paper-out conditions if there is kernel support for discovering them, but this support is not yet in the Fedora kernel. No other drivers included in Fedora 8 provide printer status.

For networked IPP printers (including remote CUPS machines with printers attached), when a job is submitted to CUPS it runs the ipp backend to transport the job to the remote machine. This backend watches the progress of the job at the destination device and periodically fetches the printer-state-reasons attribute, copying it locally. This way, the printer-state-reasons attribute from the remote printer propagates back to the local machine.

For all other networked printers there is no status feedback.

The second part of the status feedback task is to notify the user that there is a problem. There are two ways this can be done. Firstly, CUPS provides a “notification” mechanism, so that individual IPP events (such as printer-state-changed, which occurs each time the printer-state-reasons attribute is changed among other things). This can be configured to send an email to a nominated email address for each event. However, this would also include normal status changes so is no good on its own for notifications of problems such as paper-out and ink-low.

The other way this can be done is to have a program that polls the CUPS server for the printer-state-reasons attributes and displays user notifications when appropriate. This is what we do for Fedora, and the program is part of the system-config-printer package.

The way this job applet behaves is as follows. It gets started as part of the user’s login session, and listens for a D-Bus signal from CUPS to say that something has changed (currently this is very much a catch-all D-Bus signal but there are plans for improving that). Each time it catches a D-Bus signal it fetches the list of running jobs owned by the current user. When there are such jobs, the printer-state-reasons attribute is fetched for each relevant printer. Each time a new reason is seen, a notification bubble is displayed to the user describing the problem and indicating its severity.

As a special case, the “connecting-to-device” keyword can be used to detect printers that are not accepting jobs. Normally the connecting-to-device reason is added to the printer-state-reasons attribute before connecting, and removed once connected — so its presence does not indicate an error in itself, but could indicate an error if it does not go away after a short while. If the job applet sees this keyword present over a 60 second period it will display a user notification suggesting that the printer is disconnected or unplugged.

So, that’s the current state of affairs for Fedora.  The main area in need of improvement is driver support for detecting printer errors and warnings.

Red Hat Enterprise Linux 5 has the same capabilities as Fedora 8 when it comes to updating the local printer-state-reasons attributes, but it does not include the system-config-printer-applet program.  Instead, the older eggcups program is used and this does not support user notification of printer state reasons.


Posted

in

by

Tags: