[sane-devel] scanbd daemon does not load firmware

Ilya V. Ivanchenko iva2k at yahoo.com
Wed Aug 28 05:11:28 UTC 2013


I created a neat setup using xinet + scanbd service + scanbd daemon (for buttons) + sane (client) to use Epson GT-1500 (with ADF) as a workhorse of a network scanner, with scanner buttons hooked to various jobs. Everything is working great, except...

I encountered a problem after the scanner is powered off and then on again. The buttons service (scanbd daemon) stops reading the buttons and keeps getting "communication error" in the syslog.

I tried various things until it occurred to me that Epson GT-1500 uses iscan plugin that loads firmware file (/usr/share/iscan/esfw86.bin) and the power off-on resets the scanner and thus wipes out the firmware. It seems like scanbd daemon does not load the firmware when the scanner is powered back on (at least I was not able to find how to configure it to do so), and it gets into trouble trying to read the buttons from device without its firmware. 

I have few questions to scanbd team:

1. Can scanbd daemon automatically load firmware file and what should be done in the config files to achieve that? sane config files seem to have "firmware" option, but I don't see anything in scanbd documentation.

2. If scanbd daemon currently cannot load the firmware, are there any plans to add this feature?

3. If not, what is the recommended way to set scanbd up so it will work with scanners that require firmware to be loaded?

I spent few hours and came up with the following rework using udev rule that invokes "scanimage -L" command to pull the command chain that loads the firmware. It works fine and I have not seen "communication error" since.

A. Create a script that causes firmware to be loaded (I'm open to other methods, but scanimage -L is the only I found so far)
sudo tee /etc/scanbd/scanner.d/on_insert.sh > /dev/null << CATEOF
#! /bin/bash
logger=/usr/bin/logger -t scanbd
$logger "Loading firmware for $1"
/usr/sbin/service scanbd stop 2>&1 >/dev/null
/usr/bin/scanimage -L 2>&1 | $logger
/usr/sbin/service scanbd start 2>&1 >/dev/null
$logger "Done loading firmware for $1"
CATEOF
sudo chmod a+x /etc/scanbd/scanner.d/on_insert.sh

B. Create udev rule to call the above script.
sudo tee /etc/udevd/rules.d/98-epson.rules > /dev/null << CATEOF
# Force firmware load for EPSON GT-1500
ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0133", RUN+="/etc/scanbd/scanner.d/on_insert.sh %p"
CATEOF
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130827/4ebe50df/attachment-0001.html>


More information about the sane-devel mailing list