Re: SANE default scanner

2020-08-07 Thread Nicolas George
George Shuklin (12020-08-07):
> > scanimage -d "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
> > xsane "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
> > 
> > Where do I write this URL so that tools find it without having to tell
> > them each time?
> > 
> > Thanks.
> > 
> I've just yesterday got a partial success by just adding this
> into /etc/sane.d/saned.conf
> 
> tcp 192.168.9.114

Thank you. But hpaio and saned are two different protocols, and
apparently SANE lacks a cross-protocol configuration system.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-08-07 Thread George Shuklin

On 27/07/2020 12:58, Nicolas George wrote:

Hi.

This may be an obvious thing, but I cannot find the answer.

I can scan with:

scanimage -d "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
xsane "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"

Where do I write this URL so that tools find it without having to tell
them each time?

Thanks.


I've just yesterday got a partial success by just adding this
into /etc/sane.d/saned.conf

tcp 192.168.9.114

After that scanimage just works.

(that was our office scanner). I was able to scan from normal position 
but wasn't able to use feeder.




Re: SANE default scanner

2020-07-29 Thread tomas
On Wed, Jul 29, 2020 at 07:28:21PM +0100, Brian wrote:
> On Wed 29 Jul 2020 at 12:07:08 +0200, to...@tuxteam.de wrote:

> > [...] can read C.
> 
> Reviewing a patch for a non-extisting bug? That's above and beyond the
> call of duty :).

Always glad to please ;-P

Perhaps I should temper my offer. By "reading C" I wasn't including
things like this [1]... or that [2].

Cheers
[1] https://www.ioccc.org/2019/dogon/prog.c
[2] https://www.ioccc.org/2018/bellard/prog.c
-- t


signature.asc
Description: Digital signature


Re: SANE default scanner

2020-07-29 Thread Brian
On Wed 29 Jul 2020 at 12:07:08 +0200, to...@tuxteam.de wrote:

> On Wed, Jul 29, 2020 at 11:11:22AM +0200, Nicolas George wrote:
> 
> > If the patch is to be rejected, or just ignored, then my time would be
> > better invested in an external work-around, it would be less effort than
> > forking, and more convenient.
> 
> I'd just ask them. I.e. explicit is better than implicit.
> 
> If you need a second pair of eyes to look over your patch, I'm ready. I
> can read C.

Reviewing a patch for a non-extisting bug? That's above and beyond the
call of duty :).

-- 
Brian.



Re: SANE default scanner

2020-07-29 Thread tomas
On Wed, Jul 29, 2020 at 11:11:22AM +0200, Nicolas George wrote:
> Stefan Monnier (12020-07-28):
> > The fact that you sometimes can, seems a clear indication that the
> > underlying design still makes it possible [...]

> "Significant" is a subjective threshold. Probing is less reliable than
> configuration: relying on probing first is a mistake. Call it design or
> not if you will.

i.e. "explicit is better than implicit"

> It completely depends on the mindset of the project, I am waiting to get
> a feel of it. Some projects have a patch welcome attitude, some do not.
> More importantly, some project have the attitude "I do not need this,
> but if you think you do, and your patch is clean and does not make the
> rest of the code more complex, then ok", while others have the attitude
> "I do not need this, therefore nobody does" and would reject the patch.

Quite long-winded way to say "would they accept my patch?" ;-)

> If the patch is to be rejected, or just ignored, then my time would be
> better invested in an external work-around, it would be less effort than
> forking, and more convenient.

I'd just ask them. I.e. explicit is better than implicit.

If you need a second pair of eyes to look over your patch, I'm ready. I
can read C.

Cheers
-- t


signature.asc
Description: Digital signature


Re: SANE default scanner

2020-07-29 Thread Nicolas George
Stefan Monnier (12020-07-28):
> The fact that you sometimes can, seems a clear indication that the
> underlying design still makes it possible: you just need a bit of code
> somewhere in SANE so you can specify this URL in a more central place
> than on the command line.  IOW, a trivial new feature.

> You're free to do so, but usually "design mistake" refers to a problem
> whose consequences can only be addressed properly by a redesign, which
> implies a significant rework of the code.

"Significant" is a subjective threshold. Probing is less reliable than
configuration: relying on probing first is a mistake. Call it design or
not if you will.

> I don't see why: first, AFAICT it is still fully functional without
> CUPS,

Not for GUI applications that do not let set an arbitrary URL.

> Maybe if you write a patch and submit it along with your
> bug-report/feature-request there's more chance it will?

It completely depends on the mindset of the project, I am waiting to get
a feel of it. Some projects have a patch welcome attitude, some do not.
More importantly, some project have the attitude "I do not need this,
but if you think you do, and your patch is clean and does not make the
rest of the code more complex, then ok", while others have the attitude
"I do not need this, therefore nobody does" and would reject the patch.

If the patch is to be rejected, or just ignored, then my time would be
better invested in an external work-around, it would be less effort than
forking, and more convenient.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-28 Thread Liam O'Toole
On Mon, 27 Jul, 2020 at 15:38:57 +0200, Nicolas George wrote:
> John Boxall (12020-07-27):
> > I was having the same problem with the same model mfp. I had to go into the
> > HPLIP Toolbox app and setup the printer. Once I did that xsane and simple
> > scan could find the scanner.
> 
> Thanks for the suggestion.
> 
> I was hoping to avoid installing the whole GUI crap from HP. After all,
> the scanner works, my problem is only a UI problem.
> 

hplip has a CLI mode. Run 'hp-setup -i'.



Re: SANE default scanner

2020-07-28 Thread Brian
On Tue 28 Jul 2020 at 09:56:20 -0400, Stefan Monnier wrote:

> > And the fact that hpaio relies on CUPS is inexcusable.
> 
> I don't see why: first, AFAICT it is still fully functional without
> CUPS, and the fact that it tries to make use of CUPS's config
> information in order to overcome specifically the problem you're in is
> not dangerous.  It's kind of hackish but I can't see any situation where
> it would harm any(think|one), so I'm not sure why you'd find
> it inexcusable.

There are two ideas expressed here:

1. ... first, AFAICT it is still fully functional without  CUPS ...

   That's quite correct and has been clearly demonstrated to be the case.

 https://lists.debian.org/debian-user/2020/07/msg01200.html

   Any idea that libsane-hpaio relies on CUPS is without any basis.

2. ... the fact that it tries to make use of CUPS's config information
   in order to overcome specifically the problem you're in is not
   dangerous.

   libsane-hpaio does not use or attempt use any aspect of CUPS' config.
   It has nothing to overcome. If we were to explore what the HPLIP
   hp-setup and hp-makeurl utilities do when CUPS is on the system, we
   could have a different conversation. But that has nothing to do with
   libsane-hpaio.

> > There is no doubt it can be done. I just doubt it will.
> 
> Maybe if you write a patch and submit it along with your
> bug-report/feature-request there's more chance it will?
> And if you can't do it yourself, why not pay someone to do it for you?

Dream on. The submitted bogus bug reports are where we end. Nicolas
George will hopefully eventually cotton on.
 
> Also, maybe if you stop accusing people of incompetence or gross
> negligence (which is what "inexcusable" and "design mistake" evokes for
> me), they'll be more accommodating?

You are asking a leopard to change its spots.

-- 
brian.



Re: SANE default scanner

2020-07-28 Thread Stefan Monnier
>> >> The problem is with scanner that are
>> I'm not sure where you found assignment of blame in what I wrote.
> "The problem is" is an assignment of technical blame.

I was just pointing out in which circumstances the problem appears.
No blame was meant and when I reread it I don't see blame being
assigned either.

>> Apparently not 100% so since it works if you provide the URI explicitly.
> Most applications do not allow to specify an arbitrary scanner URL.

The fact that you sometimes can, seems a clear indication that the
underlying design still makes it possible: you just need a bit of code
somewhere in SANE so you can specify this URL in a more central place
than on the command line.  IOW, a trivial new feature.

> The fact that this option did not exist first and before probing is what
> I call a design mistake.

You're free to do so, but usually "design mistake" refers to a problem
whose consequences can only be addressed properly by a redesign, which
implies a significant rework of the code.

> And the fact that hpaio relies on CUPS is inexcusable.

I don't see why: first, AFAICT it is still fully functional without
CUPS, and the fact that it tries to make use of CUPS's config
information in order to overcome specifically the problem you're in is
not dangerous.  It's kind of hackish but I can't see any situation where
it would harm any(think|one), so I'm not sure why you'd find
it inexcusable.

> There is no doubt it can be done. I just doubt it will.

Maybe if you write a patch and submit it along with your
bug-report/feature-request there's more chance it will?
And if you can't do it yourself, why not pay someone to do it for you?

Also, maybe if you stop accusing people of incompetence or gross
negligence (which is what "inexcusable" and "design mistake" evokes for
me), they'll be more accommodating?



Stefan



Re: SANE default scanner

2020-07-28 Thread Nicolas George
Stefan Monnier (12020-07-27):
> >> The problem is with scanner that are

> I'm not sure where you found assignment of blame in what I wrote.

"The problem is" is an assignment of technical blame.

> Apparently not 100% so since it works if you provide the URI explicitly.

Most applications do not allow to specify an arbitrary scanner URL.

> I can't see any reason why your request can't be satisfied by a fairly
> simple change to the code (e.g. to read extra URIs from a local
> configuration file in the client; better would be to be able to read
> this info from something like the DNS), with no need for any kind of
> redesign.  So it seems like a simple missing feature.
> I haven't looked enough at the code to be sure this can be done easily,
> but if it can then it shows it's not a design problem.  Just yet another
> missing feature.

The fact that this option did not exist first and before probing is what
I call a design mistake.

And the fact that hpaio relies on CUPS is inexcusable.

There is no doubt it can be done. I just doubt it will.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-28 Thread Brian
On Mon 27 Jul 2020 at 19:39:25 +0200, Nicolas George wrote:

> Nicolas George (12020-07-27):
> > Well, in between explaining why all the answers I got do not match the
> > question, I RTFS, and it seems indeed it is not possible with SANE. What
> > stupid design.
> > 
> > As for the hpaio backend, it relies on CUPS to find networked printers,
> > but CUPS will not be always running. What stupid design.
> 
> These are now:
> 
> https://gitlab.com/sane-project/frontends/-/issues/18
> https://bugs.launchpad.net/hplip/+bug/1889109
> 
> I predict that SANE will blame hpaio and hpaio will not care that people
> do not want to run CUPS needlessly.

The assertion is:

   libsane-hpaio relies on CUPS to detect networked all-in-one
   scanner-printers. That means that if CUPS is not running,
   networked devices are usable by specifying the URL, but they
   will not be detected.

We may test this assertion as follows:

1. Install Debian with the base system only.

2. apt install libsane avahi-daemon.

3. brian@t5730sid:~$ scanimage -L
   No scanners were identified. If you were expecting something different,
   check that the scanner is plugged in, turned on and detected by the
   sane-find-scanner tool (if appropriate). Please read the documentation
   which came with this software (README, FAQ, manpages).
   brian@t5730sid:~$

4. brian@t5730sid:~$ dpkg -l | grep cups
   brian@t5730sid:~$

5. apt install libsane-hpaio --no-install-recommends

6. brian@t5730sid:~$ dpkg -l | grep cups
   ii  libcups2:i3862.2.10-6+deb10u1
   brian@t5730sid:~$

7. brian@t5730sid:~$ scanimage -L
   device `hpaio:/net/envy_4500_series?ip=192.168.7.235=false' is a 
Hewlett-Packard envy_4500_series all-in-one
   brian@t5730sid:~$

Contending that libsane-hpaio relies on CUPS to detect scanners appears
to be based on a misunderdstanding of the code in hpaio.c. Most people
would take CUPS to mean 'apt install cups' and, as we see, cups-daemon
is not running.

Game, set and match.

-- 
Brian.



Re: SANE default scanner

2020-07-28 Thread tomas
On Mon, Jul 27, 2020 at 11:49:59PM +0200, Nicolas George wrote:

[...]

> This is a sadly classic pattern in Libre software: "not my problem, it's
> the other project doing it wrong".

...and of all the rest of humanity, too.

Cheers
-- t


signature.asc
Description: Digital signature


Re: SANE default scanner

2020-07-27 Thread Stefan Monnier
Nicolas George [2020-07-27 23:49:59] wrote:
> Stefan Monnier (12020-07-27):
>> Indeed.  And given SANE's design, there shouldn't be much need for it:
>> it assumes that either the scanner is local (via a hardware-specific
>> driver, hpaio being one of them) or it's remotely accessed over the SANE
>> protocol, in which case it uses the DNS-SD protocol to find it.
>> 
>> The problem is with scanner that are remote but using a "local driver"
>> (local to the client rather than local to the scanner).
>
> This is a sadly classic pattern in Libre software: "not my problem, it's
> the other project doing it wrong".

I'm not sure where you found assignment of blame in what I wrote.

> - The only way to have SANE-using applications see the scanner is that
>   hpaio detects it.

Apparently not 100% so since it works if you provide the URI explicitly.

> Both these points are design mistakes.

I can't see any reason why your request can't be satisfied by a fairly
simple change to the code (e.g. to read extra URIs from a local
configuration file in the client; better would be to be able to read
this info from something like the DNS), with no need for any kind of
redesign.  So it seems like a simple missing feature.
I haven't looked enough at the code to be sure this can be done easily,
but if it can then it shows it's not a design problem.  Just yet another
missing feature.


Stefan



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Stefan Monnier (12020-07-27):
> Indeed.  And given SANE's design, there shouldn't be much need for it:
> it assumes that either the scanner is local (via a hardware-specific
> driver, hpaio being one of them) or it's remotely accessed over the SANE
> protocol, in which case it uses the DNS-SD protocol to find it.
> 
> The problem is with scanner that are remote but using a "local driver"
> (local to the client rather than local to the scanner).

This is a sadly classic pattern in Libre software: "not my problem, it's
the other project doing it wrong".

Sorry guys, you're BOTH doing it wrong:

hpaio, you should not rely on a print server to detect scanners, even if
you're made by a company that first came to this business through
printers.

SANE, since you accept third-party back-ends, you should assume some
will get it wrong and have workarounds ready.

> I suggest you open a feature request on the SANE's issue tracker.

Already did. And to hplip too.

> Who knows, maybe this can even be solved already by somehow tweaking the
> DNS server to advertize your hpaio device?

No, it can't, that's pretty obvious looking at the source code:

- The only way to have SANE-using applications see the scanner is that
  hpaio detects it.

- The only way to have hpaio detect the scanner is to have CUPS running,
  the corresponding printer configured and hpaio allowed to connect to
  it.

Both these points are design mistakes.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Stefan Monnier
>> It's definitely possible with SANE.  But apparently not with `hpaio`.
> I insist: it is not possible with SANE to specify a list of extra
> scanners.

Indeed.  And given SANE's design, there shouldn't be much need for it:
it assumes that either the scanner is local (via a hardware-specific
driver, hpaio being one of them) or it's remotely accessed over the SANE
protocol, in which case it uses the DNS-SD protocol to find it.

The problem is with scanner that are remote but using a "local driver"
(local to the client rather than local to the scanner).

I suggest you open a feature request on the SANE's issue tracker.
Who knows, maybe this can even be solved already by somehow tweaking the
DNS server to advertize your hpaio device?


Stefan



Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 15:09:52 -0400, Gene Heskett wrote:

> At high risk of hyjacking the thread, ...

You have driven a bulldozer through it. Please go away, think about what
you want to say and devise a new post to express your particular issue.

And don't do it again. You should know better and set a good example.

-- 
Brian.



Re: SANE default scanner

2020-07-27 Thread Gene Heskett
On Monday 27 July 2020 14:32:11 Brian wrote:

> On Mon 27 Jul 2020 at 16:52:19 +0200, Nicolas George wrote:
> > Georgi Naplatanov (12020-07-27):
> > > Did you try to add scanners to /etc/sane.d/net.conf
> > >
> > > there is another howto
> > >
> > > https://help.ubuntu.com/community/sane
> >
> > I did, and as expected it does not work, because
> >
> > "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
> >
> > looks nothing like the provided examples:
> >
> > 192.168.0.15
> >
> > ::1
> >
> > localhost
> > scan-server.office.lan
> >
> > net.conf is for scanner shared with SANE's protocol. Notice the
> > "hpaio:" fake URL protocol.
>
> You have fundamental misunderstanding about the purpose of net.conf.
> As the wiki says:
>
>  Note that the net backend is not for accessing arbitrary
>  scanners over a network. It's intended use is for the server
>  (which has a SANE-supported scanner) to be able to export that
>  scanner to clients on the network via a single SANE-specific,
>  manufacturer-agnostic protocol.

At high risk of hyjacking the thread, I have been following along, hoping 
to be able to find my aio BIG brother scanner over the net, say from an 
rpi4 running buster in the garage. This aio has both cat5 from a local 
switch and a usb cable from this machine plugged into it and the aio has 
a local net address of ###.###.71.21 assigned and is pingable from 
anyplace on my local network. But the pi can only find it via the usb 
cable.

[dll] sane_get_devices: found 1 devices
device `net:##.##.71.3:brother4:bus4;dev2' is a Brother MFC-J6920DW USB 
scanner

Why can't it be found at 71.21?  The .3 is this machine.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 



Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 16:52:19 +0200, Nicolas George wrote:

> Georgi Naplatanov (12020-07-27):
> > Did you try to add scanners to /etc/sane.d/net.conf
> > 
> > there is another howto
> > 
> > https://help.ubuntu.com/community/sane
> 
> I did, and as expected it does not work, because
> 
> "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
> 
> looks nothing like the provided examples:
> 
> 192.168.0.15
> ::1
> localhost
> scan-server.office.lan
> 
> net.conf is for scanner shared with SANE's protocol. Notice the "hpaio:"
> fake URL protocol.

You have fundamental misunderstanding about the purpose of net.conf. As
the wiki says:

 Note that the net backend is not for accessing arbitrary
 scanners over a network. It's intended use is for the server
 (which has a SANE-supported scanner) to be able to export that
 scanner to clients on the network via a single SANE-specific,
 manufacturer-agnostic protocol.

-- 
Brian.



Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 19:12:10 +0200, Nicolas George wrote:

> Brian (12020-07-27):
> > Ok, libsane-hpaio requires libcups.so.2. That's nowhere near requiring
> > CUPS, in particular cups-daemon. The printing system is not involved
> > with scanning.
> 
> This is the last time I grace you with a reply. As I have told you twice

I don't usually triumph so quickly in a discussion. :)

> now, unlike you, I have read the source code and I know what I am
> talking about. Here are the excerpts:

You are quite right - I have not read any source code; I'm illiterate!
However, I do have four scanners available over the network so must be
doing something right.

-- 
Brian.



Re: SANE default scanner

2020-07-27 Thread Siard
Nicolas George:
> Siard (12020-07-27):
> > It looks simple to me, or am I missing something?
> 
> Does it add the scanner in Gimp's scanner menu?

Ah, I guess I see what I was missing.



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Nicolas George (12020-07-27):
> Well, in between explaining why all the answers I got do not match the
> question, I RTFS, and it seems indeed it is not possible with SANE. What
> stupid design.
> 
> As for the hpaio backend, it relies on CUPS to find networked printers,
> but CUPS will not be always running. What stupid design.

These are now:

https://gitlab.com/sane-project/frontends/-/issues/18
https://bugs.launchpad.net/hplip/+bug/1889109

I predict that SANE will blame hpaio and hpaio will not care that people
do not want to run CUPS needlessly.

Extra reference for some people in this discussion:

https://en.wikipedia.org/wiki/%44%75%6e%6e%69%6e%67%E2%80%93%4b%72%75%67%65%72%5f%65%66%66%65%63%74

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Nicolas George
Siard (12020-07-27):
> It looks simple to me, or am I missing something?

Does it add the scanner in Gimp's scanner menu?

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Siard
On Mon, 27 Jul 2020 11:58:44 +0200, Nicolas George wrote:
> This may be an obvious thing, but I cannot find the answer.
> 
> I can scan with:
> 
> scanimage -d "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
> xsane "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
> 
> Where do I write this URL so that tools find it without having to tell
> them each time?

It looks simple to me, or am I missing something?
Create /usr/local/bin/scanimage with these contents:

#! /bin/sh
/usr/bin/scanimage -d "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"

Then,
$ cd /usr/local/bin
$ chmod +x scanimage

>From then on, run this command to scan:
$ scanimage

Because /usr/local/bin is before /usr/bin in $PATH, /usr/local/bin/scanimage
takes precedence over /usr/bin/scanimage.



Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 12:39:11 -0400, Stefan Monnier wrote:

> >> > Well, in between explaining why all the answers I got do not match the
> >> > question, I RTFS, and it seems indeed it is not possible with SANE.
> >> It's definitely possible with SANE.  But apparently not with `hpaio`.
> > libsane-hpaio is a backend that conforms to the SANE standard.
> 
> On one end, yes.  On the other end it talks the HPAIO "standard".
> 
> I was talking about the network protocol.  Apparently his scanner is not
> connected to a `saned` daemon (that would talk the SANE protocol) but
> talks an HPAIO-specific protocol instead.

Nicolas George appears to have ruled out using saned on a server. There
isn't a protocol specific to libsane-hpaio, not unless you are thinking
of DNS-SD/mDNS, which are standard protocols.

> Discovery is hence not performed by SANE but by the `libsane-hpaio`
> backend itself.

Ok; I'll go with that.

> IOW he wants/needs to use `libsane-hpaio` on the client rather than on
> the server.

Indeed.

We have now briefly discussed the only two techniques possible to
achieve Nicolas George's objective.

-- 
Brian.



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Brian (12020-07-27):
> Ok, libsane-hpaio requires libcups.so.2. That's nowhere near requiring
> CUPS, in particular cups-daemon. The printing system is not involved
> with scanning.

This is the last time I grace you with a reply. As I have told you twice
now, unlike you, I have read the source code and I know what I am
talking about. Here are the excerpts:

/* Look for Network Scan devices if localonly flag if FALSE. */
if (!localOnly)
{
/* Look for all-in-one scan devices for which print queue created */
cnt = GetCupsPrinters(_printer);
for (i=0; i

signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 18:39:45 +0200, Nicolas George wrote:

> Brian (12020-07-27):
> > libsane-hpaio needs CUPS to deal with scanners? Imagination is a great
> > asset. Sometimes!
> 
> If you do not believe me, just RTFS or use ldd and nm to check.

Ok, libsane-hpaio requires libcups.so.2. That's nowhere near requiring
CUPS, in particular cups-daemon. The printing system is not involved
with scanning.

-- 
Brian



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Brian (12020-07-27):
> libsane-hpaio needs CUPS to deal with scanners? Imagination is a great
> asset. Sometimes!

If you do not believe me, just RTFS or use ldd and nm to check.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Stefan Monnier
>> > Well, in between explaining why all the answers I got do not match the
>> > question, I RTFS, and it seems indeed it is not possible with SANE.
>> It's definitely possible with SANE.  But apparently not with `hpaio`.
> libsane-hpaio is a backend that conforms to the SANE standard.

On one end, yes.  On the other end it talks the HPAIO "standard".

I was talking about the network protocol.  Apparently his scanner is not
connected to a `saned` daemon (that would talk the SANE protocol) but
talks an HPAIO-specific protocol instead.
Discovery is hence not performed by SANE but by the `libsane-hpaio`
backend itself.

IOW he wants/needs to use `libsane-hpaio` on the client rather than on
the server.


Stefan



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Stefan Monnier (12020-07-27):
> It's definitely possible with SANE.  But apparently not with `hpaio`.

I insist: it is not possible with SANE to specify a list of extra
scanners.

And since SANE lies between applications and back-ends, it is the
correct place to implement it.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 12:05:15 -0400, Stefan Monnier wrote:

> 
> > Well, in between explaining why all the answers I got do not match the
> > question, I RTFS, and it seems indeed it is not possible with SANE.
> 
> It's definitely possible with SANE.  But apparently not with `hpaio`.

libsane-hpaio is a backend that conforms to the SANE standard. In what
way is it different from, say, libsane-pixma?

> > What stupid design.
> 
> Yeah, I wish they'd just used SANE instead of inventing their own wheel.
> 
> > As for the hpaio backend, it relies on CUPS to find networked printers,
> > but CUPS will not be always running. What stupid design.
> 
> At least they do use CUPS instead of reinventing yet another wheel.

libsane-hpaio needs CUPS to deal with scanners? Imagination is a great
asset. Sometimes!

-- 
Brian.



Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 17:34:52 +0200, Nicolas George wrote:

> Brian (12020-07-27):
> > Scanning with xsane or simple-scan only works by specifying a URI? You
> > don't think this is an issue, in spite of its not being the experience
> > of most users?
> 
> Well, I am pretty sure I know my situation better than you.

>From xsane(1)

  xsane accesses image acquisition devices through the SANE (Scanner
  Access Now Easy) interface. The list of available devices depends on
  installed hardware and configuration. When invoked without an explicit
  devicename argument, xsane presents a dialog listing all known and
  available devices. To access an available device that is not known to
  the system, the devicename must be specified explicitly. The format of
  devicename is backend‐name:devicefile (eg: umax:/dev/sga).

All my networked scanners show in xsane. I wonder why yours are unknown
to the system? You are in the best situation to know.

> But if you insist to know: hpaio detects networked scanners by querying
> CUPS for networked printers. But I do not want CUPS running. This is not
> a bug, just a completely idiotic design.

It's good to have technical reasons for network scanner discovery, even
when they do not match reality.

-- 
Brian.



Re: SANE default scanner

2020-07-27 Thread Stefan Monnier
>> That's the kind of reason why I don't like using printer's own network
>> facilities and prefer to connect them over USB to a local GNU/Linux
>> server which can then share them over CUPS
> There will be no computer close enough to the printer to do the job.

Indeed, it's not always a convenient option.
For me, the BananaPi homeserver was within reach of a USB cable, so it
was a no-brainer.

> And if you are suggesting I should buy a device, even an inexpensive

Definitely not.  The ecological impact of a new device dwarfs any of the
potential benefits.

>> It also has the side benefit that sleeping while connected via USB tends
>> to consume significantly less power than sleeping while connected via the
>> wifi network (can't remember what the numbers look like for ethernet).
>> The difference can be sufficient to power a BananaPi ;-)
> Have you considered turning the printer off and disconnecting it from
> the power mains with an external switch?

I could live with it, yes, but my wife expects the printer to "just
work", so it has to pretend it's always on.

> Well, in between explaining why all the answers I got do not match the
> question, I RTFS, and it seems indeed it is not possible with SANE.

It's definitely possible with SANE.  But apparently not with `hpaio`.

> What stupid design.

Yeah, I wish they'd just used SANE instead of inventing their own wheel.

> As for the hpaio backend, it relies on CUPS to find networked printers,
> but CUPS will not be always running. What stupid design.

At least they do use CUPS instead of reinventing yet another wheel.


Stefan



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Brian (12020-07-27):
> Scanning with xsane or simple-scan only works by specifying a URI? You
> don't think this is an issue, in spite of its not being the experience
> of most users?

Well, I am pretty sure I know my situation better than you.

But if you insist to know: hpaio detects networked scanners by querying
CUPS for networked printers. But I do not want CUPS running. This is not
a bug, just a completely idiotic design.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 16:15:30 +0200, Nicolas George wrote:

> Brian (12020-07-27):
> > > To summarize: I want to tell SANE URLs for network-connected scanners so
> > > that they can be presented to the users in GUI dialogs.
> > 
> > Not much chance of that happening if SANE cannot see the scanner.
> 
> Well, if I write
> 
> scanner "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
> scanner "hpaio:/net/Photosmart_2570_series?ip=10.0.0.32"
> 
> into some configuration file, then SANE does not need to see the
> scanners: I just told where to find them.
> 
> My question is: WHAT CONFIGURATION FILE?
> 
> >   SANE_DEBUG_DLL=5 scanimage -L
> 
> There is no bug to debug, this is useless.

Scanning with xsane or simple-scan only works by specifying a URI? You
don't think this is an issue, in spite of its not being the experience
of most users?

-- 
Brian.



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Stefan Monnier (12020-07-27):
> That's the kind of reason why I don't like using printer's own network
> facilities and prefer to connect them over USB to a local GNU/Linux
> server which can then share them over CUPS

There will be no computer close enough to the printer to do the job.

And if you are suggesting I should buy a device, even an inexpensive
one, for something that should be done with just a line in a config
file, please think again.

> It also has the side benefit that sleeping while connected via USB tends
> to consume significantly less power than sleeping while connected via the
> wifi network (can't remember what the numbers look like for ethernet).
> The difference can be sufficient to power a BananaPi ;-)

Have you considered turning the printer off and disconnecting it from
the power mains with an external switch?


Well, in between explaining why all the answers I got do not match the
question, I RTFS, and it seems indeed it is not possible with SANE. What
stupid design.

As for the hpaio backend, it relies on CUPS to find networked printers,
but CUPS will not be always running. What stupid design.


Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Stefan Monnier
> net.conf is for scanner shared with SANE's protocol. Notice the "hpaio:"
> fake URL protocol.

That's the kind of reason why I don't like using printer's own network
facilities and prefer to connect them over USB to a local GNU/Linux
server which can then share them over CUPS

It also has the side benefit that sleeping while connected via USB tends
to consume significantly less power than sleeping while connected via the
wifi network (can't remember what the numbers look like for ethernet).
The difference can be sufficient to power a BananaPi ;-)


Stefan



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Georgi Naplatanov (12020-07-27):
> Did you try to add scanners to /etc/sane.d/net.conf
> 
> there is another howto
> 
> https://help.ubuntu.com/community/sane

I did, and as expected it does not work, because

"hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"

looks nothing like the provided examples:

192.168.0.15
::1
localhost
scan-server.office.lan

net.conf is for scanner shared with SANE's protocol. Notice the "hpaio:"
fake URL protocol.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Georgi Naplatanov
On 7/27/20 4:32 PM, Nicolas George wrote:
> Georgi Naplatanov (12020-07-27):
>> I'm not sure how you share the scanner(s) - with saned or if those are
>> some kind of network scanners.
> 
> I do not share the scanner, the scanner shares itself.
> 
> To summarize: I want to tell SANE URLs for network-connected scanners so
> that they can be presented to the users in GUI dialogs.
> 

Did you try to add scanners to /etc/sane.d/net.conf

there is another howto

https://help.ubuntu.com/community/sane

Kind regards
Georgi



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Brian (12020-07-27):
> > To summarize: I want to tell SANE URLs for network-connected scanners so
> > that they can be presented to the users in GUI dialogs.
> 
> Not much chance of that happening if SANE cannot see the scanner.

Well, if I write

scanner "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
scanner "hpaio:/net/Photosmart_2570_series?ip=10.0.0.32"

into some configuration file, then SANE does not need to see the
scanners: I just told where to find them.

My question is: WHAT CONFIGURATION FILE?

>   SANE_DEBUG_DLL=5 scanimage -L

There is no bug to debug, this is useless.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 15:32:23 +0200, Nicolas George wrote:

> Georgi Naplatanov (12020-07-27):
> > I'm not sure how you share the scanner(s) - with saned or if those are
> > some kind of network scanners.
> 
> I do not share the scanner, the scanner shares itself.
> 
> To summarize: I want to tell SANE URLs for network-connected scanners so
> that they can be presented to the users in GUI dialogs.

Not much chance of that happening if SANE cannot see the scanner. Try

  SANE_DEBUG_DLL=5 scanimage -L

-- 
Brian.



Re: SANE default scanner

2020-07-27 Thread Nicolas George
John Boxall (12020-07-27):
> I was having the same problem with the same model mfp. I had to go into the
> HPLIP Toolbox app and setup the printer. Once I did that xsane and simple
> scan could find the scanner.

Thanks for the suggestion.

I was hoping to avoid installing the whole GUI crap from HP. After all,
the scanner works, my problem is only a UI problem.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Nicolas George
Georgi Naplatanov (12020-07-27):
> I'm not sure how you share the scanner(s) - with saned or if those are
> some kind of network scanners.

I do not share the scanner, the scanner shares itself.

To summarize: I want to tell SANE URLs for network-connected scanners so
that they can be presented to the users in GUI dialogs.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 14:53:38 +0200, Nicolas George wrote:

> Brian (12020-07-27):
> > When xsane is run it searches for devices. If the deskjet_3050a is the
> > only one found, that is the one you will get. If there is more than one,
> > it presents you with choice.
> 
> It does not find it at all. It only works if I specify the scanner.

That is not the way it works here. SANE runs each of the backends in
turn.
 
> (And I would find very bad taste for xsane to somehow scan my whole
> network just in case a scanner happens to be there.

DNS-SD is probably involved. Hardly scanning every host on the network.

-- 
Brian.



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Hans (12020-07-27):
> I had had a similar problem with a scanner from Brother. The solution was, to 
> add the 
> output from lsusb like "5986:0102" (this is just an example!) of the 
> /lib/udev/rules.d/60-libsane.rules". Not all scanners are included here and 
> sometime you 
> must add your own into this lib.

Thanks, but that is for USB, I am asking for network.

To summarize: I want to tell SANE URLs for network-connected scanners so
that they can be presented to the users in GUI dialogs.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Reco
On Mon, Jul 27, 2020 at 04:09:08PM +0300, Georgi Naplatanov wrote:
> On 7/27/20 3:40 PM, Nicolas George wrote:
> > Georgi Naplatanov (12020-07-27):
> >> https://linux.die.net/man/1/scanimage
> >>
> >> "The -d or --device-name options must be followed by a SANE device-name
> >> like 'epson:/dev/sg0' or 'hp:/dev/usbscanner0'. A (partial) list of
> >> available devices can be obtained with the --list-devices option (see
> >> below). If no device-name is specified explicitly, scanimage reads a
> >> device-name from the environment variable SANE_DEFAULT_DEVICE. If this
> >> variable is not set, scanimage will attempt to open the first available
> >> device. "
> > 
> > Unfortunately, it does not work: for GUI tools, this environment
> > variable pre-selects the device in the device selection dialog, but it
> > does not make it appear if it is not detected (?!???@!%@?!!!?).
> > 
> > Also, it works for only one scanner.
> 
> I'm not sure how you share the scanner(s) - with saned or if those are
> some kind of network scanners.
> 
> In case you share these scanners with saned then this article may be
> helpful for you.
> 
> https://feeding.cloud.geek.nz/posts/setting-up-a-network-scanner-using-sane/
> 
> My understanding is that you have to add scanners'  IP addresses in
> /etc/sane.d/net.conf

That file serves as ACL for saned (server part), and you're supposed to
add clients' IP there. It does not seem to affect xsane or scanimage
(client parts) in any way.

I'm interested in knowing how to set a default device for xsane too
(which could also disable annoying broadcast-based discovery on every
xsane launch), but it looks like there's no way of doing it.
SANE_DEFAULT_DEVICE is an interesting idea, but ultimately is no
different from a shell alias.

Reco



Re: SANE default scanner

2020-07-27 Thread John Boxall
I was having the same problem with the same model mfp. I had to go into 
the HPLIP Toolbox app and setup the printer. Once I did that xsane and 
simple scan could find the scanner.


On 2020-07-27 8:40 a.m., Nicolas George wrote:

Georgi Naplatanov (12020-07-27):

https://linux.die.net/man/1/scanimage

"The -d or --device-name options must be followed by a SANE device-name
like 'epson:/dev/sg0' or 'hp:/dev/usbscanner0'. A (partial) list of
available devices can be obtained with the --list-devices option (see
below). If no device-name is specified explicitly, scanimage reads a
device-name from the environment variable SANE_DEFAULT_DEVICE. If this
variable is not set, scanimage will attempt to open the first available
device. "

Thanks.

Unfortunately, it does not work: for GUI tools, this environment
variable pre-selects the device in the device selection dialog, but it
does not make it appear if it is not detected (?!???@!%@?!!!?).

Also, it works for only one scanner.

Regards,


--
Regards,

John Boxall



Re: SANE default scanner

2020-07-27 Thread Georgi Naplatanov
On 7/27/20 3:40 PM, Nicolas George wrote:
> Georgi Naplatanov (12020-07-27):
>> https://linux.die.net/man/1/scanimage
>>
>> "The -d or --device-name options must be followed by a SANE device-name
>> like 'epson:/dev/sg0' or 'hp:/dev/usbscanner0'. A (partial) list of
>> available devices can be obtained with the --list-devices option (see
>> below). If no device-name is specified explicitly, scanimage reads a
>> device-name from the environment variable SANE_DEFAULT_DEVICE. If this
>> variable is not set, scanimage will attempt to open the first available
>> device. "
> 
> Thanks.
> 
> Unfortunately, it does not work: for GUI tools, this environment
> variable pre-selects the device in the device selection dialog, but it
> does not make it appear if it is not detected (?!???@!%@?!!!?).
> 
> Also, it works for only one scanner.
> 

Hi,

I'm not sure how you share the scanner(s) - with saned or if those are
some kind of network scanners.

In case you share these scanners with saned then this article may be
helpful for you.

https://feeding.cloud.geek.nz/posts/setting-up-a-network-scanner-using-sane/

My understanding is that you have to add scanners'  IP addresses in
/etc/sane.d/net.conf


Kind regards
Georgi



Re: SANE default scanner

2020-07-27 Thread Hans
Am Montag, 27. Juli 2020, 14:50:12 CEST schrieb Brian:
> On Mon 27 Jul 2020 at 14:40:00 +0200, Nicolas George wrote:
> > Georgi Naplatanov (12020-07-27):
Hi!
I had had a similar problem with a scanner from Brother. The solution was, to 
add the 
output from lsusb like "5986:0102" (this is just an example!) of the 
/lib/udev/rules.d/60-libsane.rules". Not all scanners are included here and 
sometime you 
must add your own into this lib.

Try, hope it helps!

Good luck,

Hans



> When xsane is run it searches for devices. If the deskjet_3050a is the
> only one found, that is the one you will get. If there is more than one,
> it presents you with choice.




signature.asc
Description: This is a digitally signed message part.


Re: SANE default scanner

2020-07-27 Thread Nicolas George
Brian (12020-07-27):
> When xsane is run it searches for devices. If the deskjet_3050a is the
> only one found, that is the one you will get. If there is more than one,
> it presents you with choice.

It does not find it at all. It only works if I specify the scanner.

(And I would find very bad taste for xsane to somehow scan my whole
network just in case a scanner happens to be there.)

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Brian
On Mon 27 Jul 2020 at 14:40:00 +0200, Nicolas George wrote:

> Georgi Naplatanov (12020-07-27):
> > https://linux.die.net/man/1/scanimage
> > 
> > "The -d or --device-name options must be followed by a SANE device-name
> > like 'epson:/dev/sg0' or 'hp:/dev/usbscanner0'. A (partial) list of
> > available devices can be obtained with the --list-devices option (see
> > below). If no device-name is specified explicitly, scanimage reads a
> > device-name from the environment variable SANE_DEFAULT_DEVICE. If this
> > variable is not set, scanimage will attempt to open the first available
> > device. "
> 
> Thanks.
> 
> Unfortunately, it does not work: for GUI tools, this environment
> variable pre-selects the device in the device selection dialog, but it
> does not make it appear if it is not detected (?!???@!%@?!!!?).
> 
> Also, it works for only one scanner.

When xsane is run it searches for devices. If the deskjet_3050a is the
only one found, that is the one you will get. If there is more than one,
it presents you with choice.

-- 
Brian.



Re: SANE default scanner

2020-07-27 Thread Nicolas George
Georgi Naplatanov (12020-07-27):
> https://linux.die.net/man/1/scanimage
> 
> "The -d or --device-name options must be followed by a SANE device-name
> like 'epson:/dev/sg0' or 'hp:/dev/usbscanner0'. A (partial) list of
> available devices can be obtained with the --list-devices option (see
> below). If no device-name is specified explicitly, scanimage reads a
> device-name from the environment variable SANE_DEFAULT_DEVICE. If this
> variable is not set, scanimage will attempt to open the first available
> device. "

Thanks.

Unfortunately, it does not work: for GUI tools, this environment
variable pre-selects the device in the device selection dialog, but it
does not make it appear if it is not detected (?!???@!%@?!!!?).

Also, it works for only one scanner.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: SANE default scanner

2020-07-27 Thread Georgi Naplatanov
On 7/27/20 12:58 PM, Nicolas George wrote:
> Hi.
> 
> This may be an obvious thing, but I cannot find the answer.
> 
> I can scan with:
> 
> scanimage -d "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
> xsane "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
> 
> Where do I write this URL so that tools find it without having to tell
> them each time?
> 

Here is the answer:


https://linux.die.net/man/1/scanimage

"The -d or --device-name options must be followed by a SANE device-name
like 'epson:/dev/sg0' or 'hp:/dev/usbscanner0'. A (partial) list of
available devices can be obtained with the --list-devices option (see
below). If no device-name is specified explicitly, scanimage reads a
device-name from the environment variable SANE_DEFAULT_DEVICE. If this
variable is not set, scanimage will attempt to open the first available
device. "

HTH

Kind regards
Georgi



SANE default scanner

2020-07-27 Thread Nicolas George
Hi.

This may be an obvious thing, but I cannot find the answer.

I can scan with:

scanimage -d "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"
xsane "hpaio:/net/deskjet_3050a_j611_series?ip=10.0.1.155"

Where do I write this URL so that tools find it without having to tell
them each time?

Thanks.

-- 
  Nicolas George


signature.asc
Description: PGP signature