OpenPrinting / ipp-usb

ipp-usb -- HTTP reverse proxy, backed by IPP-over-USB connection to device
BSD 2-Clause "Simplified" License
129 stars 11 forks source link

Immediately detach from devices with claimed but broken IPP over USB support #52

Closed alexpevzner closed 2 years ago

alexpevzner commented 2 years ago

Some printers announce presence of the 7/1/4 interfaces, but IPP over USB doesn't work due to their firmware errors. At least two of such devices already known:

HP Inc. HP Laser MFP 135a
HP Inc. HP Laser 107a

The proposed solution from here: https://bugs.launchpad.net/ubuntu/+source/ipp-usb/+bug/1970055

@tillkamppeter

Alexander, as ipp-usb starts to communicate with the printer as soon as it attaches to it, you could perhaps add a mechanism that somehow finds out whether the printer is actually driverless or not, and if not, unattach ipp-usb immediately to give way for classic access (CUPS backend or Printer Application).

Basically, I agree with the following comments:

  1. There will be possible race condition between failed attempt of the ipp-usb to initialize the device and CUPS attempt to claim the device. If device looks like taken by the ipp-usb, CUPS should retry within a some reasonable time
  2. Some visibility is required that ipp-usb has rejected the device due to initialization error, to simplify processing of users' bug reports. Should such a device still be advertised on Avahi on some special manner, so CUPS/sane-airscan will ignore it, but it still can be listed with avahi-browse?
alexpevzner commented 2 years ago

Some visibility is required that ipp-usb has rejected the device due to initialization error, to simplify processing of users' bug reports. Should such a device still be advertised on Avahi on some special manner, so CUPS/sane-airscan will ignore it, but it still can be listed with avahi-browse?

My answer to myself here is the newly added ipp-usb status command, which prints actual status of all attached/recognized 7/1/4 devices, including those of them which are ignored by the ipp-usb either due to the explicit blacklisting, or because device initialization failed.

alexpevzner commented 2 years ago

Done in 0.9.22