[sane-devel] --batch-prompt with Fujitsu backend and iX500
Hi, I've been using scanimage to obtain scans from an iX500 thus: - scanimage --format=pnm --batch --mode Color --resolution 300dpi --source ADF Duplex --buffermode On --page-width=210mm --page-height=297mm -x 210mm -y 297mm --bgcolor White --brightness 24 - This will scan boths sides of all the sheets in the hopper and then stop. I've been experimenting with adding --batch-prompt to allow me to refill the hopper. I've been filling the hopper with just one sheet of paper at a time. When I do this it waits for me to press RETURN, scans the page, creates out1.pnm and then invites me to Place document no. 2 on the scanner. and press RETURN again. When I press RETURN it feeds the piece of paper through the scanner and creates out2.pnm which is the image of the reverse side of the paper. It then invites me to Place document no. 3 on the scanner. and press RETURN again. This time it will not detect the page load signal. It claims scanimage: sane_start: Document feeder out of documents and exits: - $ scanimage --format=pnm --batch --mode Color --resolution 300dpi --source ADF Duplex --buffermode On --page-width=210mm --page-height=297mm -x 210mm -y 297mm --bgcolor White --batch-prompt scanimage: rounded value of page-width from 210 to 210.01 scanimage: rounded value of page-height from 297 to 296.994 scanimage: rounded value of br-x from 210 to 210.01 scanimage: rounded value of br-y from 297 to 296.994 Scanning -1 pages, incrementing by 1, numbering from 1 Place document no. 1 on the scanner. Press RETURN to continue. Press Ctrl + D to terminate. Scanning page 1 Scanned page 1. (scanner status = 5) Place document no. 2 on the scanner. Press RETURN to continue. Press Ctrl + D to terminate. Scanning page 2 Scanned page 2. (scanner status = 5) Place document no. 3 on the scanner. Press RETURN to continue. Press Ctrl + D to terminate. Scanning page 3 scanimage: sane_start: Document feeder out of documents - I tried adding --batch-double but this only affects the file numbering. Is there a way for scanimage --batch-prompt ... to poll the button on the front of the scanner instead of waiting for RETURN? In gscan2pdf I can see the button sensor activate when I press the button (and refresh the scanner list with the button held down) but I can't see it in xsane or with scanimage -A. I'm happy to start the program manually (rather than using scanbd or scanbuttond) but it'd be nice if I can then just load the hopper and press the button on the scanner for each batch. Maybe it would be better to have a scanimage option which just blocks until the button (chosen with command line flags?) is pressed so that I can write a shell script thus: - #!/bin/bash N=0 while true; do scanimage -A --button scan ... # wait for button press N=$(($N + 1)) mkdir $N cd $N scanimage # acquire a document post-process $PWD # process in background cd .. done - Regards, @ndy -- andy...@ashurst.eu.org http://www.ashurst.eu.org/ 0x7EBA75FF -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] --batch-prompt with Fujitsu backend and iX500
I think what you really want is to investigate scanbd. There are some experienced users and the author also on this list who might be able to help you with configuration. allan On Sun, Dec 28, 2014 at 10:01 AM, Andy Bennett andy...@ashurst.eu.org wrote: Hi, I've been using scanimage to obtain scans from an iX500 thus: - scanimage --format=pnm --batch --mode Color --resolution 300dpi --source ADF Duplex --buffermode On --page-width=210mm --page-height=297mm -x 210mm -y 297mm --bgcolor White --brightness 24 - This will scan boths sides of all the sheets in the hopper and then stop. I've been experimenting with adding --batch-prompt to allow me to refill the hopper. I've been filling the hopper with just one sheet of paper at a time. When I do this it waits for me to press RETURN, scans the page, creates out1.pnm and then invites me to Place document no. 2 on the scanner. and press RETURN again. When I press RETURN it feeds the piece of paper through the scanner and creates out2.pnm which is the image of the reverse side of the paper. It then invites me to Place document no. 3 on the scanner. and press RETURN again. This time it will not detect the page load signal. It claims scanimage: sane_start: Document feeder out of documents and exits: - $ scanimage --format=pnm --batch --mode Color --resolution 300dpi --source ADF Duplex --buffermode On --page-width=210mm --page-height=297mm -x 210mm -y 297mm --bgcolor White --batch-prompt scanimage: rounded value of page-width from 210 to 210.01 scanimage: rounded value of page-height from 297 to 296.994 scanimage: rounded value of br-x from 210 to 210.01 scanimage: rounded value of br-y from 297 to 296.994 Scanning -1 pages, incrementing by 1, numbering from 1 Place document no. 1 on the scanner. Press RETURN to continue. Press Ctrl + D to terminate. Scanning page 1 Scanned page 1. (scanner status = 5) Place document no. 2 on the scanner. Press RETURN to continue. Press Ctrl + D to terminate. Scanning page 2 Scanned page 2. (scanner status = 5) Place document no. 3 on the scanner. Press RETURN to continue. Press Ctrl + D to terminate. Scanning page 3 scanimage: sane_start: Document feeder out of documents - I tried adding --batch-double but this only affects the file numbering. Is there a way for scanimage --batch-prompt ... to poll the button on the front of the scanner instead of waiting for RETURN? In gscan2pdf I can see the button sensor activate when I press the button (and refresh the scanner list with the button held down) but I can't see it in xsane or with scanimage -A. I'm happy to start the program manually (rather than using scanbd or scanbuttond) but it'd be nice if I can then just load the hopper and press the button on the scanner for each batch. Maybe it would be better to have a scanimage option which just blocks until the button (chosen with command line flags?) is pressed so that I can write a shell script thus: - #!/bin/bash N=0 while true; do scanimage -A --button scan ... # wait for button press N=$(($N + 1)) mkdir $N cd $N scanimage # acquire a document post-process $PWD # process in background cd .. done - Regards, @ndy -- andy...@ashurst.eu.org http://www.ashurst.eu.org/ 0x7EBA75FF -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org -- well, I stand up next to a mountain- and I chop it down with the edge of my hand -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] sane_read: Device busy with Canon PIXMA MX310 and sane 1.0.20-4ubuntu3
http://sane.10972.n7.nabble.com/file/n19274/scanner_canon_mf4450.jpg canon mf 4450 printer scanner not workig -- View this message in context: http://sane.10972.n7.nabble.com/sane-read-Device-busy-with-Canon-PIXMA-MX310-and-sane-1-0-20-4ubuntu3-tp5228p19274.html Sent from the SANE - Dev mailing list archive at Nabble.com. -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
[sane-devel] scanbd: Can't get the scbtn device list
Hello, I tried to install scanbd on a Arch Linux X64 but it did not recognize my Scanner - output of scanbd: Can't get the scbtn device list. It is not my first time with scanbd and on my previous installations it was already working with my scanner and the scanbuttond epson backend. I first installed scanbd from AUR (1.4.0) and then i tried the latest (1.4.1) from sourceforge - same problem. Scanning with sane is working, also through the running scanbd-service. Output of lsusb: Bus 001 Device 049: ID 04b8:010c Seiko Epson Corp. GT-6700U [Perfection 640] Output of scanbd, it runs as root for testing: /usr/bin/scanbd -d7 -f -c /etc/scanbd/scanbd.conf ## /usr/bin/scanbd: foreground /usr/bin/scanbd: config-file: /etc/scanbd/scanbd.conf /usr/bin/scanbd: reading config file /etc/scanbd/scanbd.conf /usr/bin/scanbd: debug on: level: 7 /usr/bin/scanbd: dropping privs to uid root /usr/bin/scanbd: dropping privs to gid scanner /usr/bin/scanbd: group scanner has member: /usr/bin/scanbd: alex /usr/bin/scanbd: drop privileges to gid: 96 /usr/bin/scanbd: Running as effective gid 96 /usr/bin/scanbd: drop privileges to uid: 0 /usr/bin/scanbd: Running as effective uid 0 /usr/bin/scanbd: dbus_init /usr/bin/scanbd: dbus match type='signal',interface='org.freedesktop.Hal.Manager' /usr/bin/scanbd: Loading /usr/lib/scanbd/scanbuttond/backends/meta.so /usr/bin/scanbd: meta-backend: init /usr/bin/scanbd: libusbi: initializing... /usr/bin/scanbd: Loading /usr/lib/scanbd/scanbuttond/backends/epson.so /usr/bin/scanbd: meta-backend: attaching backend: Epson USB /usr/bin/scanbd: epson-backend: init /usr/bin/scanbd: Scanning for local-only devices /usr/bin/scanbd: Can't get the scbtn device list /usr/bin/scanbd: device list null /usr/bin/scanbd: start_scbtn_threads /usr/bin/scanbd: start the threads (0) /usr/bin/scanbd: start dbus thread /usr/bin/scanbd: Not Primary Owner (-1) /usr/bin/scanbd: Name Error (Connection :1.110 is not allowed to own the service de.kmux.scanbd.server due to security policies in the configuration file) /usr/bin/scanbd: udev init /usr/bin/scanbd: get udev monitor /usr/bin/scanbd: udev fd is non-blocking, now setting to blocking mode /usr/bin/scanbd: start udev thread /usr/bin/scanbd: udev thread started ^C/usr/bin/scanbd: sig_term/int_handler called with signal 2 /usr/bin/scanbd: stop_scbtn_threads /usr/bin/scanbd: waiting ... /usr/bin/scanbd: stop dbus thread /usr/bin/scanbd: stop udev thread /usr/bin/scanbd: join udev thread /usr/bin/scanbd: cleanup device handler /usr/bin/scanbd: close udev monitor /usr/bin/scanbd: close udev /usr/bin/scanbd: exiting scanbd ## Any hints? Alex -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
[sane-devel] Network connected scanner, i/o error if scanner is idle for longer then 40sec
I found, using the kodakaio backend, that leaving the scanner idle between scans for more than around 40sec gives an i/o error when I try to scan again. I can scan any number of times with gaps of less than 30 sec between scans without getting this error. Has anyone ever had a similar experience with any other backend? Does anyone have an idea what might be the cause? -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] Network connected scanner, i/o error if scanner is idle for longer then 40sec
Are you using a long-running front-end like xsane, or multiple invocations of something like scanimage? allan On Sun, Dec 28, 2014 at 3:24 PM, Paul Newall p.newa...@ntlworld.com wrote: I found, using the kodakaio backend, that leaving the scanner idle between scans for more than around 40sec gives an i/o error when I try to scan again. I can scan any number of times with gaps of less than 30 sec between scans without getting this error. Has anyone ever had a similar experience with any other backend? Does anyone have an idea what might be the cause? -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org -- well, I stand up next to a mountain- and I chop it down with the edge of my hand -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] --batch-prompt with Fujitsu backend and iX500
Hi, Is there a way for scanimage --batch-prompt ... to poll the button on the front of the scanner instead of waiting for RETURN? In gscan2pdf I can see the button sensor activate when I press the button (and refresh the scanner list with the button held down) but I can't see it in xsane or with scanimage -A. I'm happy to start the program manually (rather than using scanbd or scanbuttond) but it'd be nice if I can then just load the hopper and press the button on the scanner for each batch. Maybe it would be better to have a scanimage option which just blocks until the button (chosen with command line flags?) is pressed Please find a patch to scanimage.c attached. This patch adds the --sensor-trap and -s options. With no arguments this option prints the status of all the sensors as per the -A option. When the name of the sensor is given as the option argument it waits for that sensor to change state before proceeding as normal. i.e. it scans with the supplied options unless -n is present, in which case it exits with success. I have tested this on the Fujitsu ScanSnap iX500. With the --sensor-trap=scan option it waits until the button up event on the front panel button before proceeding (provided the button is not held down when scanimage is run). With the --sensor-trap=page-loaded option it waits for a piece of paper to be placed in the hopper before immediately scanning it. Interestingly, if the hopper contains a piece of paper when scanimage is invoked then it immediately scans it otherwise it waits until the page is inserted and then scans it. I'm not sure if this will be the case for all scanners. There are a couple of issues that might require further attention: I'm not sure if the signal handler initialisation is in the correct place: If I Ctrl-C the binary whilst it is waiting for the state change then it can't stop the scanner on the first try and aborts on the second. I'm not sure if the indenting or function signature styles are correct. Regards, @ndy -- andy...@ashurst.eu.org http://www.ashurst.eu.org/ 0x7EBA75FF --- sane-backends-1.0.24-orig/frontend/scanimage.c 2013-08-25 22:22:58.0 +0100 +++ sane-backends-1.0.24/frontend/scanimage.c 2014-12-28 20:32:21.660511618 + @@ -100,13 +100,14 @@ static struct option basic_options[] = { {accept-md5-only, no_argument, NULL, OPTION_MD5}, {icc-profile, required_argument, NULL, 'i'}, {dont-scan, no_argument, NULL, 'n'}, + {sensor-trap, optional_argument, NULL, 's'}, {0, 0, NULL, 0} }; #define OUTPUT_PNM 0 #define OUTPUT_TIFF 1 -#define BASE_OPTSTRING d:hi:Lf:B::nvVTAbp +#define BASE_OPTSTRING d:hi:Lf:B::nvVTAbps #define STRIP_HEIGHT 256 /* # lines we increment image height */ static struct option *all_options; @@ -1696,6 +1697,90 @@ static void print_options(SANE_Device * fputc ('\n', stdout); } +static void print_sensors(SANE_Device * device, SANE_Int num_dev_options, + const char * sensor_name) +{ + int i, j, flag; + const SANE_Option_Descriptor *opt; + + flag = 0; + + for (i = 1; i num_dev_options; ++i) +{ + opt = 0; + + /* scan area uses modified option struct */ + for (j = 0; j 4; ++j) + if (i == window[j]) + opt = window_option + j; + + if (!opt) + opt = sane_get_option_descriptor (device, i); + + if (opt-type == SANE_TYPE_GROUP) { + if (strcmp (opt-name, SANE_NAME_SENSORS) == 0) { + flag = 1; + } else { + flag = 0; + } + } + + if (flag (!sensor_name || (strcmp(opt-name, sensor_name) == 0))) + print_option (device, i, opt); +} + if (num_dev_options) +fputc ('\n', stdout); +} + +SANE_Status +find_sensor(SANE_Device * device, SANE_Int num_dev_options, + const char * sensor_name, + SANE_Int * opt_num, const SANE_Option_Descriptor ** opt_p) +{ + SANE_Int dummy_opt_num = 0; + const SANE_Option_Descriptor *opt; + + if (opt_num == 0) +opt_num = dummy_opt_num; + + if(opt_p == 0) +opt_p = opt; + + int i, j, flag; + + flag = 0; + + for (i = 1; i num_dev_options; ++i) +{ + opt = 0; + + /* scan area uses modified option struct */ + for (j = 0; j 4; ++j) + if (i == window[j]) + opt = window_option + j; + + if (!opt) + opt = sane_get_option_descriptor (device, i); + + if (opt-type == SANE_TYPE_GROUP) { + if (strcmp (opt-name, SANE_NAME_SENSORS) == 0) { + flag = 1; + } else { + flag = 0; + } + } + + if (flag sensor_name (strcmp(opt-name, sensor_name) == 0)) +{ + *opt_p = opt; + *opt_num = i; + return SANE_STATUS_GOOD; + } +} + + return SANE_STATUS_UNSUPPORTED; +} + int main (int argc, char **argv) { @@ -1705,6 +1790,7 @@ main (int argc, char **argv) const char *devname = 0; const char *defdevname = 0; const char *format = 0; + const char* sensor_name = 0; char readbuf[2]; char *readbuf2; int batch = 0; @@ -1712,6 +1798,7 @@ main (int argc, char **argv) int batch_count = BATCH_COUNT_UNLIMITED; int
Re: [sane-devel] Network connected scanner, i/o error if scanner is idle for longer then 40sec
This was using xsane. If I close xsane and reopen it I can scan again. Paul On 28/12/14 20:40, m. allan noah wrote: Are you using a long-running front-end like xsane, or multiple invocations of something like scanimage? allan On Sun, Dec 28, 2014 at 3:24 PM, Paul Newall p.newa...@ntlworld.com wrote: I found, using the kodakaio backend, that leaving the scanner idle between scans for more than around 40sec gives an i/o error when I try to scan again. I can scan any number of times with gaps of less than 30 sec between scans without getting this error. Has anyone ever had a similar experience with any other backend? Does anyone have an idea what might be the cause? -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] scanbd: Can't get the scbtn device list
Hi Alex, Am 28.12.2014 um 21:08 schrieb Alexander Tomisch: Hello, I tried to install scanbd on a Arch Linux X64 but it did not recognize my Scanner - output of scanbd: Can't get the scbtn device list. It is not my first time with scanbd and on my previous installations it was already working with my scanner and the scanbuttond epson backend. do you really need the scanbuttond backend? These backends are included into scanbd as is, because they aren't actively maintained. I first installed scanbd from AUR (1.4.0) and then i tried the latest (1.4.1) from sourceforge - same problem. Scanning with sane is working, also through the running scanbd-service. This indicates, that libsane is working correctly! Output of lsusb: Bus 001 Device 049: ID 04b8:010c Seiko Epson Corp. GT-6700U [Perfection 640] Unfortunately I don't have access to this type of scanner ... Output of scanbd, it runs as root for testing: /usr/bin/scanbd -d7 -f -c /etc/scanbd/scanbd.conf ## /usr/bin/scanbd: foreground /usr/bin/scanbd: config-file: /etc/scanbd/scanbd.conf /usr/bin/scanbd: reading config file /etc/scanbd/scanbd.conf /usr/bin/scanbd: debug on: level: 7 /usr/bin/scanbd: dropping privs to uid root /usr/bin/scanbd: dropping privs to gid scanner /usr/bin/scanbd: group scanner has member: /usr/bin/scanbd: alex /usr/bin/scanbd: drop privileges to gid: 96 /usr/bin/scanbd: Running as effective gid 96 /usr/bin/scanbd: drop privileges to uid: 0 /usr/bin/scanbd: Running as effective uid 0 /usr/bin/scanbd: dbus_init /usr/bin/scanbd: dbus match type='signal',interface='org.freedesktop.Hal.Manager' /usr/bin/scanbd: Loading /usr/lib/scanbd/scanbuttond/backends/meta.so /usr/bin/scanbd: meta-backend: init /usr/bin/scanbd: libusbi: initializing... /usr/bin/scanbd: Loading /usr/lib/scanbd/scanbuttond/backends/epson.so /usr/bin/scanbd: meta-backend: attaching backend: Epson USB /usr/bin/scanbd: epson-backend: init /usr/bin/scanbd: Scanning for local-only devices /usr/bin/scanbd: Can't get the scbtn device list /usr/bin/scanbd: device list null /usr/bin/scanbd: start_scbtn_threads /usr/bin/scanbd: start the threads (0) /usr/bin/scanbd: start dbus thread /usr/bin/scanbd: Not Primary Owner (-1) /usr/bin/scanbd: Name Error (Connection :1.110 is not allowed to own the service de.kmux.scanbd.server due to security policies in the configuration file) /usr/bin/scanbd: udev init /usr/bin/scanbd: get udev monitor /usr/bin/scanbd: udev fd is non-blocking, now setting to blocking mode /usr/bin/scanbd: start udev thread /usr/bin/scanbd: udev thread started ^C/usr/bin/scanbd: sig_term/int_handler called with signal 2 /usr/bin/scanbd: stop_scbtn_threads /usr/bin/scanbd: waiting ... /usr/bin/scanbd: stop dbus thread /usr/bin/scanbd: stop udev thread /usr/bin/scanbd: join udev thread /usr/bin/scanbd: cleanup device handler /usr/bin/scanbd: close udev monitor /usr/bin/scanbd: close udev /usr/bin/scanbd: exiting scanbd ## Any hints? Alex -- Wilhelm w.me...@unix.net -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org