好吧,我无法用语言表达我的沮丧;我已经在 HP LaserJet P3015 上使用 Ubuntu 14.04 好几年了,第一年左右我没有遇到任何问题(在多台机器上)。然后,当我也换了机器(我再次安装了 Ubuntu 14.04)时,我首先遇到了打印机首先处于待处理状态,然后打印空白页;现在我甚至无法在这台机器上打印测试页(安装了相对较新的 Ubuntu 14.04)。
首先,我的系统信息:
$ echo $(cat /etc/issue) $(lsb_release -idrc)
Ubuntu 14.04.5 LTS \n \l Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty
$ uname -a
Linux MyPC 4.4.0-109-generic #132~14.04.1-Ubuntu SMP Tue Jan 9 21:46:42 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ apt-show-versions -r hp | grep -v 'flash\|pathplan'
hplip:amd64/trusty-security 3.14.3-0ubuntu3.4 uptodate
hplip-data:all/trusty-security 3.14.3-0ubuntu3.4 uptodate
hplip-dbg:amd64/trusty-security 3.14.3-0ubuntu3.4 uptodate
hplip-gui:all/trusty-security 3.14.3-0ubuntu3.4 uptodate
libhpmud0:amd64/trusty-security 3.14.3-0ubuntu3.4 uptodate
libsane-hpaio:amd64/trusty-security 3.14.3-0ubuntu3.4 uptodate
printer-driver-hpcups:amd64/trusty-security 3.14.3-0ubuntu3.4 uptodate
printer-driver-postscript-hp:all/trusty-security 3.14.3-0ubuntu3.4 uptodate
我从关闭打印机开始,通过 USB 连接到笔记本电脑,关闭笔记本电脑。我打开笔记本电脑,等待 Ubuntu 14.04 启动;系统托盘中自动显示“HPLIP 状态服务”。
我用;设置了一个终端tail -f /var/log/syslog
,然后打开打印机 - 系统日志消息是:
$ tail -f /var/log/syslog
...
Jan 18 15:28:14 MyPC kernel: [ 542.278213] usb 1-1: new high-speed USB device number 11 using xhci_hcd
Jan 18 15:28:15 MyPC kernel: [ 542.491165] usb 1-1: New USB device found, idVendor=03f0, idProduct=8d17
Jan 18 15:28:15 MyPC kernel: [ 542.491175] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan 18 15:28:15 MyPC kernel: [ 542.491180] usb 1-1: Product: HP LaserJet P3010 Series
Jan 18 15:28:15 MyPC kernel: [ 542.491185] usb 1-1: Manufacturer: Hewlett-Packard
Jan 18 15:28:15 MyPC kernel: [ 542.491189] usb 1-1: SerialNumber: HPSER1ALNR
Jan 18 15:28:15 MyPC kernel: [ 542.491497] usb 1-1: ep 0x5 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:15 MyPC kernel: [ 542.491506] usb 1-1: ep 0x81 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:15 MyPC kernel: [ 542.491858] usb 1-1: ep 0x5 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:15 MyPC kernel: [ 542.491866] usb 1-1: ep 0x81 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:15 MyPC kernel: [ 542.496254] usblp 1-1:1.0: usblp0: USB Bidirectional printer dev 11 if 0 alt 1 proto 2 vid 0x03F0 pid 0x8D17
Jan 18 15:28:16 MyPC kernel: [ 543.526808] usblp0: removed
Jan 18 15:28:16 MyPC kernel: [ 543.526816] usb 1-1: ep 0x5 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:16 MyPC kernel: [ 543.526819] usb 1-1: ep 0x81 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:16 MyPC kernel: [ 543.527180] usb 1-1: ep 0x5 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:16 MyPC kernel: [ 543.527184] usb 1-1: ep 0x81 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:16 MyPC kernel: [ 543.527876] usb 1-1: ep 0x5 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:16 MyPC kernel: [ 543.527879] usb 1-1: ep 0x81 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:16 MyPC kernel: [ 543.528180] usb 1-1: ep 0x5 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:16 MyPC kernel: [ 543.528183] usb 1-1: ep 0x81 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 15:28:16 MyPC kernel: [ 543.528655] usblp 1-1:1.0: usblp0: USB Bidirectional printer dev 11 if 0 alt 1 proto 2 vid 0x03F0 pid 0x8D17
此时单击“HP 设备管理器...”显示(单击可查看完整尺寸的图像):
尝试从这里打印测试页 - 首先得到一个空白的“HP 设备管理器”窗口:
...过了一会儿,出现错误:
“HP 设备管理器 - 打印测试页”:
无法与打印机 HP-LaserJet-P3010-Series 通信。
请检查打印机并重试。“hplip”:
HPLIP 设备状态
HP_LaserJet_P3010_系列打印机 (HPSER1ALNR)
设备通信错误 (5012)
关闭“HP 设备管理器 - 打印测试页”(其“打印测试页”按钮被禁用/变灰)
现在“HP 设备管理器”在打印机图标旁边显示一个小红色 X;在“HP 设备管理器”中,单击“(Cups)查看打印机和设备信息”;一段时间后,窗口变灰,得到:
“HP 设备管理器 - 设备信息”:
无法打开设备 hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR。
“HP 设备管理器”,切换到“状态”选项卡,显示“设备通信错误”:
“HP 设备管理器”,切换到“打印机控制”选项卡,显示打印机处于“已启动/空闲”状态:
即将http://本地主机:631/- 打印机选项卡 - 单击打印机;其状态为:“HP-LaserJet-P3010-Series(空闲、正在接受作业、未共享、服务器默认、颜色管理)”:
打开system-config-printer
;右键单击打印机,首先选择“查看打印队列”;然后选择“属性”: - 打印机状态为“空闲”:
单击此对话框中的“打印测试页” - 获得反馈:“已提交”,“已开始打印作业”;打印机状态:“处理中”:
... 但请注意消息“打印机‘HP...’可能未连接。”
过了一会儿,收到“打印作业已完成消息” - 但是:
我们最终得到“打印机属性”/“打印机状态”:“空闲 - 过滤器失败”;和“打印状态”:已暂停;(同样,Cups 界面显示在该打印机的“作业”下,在“状态”字段下:“自 2018 年 1 月 18 日星期四下午 4:09:44 CET“过滤器失败”以来暂停”。
此时,我们可以在“文档打印状态”中右键单击该作业,然后选择“取消”(“您确实要取消此作业吗?”:“取消作业”)
然后,检查用户组,并lsusb
:
$ groups
username sys adm lp cdrom sudo audio dip video plugdev fuse lpadmin sambashare
$ lsusb | grep Hew
Bus 001 Device 011: ID 03f0:8d17 Hewlett-Packard
尝试hp-check
:
$ hp-check
Saving output in log file: /home/username/hp-check.log
HP Linux Imaging and Printing System (ver. 3.14.3)
Dependency/Version Check Utility ver. 15.1
Copyright (c) 2001-13 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.
Note: hp-check can be run in three modes:
1. Compile-time check mode (-c or --compile): Use this mode before compiling the HPLIP supplied tarball (.tar.gz or .run)
to determine if the proper dependencies are installed to successfully compile HPLIP.
2. Run-time check mode (-r or --run): Use this mode to determine if a distro supplied package (.deb, .rpm, etc) or an
already built HPLIP supplied tarball has the proper dependencies installed to successfully run.
3. Both compile- and run-time check mode (-b or --both) (Default): This mode will check both of the above cases (both
compile- and run-time dependencies).
Check types:
a. EXTERNALDEP - External Dependencies
b. GENERALDEP - General Dependencies (required both at compile and run time)
c. COMPILEDEP - Compile time Dependencies
d. [All are run-time checks]
PYEXT SCANCONF QUEUES PERMISSION
Status Types:
OK
MISSING - Missing Dependency or Permission or Plug-in
INCOMPAT - Incompatible dependency-version or Plugin-version
warning: ubuntu-14.04 version is not supported. Using ubuntu-13.10 versions dependencies to verify and install...
---------------
| SYSTEM INFO |
---------------
Kernel: 4.4.0-109-generic #132~14.04.1-Ubuntu SMP Tue Jan 9 21:46:42 UTC 2018 GNU/Linux
Host: MyPC
Proc: 4.4.0-109-generic #132~14.04.1-Ubuntu SMP Tue Jan 9 21:46:42 UTC 2018 GNU/Linux
Distribution: ubuntu 14.04
Bitness: 64 bit
-----------------------
| HPLIP CONFIGURATION |
-----------------------
HPLIP-Version: HPLIP 3.14.3
HPLIP-Home: /usr/share/hplip
warning: HPLIP-Installation: Auto installation is not supported for ubuntu distro 14.04 version
Current contents of '/etc/hp/hplip.conf' file:
# hplip.conf. Generated from hplip.conf.in by configure.
[hplip]
version=3.14.3
[dirs]
home=/usr/share/hplip
run=/var/run
ppd=/usr/share/ppd/hplip/HP
ppdbase=/usr/share/ppd/hplip
doc=/usr/share/doc/hplip-doc/HTML
html=/usr/share/doc/hplip-3.14.3
icon=no
cupsbackend=/usr/lib/cups/backend
cupsfilter=/usr/lib/cups/filter
drv=/usr/share/cups/drv
bin=/usr/bin
# Following values are determined at configure time and cannot be changed.
[configure]
network-build=yes
libusb01-build=no
pp-build=yes
gui-build=yes
scanner-build=yes
fax-build=yes
dbus-build=yes
cups11-build=no
doc-build=yes
shadow-build=no
hpijs-install=yes
foomatic-drv-install=yes
foomatic-ppd-install=yes
foomatic-rip-hplip-install=no
hpcups-install=yes
cups-drv-install=yes
cups-ppd-install=no
internal-tag=3.14.3
restricted-build=no
ui-toolkit=qt4
qt3=no
qt4=yes
policy-kit=yes
lite-build=no
udev_sysfs_rules=no
hpcups-only-build=no
hpijs-only-build=no
Current contents of '/var/lib/hp/hplip.state' file:
[plugin]
installed = 1
eula = 1
version = 3.14.3
Current contents of '~/.hplip/hplip.conf' file:
[installation]
date_time = 01/18/2018 16:14:43
version = 3.14.3
[last_used]
device_uri = "hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR"
printer_name = HP-LaserJet-P3010-Series
working_dir = .
[settings]
systray_visible = 0
systray_messages = 0
[commands]
scan = /usr/bin/simple-scan %SANE_URI%
[refresh]
rate = 30
enable = false
type = 1
[polling]
enable = false
interval = 5
device_list =
[fax]
voice_phone =
email_address =
[upgrade]
notify_upgrade = false
last_upgraded_time = 1516286249.94309
pending_upgrade_time = 0
<Package-name> <Package-Desc> <Required/Optional> <Min-Version> <Installed-Version> <Status> <Comment>
--------------------------
| External Dependencies |
--------------------------
policykit Admin-Policy-framework OPTIONAL - 0.105 OK -
gs Ghostscript REQUIRED 7.05 9.10 OK -
network Network-wget OPTIONAL - 1.15 OK -
scanimage Shell-Scanning OPTIONAL 1.0 1.0.23 OK -
avahi-utils avahi-utils OPTIONAL - 0.6.31 OK -
dbus DBus REQUIRED - 1.6.18 OK -
error: cups CUPS REQUIRED 1.1 - INCOMPAT 'CUPS may not be installed or not running'
error: xsane SANE-GUI OPTIONAL 0.9 - MISSING 'xsane needs to be installed'
-------------------------
| General Dependencies |
-------------------------
reportlab Python-PDF-Lib OPTIONAL 2.0 3.0 OK -
error: libcrypto OpenSSL-Crypto-Lib REQUIRED - 1.0.1 MISSING 'libcrypto needs to be installed'
pil Python-Image-Lib OPTIONAL - 1.1.7 OK -
pyqt4-dbus PyQt4-DBUS REQUIRED 4.0 4.10.4 OK -
error: libjpeg JPEG-Lib REQUIRED - - MISSING 'libjpeg needs to be installed'
libpthread POSIX-Threads-Lib REQUIRED - 2.19 OK -
python-dbus Python-DBUS REQUIRED 0.80.0 1.2.0 OK -
python-devel Python-SDK REQUIRED 2.2 2.7.6 OK -
pyqt4 Python-Qt4 REQUIRED 4.0 4.10.4 OK -
error: cups-devel CUPS-SDK REQUIRED - - MISSING 'cups-devel needs to be installed'
error: sane-devel SANE-SDK REQUIRED - - MISSING 'sane-devel needs to be installed'
error: libusb USB-Lib REQUIRED - 1.0 MISSING 'libusb needs to be installed'
sane Scan-Lib REQUIRED - - OK -
error: cups-image CUPS-Image-Lib REQUIRED - - MISSING 'cups-image needs to be installed'
error: libnetsnmp-devel SNMP-Networking-SDK REQUIRED 5.0.9 - MISSING 'libnetsnmp-devel needs to be installed'
python-xml Python-XML-Lib REQUIRED - 2.1.0 OK -
python-notify Desktop-notifications OPTIONAL - - OK -
------------------------------
| Compile Time Dependencies |
------------------------------
gcc gcc-Compiler REQUIRED - 4.8.4 OK -
error: libtool Build-tools REQUIRED - - MISSING 'libtool needs to be installed'
make GNU-Build-tools REQUIRED 3.0 3.81 OK -
----------------------
| Python Extentions |
----------------------
cupsext CUPS-Extension REQUIRED - 3.14.3 OK -
pcardext PhotoCard-Extension REQUIRED - 3.14.3 OK -
hpmudext IO-Extension REQUIRED - 3.14.3 OK -
-----------------------
| Scan Configuration |
-----------------------
hpaio HPLIP-SANE-Backend REQUIRED - 3.14.3 OK 'hpaio found in /etc/sane.d/dll.conf'
scanext Scan-SANE-Extension REQUIRED - 3.14.3 OK -
------------------------------
| DISCOVERED SCANNER DEVICES |
------------------------------
No Scanner found.
--------------------------
| DISCOVERED USB DEVICES |
--------------------------
No devices found.
---------------------------------
| INSTALLED CUPS PRINTER QUEUES |
---------------------------------
HP-LaserJet-P3010-Series
------------------------
Type: Printer
Device URI: hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR
PPD: /etc/cups/ppd/HP-LaserJet-P3010-Series.ppd
PPD Description: HP LaserJet P3010 Series Postscript (recommended)
Printer Filter faileder HP-LaserJet-P3010-Series is idle. enabled since Thu 18 Jan 2018 04:09:59 PM CET
error: Unable to communicate with device (code=12): hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR
error: Device not found
error: Communication status: Failed
--------------
| PERMISSION |
--------------
-----------
| SUMMARY |
-----------
Missing Required Dependencies
-----------------------------
error: 'libcups2' package is missing/incompatible
error: 'openssl' package is missing/incompatible
error: 'libjpeg-dev' package is missing/incompatible
error: 'libcups2-dev' package is missing/incompatible
error: 'cups-bsd' package is missing/incompatible
error: 'cups-client' package is missing/incompatible
error: 'libsane-dev' package is missing/incompatible
error: 'libusb-1.0.0-dev' package is missing/incompatible
error: 'libcupsimage2-dev' package is missing/incompatible
error: 'libsnmp-dev' package is missing/incompatible
error: 'snmp-mibs-downloader' package is missing/incompatible
error: 'libtool' package is missing/incompatible
Missing Optional Dependencies
-----------------------------
error: 'gtk2-engines-pixbuf' package is missing/incompatible
error: 'xsane' package is missing/incompatible
Total Errors: 11
Total Warnings: 0
Run 'hp-doctor' command to prompt and fix the issues.
Done.
不确定该怎么做 - 我怀疑*-dev
包是否与 USB 连接问题或打印机驱动程序有关?!
还可以尝试以下hp-diagnose*
程序:
$ hp-diagnose_plugin
HP Linux Imaging and Printing System (ver. 3.14.3)
Diagnose Plugin Utility ver. 1.0
Copyright (c) 2001-13 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.
Device Plugin is already installed
$ hp-diagnose_queues
HP Linux Imaging and Printing System (ver. 3.14.3)
AutoConfig Utility to check queues configuration ver. 1.1
Copyright (c) 2001-13 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.
Got bus address: "unix:abstract=/tmp/dbus-sPV0rDmd6j,guid=668590b4a91f57f7d8a927125a60ad09"
Connected to accessibility bus at: "unix:abstract=/tmp/dbus-sPV0rDmd6j,guid=668590b4a91f57f7d8a927125a60ad09"
Registered DEC: true
Queue(s) configured correctly using HPLIP.
因此没有检测到任何问题hp-diagnose*
;我甚至考虑重新安装hplip
;然而:
$ sudo apt-get remove hplip
...
The following packages will be REMOVED:
hplip hplip-gui printer-driver-postscript-hp ubuntu-mate-desktop
...
... 它想要删除ubuntu-mate-desktop
,但不幸的是我正在使用那个。我试过了sudo apt-get install --reinstall hplip
,没有变化。
所以,我现在真的很茫然——如何让这台打印机再次使用 Ubuntu 14.04 进行打印?
编辑:按照如何在 Ubuntu 上安装 HP Laserjet P1102w?我尝试过跑步hp-setup -i
(有sudo
和没有):
$ hp-setup -i
HP Linux Imaging and Printing System (ver. 3.14.3)
Printer/Fax Setup Utility ver. 9.0
...
| SELECT CONNECTION (I/O) TYPE |
--------------------------------
Num Connection Description
Type
-------- ---------- ----------------------------------------------------------
0* usb Universal Serial Bus (USB)
1 net Network/Ethernet/Wireless (direct connection or JetDirect)
2 par Parallel Port (LPT:)
Enter number 0...2 for connection type (q=quit, enter=usb*) ? [ENTER[
Using connection type: usb
error: No device selected/specified or that supports this functionality.
... 一直lsusb
显示打印机已连接?!
答案1
好吧,我找到了一些线索 - 但这真是浪费时间......
无论如何,最后,对我来说似乎有效的程序是(这是使用较短的 USB 电缆插入仅 USB2 插座;并将旧的 USB2 鼠标+集线器连接到笔记本电脑的 USB3 插座):
- 关闭打印机
- 做
sudo service cups restart
- 打开打印机
- 只是为了检查一下:(
ls /dev/usb/lp0
应该存在,在这种情况下到目前为止一切都还好) - 运行
system-config-printer
;在“打印机”对话框中,选择打印机,右键单击,选择“属性”;“打印机属性”对话框启动,左侧的“设置”选项卡被选中;“策略”选项卡就在其正下方 - 选择“策略”选项卡,确保选中“已启用”设置(参见打印机仅处于“待处理”模式,不打印) - 尝试打印
evince
- 应该可以
以下是我的一些调试笔记:
首先,我尝试hp-testpage
直接运行,当它失败时,我意识到 syslog 中有这样的内容:
Jan 18 17:58:20 MyPC python: io/hpmud/dot4.c 231: unable to read Dot4ReverseReply header: Resource temporarily unavailable bytesRead=0
Jan 18 17:58:20 MyPC python: io/hpmud/dot4.c 319: invalid DOT4InitReply retrying command...
Jan 18 17:59:09 MyPC python: io/hpmud/dot4.c 231: unable to read Dot4ReverseReply header: Resource temporarily unavailable bytesRead=0
Jan 18 17:59:09 MyPC python: io/hpmud/dot4.c 330: invalid DOT4InitReply: cmd=0, result=20#012, revision=0
Jan 18 17:59:09 MyPC python: io/hpmud/hpmud.c 655: invalid channel_write state
Jan 18 17:59:09 MyPC python: io/hpmud/pml.c 462: GetPml channel_write failed ret=31
Jan 18 17:59:09 MyPC python: io/hpmud/hpmud.c 655: invalid channel_write state
Jan 18 17:59:09 MyPC python: io/hpmud/pml.c 462: GetPml channel_write failed ret=31
Jan 18 17:59:09 MyPC python: io/hpmud/hpmud.c 655: invalid channel_write state
...
Jan 18 17:59:09 MyPC python: io/hpmud/hpmud.c 655: invalid channel_write state
Jan 18 17:59:09 MyPC python: io/hpmud/pml.c 462: GetPml channel_write failed ret=31
Jan 18 17:59:09 MyPC python: io/hpmud/hpmud.c 636: invalid channel_close state
Jan 18 17:59:09 MyPC python: io/hpmud/musb.c 544: aborting outstanding 7/1/3 write
Jan 18 17:59:10 MyPC dbus[513]: [system] Activating service name='org.opensuse.CupsPkHelper.Mechanism' (using servicehelper)
Jan 18 17:59:10 MyPC dbus[513]: [system] Successfully activated service 'org.opensuse.CupsPkHelper.Mechanism'
Jan 18 17:59:14 MyPC hp[3059]: io/hpmud/musb.c 150: unable get_string_descriptor -7: Resource temporarily unavailable
Jan 18 17:59:14 MyPC hp[3059]: io/hpmud/musb.c 599: invalid product id string ret=-7
Jan 18 17:59:19 MyPC hp[3059]: io/hpmud/musb.c 150: unable get_string_descriptor -7: Resource temporarily unavailable
Jan 18 17:59:19 MyPC hp[3059]: io/hpmud/musb.c 599: invalid product id string ret=-7
Jan 18 17:59:24 MyPC hp[3059]: io/hpmud/musb.c 150: unable get_string_descriptor -7: Resource temporarily unavailable
Jan 18 17:59:24 MyPC hp[3059]: io/hpmud/musb.c 599: invalid product id string ret=-7
Jan 18 17:59:24 MyPC hp[3059]: io/hpmud/musb.c 1143: unable to open hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR
Jan 18 17:59:24 MyPC hp[3059]: prnt/backend/hp.c 745: ERROR: open device failed stat=12: hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR
...
这里的结束语也可以是:
...
Jan 18 18:40:50 MyPC python: io/hpmud/musb.c 1143: unable to open hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR
Jan 18 18:40:50 MyPC hp-toolbox: hp-toolbox(UI)[2529]: error: Unable to communicate with device (code=12): hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR
Jan 18 18:40:50 MyPC hp-toolbox: hp-toolbox(UI)[2529]: error: Unable to print to printer. Please check device and try again.
Jan 18 18:40:50 MyPC hp-toolbox: hp-toolbox(UI)[2529]: error: Unable to communicate with printer HP-LaserJet-P3010-Series. Please check the printer and try again.
...
我怀疑:
- 我的 USB 线有问题(我有两根旧 USB 线:一根较长,一根较短;到目前为止,我一直使用较长的那根)
- 连接 USB3 端口可能有问题(在 OP 中,我将较长的 USB 线连接到笔记本电脑的 USB3 端口)
因此,我将连接 USB3 的较长电缆改为:使用连接笔记本电脑上另一个仅 USB2 端口的较短电缆(更换电缆时关闭了打印机);打印机通电后,测试页(作为作业卡在队列中)突然被打印出来!
在这个工作案例中,请注意,当打印机出现在 USB 总线上时,syslog
首先生成与 OP 中完全相同的“发现”消息 - 但是然后它也是继续:
...
Jan 18 18:06:09 MyPC kernel: [ 1321.613894] usblp 1-4:1.0: usblp0: USB Bidirectional printer dev 26 if 0 alt 1 proto 2 vid 0x03F0 pid 0x8D17
Jan 18 18:06:09 MyPC logger: loading HP Device 001 026
Jan 18 18:06:09 MyPC udev-configure-printer: add /devices/pci0000:00/0000:00:14.0/usb1/1-4
Jan 18 18:06:09 MyPC udev-configure-printer: device devpath is /devices/pci0000:00/0000:00:14.0/usb1/1-4
Jan 18 18:06:09 MyPC udev-configure-printer: MFG:Hewlett-Packard MDL:HP LaserJet P3010 Series SERN:- serial:HPSER1ALNR
Jan 18 18:06:10 MyPC kernel: [ 1322.641726] usblp0: removed
Jan 18 18:06:10 MyPC kernel: [ 1322.641736] usb 1-4: ep 0x5 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 18:06:10 MyPC kernel: [ 1322.641750] usb 1-4: ep 0x81 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 18:06:10 MyPC kernel: [ 1322.645337] usb 1-4: ep 0x5 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 18:06:10 MyPC kernel: [ 1322.645342] usb 1-4: ep 0x81 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 18:06:10 MyPC kernel: [ 1322.646056] usb 1-4: ep 0x5 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 18:06:10 MyPC kernel: [ 1322.646060] usb 1-4: ep 0x81 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 18:06:10 MyPC kernel: [ 1322.646355] usb 1-4: ep 0x5 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 18:06:10 MyPC kernel: [ 1322.646358] usb 1-4: ep 0x81 - rounding interval to 2 microframes, ep desc says 3 microframes
Jan 18 18:06:10 MyPC kernel: [ 1322.646908] usblp 1-4:1.0: usblp0: USB Bidirectional printer dev 26 if 0 alt 1 proto 2 vid 0x03F0 pid 0x8D17
Jan 18 18:06:10 MyPC udev-configure-printer: SERN field matches USB serial number
Jan 18 18:06:10 MyPC udev-configure-printer: URI match: hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR
Jan 18 18:06:10 MyPC udev-configure-printer: URI contains USB serial number
Jan 18 18:06:10 MyPC udev-configure-printer: URI match: usb://HP/LaserJet%20P3010%20Series?serial=HPSER1ALNR
Jan 18 18:06:10 MyPC udev-configure-printer: URI of detected printer: hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR, normalized: laserjet p3010 series serial HPSER1ALNR
Jan 18 18:06:10 MyPC udev-configure-printer: URI of print queue: hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR, normalized: laserjet p3010 series serial HPSER1ALNR
Jan 18 18:06:10 MyPC udev-configure-printer: Queue ipp://localhost:631/printers/HP-LaserJet-P3010-Series has matching device URI
Jan 18 18:06:10 MyPC udev-configure-printer: Re-enabled printer ipp://localhost:631/printers/HP-LaserJet-P3010-Series
Jan 18 18:06:10 MyPC colord: Device added: sysfs-Hewlett-Packard-HP_LaserJet_P3010_Series
...
然而,这并不是全部——因为在某个时候,这种设置也开始像上面描述的那样失败,或者只是作业停留在“已暂停”或“待处理”状态。
首先,我有一个旧的有线 USB 鼠标,以及一个旧的 USB2 集线器,我将鼠标连接到该集线器(然后连接到笔记本电脑的 USB)- 我注意到,有时当插入此鼠标并连接其他 USB 设备时,“发现”消息实际上会syslog
再次列出鼠标被发现?!无论如何,断开鼠标和 USB 集线器的连接会稍微提高可靠性 - 但似乎它们并不是必不可少的,因为我也可以在连接它们的情况下进行打印。
请注意,事情可能会变得很糟,将打印机连接到 USB 时只会产生以下情况syslog
:
Jan 18 18:33:56 MyPC kernel: [ 67.692851] usb 1-4: new full-speed USB device number 5 using xhci_hcd
Jan 18 18:34:01 MyPC kernel: [ 72.860498] usb 1-4: device descriptor read/64, error -110
.. 使用“良好”的电缆时也会出现这种情况,即使在 PC 重新启动后也是如此(如果打印机在此期间保持开启状态);然后必须重新启动打印机,然后它才能像以前一样被识别。
查找这篇文章后,我发现 - 正如@pdc 在评论中提到的那样 - Ubuntu 上的 HP 打印机存在很多类似的问题;我查阅过的帖子有:
- Ubuntu 14.04 在 USB 上无法识别 HP LaserJet 1018 打印机 [存档] - Ubuntu 论坛
- 错误 #1315408 “hp-setup 无法识别 hp-1018 usb 打印机”:错误:HPLIP
- 错误 #1296085 “HP LaserJet 1020 io/hpmud/musb.c 150:无法获取...”:错误:hplip 包:Ubuntu
从这些线程中,我注意到当内核改变/更新时,这些问题会随机发生(这使得调试起来相当困难);另一个有用的评论是:
code=12 是 I/O 错误,很可能是由于与注释 #11 中相同的原因:poll() 在尝试传输 URB 时由于某种原因超时。
我不确定为什么会发生这种情况。
我还发现了两个对调试有用的命令(也有hp-firmware
,但此打印机不从 PC 下载固件);以下是这两个命令的输出,当它们不是在我的笔记本电脑上工作:
$ sudo usb_printerid /dev/usb/lp0
Error: No such file or directory: can't open '/dev/usb/lp0'
$ sudo /usr/lib/cups/backend/usb
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 107 quirks.
DEBUG: list_devices
DEBUG: libusb_get_device_list=9
DEBUG2: Printer found with device ID: Device URI: usb://Unknown/Printer
direct usb://Unknown/Printer "Unknown" "Unknown" "" ""
以下是相同命令的输出,当它们做工作:
$ sudo usb_printerid /dev/usb/lp0
GET_DEVICE_ID string:
MFG:Hewlett-Packard;CMD:PJL,BIDI-ECP,PJL,POSTSCRIPT,PDF,PCLXL,PCL;MDL:HP LaserJet P3010 Series;CLS:PRINTER;DES:Hewlett-Packard LaserJet P3010 Series;
$ sudo /usr/lib/cups/backend/usb
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 107 quirks.
DEBUG: list_devices
DEBUG: libusb_get_device_list=6
DEBUG2: Printer found with device ID: MFG:Hewlett-Packard;CMD:PJL,BIDI-ECP,PJL,POSTSCRIPT,PDF,PCLXL,PCL;MDL:HP LaserJet P3010 Series;CLS:PRINTER;DES:Hewlett-Packard LaserJet P3010 Series; Device URI: usb://HP/LaserJet%20P3010%20Series?serial=HPSER1ALNR
direct usb://HP/LaserJet%20P3010%20Series?serial=HPSER1ALNR "HP LaserJet P3010 Series" "HP LaserJet P3010 Series" "MFG:Hewlett-Packard;CMD:PJL,BIDI-ECP,PJL,POSTSCRIPT,PDF,PCLXL,PCL;MDL:HP LaserJet P3010 Series;CLS:PRINTER;DES:Hewlett-Packard LaserJet P3010 Series;" ""
例如,我注意到,如果鼠标+集线器和打印机都关闭,则打印机将打开 -cups/backend/usb
并且usb_printerid
一切正常;但如果鼠标+集线器打开 - 则/dev/usb/lp0
消失,因此现在usb_printerid
将失败,但是cups/backend/usb
也许不会- 在这种情况下,打印仍然有效!有时,和cups/backend/usb
可能usb_printerid
都正常,但仍然无法打印!
另外,我注意到cups/backend/usb
原因usblp0: removed
和usblp 1-4:1.0: usblp0: USB Bidirectional printer...
出现在syslog
,这意味着该命令可能重新插入一些内核驱动程序......
最后,我还注意到了这样的错误syslog
:
...
Jan 18 19:40:01 MyPC hp[3438]: io/hpmud/musb.c 1446: unable to write data hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR: 45 second io timeout
Jan 18 19:40:06 MyPC hp[3438]: io/hpmud/musb.c 763: invalid deviceid ret=-7: No data available
Jan 18 19:40:06 MyPC hp[3438]: prnt/backend/hp.c 625: ERROR: 5021 device communication error!
Jan 18 19:40:06 MyPC hp[3438]: io/hpmud/musb.c 544: aborting outstanding 7/1/2 write
Jan 18 19:40:06 MyPC kernel: [ 4037.477728] usb 1-4: Process 3438 (hp) called USBDEVFS_CLEAR_HALT for active endpoint 0x05
...
...我想这就是我所期望的错误(基本上是超时),如果未选择“设置>打印机>策略”中的“已启用”——这最终促使我采取了这篇文章顶部所述的程序……