You are not logged in.

#1 2010-09-28 10:55:59

avoulk
Member
From: Greece
Registered: 2007-08-28
Posts: 132
Website

HP printer not printing [Possibly a udev issue?]

Hello all!

After a clean install of Archlinux in one of my PCs, I am facing the problem vaguely described on the topic title: I cannot print.

I currently own an hp printer, namely HP Deskjet D4260 which is perfectly discrovered by cups/hplip subsystem. It is actually well installed and recognized but I cannot print anything at all.
At first i supposed it was a specific cups problem (thought so because it was perfectly discovered/installed by hplip) so i considered reinstalling cups. After another print failure i reinstalled hplip, having no result, again.
I noticed on CUPS web interface that the printer is always paused and if i press "Resume printer" i get a nice message stating that "/usr/lib/cups/backend/hp failed". I am not a nascent linux user so i was not discouraged.

I unplugged the printer, replugged it and checked the dmesg, but all was pretty normal.
I tried to blacklist the usblp module, but my hopes where mere dust as no change of things was noticed..
After a bit of more searching, I checked the following:

The lsusb command gave me this:

Bus 002 Device 012: ID 03f0:7b04 Hewlett-Packard

The ls -lh command on /dev/bus/usb/002/012 gave this output:

[root@quad ~]# ls -lh /dev/bus/usb/002/012
crw------- 1 root root 189, 139 2010-09-28 11:43 /dev/bus/usb/002/012

So, i thought it was a permissions problem. I tried to chmod 666 (no, I am not evil) the thing:

[root@quad ~]# ls -lh /dev/bus/usb/002/012
crw-rw-rw- 1 root root 189, 139 2010-09-28 11:43 /dev/bus/usb/002/012

And TARARARAAAAA! It worked like a charm.

After having understood what's wrong with the printer, I tried to fixed it.
I am a member of the relevant groups: lp, lpadmin, usbfs, but still unable to print without the previous hack.
I checked the /etc/cups/cupsd.conf file, and made the following regarding the groups:

SystemGroup lp sys root lpadmin

but the result was not the expected.
I then suspected the udev subsystem and the respective usb/printer settings, so I checked the respective files:

/lib/udev/rules.d/40-hplip.rules
/lib/udev/rules.d/50-udev-default.rules
/lib/udev/rules.d/56-hpmud_support.rules

(I did not touch /etc/udev/rules.d/40-permissions.rules, as the vendor and product id were irrelevant with regard to my printer)

In /lib/udev/rules.d/40-hplip.rules (where the basic hplip rules are located) I found the following relevant:

ACTION!="add", GOTO="hpmud_rules_end"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="pid_test"
SUBSYSTEM!="usb_device", GOTO="hpmud_rules_end"

LABEL="pid_test"

...................................

# Check for Deskjet products (0x03f0xx04).
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??04", GROUP="lp", ENV{ID_HPLIP}="1"

I tried to enter another attribute "MODE=0666" to this line and restasrt udev (udevadm control restart) , but nothing changed. In fact, the ls -lh /dev/bus/usb/002/012 command gave me the same output as before.

In /lib/udev/rules.d/50-udev-default.rules the following (concerning my problem) where written:

# libusb device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"

# printer
KERNEL=="parport[0-9]*",        GROUP="lp"
SUBSYSTEM=="printer",           KERNEL=="lp*", GROUP="lp"
SUBSYSTEM=="ppdev",             GROUP="lp"
SUBSYSTEM=="usb",               KERNEL=="lp*", SYMLINK+="usb%k", GROUP="lp"
KERNEL=="lp[0-9]*",             GROUP="lp"
KERNEL=="irlpt[0-9]*",          GROUP="lp"
# hplip and cups 1.4+ use raw USB devices, so permissions should be similar to
# the ones from the old usblp kernel module
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701*:", GROUP="lp", MODE="0664"

I can clearly see that the suggested mode is 0664 and not 0666 (the one that after a chmod solved my problem), but interestingly the assigned permissions are actually 0600 (from the ls -lh command).
I also have no idea what ENV{ID_USB_INTERFACES} stands for (Am I maybe a non-matching rule victim?).. For the shake of completeness, I should mention that changing the mode to 0666 did not change anything at all.

The third file mentioned had nothing to do with my printer so i left it untouched too.

The result from /var/log/erros.log is:

Sep 28 14:06:05 localhost hp[4401]: io/hpmud/musb.c 1122: unable to open hp:/usb/Deskjet_D4200_series?serial=TH72J12C4S04XV
Sep 28 14:06:05 localhost hp[4401]: prnt/backend/hp.c 745: ERROR: open device failed stat=12: hp:/usb/Deskjet_D4200_series?serial=TH72J12C4S04XV

dmesg gives no critical output.

The result is that each time i boot my computer, i have to do the chmod thing to print, which is somewhat inconvenient as I am not the only user of the PC (or the printer). I clearly suspect udev for my problem, but i cannot figure out what to do, so

Any help/suggestion would be really helpful smile
Thank you for your time!

Last edited by avoulk (2010-09-28 11:08:47)

Offline

#2 2010-09-28 11:49:28

alko
Member
Registered: 2010-09-25
Posts: 15

Re: HP printer not printing [Possibly a udev issue?]

but if mode is 644 in libusb device nodes why permission on file /dev/bus/usb/002/012 is 600
it seems a little strange,like installation issue

look here:
http://labs.slitaz.org/issues/134

Offline

#3 2010-09-28 12:02:48

avoulk
Member
From: Greece
Registered: 2007-08-28
Posts: 132
Website

Re: HP printer not printing [Possibly a udev issue?]

First of all, thanks for answering smile

Second, it is weird isn't it?
It is clearly stated that the mode should be 664, but is 600. Not only that, but the group assigned to the usb device is always root even if it should be lp..

Following the advice of the link that you gave me (creating a new 40-permissions.rules) did not seem to solve the problem:

[root@quad rules.d]# ls -l /dev/bus/usb/002
σύνολο 0
crw------- 1 root root 189, 128 2010-09-28 14:56 001
crw------- 1 root root 189, 132 2010-09-28 15:00 005
crw------- 1 root root 189, 133 2010-09-28 15:00 006

This is the output even after a system restart sad

Offline

#4 2010-09-28 12:20:32

alko
Member
Registered: 2010-09-25
Posts: 15

Re: HP printer not printing [Possibly a udev issue?]

this solution?
http://hg.slitaz.org/wok/rev/3f1ebca13b4f

EDIT:

also try reinstall cups and hplip as root (not using  su or sudo)

Last edited by alko (2010-09-28 12:24:02)

Offline

#5 2010-09-28 12:43:41

avoulk
Member
From: Greece
Registered: 2007-08-28
Posts: 132
Website

Re: HP printer not printing [Possibly a udev issue?]

After this fix (i added the code to both /etc/udev/rules.d/40-permissions.rules and created a new one under /lib/udev/rules.d/90-permissions.rules as suggested in the link but nothing extraordinary happened, meaning i am still unable to print.

However, i noticed the following:

[root@quad ~]# ls -l /dev/usb/lp0 
crw-rw---- 1 root lp 180, 0 2010-09-28 15:29 /dev/usb/lp0
[root@quad ~]# ls -l /dev/bus/usb/002/
σύνολο 0
crw------- 1 root root 189, 128 2010-09-28 14:56 001
crw------- 1 root root 189, 136 2010-09-28 15:29 009
crw------- 1 root root 189, 137 2010-09-28 15:29 010

So, /dev/usb/lp0 is theoritically (?) accessible but the usb descriptor in /dev/bus is not..
I am still getting print errors like "printer paused" etc.
In my first message i forgot something of importance though.

When i run hp-check -t i get the following:

As root: hp-check-root.log
As a simple user: hp-check-user.log

In the second case i seem to have no access to the printer. However, i cannot print as root via lp either!

Edit: I just checked the /usr/share/hwdata/usb.ids and the printer is properly included:

7a04  DeskJet D2460

Last edited by avoulk (2010-09-28 12:50:23)

Offline

#6 2010-09-28 13:04:15

avoulk
Member
From: Greece
Registered: 2007-08-28
Posts: 132
Website

Re: HP printer not printing [Possibly a udev issue?]

alko wrote:

also try reinstall cups and hplip as root (not using  su or sudo)

Tried that but sadly it fails as well..

Offline

#7 2013-02-23 19:57:26

Thomas.Bracken
Member
Registered: 2013-02-23
Posts: 1

Re: HP printer not printing [Possibly a udev issue?]

Hello, 

I read with interest you attempts to get your HP printer working under linux.
I just bought a 3520e all in one HP printer and had exactly the same issues as you.

Here is the solution to it:

First what you need to do is switch the printer on, and then do lsusb command
to get the ID for your printer

thomas@S010600112f5fac7c:/dev/bus/usb/001> lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 046d:0825 Logitech, Inc.
Bus 001 Device 003: ID 045e:00f4 Microsoft Corp. LifeCam VX-6000 (SN9C20x + OV9650)
Bus 001 Device 016: ID 03f0:b011 Hewlett-Packard
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 046d:c016 Logitech, Inc. M-UV69a/HP M-UV96 Optical Wheel Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 058f:9360 Alcor Micro Corp. 8-in-1 Media Card Reader

which in my case is ID 03f0:b011 next to the Hewlett-Packard name above.

These are known as the Vendor id (03f0) and the product id (b011).

The problem you are having is due to the UDEV rules which are under
directory /etc/udev/rules.d directory.  You need to login as root and go to this
directory and modify the 55-libsane.rules file there and add an entry line similar
to the one below, but using your own Vendor id and product id for your printer.
Make sure that you add this line in the USB devices area , not outside it.

# Hewlett-Packard 3520e all-in-one device                     Added by T.Bracken  Feb22,2013
ATTR{idVendor}=="03f0", ATTR{idProduct}=="b011", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"
#

Every time the printer is turned on, it will now show up in the dev area with permissions of 664 allowing
you to print from it , without manually having to go in and change the permissions on the device everytime.

As I side note, the other thing which makes this even worse is the fact that they have decided in addition
to this to use ACL (access control lists) for HP printer devices!!!.

When you list out the Devices after your printer is switched on and you have made the fix above you will
notice that the permissions are set something like this:

thomas@S010600112f5fac7c:/dev/bus/usb/001> ls -lt
total 0
crw-rw-r--+ 1 root lp   189, 15 2013-02-23 11:41   016
crw-rw-r--  1 root root 189,  2 2013-02-22 22:33    003
crw-rw-r--  1 root root 189,  0 2013-02-22 22:33    001
crw-rw-r--  1 root root 189,  1 2013-02-22 22:33    002

The HP printer device is 016 and the permissions are crw-rw-r--+   . 
The plus on the end of the permission field indicates that there is an ACL entry for the device. 
To see the permissions type the command getfacl   016

and you will see
thomas@S010600112f5fac7c:/dev/bus/usb/001> getfacl    016
# file: 016
# owner: root
# group: lp
user::rw-
user:thomas:rw-
group::rw-
mask::rw-
other::r--

The other issues I had with using my HP 3520e all in one printer was the fact that the Cups PPD file
included with the HPLIB installation for the HP 3520e printer did not work successfully for double sided printing

-rw-r--r-- 1 thomas users 5114 2013-02-13 08:39 hp-deskjet_3520_series.ppd.gz

The HPLIB has a directory called ppd, and inside of that two sub directories called "hpcups" and "hpijs"

Because this linux (Suse linux 11.2)  is using the "Cups" printing system, the hp-setup program used the driver for the printer under
"hpcups".  That driver actually has a bug in it , that when you print 2 sided , the second side shows
up as a mirror image and also upside down!!!  Luckly, the other driver from the hpijs directory
works just fine, and when I manually put that driver in , the double sided printing worked just fine
under linux!!!!

I hope this helps anyone who is trying to get anything to work under linux!!!

Good luck!!

Tom

Offline

#8 2016-04-17 15:16:32

maxl
Member
Registered: 2016-04-17
Posts: 1

Re: HP printer not printing [Possibly a udev issue?]

Having had the same problem with an USB printer [lpq:... no daemon present] IF the computer had been booted with udev enabled, I did the following as suggested in a udev/README.Debian :
create the node usblp0 in /lib/udev/devices/ which will be copied into /dev/ at boot time.
After that, mine looked like this: crw-rw-r-- 1 root lp 180, 0 Apr 17 16:25 /dev/usblp0
I did a cp -a /dev/usblp0 /lib/udev/devices/ when the system had been booted WITHOUT udev.
This because the usblp driver reported usblp0:printer .... each time the printer was turned on and usblp0 was obviously missing in /dev/ [with udev]

Offline

#9 2016-04-17 15:31:33

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,919
Website

Re: HP printer not printing [Possibly a udev issue?]

Hi Maxl, thanks for sharing that information. However, since this is a six year old topic, I'm going to go ahead and close it now.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB