# Confusing problem after installing hplip 3.9.4b-r1

## psdasilva

Hi!

I installed hplip 3.9.4b-r1 after migration to kde4.

After that I ran into a very confused situation.

Running hp-setup it creates a printer named (by default) Deskjet_F4200 but when I power on the printer a printer named Deskjet-F4200-series is created. I can see both in cups using a browser. hplip does *not* show the later.

I also tried to create a printer named Deskjet-F4200-series running hp-setup but it does not accept the character "-". Only "_"!

This causes all sorts of problems namely not printing, or printing incomplete jobs!

What causes poweron creating/using the printer named Deskjet-F4200-series?

How can I get rid of this Deskjet-F4200-series printer and make poweron start Deskjet_F4200 instead?

Thanks for any help/comments.

----------

## audiodef

I tend to prefer setting up printers in cups, but the important question for you is: Which one works (accepts print jobs and prints the way you want)?

----------

## psdasilva

Deskjet-F4200-series in general is most "usable". In fact, this printer is automatically started when the "printer device" is powered on.

There are several problems however:

1. This printer is not handled by hplip.

2. When I use the scanner (included in the printer) things get weird. In general I need to stop/remove hplip, delete existent printers using cups/browser, and (re)poweron to have Deskjet-F4200-series created again.

3. A "special" printer to print using special formats I have defined using the same device is unusable for common users.

I don't know what creates Deskjet-F4200-series.

The previous behaviour was correct. I defined printers using a browser and/or hplip and all printers were always started provided they are poweredon.

----------

## audiodef

Do you have other printers attached to this system? If it's just this one - or if they're all HP printers if you have more than one, and you don't need any sharing and such, maybe you can just get rid of cups. You do need hplip for the scanner on HP printers, so getting rid of hplip isn't an option. 

Also, make sure you have the scanner use flag enabled, which should pull in xsane.

----------

## keyson

FYI

The new cups (1.4) and hplip is not using the usblp driver in the kernel.

So in /etc/modprobe.d/blacklist.conf you have this. (But the blacklist line is commented)

 *Quote:*   

> 
> 
> # hplip and cups 1.4+ use raw USB devices, so it requires usblp not be loaded
> 
> blacklist usblp
> ...

 

So check that you don't have the usblp module loaded, or included into the kernel.

Had the same problem with my HP DeskJet before I found this out.

----------

## LD

I'm having similar issues. HPLIP is reporting the project completed, but it never goes out to the printer. Scaner works just fine on the f4140 deskjet that's plugged in, just no print.

usblp is not a problem, as it's not loaded or installed.

----------

## keyson

Hi LD,

Think this have come up on the forum. You have a multi function printer/scanner.

The udev rules set it as scanner an therefore the lp group does not have access to the

printer.

Check where the printer is attached by lsusb. Then check the ls -l /dev/bus/usb/00x/oox

for the printer. If it belong to root scanner you have the problem.

----------

## LD

This is the output.

blathazar chris # ls -l /dev/bus/usb/001/012

crw-rw-r-- 1 root usb 189, 11 Nov 22 20:21 /dev/bus/usb/001/012

----------

## keyson

Hmmm... That look strange.

On my machine.

```

lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 004: ID 03f0:1004 Hewlett-Packard DeskJet 970c/970cse

Bus 002 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

Bus 002 Device 003: ID 0592:0002 Powerware Corp. UPS (X-Slot)

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

```

So

```

ls -l /dev/bus/usb/002/004

crw-rw---- 1 root lp 189, 131 Nov 23 21:21 /dev/bus/usb/002/004

```

If it don't belong to the lp group you have to check the udev rules for your printer.

----------

## LD

hplip put this in it's own rules file.

I found what it said for my deskjet printer. 

```
# Check for Deskjet products (0x03f0xx04).

ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??04", OWNER="root", GROUP="lp", MODE="660"
```

That is the udev rule

----------

## keyson

Yep that is right.

But it looks like it not set the device right like it does on my machine.

I use hplip and cups. And use the same rule.

Maybe you can use udevadm to track what is going on.

----------

## LD

 *keyson wrote:*   

> Yep that is right.
> 
> But it looks like it not set the device right like it does on my machine.
> 
> I use hplip and cups. And use the same rule.
> ...

 

Not quiet sure how to use this one. I'm used to just modifying udev rules.

----------

## keyson

OK

Try this:

Unplug the printer.

Run this command as root.

```

udevadm monitor --property

```

Now plug the printer back.

Then you should see the kernel event and the udev event.

Halt by ctrl-c.

Now you can see that it gives the right info for the rule to take action.

Time for bed her in Sweden.

----------

## LD

UEVENT[1259020988.962039] add      /devices/pci0000:00/0000:00:02.1/usb1/1-1/1-1.5 (usb)

UDEV_LOG=3                                                                              

ACTION=add                                                                              

DEVPATH=/devices/pci0000:00/0000:00:02.1/usb1/1-1/1-1.5                                 

SUBSYSTEM=usb                                                                           

DEVNAME=bus/usb/001/030                                                                 

DEVTYPE=usb_device                                                                      

DEVICE=/proc/bus/usb/001/030                                                            

PRODUCT=3f0/7e04/100                                                                    

TYPE=0/0/0                                                                              

BUSNUM=001                                                                              

DEVNUM=030                                                                              

SEQNUM=1480                                                                             

MAJOR=189                                                                               

MINOR=29

----------

## keyson

The uevent look OK. And the PRODUCT line is fine.

So I have no more idea why the rule don't work.

After this plug you should have /dev/bus/usb/001/030 set to root:lp

????

----------

## LD

 *keyson wrote:*   

> The uevent look OK. And the PRODUCT line is fine.
> 
> So I have no more idea why the rule don't work.
> 
> After this plug you should have /dev/bus/usb/001/030 set to root:lp
> ...

 

Nope, still being asigned to group usb instead of lp.

ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="7e04", OWNER="root", GROUP="lp", MODE="660"

this is the rule line I have in 60-hpmud-unique.rules

----------

## LD

Any thoughts at all?

----------

## keyson

The thing is that the 55-hpmud.rules have a line also that should have set the

right group. That is the one I use.

```

# Check for Deskjet products (0x03f0xx04).

ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??04", OWNER="root", GROUP="lp", MODE="660"

```

But you say that the scanning works.

Maybe there is a race condition in the udev. Check where the rule is for the scanner.

Is it trigged before the printer.

You should have seen it on the previous test with udevadm.

B.t.w It have a card-slot also, does it work like a mass storage device?

----------

## LD

Mine actually does not hahve a memory card slot.

And any idea which specific udev rule I should look in for the scanner info?

----------

## LD

I think I found the issue in 70-libsane.rules.

```
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="0405", MODE="0664", GROUP="scanner"
```

not sure if this is it but I'm still looking.

----------

## keyson

OK LD,

Have no idea what is going wrong. But that rule from libsane would not do anything,

as the product-id is wrong.

But something is hugging the interface.

And that would be sane, as you say the scanner work.

Normally sane would not take that as the product id is not right.

It should work with hplip and xsane, if you change the rule to set it in scanner group.

The thing that should happen, is that the printer rule would set /dev/bus/usb/xxx/xxx to root:lp, and the

scanner would not work as user.

I would uninstall sane and it's components. Then test if it is possible to get the printer going.

Found some on google with the same problem, but have not found any answers what have gone wrong.

Some discussions have come up regarding this multifunction devices, and the permissions. And they all say that

it get the wrong permissions for scanning, as it belong to the lp group.

----------

## LD

Thanks, I'll see what I can do then.

----------

## rsa4046

LD, if I can piggyback on this thread, did you resolve this issue? I have something very similar

```
# lsusb | grep PSC

Bus 002 Device 004: ID 03f0:3611 Hewlett-Packard PSC 2410 PhotoSmart
```

I have net-print/cups-1.4.2-r1 and net-print/hplip-3.9.10 installed. I wasted days trying different versions of hplip and cups, but attempts to print anything would only return errors such as " /usr/libexec/cups/backend/hp failed ..." and no print job, despite my having proper group membership (lp, usb, etc.). I finally saw this thread, and checked the permissions on the device

```
$ ls -l /dev/bus/usb/002/004                 

crw-rw-r-- 1 root usb 189, 131 Dec  2 20:57 /dev/bus/usb/002/004
```

After 

```
# chgrp lp /dev/bus/usb/002/004

# ls -l /dev/bus/usb/002/004

crw-rw-r-- 1 root lp 189, 131 Dec  2 21:09 /dev/bus/usb/002/004
```

everything works flawlessly.

I don't know enough about udev: net-print/hplip-3.9.10  writes /etc/udev/rules.d/55-hpmud.rules, of which the first entry seems to be one pertaining to my PSC (i.e., 03f0:3611):

```
# HPLIP udev rules file for HP printer and all-in-one products.

#                                                              

# Notes for downstream implementers.                           

#                                                              

#   1. The 55-hpmud.rules name was chosen in order to run after the default udev rule /etc/udev/rules.d/50-udev.rules. See

#      "Writing udev rules" Ver 0.74, Daniel Drake. Although it seems 50-udev.rules is no longer used I continue to reuse "55-"

#      name for backward compatibility with older distros. 2/11/2009, D Suffield                                               

#                                                                                                                              

#   2. It seems SFSFS has been replaced or depreciated by ATTR/ATTRS, but I continue to use SFSFS in order to be compatible with 

#      older distros. SFSFS was defined in "Writing udev rules" Ver 0.72, Daniel Drake. 2/11/2009, D Suffield                    

#                                                                                                                                

#   3. This rules file is an attempt at being compatable with all distros. Feel free to make your own changes and if you feel your

#      changes are not distro specific please send your patch to us. 2/11/2009, D Suffield                                        

#                                                                                                                                 

ACTION!="add", GOTO="hpmud_rules_end"

SUBSYSTEM=="ppdev", OWNER="root", GROUP="lp", MODE="0660"

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="hplip_pid_test"

SUBSYSTEM!="usb_device", GOTO="hpmud_rules_end"                    

LABEL="hplip_pid_test"

# Check for AiO products (0x03f0xx11).

ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??11", OWNER="root", GROUP="lp", MODE="660"

# Check for Photosmart products without wildcard since cameras and scanners also used (0x03f0xx02).

# The xx02 pid has been retired so this explicit list should not change.

# photosmart_d2300_series

<snip>

```

It seems the device ends up with group membership that is at odds with what hplip expects (at least in terms of print functionality): if I unplug/plug the printer, that device and its corrected permissions goes away, and a new device with usb group appears

```
$ dmesg | tail

[ 4473.221161] usb 2-1: USB disconnect, address 4

[ 4556.622041] usb 2-1: new full speed USB device using ohci_hcd and address 5

[ 4556.824052] usb 2-1: New USB device found, idVendor=03f0, idProduct=3611

[ 4556.824056] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[ 4556.824059] usb 2-1: Product: psc 2400 series

[ 4556.824061] usb 2-1: Manufacturer: hp

[ 4556.824063] usb 2-1: SerialNumber: MY41EJ14PZ6T

[ 4556.824170] usb 2-1: configuration #1 chosen from 1 choice

[ 4556.828205] scsi9 : SCSI emulation for USB Mass Storage devices

[ 4556.828309] usb-storage: device found at 5

[ 4556.828312] usb-storage: waiting for device to settle before scanning

[ 4561.835137] scsi 9:0:0:0: Direct-Access     HP       psc 2410         1.00 PQ: 0 ANSI: 2

[ 4561.835321] sd 9:0:0:0: Attached scsi generic sg4 type 0

[ 4561.857126] sd 9:0:0:0: [sde] Attached SCSI removable disk

[ 4561.857409] usb-storage: device scan complete

# ls -l  /dev/bus/usb/002/005

crw-rw-r-- 1 root usb 189, 132 Dec  2 21:34 /dev/bus/usb/002/005
```

Attempts to print now once again produce the error (from cups error_log):

```
D [02/Dec/2009:21:41:44 -0600] [Job 11] prnt/hpcups/HPCupsFilter.cpp 506: HPCUPS: StartPrintJob end of job, calling closeFilter()

D [02/Dec/2009:21:41:44 -0600] [Job 11] Backend returned status 1 (failed)

D [02/Dec/2009:21:41:44 -0600] [Job 11] Printer stopped due to backend errors; please consult the error_log file for details.

D [02/Dec/2009:21:41:44 -0600] [Job 11] End of messages

D [02/Dec/2009:21:41:44 -0600] [Job 11] printer-state=5(stopped)

D [02/Dec/2009:21:41:44 -0600] [Job 11] printer-state-message="Processing page 2..."

D [02/Dec/2009:21:41:44 -0600] [Job 11] printer-state-reasons=paused
```

After changing the device's group back to lp

```
# chgrp lp /dev/bus/usb/002/005
```

and clearing the paused status I retry the test and it again works fine.

```
tail /var/log/cups/access_log

localhost - - [02/Dec/2009:21:05:17 -0600] "POST /admin/ HTTP/1.1" 401 3077 CUPS-Add-Modify-Printer successful-ok

localhost - root [02/Dec/2009:21:05:17 -0600] "POST /admin/ HTTP/1.1" 200 3077 CUPS-Add-Modify-Printer successful-ok

localhost - root [02/Dec/2009:21:05:17 -0600] "POST /admin HTTP/1.1" 200 2177 - -

localhost - - [02/Dec/2009:21:41:42 -0600] "POST /printers/psc_2400 HTTP/1.1" 200 455 Print-Job successful-ok

localhost - - [02/Dec/2009:21:45:27 -0600] "POST /jobs HTTP/1.1" 401 140 Cancel-Job successful-ok

localhost - - [02/Dec/2009:21:45:29 -0600] "POST /jobs HTTP/1.1" 200 139 Cancel-Job successful-ok

localhost - - [02/Dec/2009:21:45:51 -0600] "POST /printers/psc_2400 HTTP/1.1" 401 124 Resume-Printer successful-ok

localhost - - [02/Dec/2009:21:45:51 -0600] "POST /printers/psc_2400 HTTP/1.1" 401 124 Resume-Printer successful-ok

localhost - root [02/Dec/2009:21:45:51 -0600] "POST /printers/psc_2400 HTTP/1.1" 200 124 Resume-Printer successful-ok

localhost - - [02/Dec/2009:21:46:03 -0600] "POST /printers/psc_2400 HTTP/1.1" 200 484 Print-Job successful-ok
```

How do I set udev perms such that this device always ends up in the right group for printing?

----------

## menace

It seems i'm getting a similar problem. When the LaserJet1200 is plugged into USB the wrong permissions are given by udev.

It get the root:lp ownership, but no write permission to the group.

```
crw-r--r-- 1 root lp  189, 272 Dec 11 19:44 017 
```

My user is in the lp group of course. If i add g+w permission the device, everything works.

55-hpmud.rules contains only MODE="660" rules which should give the correct MODE (AFAIK, i'm not really up to speed with udev), so i don't know where this permission comes from.

I'm now sure when this change occured, but i think it was after an hplip upgrade.

----------

## rsa4046

After looking at similar bug reports, I realized that /usr/portage/net-print/hplip/files/70-hpmud.rules does not get put /etc/udev/rules.d

```
# Udev rules file for HP printer products.

ACTION!="add", GOTO="hpmud_rules_end"

SUBSYSTEM!="usb|usb_device", GOTO="hpmud_rules_end"

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

# Check for AiO products (0x03f0xx11).

ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??11", GROUP="lp"

# Check for Photosmart products (0x03f0xx02).

ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??02", GROUP="lp"

# Check for Business Inkjet products (0x03f0xx12).

ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??12", GROUP="lp"

# Check for Deskjet products (0x03f0xx04).

ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??04", GROUP="lp"

# Check for LaserJet products (0x03f0xx17).

ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??17", GROUP="lp"

LABEL="hpmud_rules_end"

```

Installing this file fixes the lp versus usb problem, thus returning print functionality, although I haven't tried scanning or other functions.

----------

