Successfully tested on Ubuntu Server 10.04 LTS 64-bit
Few days ago, I described how to build and install scanbd. Now, it needs to be configured to perfectly suit the scanner it’s used with. As you’ll see, you have some very interesting possibilities with a four buttons scanner such as the EPSON Perfection V200 Photo.
First, install xinetd which will allow to use scanbd as a wrapper:
apt-get install xinetd
Create a sane-port service configuration file /etc/xinetd.d/sane-port
with the following content:
service sane-port
{
socket_type = stream
server = /usr/local/bin/scanbd
server_args = -m -c /usr/local/etc/scanbd/scanbd.conf
protocol = tcp
user = saned
group = saned
wait = no
disable = no
}
Stop saned service
service saned stop
and disable it as it will now be launched through xinetd/scanbd. Just modify /etc/default/saned
as follows:
RUN=no
Now, restart xinetd:
service xinetd restart
It should return:
* Stopping internet superserver xinetd [ OK ]
* Starting internet superserver xinetd [ OK ]
Next, create your own /usr/local/etc/scanbd/scanbd.conf
file (keep the original file, just in case…) to describe the available actions (buttons) on your scanner model. The configuration file I created for the EPSON Perfection V200 Photo is available here.
Copy the scanbd.debian
initialisation script located in scanbd source directory to /etc/init.d/scanbd
and install its link using the following command:
update-rc.d scanbd defaults
Make sure all the backends except the SANE network backend are commented out in /etc/sane.d/dll.conf
:
net
Uncomment the following line at the end of /etc/sane.d/net.conf
:
localhost
Comment out the SANE backend for EPSON scanners in /etc/sane.d/dll.d/iscan
:
#epkowa
Create a /usr/local/etc/scanbd/dll.conf
file including the following line:
epkowa
Copy (don’t move!) /etc/sane.d/epkowa.conf
to /usr/local/etc/scanbd/epkowa.conf
.
Copy /etc/sane.d/saned.conf
to /usr/local/etc/scanbd/saned.conf
.
Then, verify that you have no access list entry configured in /etc/sane.d/saned.conf
and add one in /usr/local/etc/scanbd/saned.conf
to restrict access to local subnet hosts only (adapt to your own network configuration):
192.168.253.0/24
Now that scanbd is configured for both local and LAN hosts access, let’s continue with the most interesting part of the configuration: The script executed when each button is pressed. You’ll find here the one I use to manage the 4 buttons “Start”, “Copy”, “Email” and “Pdf” available on the EPSON Perfection V200 Photo. Save it as /usr/local/etc/scanbd/actions.sh
and make it executable with a chmod 755
command.
In association with my scanner model, this script offers the following functions:
– Single page scan to JPEG
– Instant copy (scan to printer)
– Email creation with JPEG or multi-page PDF attachment
– Multi-page PDF creation
All this using only the scanner front buttons!
The buttons usage is explained at the beginning of the script file, along with some variables (such as SCANDIR
and PRINTER
) you’ll have to modify according to your needs. Also make sure to have imagemagick and mpack packages installed. If not, install them:
apt-get install imagemagick mpack
Scanbd setup is complete now but I added a last refinement. Having xinetd always running on the server, just because of the scanner buttons, bothered me (I don’t have any other service depending on xinetd). I updated the existing udev rule (previously added to assign the scanner to the saned group) to automatically start/stop the internet superserver when turning on/off the scanner, respectively. All you have to do is to replace your existing “scanner” udev rule (mine was /etc/udev/rules.d/40-saned.rules
) with the following file and disable xinetd, scanbd and saned startup scripts using the following three commands:
update-rc.d xinetd disable
update-rc.d scanbd disable
update-rc.d saned disable
If ever you have other services depending on xinetd and only want to stop the scanbd service, take a look at the chkconfig package.
That’s all Folks!
(Thanks for the help, bro. You’re da man!)
For further reading, see scanbd website and Gentoo udev Guide.
May 18, 2012 @ 14:13:37
Thanks!
Спасибо!
!תודה
شكرا
谢谢
ありがとう
Danke
Merci
This is a great post!
But maybe it’s worth merge /etc/sane.d with /usr/local/src/saned and disable network scanning (only script with scanner buttons)
May 18, 2012 @ 19:36:20
Thanks! I’m glad you found it useful.
I agree with your remarks but I wanted to keep network scanning working.
Jun 03, 2012 @ 19:59:13
It’s not work for my Epson v200 photo run at Ubuntu 12.04 LTS x64
iscan 2.28.1-3 (libltdl3 1.5.26)
iscan-data 1.15.0-2
iscan-plugin 2.1.2-1
scanbd 1.2
i check all steps, maybe something wrong?
Jun 03, 2012 @ 21:33:43
I’ll wait few months before upgrading to 12.04 LTS so, unfortunately, I cannot tell you what’s wrong. I fear you’ll have to do some more searches on the web or maybe ask for assistance on the sane-devel mailing list (subscribe at http://lists.alioth.debian.org/mailman/listinfo/sane-devel). Just out of curiosity, do you have any error message?
Jan 26, 2015 @ 23:44:53
Where is the script? The link didn’t seem to work.
Jan 27, 2015 @ 00:16:48
I just tried by clicking the link and it does work. Maybe you have a suspicious anti-virus, no?
Also, just for your info, note that scanbd evolved a lot since this post (I believe it includes the V200 patch now) and you can find some builds on PPAs such as https://launchpad.net/~r0lf/+archive/ubuntu/stable/+packages for instance. I didn’t try, but maybe you could have a look at this.
Aug 02, 2017 @ 09:16:42
Hi there, I am using a fujitsu scanner and have followed all the steps and all seems fine. However, scanbd does not detect the buttons, any idea on how to add a custom backend for the buttons?
Aug 03, 2017 @ 21:08:48
Hi, I don’t know much about your scanner model but it seems there are some references to Fujitsu + scanbd if you search on the web. Here is just an exemple : https://gitcommit.fr/install-ix500-scanner-on-linux/
I’m pretty sure you’ll find something interesting to complete your scanner setup. Good luck!