[sane-devel] scanbd daemon does not load firmware
Hi Ilya, Am 20.09.2013 06:36, schrieb Ilya V. Ivanchenko: Wilhelm, Here's a patch that implements device insertion/removal hooks. I've tested it with scanbuttond backend and it solves the problem of firmware not being loaded to the scanner. thanks again. Just added the patches! -- Ilya *From:* Wilhelm wilhelm.meier at fh-kl.de *To:* Ilya V. Ivanchenko iva2k at yahoo.com *Cc:* w.meier at unix.net w.meier at unix.net; sane-devel at lists.alioth.debian.org sane-devel at lists.alioth.debian.org *Sent:* Friday, August 30, 2013 10:29 PM *Subject:* Re: scanbd daemon does not load firmware Am 31.08.2013 02:28, schrieb Ilya V. Ivanchenko: Thanks, that clarifies the situation and also explains what you meant by the callback. This external hook should be given in configuration file, like in /etc/scanbd/scanbd.conf. Do you have a name you'd like for that option? Well, could imagine prepare_script as an option name for the scriptname. It's value should be an absolute path name or a relative pathname, where the same rules apply as for all scripts (see scriptdir option). And I would to pass it at most the same env vars the action scripts receive. And additionally an env variable called WHEN (or make it configurable) with the values inserted or removed or thelike. I'm looking forward to your contribution! Thanks! -- Wilhelm w.meier at unix.net mailto:w.meier at unix.net -- Wilhelm w.meier at unix.net
[sane-devel] scanbd daemon does not load firmware
Wilhelm, Great, thanks! --- Ilya Here's a patch that implements device insertion/removal hooks. I've tested it with scanbuttond backend and it solves the problem of firmware not being loaded to the scanner. thanks again. Just added the patches! -- next part -- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130923/3f482085/attachment.html
[sane-devel] scanbd daemon does not load firmware
Hi Ilya, Am 20.09.2013 06:36, schrieb Ilya V. Ivanchenko: Wilhelm, Here's a patch that implements device insertion/removal hooks. I've tested it with scanbuttond backend and it solves the problem of firmware not being loaded to the scanner. thank you for your patch! Looks very good. I will integrate that in the next few days, please be a little patient because I have a very tight time budget this weekend. Thanks! Wilhelm -- Ilya *From:* Wilhelm wilhelm.meier at fh-kl.de *To:* Ilya V. Ivanchenko iva2k at yahoo.com *Cc:* w.meier at unix.net w.meier at unix.net; sane-devel at lists.alioth.debian.org sane-devel at lists.alioth.debian.org *Sent:* Friday, August 30, 2013 10:29 PM *Subject:* Re: scanbd daemon does not load firmware Am 31.08.2013 02:28, schrieb Ilya V. Ivanchenko: Thanks, that clarifies the situation and also explains what you meant by the callback. This external hook should be given in configuration file, like in /etc/scanbd/scanbd.conf. Do you have a name you'd like for that option? Well, could imagine prepare_script as an option name for the scriptname. It's value should be an absolute path name or a relative pathname, where the same rules apply as for all scripts (see scriptdir option). And I would to pass it at most the same env vars the action scripts receive. And additionally an env variable called WHEN (or make it configurable) with the values inserted or removed or thelike. I'm looking forward to your contribution! Thanks! -- Wilhelm w.meier at unix.net mailto:w.meier at unix.net -- Wilhelm w.meier at unix.net
[sane-devel] scanbd daemon does not load firmware
Wilhelm, Here's a patch that implements device insertion/removal hooks. I've tested it with scanbuttond backend and it solves the problem of firmware not being loaded to the scanner. -- Ilya From: Wilhelm wilhelm.meier at fh-kl.de To: Ilya V. Ivanchenko iva2k at yahoo.com Cc: w.meier at unix.net w.meier at unix.net; sane-devel at lists.alioth.debian.org sane-devel at lists.alioth.debian.org Sent: Friday, August 30, 2013 10:29 PM Subject: Re: scanbd daemon does not load firmware Am 31.08.2013 02:28, schrieb Ilya V. Ivanchenko: Thanks, that clarifies the situation and also explains what you meant by the callback. This external hook should be given in configuration file, like in /etc/scanbd/scanbd.conf. Do you have a name you'd like for that option? Well, could imagine prepare_script as an option name for the scriptname. It's value should be an absolute path name or a relative pathname, where the same rules apply as for all scripts (see scriptdir option). And I would to pass it at most the same env vars the action scripts receive. And additionally an env variable called WHEN (or make it configurable) with the values inserted or removed or thelike. I'm looking forward to your contribution! Thanks! -- Wilhelm w.meier at unix.net -- next part -- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130919/430151fc/attachment.html -- next part -- A non-text attachment was scrubbed... Name: scanbd-hooks-iva2k-20130919.patch Type: text/x-patch Size: 10730 bytes Desc: not available URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130919/430151fc/attachment.bin
[sane-devel] scanbd daemon does not load firmware
Am 30.08.2013 19:44, schrieb Ilya V. Ivanchenko: Hi Wilhelm, Thanks! I checked out the code from svn and found the markers without problems. It is first time I reviewed scanbd code, so I got few questions, maybe you can answer and save me some time. I hope so ... It looks like the backend selection sane vs. scanbuttond is exclusive (compiled with #ifdef). What I gathered is in sane branch the calling sequence will be sane_init(), sane_get_devices(). I peeked into sanei code, and it seems it will call sane_open() from sane_get_devices(). sane_open() does load firmware for the scanner if it is required (each sane backend has its own implementation). So my understanding is that scanbd with sane backend will load the firmware and have no problem. Is that correct? yes! Now to the scanbuttonbd backend of scanbd. It looks like it won't call into sane backends as it has its own backends library. And scanbuttond backend has no code that loads firmware. As such, the bug of not loading the firmware is only happens with scanbuttond backend. Am I right? yes! Now I have to select an appropriate fix for the firmware issue, and my #1 option is to call sane_get_devices(), even when using scanbuttond backend which now is exclusive from sane backend. Will that be a problem? The scanbuttons backends exists only for old scanners / for historical reasons. So, the preferred way is to use sane-backends. Because there are scanbuttond backends for scanners with no sane-backend I don't want to couple scanbuttond and sane together. Therefore I would suggest a generic solution to call an external programm / script in the case a device is inserted / removed. This external programm / script can then load the firmware by any means - even calling simply scanimage if sane is configured correctly. One can aruge that using scanbd/scanbuttond for a scanner with no sane-support is sort of useless in case the buttons should trigger a scan-operation. But there might be other scan-applications than sane ... If it is, then I don't have an option #2... or better said it gets very complicated very quickly. -- Ilya *From:* Wilhelm wilhelm.meier at fh-kl.de *To:* Ilya V. Ivanchenko iva2k at yahoo.com *Cc:* w.meier at unix.net w.meier at unix.net; sane-devel at lists.alioth.debian.org sane-devel at lists.alioth.debian.org *Sent:* Thursday, August 29, 2013 12:33 PM *Subject:* Re: scanbd daemon does not load firmware Am 29.08.2013 16:03, schrieb Ilya V. Ivanchenko: 2. When using scanbuttond-backends, fix loading firmware on USB insert. what I could imagine is to fix this problem with a special shell-callback, when scanbd detects a device inserion / removal. Forgot to say: would you like to write a patch for that? I will provide you with the neccessary info to do that. Shouldn't be too much work ;-) Not a problem. I'm a software/systems engineer, so I know what I (will be) doing. Only I have short window before I leave for a business trip. I just marked the code with four place to insert code to start such a callback: // TODO: call the device insertion / removal callback (if you use qtcreator you'll quickly find them) I'm looking forward to your patches ;-) 2. When using scanbuttond-backends, fix loading firmware on USB insert. what I could imagine is to fix this problem with a special shell-callback, when scanbd detects a device inserion / removal. This is in the nutshell how I patched the problem from udev. yes, but you had to stop / restart the scanbd and that's more a workaround than a solution ... I agree. -- Ilya -- Wilhelm w.meier at unix.net mailto:w.meier at unix.net -- Wilhelm w.meier at unix.net
[sane-devel] scanbd daemon does not load firmware
Thanks, that clarifies the situation and also explains what you meant by the callback. This external hook should be given in configuration file, like in /etc/scanbd/scanbd.conf. Do you have a name you'd like for that option? -- Ilya -- next part -- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130830/c0715150/attachment.html
[sane-devel] scanbd daemon does not load firmware
Hi Ilya, is there a special reason using the (old) scanbuttond-backends and not sane-backends? If you plugin / poweron the scanner for the first time, who does the firmware get loaded in this case? Am 29.08.2013 03:42, schrieb Ilya Ivanchenko: On Wed, 2013-08-28, Wilhelm wrote: Am 28.08.2013 07:11, schrieb Ilya V. Ivanchenko: 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. that shouldn't happen. Normally, scanbd gets via udev | hal | dbus a device-removed event and then abandones the device until it gets plugged in again. Good to know that scanbd should manage firmware loading, it answers the questions I had. Now it seems we better dig to the root of the problem... So, please show the syslog from beginning of the scanbd log messages and in the situation when the device is removed. I've pasted syslog snippet with the problem when firmware is not loaded (with scanbd debug-level=7) here (device was removed on Aug 28 18:02:28, communication error happens on Aug 28 18:03:19): http://pastebin.com/BweSr5p2 (it will expire in 1 month) And please: how did you configure / compile, which platform, ... Ubuntu 12.04LTS on Intel amd64, 1st installed sane and Epson's iscan: sudo apt-get install sane-utils sudo dpkg -i iscan-data_1.23.0-1_all.deb sudo dpkg -i iscan_2.29.1-5~usb0.1.ltdl7_amd64.deb sudo dpkg -i iscan-plugin-gt-1500_2.2.0-1_amd64.deb scanimage -L # works 2nd downloaded scanbd (181-trunk) Prepared: sudo apt-get install build-essential checkinstall sudo apt-get install libconfuse-dev libsane-dev libudev-dev sudo apt-get install libconfuse-dev libusb-dev libudev-dev libdbus-1-dev dbus libsane-dev ## Sane option will only work if sane backend supports reading buttons from the scanner (use scanimage -A to check): # ./configure --prefix= --with-user=saned --with-group=scanner ## Use scanbuttond backend (embedded into scanbd): ./configure --prefix= --with-user=saned --with-group=scanner --enable-scanbuttond I patched 2 files: - src/scanbuttond/backends/epson_vphoto.c - added VID/PID 04B8/0133 for Epson GT-1500: { 0x04B8, 0x0133, 5 } // Epson GT-1500, buttons: 1=scan, 2=copy, 3=email, 4=pdf, 5=stop ... { Epson, GT-1500} - src/scanbd/scanbuttond_wrapper.c function scanbtnd_button_name() (upped the assert for button count =4 to =5 and renamed buttons per Epson line above) BTW - it would be nice if device definitions can name their own buttons instead of hard-coded values.That first list with VID/PID/count_buttons could contain an array of strings for that. Then I compiled: make sudo make install The system configuration involved some editing in /etc/, but I think it is not the issue here. Anyway let me know if you need any other information. Regards, -- Ilya -- Wilhelm w.meier at unix.net
[sane-devel] scanbd daemon does not load firmware
Hi Wilhelm, is there a special reason using the (old) scanbuttond-backends and not? sane-backends? I first tried sane-backends, and apparently it does not read the buttons for Epson GT-1500. I tried various things with sane-backends, but scanimage -A gives no button options and it was very unclear how to patch sane-backends or even where to start. So I quickly gave up and moved to scanbuttond-backends where it was easy to figure out a patch and it worked right away. I'd be glad if sane backend worked, but even Epson's iscan does not support buttons (seemingly on any of their scanners). If you plugin / poweron the scanner for the first time, who does the firmware get loaded in this case? Good question. Now retracing my steps backwards, I think I got iscan+sane to load the drivers the very first time and I did not notice this problem. When I tested things, I always used scanimage -L as a quick test, and it pulled the string up to the firmware loading (at which moment scanner clearly does a whizz sound moving the head in its POST). It appears to me that scanbd somehow misses calling the firmware load on USB insert (before reading buttons), but does it on scanimage -L. Perhaps it is due to the use of scanbuttond-backends and not sane-backends. So my current conclusions are that there are two potential issues to fix: ?1. Make sane-backends support buttons that scanbuttond-backends support. ?2. When using scanbuttond-backends, fix loading firmware on USB insert. Please correct me if I'm wrong here. -- Wilhelm w.meier at unix.net -- next part -- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130829/c1035439/attachment.html
[sane-devel] scanbd daemon does not load firmware
Hi Ilja, Am 29.08.2013 15:25, schrieb Ilya V. Ivanchenko: Hi Wilhelm, **is there a special reason using the (old) scanbuttond-backends and not sane-backends? I first tried sane-backends, and apparently it does not read the buttons for Epson GT-1500. did you use the epkowa backend? The sane-support-page says, that this backend supports most features of the GT-1500. I tried various things with sane-backends, but scanimage -A gives no button options and it was very unclear how to patch sane-backends or even where to start. So I quickly gave up and moved to scanbuttond-backends where it was easy to figure out a patch and it worked right away. I'd be glad if sane backend worked, but even Epson's iscan does not support buttons (seemingly on any of their scanners). If you plugin / poweron the scanner for the first time, who does the firmware get loaded in this case? Good question. Now retracing my steps backwards, I think I got iscan+sane to load the drivers the very first time and I did not notice this problem. When I tested things, I always used scanimage -L as a quick test, and it pulled the string up to the firmware loading (at which moment scanner clearly does a whizz sound moving the head in its POST). It appears to me that scanbd somehow misses calling the firmware load on USB insert (before reading buttons), but does it on scanimage -L. Perhaps it is due to the use of scanbuttond-backends and not sane-backends. So my current conclusions are that there are two potential issues to fix: 1. Make sane-backends support buttons that scanbuttond-backends support. that would be the best choice, since I have no real plans to support the scanbuttond backends. 2. When using scanbuttond-backends, fix loading firmware on USB insert. what I could imagine is to fix this problem with a special shell-callback, when scanbd detects a device inserion / removal. Please correct me if I'm wrong here. -- Wilhelm w.meier at unix.net mailto:w.meier at unix.net -- Wilhelm w.meier at unix.net
[sane-devel] scanbd daemon does not load firmware
Hi Wilhelm, is there a special reason using the (old) scanbuttond-backends and not sane-backends? I first tried sane-backends, and apparently it does not read the buttons for Epson GT-1500. did you use the epkowa backend? The sane-support-page says, that this backend supports most features of the GT-1500. Yes, epkowa is the backend used in the current configuration. I had problems of getting buttons to work with sane, but now retracing back it may be due to sane configuration needing epson2 (would not work with epkowa for some reason), and switching to scanbd needing epkowa (would not work with epson2). I just tried scanimage -A again and found --monitor-button option there, but scanimage -h does not have button options (except --wait-for-button). Can you suggest what commands I should use to test the buttons from command line? So my current conclusions are that there are two potential issues to fix: ? 1. Make sane-backends support buttons that scanbuttond-backends support. that would be the best choice, since I have no real plans to support the scanbuttond backends. I guess I could try sane-backends again to see if I can make the buttons work with epkowa backend. ? 2. When using scanbuttond-backends, fix loading firmware on USB insert. what I could imagine is to fix this problem with a special shell-callback, when scanbd detects a device inserion / removal. This is in the nutshell how I patched the problem from udev. -- Ilya -- next part -- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130829/780263cb/attachment.html
[sane-devel] scanbd daemon does not load firmware
Am 29.08.2013 15:33, schrieb Wilhelm: Hi Ilja, Am 29.08.2013 15:25, schrieb Ilya V. Ivanchenko: Hi Wilhelm, **is there a special reason using the (old) scanbuttond-backends and not sane-backends? I first tried sane-backends, and apparently it does not read the buttons for Epson GT-1500. did you use the epkowa backend? The sane-support-page says, that this backend supports most features of the GT-1500. I tried various things with sane-backends, but scanimage -A gives no button options and it was very unclear how to patch sane-backends or even where to start. So I quickly gave up and moved to scanbuttond-backends where it was easy to figure out a patch and it worked right away. I'd be glad if sane backend worked, but even Epson's iscan does not support buttons (seemingly on any of their scanners). If you plugin / poweron the scanner for the first time, who does the firmware get loaded in this case? Good question. Now retracing my steps backwards, I think I got iscan+sane to load the drivers the very first time and I did not notice this problem. When I tested things, I always used scanimage -L as a quick test, and it pulled the string up to the firmware loading (at which moment scanner clearly does a whizz sound moving the head in its POST). It appears to me that scanbd somehow misses calling the firmware load on USB insert (before reading buttons), but does it on scanimage -L. Perhaps it is due to the use of scanbuttond-backends and not sane-backends. So my current conclusions are that there are two potential issues to fix: 1. Make sane-backends support buttons that scanbuttond-backends support. that would be the best choice, since I have no real plans to support the scanbuttond backends. 2. When using scanbuttond-backends, fix loading firmware on USB insert. what I could imagine is to fix this problem with a special shell-callback, when scanbd detects a device inserion / removal. Forgot to say: would you like to write a patch for that? I will provide you with the neccessary info to do that. Shouldn't be too much work ;-) Please correct me if I'm wrong here. -- Wilhelm w.meier at unix.net mailto:w.meier at unix.net -- Wilhelm w.meier at unix.net
[sane-devel] scanbd daemon does not load firmware
Am 29.08.2013 15:52, schrieb Ilya V. Ivanchenko: Hi Wilhelm, is there a special reason using the (old) scanbuttond-backends and not sane-backends? I first tried sane-backends, and apparently it does not read the buttons for Epson GT-1500. did you use the epkowa backend? The sane-support-page says, that this backend supports most features of the GT-1500. Yes, epkowa is the backend used in the current configuration. I had problems of getting buttons to work with sane, but now retracing back it may be due to sane configuration needing epson2 (would not work with epkowa for some reason), and switching to scanbd needing epkowa (would not work with epson2). I just tried scanimage -A again and found --monitor-button option there, but scanimage -h does not have button options (except --wait-for-button). Can you suggest what commands I should use to test the buttons from command line? So my current conclusions are that there are two potential issues to fix: 1. Make sane-backends support buttons that scanbuttond-backends support. that would be the best choice, since I have no real plans to support the scanbuttond backends. I guess I could try sane-backends again to see if I can make the buttons work with epkowa backend. 2. When using scanbuttond-backends, fix loading firmware on USB insert. what I could imagine is to fix this problem with a special shell-callback, when scanbd detects a device inserion / removal. This is in the nutshell how I patched the problem from udev. yes, but you had to stop / restart the scanbd and that's more a workaround than a solution ... -- Ilya -- Wilhelm w.meier at unix.net
[sane-devel] scanbd daemon does not load firmware
? 2. When using scanbuttond-backends, fix loading firmware on USB insert. what I could imagine is to fix this problem with a special shell-callback, when scanbd detects a device inserion / removal. Forgot to say: would you like to write a patch for that? I will provide you with the neccessary info to do that. Shouldn't be too much work ;-) Not a problem. I'm a software/systems engineer, so I know what I (will be) doing. Only I have short window before I leave for a business trip. ? ? 2. When using scanbuttond-backends, fix loading firmware on USB insert. ? ? what I could imagine is to fix this problem with a special ? shell-callback, when scanbd detects a device inserion / removal. This is in the nutshell how I patched the problem from udev. yes, but you had to stop / restart the scanbd and that's more a? workaround than a solution ... I agree. -- Ilya -- next part -- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130829/fbb4a285/attachment.html
[sane-devel] scanbd daemon does not load firmware
Am 29.08.2013 16:03, schrieb Ilya V. Ivanchenko: 2. When using scanbuttond-backends, fix loading firmware on USB insert. what I could imagine is to fix this problem with a special shell-callback, when scanbd detects a device inserion / removal. Forgot to say: would you like to write a patch for that? I will provide you with the neccessary info to do that. Shouldn't be too much work ;-) Not a problem. I'm a software/systems engineer, so I know what I (will be) doing. Only I have short window before I leave for a business trip. I just marked the code with four place to insert code to start such a callback: // TODO: call the device insertion / removal callback (if you use qtcreator you'll quickly find them) I'm looking forward to your patches ;-) 2. When using scanbuttond-backends, fix loading firmware on USB insert. what I could imagine is to fix this problem with a special shell-callback, when scanbd detects a device inserion / removal. This is in the nutshell how I patched the problem from udev. yes, but you had to stop / restart the scanbd and that's more a workaround than a solution ... I agree. -- Ilya -- Wilhelm w.meier at unix.net
[sane-devel] scanbd daemon does not load firmware
Hello, Am 28.08.2013 07:11, schrieb Ilya V. Ivanchenko: 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. that shouldn't happen. Normally, scanbd gets via udev | hal | dbus a device-removed event and then abandones the device until it gets plugged in again. So, please show the syslog from beginning of the scanbd log messages and in the situation when the device is removed. And please: how did you configure / compile, which platform, ... 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. This seems to be a consequence of the above failure: the device isn't closed correctly and not reopened therefore. So the firmware isn't loaded again (should be done on device opening). 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. as stated above: should be done on openeing the device 2. If scanbd daemon currently cannot load the firmware, are there any plans to add this feature? see above 3. If not, what is the recommended way to set scanbd up so it will work with scanners that require firmware to be loaded? see above 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 21 /dev/null /usr/bin/scanimage -L 21 | $logger /usr/sbin/service scanbd start 21 /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 -- Wilhelm w.meier at unix.net
[sane-devel] scanbd daemon does not load firmware
On Wed, 2013-08-28, Wilhelm wrote: Am 28.08.2013 07:11, schrieb Ilya V. Ivanchenko: 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. that shouldn't happen. Normally, scanbd gets via udev | hal | dbus a device-removed event and then abandones the device until it gets plugged in again. Good to know that scanbd should manage firmware loading, it answers the questions I had. Now it seems we better dig to the root of the problem... So, please show the syslog from beginning of the scanbd log messages and in the situation when the device is removed. I've pasted syslog snippet with the problem when firmware is not loaded (with scanbd debug-level=7) here (device was removed on Aug 28 18:02:28, communication error happens on Aug 28 18:03:19): http://pastebin.com/BweSr5p2 (it will expire in 1 month) And please: how did you configure / compile, which platform, ... Ubuntu 12.04LTS on Intel amd64, 1st installed sane and Epson's iscan: sudo apt-get install sane-utils sudo dpkg -i iscan-data_1.23.0-1_all.deb sudo dpkg -i iscan_2.29.1-5~usb0.1.ltdl7_amd64.deb sudo dpkg -i iscan-plugin-gt-1500_2.2.0-1_amd64.deb scanimage -L # works 2nd downloaded scanbd (181-trunk) Prepared: sudo apt-get install build-essential checkinstall sudo apt-get install libconfuse-dev libsane-dev libudev-dev sudo apt-get install libconfuse-dev libusb-dev libudev-dev libdbus-1-dev dbus libsane-dev ## Sane option will only work if sane backend supports reading buttons from the scanner (use scanimage -A to check): # ./configure --prefix= --with-user=saned --with-group=scanner ## Use scanbuttond backend (embedded into scanbd): ./configure --prefix= --with-user=saned --with-group=scanner --enable-scanbuttond I patched 2 files: - src/scanbuttond/backends/epson_vphoto.c - added VID/PID 04B8/0133 for Epson GT-1500: { 0x04B8, 0x0133, 5 } // Epson GT-1500, buttons: 1=scan, 2=copy, 3=email, 4=pdf, 5=stop ... { Epson, GT-1500} - src/scanbd/scanbuttond_wrapper.c function scanbtnd_button_name() (upped the assert for button count =4 to =5 and renamed buttons per Epson line above) BTW - it would be nice if device definitions can name their own buttons instead of hard-coded values.That first list with VID/PID/count_buttons could contain an array of strings for that. Then I compiled: make sudo make install The system configuration involved some editing in /etc/, but I think it is not the issue here. Anyway let me know if you need any other information. Regards, -- Ilya
[sane-devel] scanbd daemon does not load firmware
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 21 /dev/null /usr/bin/scanimage -L 21 | $logger /usr/sbin/service scanbd start 21 /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