WhatsYourFunction
WhatsYourFunction

Reputation: 825

scanimage: open of device fujitsu:ScanSnap iX500:[s/n] failed: Invalid argument

Trying to trigger scans from fujitsu ScanSnap iX500 using CLI, defining a specific scanner.

scanimage --device 'fujitsu:ScanSnap iX500:[s/n]' --resolution 300 --batch=Scan-p%d.pnm --format=pnm --mode color

The error from that: scanimage: open of device fujitsu:ScanSnap iX500:[s/n] failed: Invalid argument

The --device entry was derived from sudo scanimage -L The following variations of --device return the same error:

Removing the --device option removes the error, BUT causes the command to search for a locally-attached device, which introduces a long delay. Targeting the --device in the hopes of eliminating the delay.

Upvotes: 0

Views: 1399

Answers (2)

WhatsYourFunction
WhatsYourFunction

Reputation: 825

The problem, it turns out, was not in the naming of the device. (The name returned by sudo scanimage -L is the correct one to use and works fine.

The issue has to do with permissions / user

Running the command under the .sh file used appropriate permissions. Running directly in command line must have used another user, even though both were executed under the same ssh session.

Solution: Choose the right login user. In my case adding sudo before the command (which was not included or necessary in the .sh file) resolved the issue.

Upvotes: 0

jhecn
jhecn

Reputation: 1

From https://linux.die.net/man/1/scanimage : there is no parameter "--device" for the scanimage command.

Maybe you want to use -d or --device-name and follow the advices given in the manual:

The -d or --device-name options must be followed by a SANE device-name like 'epson:/dev/sg0' or 'hp:/dev/usbscanner0'. A (partial) list of available devices can be obtained with the --list-devices option (see below). If no device-name is specified explicitly, scanimage reads a device-name from the environment variable SANE_DEFAULT_DEVICE. If this variable is not set, scanimage will attempt to open the first available device.

Upvotes: 0

Related Questions