[scanbd] using scanbd and saned over network at the same time

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[scanbd] using scanbd and saned over network at the same time

Rolf Leggewie-2
Hello,

I'd like to know if it is possible to have a computer that does
button-triggered scanning via scanbd but also exports the scanner over
the network to be accesible via the common. How would one do that?

Others seem to have the same question:
https://forum.manjaro.org/index.php?topic=29734.0

Regards

Rolf


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [scanbd] using scanbd and saned over network at the same time

Wilhelm Meier-2
Am 19.02.2016 um 14:38 schrieb Rolf Leggewie:
> Hello,
>
> I'd like to know if it is possible to have a computer that does
> button-triggered scanning via scanbd but also exports the scanner over
> the network to be accesible via the common. How would one do that?

Well, absolutely: thats the whole story of scanbd (see the readme.txt of
scanbd). With scanbd all scan-request must be via network, even local
applications must use network-scanning instead of local (via usb) access
to the scanner.

From ReadMe.txt:

0.1) the solution

scanbd (the scanner button daemon) opens and polls the scanner and
therefore
locks the device. So no other application can access the device directly
(open
the /dev/..., or via libusb, etc).

To solve this, we use a second daemon (in the so called "manager-mode" of
scanbd): scanbm is configured as a "proxy" to access the scanner and, if
another
application tries to use the scanner, the polling daemon is ordered to
disable
polling for the time the other scan-application wants to use the scanner.

To make this happen, scanbm is configured instead of saned as the network
scanning daemon. If a scan request arrives to scanbm on the sane-port,
scanbm
stops the polling by sending a dbus-signal (default) or a posix-signal
(SIGUSR1)
(signal-mode) to the polling scanbd-daemon. Then it starts the real
saned which
scans and sends the data back to the requesting application. Afterwards the
scanbd-manager scanbm restarts the polling by sending another
dbus-signal (or the
posix-signal SIGUSR2) to scanbd. scanbd now reenables polling of the
devices.

Scanbm is actually only a symbolic link to scanbd. Manager mode can be
activatied by calling scanbd as scanbm OR as scanbd -m as in previous
version
of scanbd.

So all applications must be enabled to use network-scanning (even if the
scanner is local, see below)!

Hth
--
Wilhelm


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [scanbd] using scanbd and saned over network at the same time

Rolf Leggewie-2
Hello Wilhelm,

thank you for the quick response.

On 19.02.2016 22:52, Wilhelm wrote:
> Am 19.02.2016 um 14:38 schrieb Rolf Leggewie:
>> Hello,
>>
>> I'd like to know if it is possible to have a computer that does
>> button-triggered scanning via scanbd but also exports the scanner over
>> the network to be accesible via the common. How would one do that?
>
> Well, absolutely: thats the whole story of scanbd (see the readme.txt of
> scanbd).

Well, I am aware of the general idea how saned and scanbd are supposed
to interact.  It can be pretty complicated to configure this error-free.
  Going from one machine back to a real network adds yet another layer
of complexity (and I was bitching when getting saned over network to run
for the first and a couple subsequent times).

As you probably know, I added a couple of checks for common
configuration errors to the Debian scanbd startup script.  Anything
detected by
http://anonscm.debian.org/cgit/collab-maint/scanbd.git/tree/debian/scanbd.init 
is OK on my scanbd server machine.  Button presses are detected fine by
scanbd.  But with this configuration, the scanner will only be detected
by sane-find-scanner and not be "scanimage -L".

$ sane-find-scanner | grep ^found
found USB scanner (vendor=0x04a9 [Canon], product=0x2213 [CanoScan]) at
libusb:001:035

Should this really be libusb?

Only if I add the genesys backend to /etc/sane.d/dll.conf, shut down
scanbd and start up saned do I get an output from "scanimage -L".

$ scanimage -L
device `genesys:libusb:001:035' is a Canon LiDE 35/40/50 flatbed scanner

That's when I also get a response from a network-connected client.

$ scanimage -L
device `net:himbeere.local:genesys:libusb:001:035' is a Canon LiDE
35/40/50 flatbed scanner

So, what am I likely doing wrong here? Any idea?

When scanbd is running (and thus scanimage is broken locally as well as
over the network), the following is the status:
- scanbd service is running
- saned service is stopped
- /etc/sane.d/dll.conf contains only the net backend
- /etc/scanbd/dll.conf does NOT contain the net backend
- /etc/scanbd/dll.conf contains the necessary genesys backend
   (and a few others)

Regards

Rolf


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [scanbd] using scanbd and saned over network at the same time

Wilhelm Meier-2
Hi Rolf,

your description looks reasonable.

Please ensure that scanbd (or systemd) really listens on port 6566:

[lmeier:/home/lmeier] $ sudo netstat -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address
State       PID/Program name
tcp        0      0 0.0.0.0:79              0.0.0.0:*
LISTEN      1/init
tcp        0      0 0.0.0.0:80              0.0.0.0:*
LISTEN      1119/httpd
tcp        0      0 0.0.0.0:22              0.0.0.0:*
LISTEN      1120/sshd
tcp        0      0 0.0.0.0:631             0.0.0.0:*
LISTEN      472/cupsd
tcp        0      0 0.0.0.0:6566            0.0.0.0:*
LISTEN      1/init
tcp        0      0 0.0.0.0:9000            0.0.0.0:*
LISTEN      1139/nginx: master

If thats ok check your scanimage:

[lmeier:/home/lmeier] $ strace scanimage -L 2>&1 | grep dll.conf
open("./dll.conf", O_RDONLY)            = -1 ENOENT (No such file or
directory)
open("/usr/local/etc/sane.d/dll.conf", O_RDONLY) = 4

Also you should check if the port is reachable or if some portfilter
sits there in between:

[lmeier:/home/lmeier] $ telnet localhost 6566
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Please report your results.

Am 19.02.2016 um 17:29 schrieb Rolf Leggewie:

> Hello Wilhelm,
>
> thank you for the quick response.
>
> On 19.02.2016 22:52, Wilhelm wrote:
>> Am 19.02.2016 um 14:38 schrieb Rolf Leggewie:
>>> Hello,
>>>
>>> I'd like to know if it is possible to have a computer that does
>>> button-triggered scanning via scanbd but also exports the scanner over
>>> the network to be accesible via the common. How would one do that?
>>
>> Well, absolutely: thats the whole story of scanbd (see the readme.txt of
>> scanbd).
>
> Well, I am aware of the general idea how saned and scanbd are supposed
> to interact.  It can be pretty complicated to configure this error-free.
>  Going from one machine back to a real network adds yet another layer of
> complexity (and I was bitching when getting saned over network to run
> for the first and a couple subsequent times).
>
> As you probably know, I added a couple of checks for common
> configuration errors to the Debian scanbd startup script.  Anything
> detected by
> http://anonscm.debian.org/cgit/collab-maint/scanbd.git/tree/debian/scanbd.init
> is OK on my scanbd server machine.  Button presses are detected fine by
> scanbd.  But with this configuration, the scanner will only be detected
> by sane-find-scanner and not be "scanimage -L".
>
> $ sane-find-scanner | grep ^found
> found USB scanner (vendor=0x04a9 [Canon], product=0x2213 [CanoScan]) at
> libusb:001:035
>
> Should this really be libusb?
>
> Only if I add the genesys backend to /etc/sane.d/dll.conf, shut down
> scanbd and start up saned do I get an output from "scanimage -L".
>
> $ scanimage -L
> device `genesys:libusb:001:035' is a Canon LiDE 35/40/50 flatbed scanner
>
> That's when I also get a response from a network-connected client.
>
> $ scanimage -L
> device `net:himbeere.local:genesys:libusb:001:035' is a Canon LiDE
> 35/40/50 flatbed scanner
>
> So, what am I likely doing wrong here? Any idea?
>
> When scanbd is running (and thus scanimage is broken locally as well as
> over the network), the following is the status:
> - scanbd service is running
> - saned service is stopped
> - /etc/sane.d/dll.conf contains only the net backend
> - /etc/scanbd/dll.conf does NOT contain the net backend
> - /etc/scanbd/dll.conf contains the necessary genesys backend
>   (and a few others)
>
> Regards
>
> Rolf
>
>


--
Wilhelm


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Loading...