打印机无法向 CUPS 报告问题

Printers fail to report issues to CUPS

CUPS 有 3 个用于问题报告的字段,

  1. 打印机状态(枚举):空闲、正在处理或已停止。
  2. printer-state-message:纯文本人类可读解释。
  3. printer-state-reasons:列出了打印机状态的描述,如 RFC8011 第 152 页所述,这是真正的问题报告发生的地方。它有一个逗号分隔的关键字列表,描述打印机的状态,例如。 'media-needed' 或 'toner-low'

当使用 Zebra EPL2 标签打印机驱动程序在 Ubuntu 16.04(和 mac 但让我们暂时保持简单)测试 Zebra LP 2844 时,我得到以下结果。

----Printer out of paper----
Status Enum: processing
Status Message: printer-state-message: 1 textWithoutLanguage {Waiting for 
printer to become available.}
Status Reason: printer-state-reasons: 1 keyword {none}

----Printer rejecting jobs----
Status Enum: idle
Status Message: printer-state-message: 1 textWithoutLanguage {Rejecting Jobs}
Status Reason: printer-state-reasons: 1 keyword {none}

如您所见,'Printer out of paper' 问题和大多数阻止打印机打印的问题解决为 'processing' 并且从不给我更多信息。您可以计算出打印机已经使用了多长时间 'processing' 并从那里推断出是否存在问题,但除了卡顿之外,问题的原因仍然未知。

与此同时,'Printer rejecting jobs' 状态绝对没有告诉我任何信息(请记住,状态消息只是人类可读的纯文本,并且由于没有关于放在那里的内容的指南而无法解析)。除了雇人阅读状态消息外,我的程序无法知道存在问题。

并不是所有的打印机都是这样,例如,这是兄弟 HL-L2380DW 的输出

----Printer out of paper----
Status Enum: processing
Status Message: printer-state-message: 1 textWithoutLanguage {Waiting for job to complete.}
Status Reason: printer-state-reasons: 2 keyword {cups-waiting-for-job-completed, media-needed-error} 

在目前测试的 3 台打印机(HP、Brother 和 Zebra)中,Brother HL-L2380DW 是唯一能够正确传达问题的打印机。如果你想自己测试,你可以 运行 我在 java https://github.com/Vzor-/cupstool 中一起使用的这个粗糙的 CUPS 工具 更多数据有帮助!

不知道是杯子的问题还是厂家的问题。无论哪种方式,我都需要一条前进的道路,无论是作为修复还是我可以帮助修复的团队。

编辑:Zebra 似乎不制造或维护自己的 Linux 驱动程序。

来自 Michael Sweet,

Kyle,

Status reporting is complicated, but in general the problem with driver-based queues can come from the driver not implementing STATE: message support (typically because the printer's communication channel does not provide support) or from the printer itself not supporting any kind of status reporting.

In the case of the Zebra printer, it does not support in-band status reporting so the CUPS-bundled driver has no way of getting status from the printer that way. It also does not support the SNMP Printer MIB for status, so we don't even get out-of-band status... :/ Sadly, these kind of printers often do not support status reporting, which is funny given that many are deployed in industrial settings where remote monitoring is common...

Printers that implement IPP (typically all printers these days except label printers - so 98%+ of printers) support the IPP printer-state-reasons keywords for status, in addition to other IPP attributes and (in many cases) SNMP Printer MIB properties as well.

看来这主要只是一些标签打印机的问题。