2

Well, I don't have words to express my frustration; I've been using Ubuntu 14.04 with my HP LaserJet P3015 for some years now, and I didn't have a problem in the first year or so (on multiple machines). Then, as I also switched machines (on which I again installed Ubuntu 14.04), first I got into Printer first has status pending, then prints a blank page ; and now I cannot even print a test page on this machine (with a relatively fresh Ubuntu 14.04 install).

First of all, my system info:

$ 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

I start from Printer OFF, connected via USB to laptop, laptop OFF. I turn the laptop ON, wait for Ubuntu 14.04 to boot; "HPLIP Status Service" in the system tray is automatically shown.

hp01

I set up a terminal with tail -f /var/log/syslog; and then turn the printer ON - the syslog messages are:

$ 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

Clicking on "HP Device Manager..." at this point shows (click for full size image):

hp02.png

Try print test page from here - first get a blank window of "HP Device Manager":

hp03.png

... then after a while, errors:

"HP Device Manager - Print Test Page":
Unable to communicate with printer HP-LaserJet-P3010-Series.
Please check the printer and try again.

"hplip":
HPLIP Device Status
HP_LaserJet_P3010_Series Printer (HPSER1ALNR)
Device communication error (5012)

hp04.png

Close "HP Device Manager - Print Test Page" (its "Print Test Page" button is disabled/greyed out)

Now "HP Device Manager" shows a small red X by the printer icon; in "HP Device Manager", click "(Cups) View Printer and Device Information"; after a while with greyed window, get:

hp05.png

"HP Device Manager - Device Information":
Unable to open device hp:/usb/HP_LaserJet_P3010_Series?serial=HPSER1ALNR.

"HP Device Manager", changing to Status tab, says "Device communication error":

hp06.png

"HP Device Manager", changing to Printer Control tab, says printer is "Started/Idle":

hp07.png

Going to http://localhost:631/ - Printers tab - click on the printer; its status is: "HP-LaserJet-P3010-Series (Idle, Accepting Jobs, Not Shared, Server Default, Color-Managed)":

hp08.png

Open system-config-printer; right-click on the printer, first choose "View Print Queue"; then choose "Properties": - Printer State is "Idle":

hp09.png

Click "Print Test Page" in this dialog - get as feedback: "Submitted", "Started a print job"; Printer State: "Processing":

hp10.png

... however note the message "Printer 'HP...' may not be connected."

And after a short time, get "Print job has completed message" - however:

hp11.png

We end up with "Printer Properties"/"Printer State": "Idle - Filter failed"; and "Print Status": Held; (silarly, the Cups interface shows under Jobs of this printer, under State field: 'held since Thu 18 Jan 2018 04:09:44 PM CET "Filter failed"'.

At this point; we can right-click the job in Document Print Status, and Cancel ("Do you really want to cancel this job?": "Cancel job")

Then, check groups of user, and 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

Try 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.

Not sure what to make of this - I doubt *-dev packages would have anything to do with USB connectivity problems or printer drivers ?!

Also try these hp-diagnose* programs:

$ 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.

So no problems detected with hp-diagnose*; I thought even about reinstalling hplip; however:

$ sudo apt-get remove hplip
...
The following packages will be REMOVED:
  hplip hplip-gui printer-driver-postscript-hp ubuntu-mate-desktop
...

... it wants to remove ubuntu-mate-desktop, but unfortunately I'm using that one. I've tried sudo apt-get install --reinstall hplip, no change.

So, I'm really at a loss now - how do I get this printer to print with Ubuntu 14.04 again?


EDIT: as per How can I install HP Laserjet P1102w on Ubuntu? I tried running hp-setup -i (both with sudo and without):

$ 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.

... all the while lsusb shows the printer being connected?!

sdaau
  • 3,056
  • 1
    sorry to hear of your issues; posts such as this https://bugs.launchpad.net/hplip/+bug/1315408 suggest you are not alone; however when I see the missing required dependencies, then I think you have to install those; one could suggest installing the latest hplip which is 3.17.11 I think; the bug report has various suggested remedies; eg removing foo2zjs – pdc Jan 18 '18 at 16:59
  • 1
    again; I wonder if switching drivers might help; https://ma.juii.net/blog/slow-printing-of-lj-2200 ....... use pcl or the other variants suggested in this blog – pdc Jan 18 '18 at 17:41
  • 1
    and just to prove how individual many fixes are; this post https://bbs.archlinux.org/viewtopic.php?id=218509 suggests using foo2zjs – pdc Jan 18 '18 at 17:57
  • Many thanks @pdc - I've seen other posts (see my answer below) that recommend instead to uninstall foo2zjs (but that was not my problem, since for me, grep foo2zjs /var/log/syslog returned nothing). It seems I had found some procedure that works for me - let's hope it lasts for more than a day... – sdaau Jan 18 '18 at 21:05

1 Answers1

2

Well, I got somewhere - but what a goddamned waste of time this is...

Anyways, at the end, the procedure that seemed to work for me was (this was using shorter USB cable plugged in USB2-only socket; and with old USB2 mouse+hub connected to the USB3 socket of the laptop):

  • turn printer OFF
  • do sudo service cups restart
  • turn printer ON
  • just to check: ls /dev/usb/lp0 (should be existing, in which case we're OK so far)
  • run system-config-printer; in the Printers dialog, select the printer, right-click, choose Properties; the Printer Properties dialog is started with the "Settings" tab on the left selected; the "Policies" tab is right below it - select "Policies" tab, make sure "Enabled" setting is checked ( see Printer in "pending" mode only, not printing )
  • Attempt to print from evince - it should work

Below are some of my debug notes:


First of all, I tried running hp-testpage directly, and when it failed, I realized there was this in 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
...

The finishing messages here can also be:

...
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.
...

Here I suspected:

  • That I have a faulty USB cable (I have two older USB cables: one longer, one shorter; so far I was using the longer one)
  • That there may be a problem connecting to a USB3 port (in OP, I had the longer USB cable connected to a USB3 port to my laptop)

So, I changed from: using the longer cable connected to USB3 - to: using the shorter cable connected to another, USB2-only, port on my laptop (had the printer turned off while changing cables); and once the printer was powered, suddenly the test page (which was stuck as a job in the queue) printed!

In this working case, note that upon the printer appearing on the USB bus, syslog started with generating the exact same "discovery" messages as in OP - but then it also continues:

...
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
...

This was however, not the whole thing - since, at a certain point, this setup aslo started either failing as described above, or just with jobs being stuck in a "Held" or "Pending" state.

For one, I have an old wired USB mouse, and an old USB2 hub that I connect it to (which then goes to the laptop USB) - I've noticed, sometimes when this mouse is plugged in, and I attach some other USB device, the "discovery" messages in syslog actually list the mouse as being discovered again?! In any case, having the mouse and USB hub disconnected increased reliability a bit - but it seems they were not essential, as I got printing to work with them connected as well.

Note that things can get screwed to the point where connecting the printer to USB generates only this in 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

.. which happened with "good" cable, even after fresh PC reboot (if the printer remained ON during that time); then had to reboot printer, then it got recognized as previously.

Looking this up, I've found - as @pdc mentions in comments - there are plenty of problems like these with HP printers on Ubuntu; threads I've consulted are:

From these threads, I've noticed that problems like these occur randomly when the kernel changes/is updated (which makes it a rather tough problem to debug); another useful comment was:

code=12 is an I/O error, most likely due to the same thing as in comment #11: poll() is timing out for some reason when trying to transfer an URB.
I'm not sure why that would happen.

I also found about two commands useful for debug (there is also hp-firmware, but this printer does not download firmware from PC); here is the output of both, when they are not working on my laptop:

$ 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" "" ""

Here is the output of the same commands when they do work:

$ 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;" ""

For instance, I've noticed that if both mouse+hub and printer are OFF; then printer goes ON - cups/backend/usb and usb_printerid are fine; but if then mouse+hub goes ON - /dev/usb/lp0 disappears, so now usb_printerid will fail, but cups/backend/usb might not - and in that case, printing still works! And sometimes, both cups/backend/usb and usb_printerid might be fine, but printing will still not happen!

Also, I've noticed that the cups/backend/usb causes usblp0: removed and usblp 1-4:1.0: usblp0: USB Bidirectional printer... to appear in syslog, meaning that command probably reinserts some kernel driver...

Finally, I also noticed an error like this in 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
...

... and I guess this is the kind of error (basically, timeout) that I'd expect if Settings>Printers>Policies "Enabled" is not selected - which is what finally led me to the procedure at the top of this post...

sdaau
  • 3,056