Skip to content

Scanning initiated by scanner buttons starts with a great delay #31

Description

@archont00

Hi,

The scanner is connected via ethernet cable.

device `brother4:net1;dev0' is a Brother *DCP-B7520W Brother_DCP-B7520DW_series

When I use in scripts/scantofile.sh:

scan_cmd="scanimage -l 0 -t 0 -x 215 -y 297 --device-name=$device --resolution=$resolution --batch=$output_file"
echo "Command: $scan_cmd"

the initiation of the scanning has a great delay of cca 30 seconds ("Connecting to PC" is displayed on the scanner LCD after pressing the scan button on the scanner):

2024-09-17T**19:32:54**.578402000Z /opt/brother/scanner/brscan-skey/script/scantofile.sh: line 14: UID: readonly variable
2024-09-17T19:32:54.579085000Z filename: /scans/2024-09-17--21-32-54/2024-09-17--21-32-54-front-page%04d.pnm
2024-09-17T19:32:54.579236000Z Command: scanimage -l 0 -t 0 -x 215 -y 297 --device-name=brother4:net1;dev0 --resolution=150 --batch=/scans/2024-09-17--21-32-54/2024-09-17--21-32-54-front-page%04d.pnm
2024-09-17T19:32:54.579382000Z Output format is not set, using pnm as a default.
2024-09-17T**19:33:03**.579674000Z scanimage: rounded value of br-x from 215 to 211.881
2024-09-17T19:33:03.580342000Z scanimage: rounded value of br-y from 297 to 296.973
2024-09-17T19:33:03.580492000Z Scanning infinity pages, incrementing by 1, numbering from 1
2024-09-17T19:33:03.580631000Z Scanning page 1
2024-09-17T**19:34:23**.590222000Z Scanned page 1. (scanner status = 5)

Scanning of subsequent pages within the batch starts promptly after button press (Next = up arrow key on the scanner).

When I run the above scanimage command from terminal inside the docker container (i.e. direct scanning initiated from computer), it takes 9 seconds to actually start the scanning. The scanning itself takes just a few seconds as it is 150 dpi only.

As per above log, the delay between the scanner button press (19:32:54) and the scanning (cca 19:33:34 less few seconds spent on actual scanning) looks like 3 times the 9 seconds delay. (Could it be that SANE commands are triggered three times for any reason.)

Any ideas what might be wrong with brother4 driver or brscan-skey and if it can be setup to run with shorter initial delay? It makes it impractical to use the scanner buttons now...

BTW, I tried to run scanimage in terminal inside the container with --device-name=escl:http://10.11.13.11:80 instead and the scanning started immediately without any delay.

Unfortunately, when I tried to use this device name in the script, the delay of cca 10 seconds is still there and the command fails eventually (driver is probably not supported by brscan-skey?):

2024-09-17T**19:35:35**.600366000Z /opt/brother/scanner/brscan-skey/script/scantofile.sh: line 14: UID: readonly variable
2024-09-17T19:35:35.601023000Z filename: /scans/2024-09-17--21-35-34/2024-09-17--21-35-34-front-page%04d.pnm
2024-09-17T19:35:35.601164000Z Command: scanimage -l 0 -t 0 -x 215 -y 297 --device-name=escl:http://10.11.13.11:80 --resolution=100 -v -v -v --batch=/scans/2024-09-17--21-35-34/2024-09-17--21-35-34-front-page%04d.pnm
... cut on purpose ...
2024-09-17T19:35:35.602824000Z Scanning page 1
2024-09-17T**19:35:45**.601742000Z scanimage: sane_start: Invalid argument
2024-09-17T19:35:45.602384000Z Batch terminated, 0 pages scanned
2024-09-17T19:35:45.602531000Z Closing device
2024-09-17T19:35:45.602666000Z Calling sane_exit

EDIT: Clarifying that the delay 30 secs is when using the physical scan button on the scanner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions