Invalid argument - Brother scanner not working after upgrade (brscan2 driver)

After I update to 13.10 I got the same error when scanning. There are two problems here.

  1. The error Invalid argument is not a argument problem, but is a write access problem.
  2. 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


Just add your user to the lp group:

usermod -a -G lp username

After this you will have write permissions for your scanner.

Tested with:

  • 14.04 LTS 64 bit up-to-date
  • Brother DCP-J315W
  • linux-brprinter-installer-2.0.0-1 downloaded from Brother Support Center

The permissions for the printer/scanner at /dev/bus/usb/001 are:

crw-rw-r-- 1 root lp

It's because of this that adding your user to the lp group is a solution.


Try this program called VueScan, I was searching for mfc-420cn driver and i ran into this website: "http://www.hamrick.com/" I haven't been able to test this though (because I still have yet to find the power cable to my old printer that's been collecting dust.), but it did say it would support a vast variety of printers, so I thought I should post it. Anyways, hope this helps.