USB printer not re-enabled when it is turned on

Bug #139317 reported by mikko
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
hal-cups-utils (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

Binary package hint: system-config-printer

I have Brother DCP-7010 printer with Brother's own drivers and it works perfect. But if I turn it off and then on again, system-config-printer doesn't recognize it, status of the printer is set to "stopped". I have to go to the system-config-printer every time and select the box "in use" (or something, I don't know what it is in english) again and press the button in lower right corner.

Revision history for this message
mikko (mikko-) wrote :
Revision history for this message
mikko (mikko-) wrote :
Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

Which s-c-p version are you using ?

Changed in system-config-printer:
status: New → Incomplete
Revision history for this message
mikko (mikko-) wrote :

gutsy, newest updates, 0.7.74
no problems in feisty

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

0.7.74 is not enough for informations. Which version are you using (last is : 0.7.74+svn1504-0ubuntu1) ?

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

To see changes, s-c-p must be close and re-opened.
If you stay with s-c-p open on your printer, power on printer do not change his status

Revision history for this message
mikko (mikko-) wrote :

0.7.74+svn1504-0ubuntu1

If s-c-p is closed and I do power off and on, next time my printer is set to "not in use."

If s-c-p is open, same box stays "in use" but the printer still doesn't work when I try to print something. And when I restart s-c-p or press the "update" button printer status goes to "stopped."

I think s-c-p should remember all the settings althought printer is powered off.?

Revision history for this message
mikko (mikko-) wrote :

Maybe this is a cups problem, not s-c-p??

Revision history for this message
Tim Waugh (twaugh) wrote :

No, it'll be the fact that hal-cups-utils sets the queue disabled when the device is disconnected.

I wonder if we ought to just leave the queue alone when the device is disconnected. If a job is sent to it CUPS will mark it disabled anyway.

Revision history for this message
mikko (mikko-) wrote :

Why in feisty this wasn't a problem? Printer was always active and ready to print after turning on.

Could cups then make the device active again automatically?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

How it should work is that if an already installed USB printer is disconnected or turned off that its queue is automatically disabled by hal-cups-utils and if it is turned on again that its queue gets enabled again. This avoids that CUPS resends jobs periodically to printers which are turned off

This is done by the script /usr/lib/hal/scripts/hal_lpadmin which is triggered by HAL.

I attach a replacement for this script where I have done the following improvements: No call of a scan of all available printers by CUPS is done any more. This took a rather long time and then enabling and disabling of the queues happens long after the power on/off events and this can cause confusion when the printer is power-cycled quickly. Plug'n'Print is also much faster now. I have also fixed a bug of queues with another than the default name not being re-enabled.

Tim, can you add the new version upstream into the hal-cups-utils package? Or better give me SVN write access there, too? Thanks.

Mikko, can you download the attached script and replace /usr/lib/hal/scripts/hal_lpadmin by it enabling and disabling of your printer should happen much more quickly after plugging it now, And if you have manually assigned a name to your queue (or the queue is created by a pre-Gutsy Ubuntu) now re-enabling should really work.

Changed in system-config-printer:
importance: Undecided → Medium
status: Incomplete → In Progress
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Please take this new attachment, the first one created fax queues also for non-fax HP printers.

Revision history for this message
mikko (mikko-) wrote :

Thanks!

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Fixed upstream in the subversion repository.

Changed in hal-cups-utils:
status: In Progress → Fix Committed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

hal-cups-utils (0.6.12+svn77-0ubuntu1) gutsy; urgency=low

  * New upstream release
     o Subversion snapshot r77
     o Fixed re-enabling printers when they are turned on. Re-enabling did
       not work when the queue name was not the one generated when
       hal-cups-utils auto-creates print queues. So every manually
       created queue stayed disabled. Fixes LP: #139317
     o Avoid auto-disabling HPLIP-based print queues when HPLIP accesses
       the printer for the first time and uncouples it from the "usblp"
       kernel module.
     o Made auto-setup and re-enabling HPLIP-based print queues much
       faster
  * debian/patches/00_fix_libexec.patch: Removed, fixed upstream.
  * debian/patches/10_get_ppds_from_cups_in_configure_mode.patch,
    debian/patches/20_fix_usb_uris_fix_hplip_add_fax_queues_disabled_unplugged_printer.patch:
    Removed, merged upstream.

 -- Till Kamppeter <email address hidden> Fri, 14 Sep 2007 10:04:15 +0100

Changed in hal-cups-utils:
status: Fix Committed → Fix Released
Revision history for this message
Wowbagger (ha87psc02) wrote :

This is NOT fixed in Intrepid: I have 2 HP printers on USB (one laser printer, one ink jet), and in both cases if the printer is turned off when CUPS starts, the printer is marked "Disabled" and is not re-enabled when the printer is turned on.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Wowbagger, can you post the output of "lpstat -p", once before turning on the printers and once after? Can you also post the output of "lpstat -v"? Can you post the logging which goes into /var/log/syslog when turning on the printers?

Revision history for this message
blast (blastg) wrote :

Hi all,
same for me with HP LJ 1020 and Intrepid (hal-cups-utils is 0.6.17+git20080728-0ubuntu2)

When I turn printer on it's disabled and all print jobs go to queue.

After manually re-enable printer using "enable flag" in system-config-printer (1.0.5) all works fine.

Revision history for this message
Pekka Tiittanen (pekka-tiittanen) wrote :

This same issue is still in Intrepid for me too. I didn't have this one in earlier versions, for me it surfaced when upgrading to Intrepid from Hardy.

Revision history for this message
TDB (michael-baranov) wrote :

Same issue for me in 8.10 after certain system update.
Once my HPLaserJet 1018 is turned off, CUPS printer status changes to "not enabled" and I need to manually go an enable it when I power it up again.

Revision history for this message
Dude4Linux (dude4linux) wrote :

Same issue for me with new install of 8.10. I have an HP LaserJet 1020 with USB.
dude@ns01:~$ uname -a
Linux ns01 2.6.27-11-generic #1 SMP Thu Jan 29 19:28:32 UTC 2009 x86_64 GNU/Linux
dude@ns01:~$ lpinfo -v
network socket
network beh
direct hal:///org/freedesktop/Hal/devices/usb_device_3f0_2b17_JL1ANRG_0_if0_printer_noserial
direct hal:///org/freedesktop/Hal/devices/usb_device_3f0_2b17_JL1ANRG_if0_printer_noserial
direct hpfax
direct usb://HP/LaserJet%201020
direct hp:/usb/HP_LaserJet_1020?serial=JL1ANRG
network http
network ipp
network lpd
direct scsi
serial serial:/dev/ttyS0?baud=115200
network smb
dude@ns01:~$ sudo cat /etc/cups/printers.conf
# Printer configuration file for CUPS v1.3.9
# Written by cupsd on 2009-02-17 21:28
<DefaultPrinter HP-LaserJet-1020>
Info Hewlett-Packard HP LaserJet 1020
Location ns01.carverfamily.name
DeviceURI hp:/usb/HP_LaserJet_1020?serial=JL1ANRG
State Stopped
StateMessage Unplugged or turned off
StateTime 1234927713
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>
dude@ns01:~$ lsusb
Bus 005 Device 009: ID 03f0:2b17 Hewlett-Packard LaserJet 1020
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 046d:c001 Logitech, Inc. N48/M-BB48 [FirstMouse Plus]
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 004: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Revision history for this message
Dude4Linux (dude4linux) wrote :

*** Additional information starting with printer on and enabled in system-config-printer.
dude@ns01:~$ lpstat -v
device for HP-LaserJet-1020: hp:/usb/HP_LaserJet_1020?serial=JL1ANRG
dude@ns01:~$ lpstat -p
printer HP-LaserJet-1020 is idle. enabled since Tue 17 Feb 2009 09:54:45 PM CST
*** Turned printer off
dude@ns01:~$ Feb 17 21:56:33 ns01 kernel: [1314474.797074] usb 5-4: USB disconnect, address 10
Feb 17 21:56:33 ns01 kernel: [1314474.799730] usblp0: removed
Feb 17 21:56:33 ns01 hal_lpadmin: Running hal_lpadmin
Feb 17 21:56:34 ns01 hal_lpadmin: hal_lpadmin triggered by usblp kernel module
Feb 17 21:56:34 ns01 hal_lpadmin: Using device ID from HAL database entry
Feb 17 21:56:34 ns01 hal_lpadmin: remove
Feb 17 21:56:34 ns01 hal_lpadmin: Found configured printer: HP-LaserJet-1020
Feb 17 21:56:34 ns01 hal_lpadmin: Disabled printer HP-LaserJet-1020, as the corresponding device was unplugged or turned off
Feb 17 21:56:34 ns01 hal_lpadmin: Running hal_lpadmin
Feb 17 21:56:35 ns01 hal_lpadmin: hal_lpadmin triggered by low-level USB device
Feb 17 21:56:35 ns01 hal_lpadmin: Polling device ID from the printer
Feb 17 21:56:35 ns01 hal_lpadmin: Written device ID into HAL database entry
Feb 17 21:56:35 ns01 hal_lpadmin: remove
Feb 17 21:56:35 ns01 hal_lpadmin: Found configured printer: HP-LaserJet-1020
lpstat -p
printer HP-LaserJet-1020 disabled since Tue 17 Feb 2009 09:56:34 PM CST -
 Unplugged or turned off
*** Turned printer on
dude@ns01:~$ Feb 17 21:57:07 ns01 kernel: [1314508.972028] usb 5-4: new high speed USB device using ehci_hcd and address 11
Feb 17 21:57:07 ns01 kernel: [1314509.124787] usb 5-4: configuration #1 chosen from 1 choice
Feb 17 21:57:07 ns01 kernel: [1314509.130549] usblp0: USB Bidirectional printer dev 11 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2B17
Feb 17 21:57:07 ns01 /usr/sbin/hplj1020: foo2zjs: loading HP LaserJet 1020 firmware /usr/share/foo2zjs/firmware/sihp1020.dl to /dev/usb/lp0 ...
Feb 17 21:57:07 ns01 hal_lpadmin: Running hal_lpadmin
Feb 17 21:57:07 ns01 /usr/sbin/hplj1020: foo2zjs: ... download successful.
Feb 17 21:57:08 ns01 hal_lpadmin: hal_lpadmin triggered by low-level USB device
Feb 17 21:57:08 ns01 hal_lpadmin: Polling device ID from the printer
Feb 17 21:57:08 ns01 hal_lpadmin: Device 005:011: /org/freedesktop/Hal/devices/usb_device_3f0_2b17_JL1ANRG_1_if0
Feb 17 21:57:08 ns01 hal_lpadmin: Stopping hal_lpadmin triggered by low-level USB device
lpstat -p
printer HP-LaserJet-1020 disabled since Tue 17 Feb 2009 09:56:34 PM CST -
 Unplugged or turned off

Revision history for this message
crys (schaefec) wrote :

Same here with a Canon Pixma ip5200.

Revision history for this message
crys (schaefec) wrote :

Same here with a Canon Pixma ip5200 on jaunty amd64.

Revision history for this message
skillllllz (bmustafa) wrote :

I am suddenly experiencing the exact same issue on several Intrepid boxes with USB printers. The computers are various models by Dell, and the printers are either Brother HL2170W or HL2070N models. Is there any way to prevent this from occuring?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The HP LaserJet 1020 should re-enable fine in Jaunty. I have this printer and have tested it.

For any other printer please re-enable it with system-config-printer (or the "cupsenable" command), then unplug the printer, wait 5 seconds and plug it again. After that attach /var/log/syslog here.

Changed in hal-cups-utils:
status: Fix Released → Incomplete
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Anyone who has still problems with printers not getting re-enabled when turning them on, please replace your file

/usr/lib/hal/scripts/hal_lpadmin

by the attached file and make it executable with

sudo chmod 755 /usr/lib/hal/scripts/hal_lpadmin

Then unplug and replug your printer. Does it get re-enabled now?

If this helps, your problem would also be bug 341646.

Revision history for this message
TDB (michael-baranov) wrote :

The above instructions did not change anything for me...

Can I provide any info to help crack this problem?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Then your problem is not covered by these changes.

Please re-enable your printer with system-config-printer (or the "cupsenable" command), then unplug the printer, wait 5 seconds and plug it again. After that attach /var/log/syslog here.

Revision history for this message
crys (schaefec) wrote :

Here is my relevant syslog after applying these instructions.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Christian Schaefer, can you also post the output of "lpstat -v", of "sudo usb_printerid /dev/usb/lp0", of "sudo usb_printerid /dev/usb/lp1", and your PPD file (/etc/cups/ppd/IP5200.ppd?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Christian Schaefer, did you try my new version of hal_lpadmin which I attached to this bug yesterday (or did you update hal-cups-utils to the new version from yesterday, 0.6.19+git20090217-0ubuntu2)?

Revision history for this message
crys (schaefec) wrote :

Yes, the problem still occurs with hal-cups-utils 0.6.19+git20090217-0ubuntu2.
Here are the desired outputs:

root@tatooine:~# lpstat -v
device for IP5200: usb://Canon/iP5200

root@tatooine:~# usb_printerid /dev/usb/lp0
GET_DEVICE_ID string:
MFG:Canon;CMD:BJL,BJRaster3,BSCCe;SOJ:TXT01;MDL:iP5200;CLS:PRINTER;DES:Canon iP5200;VER:1.05;STA:10;FSI:03;HRI:OTH;

root@tatooine:~# usb_printerid /dev/usb/lp1
Error: No such file or directory: can't open '/dev/usb/lp1'

IP5200.ppd is attached.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The problem was that hal_lpadmin has used different methods to determine whether for a printer reported by HAL there is already a print queue set up for the plugging and unplugging cases

Please replace your file

/usr/lib/hal/scripts/hal_lpadmin

by the attached file and make it executable with

sudo chmod 755 /usr/lib/hal/scripts/hal_lpadmin

Then unplug and replug your printer. Does it get re-enabled now?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package hal-cups-utils - 0.6.19+git20090217-0ubuntu3

---------------
hal-cups-utils (0.6.19+git20090217-0ubuntu3) jaunty; urgency=low

  * debian/patches/15_hal-lpadmin-fix-device-id-reading-find-configured-queues-by-same-method-for-plug-and-unplug.patch:
    Fixed reading of the printer device ID (LP: #306301) and let hal_lpadmin
    use the same method for finding already configured CUPS queues on plugging
    and unplugging the printer (LP: #341646, LP: #139317).

 -- Till Kamppeter <email address hidden> Sat, 14 Mar 2009 00:00:32 +0100

Changed in hal-cups-utils:
status: Incomplete → Fix Released
Revision history for this message
crys (schaefec) wrote :

Yes, I can confirm that the problem is gone now with 0.6.19+git20090217-0ubuntu3.

Revision history for this message
TDB (michael-baranov) wrote :

Latest 9.04, 0.6.19+git20090217-0ubuntu7 : problem persists. Not enabled when powered up, works OK when manually enabled.

sudo lpstat -v
device for HP_LaserJet_1018: hp:/usb/HP_LaserJet_1018?serial=KP0P04F

sudo usb_printerid /dev/usb/lp0
Error: Device or resource busy: can't open '/dev/usb/lp0'

Revision history for this message
sschuller (xsjsx-deactivatedaccount) wrote :

Exactly as TDB says. f the printer (HP 1020) is turned on when 9.04 is running, it will load the firmware and run perfectly. However, if left 'on' during the next boot, it will appear to load the firmware at startup - the lights flash, etc., but the pattern is not the same as when manually started. The printer then will not work. At the next boot, the computer will hang for over a minute during the bios part of the boot cycle, making me think something with the USB is causing this.

Revision history for this message
Pelládi Gábor (pelladigabor) wrote :

Still a problem, hal-cups-utils 0.6.19+git20090217-0ubuntu7, HP LaserJet 1020. /var/log/syslog attached.
lpstat -p: (after replugging printer)
printer hp_laserjet_1020 disabled since 2009. jún. 2., kedd, 20.14.20 CEST -
        Unplugged or turned off
lpstat -v:
device for hp_laserjet_1020: hp:/usb/HP_LaserJet_1020?serial=FN20LG4

Changed in hal-cups-utils (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

With the deprecation of HAL, the hal-cups-utils get deprecated upstream and removed from Ubuntu, so any bugs in the hal_lpadmin script will not get fixed any more. A replacement for the script will soon appear in the system-config-printer-common package.

Changed in hal-cups-utils (Ubuntu):
milestone: ubuntu-7.10-beta → none
status: Confirmed → Won't Fix
Revision history for this message
TomaszChmielewski (mangoo-wpkg) wrote :

It's year 2012, and I have the same issue with 12.04 (and had with 11.10)...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.