Quantcast

--batch-prompt with Fujitsu backend and iX500

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

--batch-prompt with Fujitsu backend and iX500

Andy Bennett
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

--
[hidden email]
http://www.ashurst.eu.org/
0x7EBA75FF


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: --batch-prompt with Fujitsu backend and iX500

m. allan noah-3
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 <[hidden email]> 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
>
> --
> [hidden email]
> http://www.ashurst.eu.org/
> 0x7EBA75FF
>
>
> --
> sane-devel mailing list: [hidden email]
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>              to [hidden email]



--
"well, I stand up next to a mountain- and I chop it down with the edge
of my hand"

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: --batch-prompt with Fujitsu backend and iX500

Andy Bennett
In reply to this post by Andy Bennett
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

--
[hidden email]
http://www.ashurst.eu.org/
0x7EBA75FF


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]

sensor-trap-2014-12-28-01.patch (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: --batch-prompt with Fujitsu backend and iX500

Andy Bennett
Hi,

Has anybody had a chance to take a look at this patch?

I'd be interested in feedback and information about how to get it applied.


>> 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
>
>
>





Regards,
@ndy

--
[hidden email]
http://www.ashurst.eu.org/
0x7EBA75FF


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: --batch-prompt with Fujitsu backend and iX500

Andy Bennett
Hi,

I've created a ticket for this:

https://alioth.debian.org/tracker/index.php?func=detail&aid=314974&group_id=30186&atid=410366


It's be great to get some feedback about how to get this applied.
:-)



> Has anybody had a chance to take a look at this patch?
>
> I'd be interested in feedback and information about how to get it applied.
>
>
>>> 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
>>
>>
>>
>
>
>
>
>
> Regards,
> @ndy
>





Regards,
@ndy

--
[hidden email]
http://www.ashurst.eu.org/
0290 DA75 E982 7D99 A51F  E46A 387A 7695 7EBA 75FF


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: multipage scans (was: Re: --batch-prompt with Fujitsu backend and iX500)

Andy Bennett
In reply to this post by Andy Bennett
Hi Carl,

> I am hoping there is support for the button.

I wrote the attached patch (explanation below) to support the button for
my ScanSnap iX500 with scanimage.

Please let me know if you are able to try it out and whether it works
for you.




-------- Forwarded Message --------
Subject: Re: [sane-devel] --batch-prompt with Fujitsu backend and iX500
Date: Sun, 28 Dec 2014 20:41:30 +0000
From: Andy Bennett <[hidden email]>
To: [hidden email]

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

--
[hidden email]
http://www.ashurst.eu.org/
0x7EBA75FF






Regards,
@ndy

--
[hidden email]
http://www.ashurst.eu.org/
0290 DA75 E982 7D99 A51F  E46A 387A 7695 7EBA 75FF




--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]

sensor-trap-2014-12-28-01.patch (4K) Download Attachment
Loading...