Re: HP ScanJet Pro 3500 f1 Flatbed Scanner and Debian

2021-09-17 Thread Federico Grau
On Sat, Jun 26, 2021 at 04:17:10PM -0400, Federico Grau wrote:
> On Sat, Jun 26, 2021 at 08:44:40PM +0100, Brian Potkin wrote:
> > On Sat 26 Jun 2021 at 14:27:08 -0400, Federico Grau wrote:
> > 
> > > In brief, success with basic scanning after installing and selecting
> > > sane-airscan.  
> > 
> 
> I still have the ADF and 2-sided scanning to explore 
...

Hell again debian-printing,

I wanted to update some of my progress with the HP ScanJet Pro 3500 f1 Flatbed
Scanner and Debian.


Trying Debian 10 'buster' (now oldstable) did not function, as there is no
"sane-airscan" package in the standard distro.  That package is available via
backports, but I did not pursue that.


As identified earlier, Debian 11 'bullseye' worked very well.  Packages I had
to install were "sane-airscan" and "hplip".  I did not require "hplip-doc" or
"hplip-gui"; the latter provides a desktop GUI with scanner status, but also
runs additional daemon processes.  For a SANE frontend I focused on the
"simple-scan" package, which has fewer options/variables than xsane.  

Simply installing the above two packages and their dependencies (with a reboot
to ensure newly installed daemons were running, such as ipp-usb), allowed
scans to function to some degree via both the flatbed and ADF.  

I was surprised things functioned without the proprietary HP binary "plug-in",
both from the command line with "hp-scan" (in the hplip package) and with
simple-scan.  However, without the binary plug-in simple-scan appeared to have
a significant memory leak, consuming 4 to 12GB of RAM when scanning ~60 pages
from the ADF.  Additionally, without the binary plug-in simple-scan could only
use the ADF scanning both sides.  Trying to scan only the front or back with
the ADF resulted in long blank pages.

While initially I had added non-priv users to th "lp" group, trying a
reinstall without that group membership still functioned OK.  Non-priv users
could access and use the scanner.


To install the binary plug-in, I ran "hp-setup -i" from the hplip Debian
package as a non-priv user while the scanner was powered-on and connected.  I
selected the USB connected scanner, downloaded the plug-in, accepted the
license, and provided root credentials when prompted.  I also proceeded to
setup a "print queue" accepting the defaults, but I'm not clear if that was
needed (or if quiting early would interrupt the setup).

Using simple-scan, selecting the "eSCL HP ScanJet Pro 3500 f1 (USB)" scanner
option was the one that worked (out of the 4 available scanner
choices/protocols listed).

After the binary plug-in was installed, there were no obvious memory leaks
with simple-scan.  Trying to scan just the "front" or "back" from the ADF
mostly worked, scanning the text side regardless of the selection.  This
functioned well enough for me to complete the task at hand, and I did not
retest with source pages that had text on both sides.


Exploring higher quality scans and color calibration, the "argyll" Debian
package maintainer (Dmitry Smirnov) was very helpful.  He generously assisted
with a version upgrade of argyll that supported my calibration target (IT8).
Unfortunately, I reached a temporary roadblock, as I do not yet have an output
calibration hardware device to measure a monitor.  It seems xsane requires
both input and output calibration configs.  For now that study is paused.


On the upside I am pleased to have a functional scanner with an efficient ADF
that scans both sides in a single pass.  This is a step up from the old HP
scanner that performed legacy acrobatics to feed ADF sheets twice for double
sided scans, and worse it required a windows computer.  Looking ahead I hope
to resume exploring calibrated scans, and also OCR.  Thanks again everyone for
the good work and support.


happy hacking,
donfede




signature.asc
Description: PGP signature


Re: HP ScanJet Pro 3500 f1 Flatbed Scanner and Debian

2021-06-26 Thread Federico Grau
On Sat, Jun 26, 2021 at 08:44:40PM +0100, Brian Potkin wrote:
> On Sat 26 Jun 2021 at 14:27:08 -0400, Federico Grau wrote:
> 
> > In brief, success with basic scanning after installing and selecting
> > sane-airscan.  
> 
> Excellent. That's what we like to hear. I have not yet come across a
> modern device that has not worked with sane-airscan.
...
> Federico, I would like two things for my records:
> 
> * Conform that
> 
>  xsane "airscan:e0:HP ScanJet Pro 3500 f1 (USB)"
> 
>   produces scanning.
> 
> * Give the output of
> 
>  avahi-browse -rt _uscan._tcp
> 

Success scans using xsane, which I'm still learning, and simple-scan.  
No output worth reviewing.

Here is the avahi-browse output:

donfede@bwing:~$ avahi-browse -rt _uscan._tcp
+ lo IPv4 HP ScanJet Pro 3500 f1 (USB)  _uscan._tcp
local
= lo IPv4 HP ScanJet Pro 3500 f1 (USB)  _uscan._tcp
local
   hostname = [bwing.local]
   address = [127.0.0.1]
   port = [6]
   txt = ["duplex=T" "is=platen,adf" "cs=binary,color,grayscale"
"UUID=FCBF73D4-E19E-4c31-9AB6-569A9165C226"
"representation=http://localhost:6/icon.png;
"pdl=application/octet-stream,image/jpeg" "ty=HP ScanJet Pro 3500 f1"
"rs=eSCL" "vers=2.6" "txtvers=1"]
donfede@bwing:~$ echo $?
0
donfede@bwing:~$ 


I still have the ADF and 2-sided scanning to explore (hopefully later this
week).

regards,
donfede



signature.asc
Description: PGP signature


Re: HP ScanJet Pro 3500 f1 Flatbed Scanner and Debian

2021-06-26 Thread Brian Potkin
On Sat 26 Jun 2021 at 14:27:08 -0400, Federico Grau wrote:

> In brief, success with basic scanning after installing and selecting
> sane-airscan.  

Excellent. That's what we like to hear. I have not yet come across a
modern device that has not worked with sane-airscan.

> Thank you Brian (and pabs that was trying to suggest this to me in IRC)!
> 
> 
> The ipp-usb package was installed, but not sane-airscan (in this test Debian
> build).  For completeness, below is the output of the requested commands after
> installing sane-airscan and rebooting (just in case to remove as many
> variables).
> 
> 
> It's unclear to me the relationship between SANE and CUPS in the context with
> a dedicated scanner (makes sense with a MFD).  Is configuring a CUPS
> "print-queue" required?  Not sure if there's a brief explanation, or pointer
> where can one learn more about this?   Clearly there is more testing to try,
> and I'll read over wiki.d.o CUPSDriverlessPrintinga.

There isn't any relationship between SANE and CUPS with either an MFD
or a dedicated scanne. There is a relationship if libsane-hpaio with an
MFD is used, but that is a long story. Part of it is on our wiki.

However, while printing and scanning are technically different, Odyx
made a good decision in bringing sane-airscan under the printing team's
umbrella.

> Also, is there any quick info on the link between sane_open() and
> sane_hpaio_open()?  Expect it's a registered callback function, but where?
> The SANE API docs seem more "front end" focused (e.g.
> https://sane-project.gitlab.io/standard/api.html#sane-open).

I don't do programming things.

> I'll continue testing functionality further, and hope to share more findings
> in the next week or so.  This scanner is replacing a legacy HP Scanjet N6310,
> which required a windows system.  I'm so glad to shed that dependency with
> this new unit.  Many thanks again!
> 
> donfede
> 
> # console output of test commands after installing sane-airscan, rebooting,
> # and connecting scanner
> donfede@bwing:~$ systemctl status ipp-usb
> ● ipp-usb.service - Daemon for IPP over USB printer support
>  Loaded: loaded (/lib/systemd/system/ipp-usb.service; static)
>  Active: active (running) since Sat 2021-06-26 13:24:57 EDT; 20s ago
>Docs: man:ipp-usb(8)
>Main PID: 1522 (ipp-usb)
>   Tasks: 10 (limit: 4571)
>  Memory: 12.5M
> CPU: 84ms
>  CGroup: /system.slice/ipp-usb.service
>  └─1522 /sbin/ipp-usb udev

Exactly what one should get.

> Jun 26 13:24:57 bwing systemd[1]: Started Daemon for IPP over USB printer
> support.
> donfede@bwing:~$ 
> donfede@bwing:~$ scanimage -L
> device `hpaio:/usb/HP_ScanJet_Pro_3500_f1?serial=1234' is a 
> Hewlett-Packard HP_ScanJet_Pro_3500_f1 all-in-one
> device `hpaio:/net/hp_scanjet_pro_3500_f1?ip=127.0.0.1=false' is a 
> Hewlett-Packard hp_scanjet_pro_3500_f1 all-in-one
> device `airscan:e0:HP ScanJet Pro 3500 f1 (USB)' is a eSCL HP ScanJet Pro 
> 3500 f1 (USB) ip=127.0.0.1
> donfede@bwing:~$ 
> donfede@bwing:~$ airscan-discover 
> [devices]
>   HP ScanJet Pro 3500 f1 (USB) = http://127.0.0.1:6/eSCL/, eSCL

That's fine too.

Federico, I would like two things for my records:

* Conform that

 xsane "airscan:e0:HP ScanJet Pro 3500 f1 (USB)"

  produces scanning.

* Give the output of

 avahi-browse -rt _uscan._tcp

TIA,

Brian.



Re: HP ScanJet Pro 3500 f1 Flatbed Scanner and Debian

2021-06-26 Thread Federico Grau
On Sat, Jun 26, 2021 at 05:32:51PM +0100, Brian Potkin wrote:
> On Sat 26 Jun 2021 at 11:06:36 -0400, Federico Grau wrote:
> > On Fri, Jun 25, 2021 at 11:39:24PM +0100, Brian Potkin wrote:
> > > On Fri 25 Jun 2021 at 17:47:55 -0400, Federico Grau wrote:
> > > 
> > > > 
> > > > Hello Debian Printing Team,
> > > > 
> > > > Please Cc: me on responses, as I'm not currently subscribed to this 
> > > > mailing
> > > > list.  Advise if that's required.  Via IRC I am regularly present on 
> > > > OFTC
> > > > #debian-printing (UTC-4).
> > > > 
> > > > 
> > > > I'm trying to get an "HP ScanJet Pro 3500 f1 Flatbed Scanner" working 
> > > > with
> > > > Debian ...
> [...]
> 
> > Bus 003 Device 003: ID 03f0:5305 HP, Inc HP ScanJet Pro 3500 f1
> [...]
> >   bInterfaceClass 7 Printer 
> >   
> >   bInterfaceSubClass  1 Printer 
> >   
> >   bInterfaceProtocol  4
> [...]
> This appears twice and is a strong indication that the scanner is an
> IPP-over-USB (7/1/4) device and should be detected as such by ipp-usb.
> See
> 
>   https://wiki.debian.org/CUPSDriverlessPrinting
> 
> ipp-usb is a recommended package and should be there on the system.
> Check that the service is active when the scanner is plugged into USB:
> 
>   systemctl status ipp-usb
> 
> With sane-airscan installed please give
> 
>   scanimage -L
> 
> and
> 
>   airscan-discover
> 

In brief, success with basic scanning after installing and selecting
sane-airscan.  
Thank you Brian (and pabs that was trying to suggest this to me in IRC)!


The ipp-usb package was installed, but not sane-airscan (in this test Debian
build).  For completeness, below is the output of the requested commands after
installing sane-airscan and rebooting (just in case to remove as many
variables).


It's unclear to me the relationship between SANE and CUPS in the context with
a dedicated scanner (makes sense with a MFD).  Is configuring a CUPS
"print-queue" required?  Not sure if there's a brief explanation, or pointer
where can one learn more about this?   Clearly there is more testing to try,
and I'll read over wiki.d.o CUPSDriverlessPrinting.

Also, is there any quick info on the link between sane_open() and
sane_hpaio_open()?  Expect it's a registered callback function, but where?
The SANE API docs seem more "front end" focused (e.g.
https://sane-project.gitlab.io/standard/api.html#sane-open).


I'll continue testing functionality further, and hope to share more findings
in the next week or so.  This scanner is replacing a legacy HP Scanjet N6310,
which required a windows system.  I'm so glad to shed that dependency with
this new unit.  Many thanks again!

donfede



# console output of test commands after installing sane-airscan, rebooting,
# and connecting scanner
donfede@bwing:~$ systemctl status ipp-usb
● ipp-usb.service - Daemon for IPP over USB printer support
 Loaded: loaded (/lib/systemd/system/ipp-usb.service; static)
 Active: active (running) since Sat 2021-06-26 13:24:57 EDT; 20s ago
   Docs: man:ipp-usb(8)
   Main PID: 1522 (ipp-usb)
  Tasks: 10 (limit: 4571)
 Memory: 12.5M
CPU: 84ms
 CGroup: /system.slice/ipp-usb.service
 └─1522 /sbin/ipp-usb udev

Jun 26 13:24:57 bwing systemd[1]: Started Daemon for IPP over USB printer
support.
donfede@bwing:~$ 
donfede@bwing:~$ scanimage -L
device `hpaio:/usb/HP_ScanJet_Pro_3500_f1?serial=1234' is a 
Hewlett-Packard HP_ScanJet_Pro_3500_f1 all-in-one
device `hpaio:/net/hp_scanjet_pro_3500_f1?ip=127.0.0.1=false' is a 
Hewlett-Packard hp_scanjet_pro_3500_f1 all-in-one
device `airscan:e0:HP ScanJet Pro 3500 f1 (USB)' is a eSCL HP ScanJet Pro 3500 
f1 (USB) ip=127.0.0.1
donfede@bwing:~$ 
donfede@bwing:~$ airscan-discover 
[devices]
  HP ScanJet Pro 3500 f1 (USB) = http://127.0.0.1:6/eSCL/, eSCL
donfede@bwing:~$ echo $?
0
donfede@bwing:~$ 
donfede@bwing:~$ time hp-scan -g  -d 
'hpaio:/usb/HP_ScanJet_Pro_3500_f1?serial=1234' -s file -o test01.png 
...
Using device hpaio:/usb/HP_ScanJet_Pro_3500_f1?serial=1234
Opening connection to device...
DEBUG 21: before sane.openDevice
error: SANE: Error during device I/O (code=9)

real0m4.101s
user0m0.707s
sys 0m0.826s
donfede@bwing:~$ 

root@bwing:~# ss -aptunx | grep 6000
tcp   LISTEN 0  4096
*:6*:* users:(("ipp-usb",pid=1522,fd=14))   

  
root@bwing:~# 

# success scan, selecting airscan device
donfede@bwing:~$ time hp-scan -g   -s file -o test01.png 

HP Linux Imaging and Printing System (ver. 3.21.2)
Scan Utility ver. 2.2

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute 

Re: HP ScanJet Pro 3500 f1 Flatbed Scanner and Debian

2021-06-26 Thread Brian Potkin
On Sat 26 Jun 2021 at 11:06:36 -0400, Federico Grau wrote:

> On Fri, Jun 25, 2021 at 11:39:24PM +0100, Brian Potkin wrote:
> > On Fri 25 Jun 2021 at 17:47:55 -0400, Federico Grau wrote:
> > 
> > > 
> > > Hello Debian Printing Team,
> > > 
> > > Please Cc: me on responses, as I'm not currently subscribed to this 
> > > mailing
> > > list.  Advise if that's required.  Via IRC I am regularly present on OFTC
> > > #debian-printing (UTC-4).
> > > 
> > > 
> > > I'm trying to get an "HP ScanJet Pro 3500 f1 Flatbed Scanner" working with
> > > Debian, but currently stuck at "SANE: Error during device I/O (code=9)".
> > 
> > I believe this is a USB-only device. Please give 'lsusb -v'.
> > 
> 
> Thanks fore the feedback Brian,
> 
> Yes, the "HP ScanJet Pro 3500 f1 Flatbed Scanner" scanner is USB only.  Below
> is the output of lsusb and some other commands.  These were run from an
> 'older' T61 laptop (circa 2008), but expect that's not the issue given similar
> errors with other newer systems.

Thank you for the wealth of detail, Federico. 
 
> # full lsusb -v output
> 
> root@bwing:~# 
> root@bwing:~# lsusb -v

As a user would have been sufficient for this command.

[...]

> Bus 003 Device 003: ID 03f0:5305 HP, Inc HP ScanJet Pro 3500 f1

[...]

>   bInterfaceClass 7 Printer   
> 
>   bInterfaceSubClass  1 Printer   
> 
>   bInterfaceProtocol  4

[...]

This appears twice and is a strong indication that the scanner is an
IPP-over-USB (7/1/4) device and should be detected as such by ipp-usb.
See

  https://wiki.debian.org/CUPSDriverlessPrinting

ipp-usb is a recommended package and should be there on the system.
Check that the service is active when the scanner is plugged into USB:

  systemctl status ipp-usb

With sane-airscan installed please give

  scanimage -L

and

  airscan-discover

Regards,

Brian.



Re: HP ScanJet Pro 3500 f1 Flatbed Scanner and Debian

2021-06-26 Thread Federico Grau
On Fri, Jun 25, 2021 at 11:39:24PM +0100, Brian Potkin wrote:
> On Fri 25 Jun 2021 at 17:47:55 -0400, Federico Grau wrote:
> 
> > 
> > Hello Debian Printing Team,
> > 
> > Please Cc: me on responses, as I'm not currently subscribed to this mailing
> > list.  Advise if that's required.  Via IRC I am regularly present on OFTC
> > #debian-printing (UTC-4).
> > 
> > 
> > I'm trying to get an "HP ScanJet Pro 3500 f1 Flatbed Scanner" working with
> > Debian, but currently stuck at "SANE: Error during device I/O (code=9)".
> 
> I believe this is a USB-only device. Please give 'lsusb -v'.
> 

Thanks fore the feedback Brian,

Yes, the "HP ScanJet Pro 3500 f1 Flatbed Scanner" scanner is USB only.  Below
is the output of lsusb and some other commands.  These were run from an
'older' T61 laptop (circa 2008), but expect that's not the issue given similar
errors with other newer systems.


# full lsusb -v output

root@bwing:~# 
root@bwing:~# lsusb -v

Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass9 Hub
  bDeviceSubClass 0 
  bDeviceProtocol 0 Full speed (or root) hub
  bMaxPacketSize064
  idVendor   0x1d6b Linux Foundation
  idProduct  0x0002 2.0 root hub
  bcdDevice5.10
  iManufacturer   3 Linux 5.10.0-7-amd64 ehci_hcd
  iProduct2 EHCI Host Controller
  iSerial 1 :00:1d.7
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   0x0019
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0 
bmAttributes 0xe0
  Self Powered
  Remote Wakeup
MaxPower0mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 9 Hub
  bInterfaceSubClass  0 
  bInterfaceProtocol  0 Full speed (or root) hub
  iInterface  0 
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0004  1x 4 bytes
bInterval  12
Hub Descriptor:
  bLength   9
  bDescriptorType  41
  nNbrPorts 6
  wHubCharacteristic 0x000a
No power switching (usb 1.0)
Per-port overcurrent protection
  bPwrOn2PwrGood   10 * 2 milli seconds
  bHubContrCurrent  0 milli Ampere
  DeviceRemovable0x00
  PortPwrCtrlMask0xff
 Hub Port Status:
   Port 1: .0100 power
   Port 2: .0100 power
   Port 3: .0100 power
   Port 4: .0100 power
   Port 5: .0100 power
   Port 6: .0100 power
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0001
  Self Powered

Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass9 Hub
  bDeviceSubClass 0 
  bDeviceProtocol 0 Full speed (or root) hub
  bMaxPacketSize064
  idVendor   0x1d6b Linux Foundation
  idProduct  0x0001 1.1 root hub
  bcdDevice5.10
  iManufacturer   3 Linux 5.10.0-7-amd64 uhci_hcd
  iProduct2 UHCI Host Controller
  iSerial 1 :00:1d.2
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   0x0019
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0 
bmAttributes 0xe0
  Self Powered
  Remote Wakeup
MaxPower0mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 9 Hub
  bInterfaceSubClass  0 
  bInterfaceProtocol  0 Full speed (or root) hub
  iInterface  0 
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0002  1x 2 bytes
bInterval 255
Hub Descriptor:
  bLength   9
  bDescriptorType  41
  nNbrPorts 2
  wHubCharacteristic 

Re: HP ScanJet Pro 3500 f1 Flatbed Scanner and Debian

2021-06-25 Thread Brian Potkin
On Fri 25 Jun 2021 at 17:47:55 -0400, Federico Grau wrote:

> 
> Hello Debian Printing Team,
> 
> Please Cc: me on responses, as I'm not currently subscribed to this mailing
> list.  Advise if that's required.  Via IRC I am regularly present on OFTC
> #debian-printing (UTC-4).
> 
> 
> I'm trying to get an "HP ScanJet Pro 3500 f1 Flatbed Scanner" working with
> Debian, but currently stuck at "SANE: Error during device I/O (code=9)".

I believe this is a USB-only device. Please give 'lsusb -v'.

Regards,

Brian.