Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scanadf: open of device fujitsu failed: Invalid argument #16

Closed
timcknowles opened this issue Nov 2, 2020 · 11 comments
Closed

scanadf: open of device fujitsu failed: Invalid argument #16

timcknowles opened this issue Nov 2, 2020 · 11 comments
Labels

Comments

@timcknowles
Copy link

I meant to say the script fails on this. Thanks Tim

@rocketraman
Copy link
Owner

rocketraman commented Nov 2, 2020

The script defaults to a fujitsu scanner/device. What is your hardware? You can see the drivers / connected devices by doing this:

scanadf -L

You can then pass --device <device-name> to the script to use the correct one.

See the -L and -d parameters in man scanadf.

@timcknowles
Copy link
Author

timcknowles commented Nov 2, 2020

I'm using a FUJITSU ScanSnap S1300i scanner

pi@raspberrypi:~ $ scanadf -L
device `epjitsu:libusb:001:011' is a FUJITSU ScanSnap S1300i scanner

but the script already defaults to DEVICE=fujitsu

Thanks again for your help

@timcknowles
Copy link
Author

Update:

I changed the device from DEVICE=fujitsu to DEVICE=epjitsu

pi@raspberrypi:~ $ sudo scanbd -f
scanbd: dbus match type='signal',interface='org.freedesktop.Hal.Manager'
scanbd: SANE_CONFIG_DIR not set
scanbd: Not Primary Owner (-1)
scanbd: Name Error (Connection ":1.75" is not allowed to own the service "de.kmux.scanbd.server" due to security policies in the configuration file)
scanbd: trigger action for scan for device epjitsu:libusb:001:011 with script scan.sh
units: cannot read file '/root/.units'. Permission denied
units: cannot read file '/root/.units'. Permission denied
Scanning...
scanadf: rounded value of page-height from 279.4 to 279.406
scanadf: invalid option -- 'y'
Found no scans.

@rocketraman
Copy link
Owner

You are triggering a scan from scanbd -- honestly I don't know what parameters that script is called with. You'll likely need to create some type of shim script that takes whatever parameters it gets when the button is pressed, and converts them to the parameters needed by the scan script.

For the purposes of debugging here, I'd remove scanbd out of the equation, and just get things working directly with scan. If that doesn't work, then post here your command line, and complete output with the -v (verbose) parameter.

@timcknowles
Copy link
Author

That makes complete sense to remove scanbd, I saw that other's had had success and that's how I came to try try it. This is the output:

pi@raspberrypi:~/sane-scan-pdf $ sudo bash scan -v -d -r 300 -v -m Lineart --skip-empty-pages -o /home/pi/scans/scan
Scanning...
scanadf: rounded value of page-height from 279.4 to 279.406
scanadf: invalid option -- 'y'
Found no scans.

Thanks

@rocketraman
Copy link
Owner

Probably unrelated, but you shouldn't need to use sudo when running this script. Nothing it does should require root access.

The '-y' option is a driver-specific option for page height. Looking at the man page for epjitsu (https://linux.die.net/man/5/sane-epjitsu) it does seem to have some limitations:

These scanners are fairly limited, only supporting a couple of modes and resolutions, and always scanning full width. The backend supports missing modes (binary, grayscale) in software, but makes no effort to offer intermediate resolutions or scan area controls. See KNOWN ISSUES.

and

No scan area options are exposed.

Try removing or commenting these lines from your script and see if it works:

https://github.com/rocketraman/sane-scan-pdf/blob/master/scan#L185-L188

@rocketraman
Copy link
Owner

Or grab the code from #17 and try to call the scan script with the argument --no-default-size.

@rocketraman
Copy link
Owner

@timcknowles Once you let me know if the code from #17 is working for this case, I can merge it to master.

@timcknowles
Copy link
Author

Hi thanks so much for this. I can confirm that by using code from #17 and calling the script with the argument --no-default-size works for the S1300i.

I did run into one more dependency issue with the scan_perpage script "bc: command not found" - installing the bc package fixed this (apt-get install bc)

I'm going to continue to try and get this work calling it via scanbd so the scan triggered form the scanner button and not just the cmd line.

Thanks Tim

@rocketraman
Copy link
Owner

Thanks for that confirmation. Code merged to master, README updated with optional bc dependency, and wiki https://github.com/rocketraman/sane-scan-pdf/wiki/Dependencies-Installation updated also.

@rocketraman
Copy link
Owner

@timcknowles This issue might be relevant to your use case with scanbd: #39.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants