Re: [HPLIP-Devel] Bug: hplip =1.6.12 breaks support for the sane network daemon

2007-07-25 Thread Johannes Meixner

Hello David,

On Jul 24 19:24 Suffield, David wrote (shortened):
 This looks like a case where we don't necessarily follow
 the Sane specification. Since the old hpaio code ignored localOnly
 and seemed to work ok, I see no reason for not changing it back.

Yesterday I did a very quick search what other backends in the SANE
software do and it seems they usually ignore localOnly too.

For your information I attached the gzipped output of
  for f in sane-backends-1.0.18/backend/*.c
  do echo $f
 grep local_only $f
 echo
  done

It seems the net backend ist the only one which implements
a test for local_only: if (local_only).

Because of this I got the assumtion that perhaps local_only
is only useful for the net backend to avoid that SANE devices
with net are reported duplicated to the frontend.

SANE devices with net can be also locally connected scanners
(e.g. via USB) because saned and net can both run on localhost
like on my workstation:
---
# scanimage -L
device `hpaio:/usb/HP_LaserJet_1220?serial=00XX'
 is a Hewlett-Packard HP_LaserJet_1220 all-in-one
device `hpaio:/net/Officejet_7200_series?ip=10.10.100.100'
 is a Hewlett-Packard Officejet_7200_series all-in-one
device `plustek:libusb:001:006'
 is a Canon N1240U/LiDE30 USB flatbed scanner
device `net:localhost:hpaio:/usb/HP_LaserJet_1220?serial=00XX'
 is a Hewlett-Packard HP_LaserJet_1220 all-in-one
device `net:localhost:plustek:libusb:001:006'
 is a Canon N1240U/LiDE30 USB flatbed scanner
---
There is no good reason why there shouldn't be also a SANE device
`net:localhost:hpaio:/net/Officejet_7200_series?ip=10.10.100.100'
when I explicitely run saned and net on my workstation.

Of course one could discuss why someone should run saned and net
on his workstation for his locally connected scanners.
Usually this is the easiest way to get user access in problematic
cases (because saned runs as root) like for parallel port scanners
or if someone might be fed-up with the udev/HAL/resmgr magic ;-)


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex

foo.gz
Description: output.gz
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/___
HPLIP-Devel mailing list
HPLIP-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hplip-devel


Re: [HPLIP-Devel] Bug: hplip =1.6.12 breaks support for the sane network daemon

2007-07-24 Thread Johannes Meixner

Hello,

On Jul 24 00:18 Suffield, David wrote (shortened):
 Why would you use saned with a networked PS C5180? Since the PS C5180 is
 networked, you can use xsane from any PC without saned.

I do not understand this.
When a device is connected via ethernet, it is not sufficient
to run only a scanning frontend (like xsane) to access it.
When a device is connected via ethernet, it requires also to run
the appropriate scanner driver (here HPLIP/hpaio) on the host
from which it should be accessed.

Asssume there is a HP all-in-one device with ethernet connection
and there are several workstations in an office:

With saned it should be sufficient when HPLIP/hpaio and saned runs
only on one single workstation which is then the server for the
HP all-in-one device and on all other workstations only the SANE
net meta-backend runs so that users on the other workstations
could access the device.

 
 According to SANE Standard v1.04, when localOnly is true during
 sane_get_devices, no remote devices are returned. This means only
 USB/Parallel devices are returned.

Is there perhaps a misunderstanding what
http://www.sane-project.org/html/doc012.html#s4.3.3
should actually mean?

Of course on the one hand devices directly attached to the
machine that SANE is running on is very clear (i.e. explicitely
no devices with ethernet connection) but perhaps when it was written,
they might have had only in mind to use local_only==false to suppress
those SANE devices which are reported by the net meta-backend?

I ask because I cannot imagine a good reason why a frontend should
show only USB, SCSI and parallel port devices but not a device which
is connected via ethernet.

On the other hand I would understand why to suppress the SANE devices
which are reported by the net meta-backend: The saned frontend
is only interested in devices which are not already reported
by the net meta-backend which may be active on the same host.


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
HPLIP-Devel mailing list
HPLIP-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hplip-devel


Re: [HPLIP-Devel] Bug: hplip =1.6.12 breaks support for the sane network daemon

2007-07-24 Thread Suffield, David
Thanks everybody for your feedback. Now I have a better understanding of your 
use case. This looks like a case where we don't necessarily follow the Sane 
specification. Since the old hpaio code ignored localOnly and seemed to work 
ok, I see no reason for not changing it back. It should be fixed in the next 
hplip release.

-dave 

 -Original Message-
 From: Hernan Pastoriza [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, July 24, 2007 6:10 AM
 To: Suffield, David
 Subject: Re: Bug: hplip =1.6.12 breaks support for the sane 
 network daemon
 
 Hi Dave,
 Thanks for answering.
 My reason is simplicity and access control.We have the C5180 
 in a ghost network, only local to our server and through 
 saned and cups we provide access to the scanners and printers 
 to our users. In this sense, our C5180 and printers are only 
 local to the server but no to the clients.
 We must setup some complicated routing in the server to make 
 the printers visible to the clients at the network level. And 
 no, I can not connect them by USB as there are several rooms apart.
 I don't know who must care about our configuration, saned or 
 hplip. My first impression is that hplip.
 I interpret that the localOnly is for those devices that are 
 not accessible through the sane net protocol, which is this 
 case as the control of the data through the wire is done by 
 hplip right?
 Again I am not a developer just an user that tried to figure 
 out what happened. As I read in several mailing list I wasn't 
 the only one, and there were no clear answer to it (only: 
 stay with hplip  1.6.10...)
 
 Thanks again for your time,
 
HernĂ¡n
 
 
 
 Suffield, David wrote:
  Hi,
 
  Why would you use saned with a networked PS C5180? Since 
 the PS C5180 
  is networked, you can use xsane from any PC without saned.
 
  According to SANE Standard v1.04, when localOnly is true during 
  sane_get_devices, no remote devices are returned. This means only 
  USB/Parallel devices are returned.
 
  I would use saned if the all-in-one was USB connected only. 
 Then the 
  hpaio.c code should work correctly.
 
  -dave
 
 

  -Original Message-
  From: Hernan Pastoriza [mailto:[EMAIL PROTECTED]
  Sent: Friday, July 20, 2007 2:14 PM
  To: hplip-devel@lists.sourceforge.net
  Cc: [EMAIL PROTECTED]
  Subject: Re: Bug: hplip =1.6.12 breaks support for the 
 sane network 
  daemon
 
  I tracked down
  this  problem to  the file:
  scan/sane/hpaio.c
 
  The function DevDiscovery(int localOnly) skips the 
 detection of cups 
  connected  devices if localOnly is set. This flag is 
 passed as TRUE 
  by scaned, probably to avoid a loop with itself.
  I think that hplip is misunderstanding this flag.
  I just commented out the respective if (line 291 of hpaio.c in
  hplip-1.7.4a)
  and now it works.
 
  This is very crude but in this way saned is working with 
  libsane-hpaio again.
 
  I hope this helps.
 
  Hernan
 
 
  This is the patch:
 
 
  diff -rup hplip-1.7.4a/scan/sane/hpaio.c 
 hplip-1.7.4/scan/sane/hpaio.c
  --- hplip-1.7.4a/scan/sane/hpaio.c  2007-03-16 
  21:09:04.0 -0300
  +++ hplip-1.7.4b/scan/sane/hpaio.c 2007-07-20 16:17:38.0 
  +++ -0300
  @@ -288,7 +288,7 @@ static int DevDiscovery(int localOnly)
 }
  }
   
  -   if (!localOnly)
  +   if (1)
  {
 cnt = GetCupsPrinters(cups_printer);
 for (i=0; icnt; i++)
 
 
 
 
 
 
  
  I've discovered a bug in hplip which makes it impossible to

  share the
  
  scanner of a networked HP Photosmart C5180 using the sane network 
  daemon (saned).
 
  In theory saned is supposed to provide access to a

  connected scanner
  
  (using e.g. the hpaio backend). Each client on the network which 
  supports sane should now be able to connect to the server

  running the
  
  sane network daemon and access the server's scanners -

  without needing
  
  any special drivers (because the driver, hplip in my case

  is installed
  
  on the server).
  And this setup worked well with all hplip versions up to 1.6.10.
 
  I've tried many different distros now to get this feature

  to work with
  
  newer versions of hplip, but I was not successful:
  Ubuntu 7.04 - hplip 2.7.6 - saned not working Gentoo 
 2006.1 - hplip
  1.6.12  1.7.3 - saned not working Debian 4.0 - hplip 
 1.7.3 - saned 
  not working openSuSE 10.2 - hplip 1.7.3 - saned not working
 
  Scanning (locally, on the server) and printing (locally and

  over the
  
  net using
  cups) works fine in all cases.
  Of course I am not using any firewall or other related 
  software/hardware which could block the saned 
 functionality (and it 
  works with 1.6.10).
 
  For further details (output of saned, etc.) you might want

  to take a
  
  look at:
 

  
 http://www.mail-archive.com/hplip-help%40lists.sourceforge.net/msg028
  6
  
  7.html
 
  I am definitely _not_ the