# Problems with USB Printer (HP LaserJet 1020)

## CodAv

Hi,

after a world update, I have serious problem getting my HP LaserJet 1020 working again. Before the world update, everything worked fine. Now, when I switch my printer on, dmesg shows these messages:

```
usb 1-1: new high speed USB device using ehci_hcd and address 6

drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 6 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2B17

printk: 5363 messages suppressed.

drivers/usb/class/usblp.c: usblp0: failed reading printer status

drivers/usb/class/usblp.c: usblp0: error -110 reading printer status

drivers/usb/class/usblp.c: usblp0: failed reading printer status

drivers/usb/class/usblp.c: usblp0: error -110 reading printer status

drivers/usb/class/usblp.c: usblp0: error -110 reading printer status

drivers/usb/class/usblp.c: usblp0: error -110 reading printer status

drivers/usb/class/usblp.c: usblp0: nonzero read/write bulk status received: -71

drivers/usb/class/usblp.c: usblp0: nonzero read/write bulk status received: -71

drivers/usb/class/usblp.c: usblp0: error -71 reading printer status

drivers/usb/class/usblp.c: usblp0: error -71 reading printer status

drivers/usb/class/usblp.c: usblp0: error -71 reading printer status

drivers/usb/class/usblp.c: usblp0: error -71 reading printer status

drivers/usb/class/usblp.c: usblp0: error -71 reading printer status

drivers/usb/class/usblp.c: usblp0: error -71 reading printer status

drivers/usb/class/usblp.c: usblp0: error -71 reading printer status

drivers/usb/class/usblp.c: usblp0: error -71 reading printer status

drivers/usb/class/usblp.c: usblp0: error -71 reading printer status

drivers/usb/class/usblp.c: usblp0: error -71 reading printer status
```

usb_printerid also just gets an error:

```
codav ~ # usb_printerid /dev/usb/lp0

Error: Input/output error: GET_DEVICE_ID on '/dev/usb/lp0'
```

The device has been created by udev, there is also a symlink to it at /dev/hplj1020. I followed the directions in https://forums.gentoo.org/viewtopic-t-437476.html but with no luck. The printer just won't communicate with me.

The funny thing is, if I comment out the udev rules written by foo2zjs, and run the firmware upload script manually, the printer works nicely.   :Shocked: 

Here are the rules:

```
#Own udev rule for HP Laserjet 1000

KERNEL="lp*", BUS="usb", SYSFS{idVendor}="03f0", SYSFS{idProduct}="0517", NAME="usb/%k", SYMLINK="hplj1000%e", MODE="0666", RUN+="/sbin/foo2zjs-loadfw 1000"

KERNEL="lp*", BUS="usb", SYSFS{idVendor}="03f0", SYSFS{idProduct}="1317", NAME="usb/%k", SYMLINK="hplj1005%e", MODE="0666", RUN+="/sbin/foo2zjs-loadfw 1005"

KERNEL="lp*", BUS="usb", SYSFS{idVendor}="03f0", SYSFS{idProduct}="4117", NAME="usb/%k", SYMLINK="hplj1018%e", MODE="0666", RUN+="/sbin/foo2zjs-loadfw 1018"

KERNEL="lp*", BUS="usb", SYSFS{idVendor}="03f0", SYSFS{idProduct}="2b17", NAME="usb/%k", SYMLINK="hplj1020%e", MODE="0666", RUN+="/sbin/foo2zjs-loadfw 1020"
```

Any ideas what exactly is going wrong with udev?

----------

## paddlaren

I got the same problem on my girlfriends computer. I discovered that the version of foo2jzs that was working no longer exists in portage. Then I got mad!

I solved it by doing an unemerge for the foo2jzs and some strange hp-printer tool that was installed. I then downloaded the source from foo2jzs homepage, compiled and installed as the INSTALL file guides me to and now it seems to work.

One problem though.

Last night I spoke with her and she had problem with the printer. We found that the printer was set dissabled in the KDE printer manager. I know that I put the printer enabled last weekend. This is a new problem and I do not know if it is related to what I described above. 

It beats me that when I made the update that fu**ed up things I allso hade to resolve a emerge blocking problem. I cannot remember what it was and I do not have the logs here but I do know that it was a foo-something. It was not the foo2jzs thoug. Can this been a package to handle the firmware, the one you edited above?

// Erik

----------

## CodAv

The rules I posted are from the foo2zjs package. The problem, at least in my case, seems to be a problem regarding the tasks ran by udev. With the original file, udevtest gives me the following output (I replaced %e by %n, to get rid of the warning message below and ensure correct numbering of the symlink):

```
codav rules.d # udevtest /class/usb/lp0

main: looking at device '/class/usb/lp0' from subsystem 'usb'

udev_rules_get_name: reset symlink list

find_free_number: %e is deprecated, will be removed and is unlikely to work correctly. Don't use it.

udev_rules_get_name: add symlink 'hplj1020'

udev_rules_get_name: rule applied, 'lp0' becomes 'usb/lp0'

udev_device_event: device '/class/usb/lp0' already known, remove possible symlinks

udev_node_add: creating device node '/dev/usb/lp0', major = '180', minor = '0', mode = '0666', uid = '0', gid = '0'

udev_node_add: creating symlink '/dev/hplj1020' to 'usb/lp0'

main: run: '/sbin/foo2zjs-loadfw 1020'

main: run: '/sbin/modprobe '

main: run: '/sbin/udev_run_devd usb'

main: run: 'socket:/org/kernel/udev/monitor'

main: run: 'socket:/org/freedesktop/hal/udev_event'
```

This does not work. After a bit of testing, I worked out that the HAL event script somehow blocks any interaction with the printer. Removing the command from the "RUN" list made the printer work again.

A workaround is to create two rule files. The first at position 11, creating the device symlink "hplj1010%n", and the second after the HAL rules, at position 95, adding the firmware upload script to the "RUN" list so it runs after the HAL event script. This is no real solution to the actual problem.

Now I am a little unsure whether to file a bugreport or not, and for which product actually - is it HAL or udev going crazy on me? Or both?

----------

## gasparov

Could you explain what you did and if does work please?

I tried removing the RUN+ part of udev rules in position 11,then i made a rule in 95 similar but with no symlink part and just the RUN+ part...no luck

Are you using hplip?

Start Time:14:00

Now:18:19

Printed pages:0

Damn it....a guy has gives for free his laserjet 1020 to the foo2zjs guy and still stuff doesn't work,for ex the ex command was changed to ed a few version ago (Gentoo fix),guess what comand was present on latest version?

----------

## gasparov

thanks

----------

## paddlaren

It's been a while since I got the printer working. Both in gentoo and Kubunto 6.06 (more sutable for my girlfriend).

The solution is rather easy, though it will be discharged when the foo2zjs and probably some other ebuilds is updated.

What I did was the following:

First I emerged the foo2jzs from portage.

Second I downloaded the foo2zjs driver sources from the original site: http://foo2zjs.rkkda.com/

I compiled and installed it according to the instructions, including the fetching of latest firmware for the HP-printer. There is a lot of targets to make for this one so take a good look in the README and INSTALL file.

Note that the site saye the following about Gentoo and some other distros:

 *Quote:*   

> *** DON'T USE the foo2zjs package from Ubuntu, SUSE, Mandrake/Manrivia, Debian, RedHat, Gentoo, or ideainformatica.com! 
> 
> *** Download it here and follow the directions below.

 

I will now save the compiled source and if the printer starts failing again I will first try to reinstall this files.  :Idea: 

I gues that we must make sure that a troublereport is filed for this   :Exclamation:  .

----------

## CodAv

This notice has been added recently. For me it looks that some problems have been fixed upstream (e.g. the udev problem), and the package maintainers of the major distributions just need to catch up on it. I added a bug report to Bugzilla:

https://bugs.gentoo.org/show_bug.cgi?id=136550

For your particular problem, I suggest to delete the udev rule the ebuild placed in your /etc/udev/rules.d folder before installing the package manually.

----------

## paddlaren

 *CodAv wrote:*   

> This notice has been added recently. For me it looks that some problems have been fixed upstream (e.g. the udev problem), and the package maintainers of the major distributions just need to catch up on it. I added a bug report to Bugzilla:
> 
> https://bugs.gentoo.org/show_bug.cgi?id=136550
> 
> For your particular problem, I suggest to delete the udev rule the ebuild placed in your /etc/udev/rules.d folder before installing the package manually.

 

Nop!

I remember I've seen the message there since early this year.

For me the printer works now and  the point was to share that to others with similar problem. If this works on larger scale please tell the forum and the owner of this thread can add [solved] in the subject.

// Erik

----------

## CodAv

I started the thread, but my problem seems to be different from yours. My problem are in fact only the udev rules and some weird incompatibility with the HAL udev script. I'll wait for the maintainers to fix the ebuild and push it to the latest version, which - as the changelog states - has corrected those errors. When everything runs fine, I'll surely add [SOLVED] to the topic   :Smile: 

----------

## paddlaren

The problem I had was actualy that the printer was not detected properly and the printer firmware was not downloaded. Once this was solved, the printer was easy to install and use.

What I THINK I mannaged with the installation of my own foo2zjs-driver was to use the udev-rules from the original driver with seems to work.

When the printer is powered on, it make a little bruuum. When the firmware is downloaded it makes a second bruuum just a few seconds later. Once this happen, the porinter is functionalk. Whitout this the printer will not function since the printer do not carry it's own firmware.

// Erik

----------

## jleejj

I finally just got this printer to work after 3 months of issues.  My solution is here:

https://forums.gentoo.org/viewtopic-p-3868823.html#3868823

I've posted this link on several different threads around the forums in the hopes that I can save someone else some time.

----------

