[sane-devel] [scanbd] using scanbd and saned over network at the same time
wilhelm.meier at fh-kl.de
Fri Feb 19 14:52:45 UTC 2016
Am 19.02.2016 um 14:38 schrieb Rolf Leggewie:
> 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.
0.1) the solution
scanbd (the scanner button daemon) opens and polls the scanner and
locks the device. So no other application can access the device directly
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
application tries to use the scanner, the polling daemon is ordered to
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,
stops the polling by sending a dbus-signal (default) or a posix-signal
(signal-mode) to the polling scanbd-daemon. Then it starts the real
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
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
So all applications must be enabled to use network-scanning (even if the
scanner is local, see below)!
More information about the sane-devel