I had the same problem and fixed it by editing /lib/udev/rules.d/40-libsane.rules
.
I uncommented the line:
ENV{DEVTYPE}=="usb_device", MODE="0664", OWNER="root", GROUP="root"
Then edited it to be:
ENV{DEVTYPE}=="usb_device", MODE="0664", OWNER="root", GROUP="saned"
After that I added my user to the saned
group. It all works now.
The problem is that it wants to run as root till you do this.
After I update to 13.10 I got the same error when scanning. There are two problems here.
- The error Invalid argument is not a argument problem, but is a write access problem.
- The other problem is that the bus and dev number are wrong from the scanimage error.
How to find and fix the problem?
Install the brscan4 drivers from the brother website
sudo dpkg -i brscan4-0.4.2-1.amd64.deb
Check to see if it works
sudo brsaneconfig4 -d
Test to see if the scanner is installed (scanner need to be powered on). And run as a user NOT root
$ scanimage -L
device `brother4:bus5;dev1' is a Brother ADS-2000 USB scanner
$ scanimage --test
scanimage: open of device brother4:bus5;dev1 failed:
Invalid argument
or
$ scanimage
scanimage: open of device brother4:bus5;dev1 failed:
Invalid argument
You can use the following script to update the permissions for the scanner.
lsusb | grep -i brother | sed 's/://' | awk '{printf "/dev/bus/usb/%s/%s", $2,$4}' | xargs -i -t sudo chmod 666 "{}"
lsusb
lists usb devices
grep -i brother
will find the brother device (assumption I made is you have only one brother device connected to the USBs at a time)
sed 's/://' | awk '{printf "/dev/bus/usb/%s/%s", $2,$4}'
will find the bus & device numbers
xargs -i -t sudo chmod 666 "{}"
will add write permission to scanner
Here is more detailed information on why we did what we did above
To find out where the brother scanner is on the bus use lsusb
. This is one of the problems in the scanimage. The bus is 003 and the device is 002 and not bus 5, dev 1 as per scanimage
$ lsusb
Bus 003 Device 002: ID 04f9:60a0 Brother Industries, Ltd**
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
...
To fix the problem, you will need to use the path based on the location of the brother scanner in the lsusb
command. In my case it was bus 003
and device 002
. Note that if you unplug the USB cable to the scanner and plug it back in the device, you will get a new number and/or bus. (The number return back to 2 when you reboot the PC)
Examples:
sudo cd /dev/bus/usb/003
sudo chmod 666 002
or just:
sudo chmod 666 /dev/bus/usb/003/002
Scanimage
need to fix the message when it can not access the scanner to have the right bus and dev number and also tell the user that the problem is a write access problem.
Brother
needs to update the driver code so that global user can write to the scanner i.e. chmod 666
to the scanner driver location
Best Answer
The solution was so silly... after hours of frustration, I just unplugged the USB cable and re-connected it. Then, I ran brsaneconfig4 -d again and got:
Now I can print with simple-scan!