LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 02-17-2019, 04:41 AM   #1
KWTm
Member
 
Registered: Jan 2004
Distribution: Kubuntu 14.04 (Dell Linux-preinstalled laptop + 2 other laptops)
Posts: 117

Rep: Reputation: 21
Brother scanner MFC-665CW - XSANE would say Failed to open device : invalid argument


Here is how I solved my problem with my Brother networked scanner using Ubuntu. Hope this works for other people as well.

My situation:

I have a Brother MFC-665CW hooked up by wireless (not USB), and my Kubuntu 16.04 laptop used to be able to scan stuff. After updating my router firmware (I didn't change anything on the laptop that was running Kubuntu Linux), Xsane would no longer scan. It would detect the scanner, but then it would show an error message:


device brother2:net1;dev0 failed: Invalid argument


Then it would exit.

What I tried at first:

I looked into modifying permissions in /lib/udev/rules.d/40-libsane.rules , but my scanner was connected by wifi network, not via USB.

I also tried rebooting my Linux laptop, which didn't have any effect.

What I had already done, which was necessary:

First, I had already installed the Brother scanner drivers, with the following commands type in the terminal:

Code:
sudo dpkg -i brscan4-0.4.3-1.amd64.deb
sudo dpkg -i brscan-skey-0.2.4-1.amd64.deb
sudo apt-get -f install
Those driver files: "brscan-skey-0.2.4-1.amd64.deb" and "brscan4-0.4.3-1.amd64.deb" --those filenames might be slightly different for you, depending on your computer and their version. For example, previous do this I had installed other versions:


brscan2-0.2.4-0.i386.deb
brscan-skey-0.2.1-1.i386.deb


(You can see that these are older versions, and they are for 386-type thirty-bit computers instead of the newer 64bit versions I listed before.)

Where did I get these files? From the Brother website, somewhere around here:

https://support.brother.com/g/b/down...w_us_as&os=128

I had already installed the Brother Driver Installer through a tool I had downloaded from the Brother web site:
I don't remember what the file was originally called -- I had renamed it "Brother_DriverInstaller" on my own computer.
The program is actually for installing Linux drivers for various Brother printers. It asks for the model name of the printer, so you have to get the exact model name, like "MFC-665CW", not "665cw".
It downloads the correct drivers, but I don't remember if it installs them for you. I didn't want it installing the files on its own --I prefer to be in control-- so either I waited for it to download the drivers and then interrupted the installation process, or it never actually installed and only downloaded. In any case, I ended up with the files brscan4-0.4.3-1.amd64.deb and brscan-skey-0.2.4-1.amd64.deb as listed above, which I then used the "dpkg -i" command to install as above. Then, as one should after using the "dpkg -i" command, I followed-up with the "apt-get -f install" command to "fix" (-f) any other dependencies.

Second, I found the IP address of my scanner. There are various ways to find this out, and also various ways to preset this. One thing you can do is go to your Brother MFC-65CW printer/scanner/copier and, using the onscreen display, check the Menu > Lan > WLAN setup > IP address > it showed "192.168.1.234" as an example. Yours will probably start with 192.168.(something) also.

As I said, I had already done this, and things were working, but then it failed. So here's what I did to solve the problem:

How I Solved It:

I used the brsaneconfig4 command to tell the SANE system what the IP address of my scanner was. Just typing the "brsaneconfig4" command by itself on the command line gave me a reminder of how to use the command. It said, among other things:


USAGE: brsaneconfig4 [-OPTION] OPTION:
-a name=FRIENDLY-NAME model=MODEL-NAME ip=xx.xx.xx.xx


So I typed:

Code:
brsaneconfig4 -a name=MyOwn665 model=MFC-665CW ip=192.168.1.234
Then, just to make sure it worked, I typed:

Code:
brsaneconfig4 -q
It spouted a huge list of over 200 supported Brother scanner models, and then at the very end, it listed what scanners it actually knew were present:


[ ... 245 other lines here ...]
246 "DCP-7065DN"
247 "DCP-7060D"
248 "DCP-7055"

Devices on network
0 MyOwn665 "MFC-665CW" I:192.168.1.234


So that confirmed that now it knew where to find my scanner.

With the configuration set up, I wanted to make sure the "scanimage" program (which seems to be what actually does the scanning for the XSANE scanner utilities) would find the scanner, so I typed:

Code:
	 scanimage -L
And it said:


device `brother4:net1;dev0' is a Brother *MyOwn665 MFC-665CW
device `brother2:net1;dev0' is a Brother MFC-665CW MFC-665CW


Oh ho! It listed not only the scanner that I had just set up, under "brother4:net1;dev0", but also the old setting it had been trying to use before I did the setup, which was "brother2:net1;dev0", which was wrong. No wonder it didn't work before.

I was also able to verify it another way, by typing

Code:
	scanimage --help
It listed some help text and then seemed to freeze for a few minutes. Turns out it was just taking a long time detecting scanners. I think this is poor design; when you ask for help, the scanimage program (or any other program) should not do anything that has the possibility of freezing or crashing the program. It should just print help text and then return to the command prompt.

Anyway, the --help option on the scanimage program finally spit out the following info:


List of available devices:
brother4:net1;dev0 brother2:net1;dev0


Again, we see that it keeps finding something on "brother2:net1;dev0", which doesn't exist. We'll use the one at brother4, which we can tell is the correct one because we gave it a recognizable name, "MyOwn655" and we ourselves set that to be at the correct IP address.

Then I ran the XSANE graphical tool, and it let me choose which scanner to use, so I chose the one that existed.

Hope this helps people.

Last edited by KWTm; 02-17-2019 at 04:58 AM. Reason: adjusted formatting
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED]...Brother MFC-440CN Scanner Issues dbrew4 Linux - Newbie 18 12-10-2017 04:19 PM
New Printer Scanner in Xsane finds new printer/scanner (Brother MFC-6520DW) with error message TrinityBeing Linux - Newbie 23 03-29-2016 10:27 AM
[SOLVED] Brother MFC-7840W Network Scanner not Recognized in XSane Kaiser Soze Slackware 9 06-21-2011 11:40 PM
[SOLVED] xsane networked scanner returns "invalid argument" wufo Linux - Hardware 2 04-22-2011 05:25 PM
Easy install Brother MFC-665CW printer scanner etc. paynejp Linux - Hardware 1 11-07-2009 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 05:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration