xsane fails to open brother scanner (linux mint xfce 19.1)

Forum rules
Before you post please read this
getstarted
Level 1
Level 1
Posts: 18
Joined: Sun Jul 03, 2016 2:11 pm

xsane fails to open brother scanner (linux mint xfce 19.1)

Post by getstarted »

I successfully installed LM xfce 19.1 on my desktop. I have a USB-connected brother printer scanner MFC-7420, but the scanner does not work. Here's what I have done and the error messages I got:
-----------------
0) To install the drivers I following the instruction (+FAQ) on

https://support.brother.com/g/b/downloa ... all&os=128

including brother-udev-rule-type1-1.0.2-0.all.deb. The printer works, but not the scanner.
-----------------
1) Xsane says

Failed to open device `brother2:bus2;dev5'
Invalid argument.

(sudo xsane gives the same error message). When I fire up simple-scan (sudo or otherwise) it says

Ready to Scan
Brother MFC-7420

but when I click "scan" I got "Unable to connect to scanner".
-----------------
2) scanimage -L
device `brother2:bus2;dev5' is a Brother MFC-7420 USB scanner

scanimage --test
scanimage: open of device brother2:bus2;dev5 failed: Invalid argument
-----------------
3) lsusb
Bus 001 Device 002: ID 04f9:0180 Brother Industries, Ltd MFC-7420

[ Question: How come it says 001:002 when xsane complains about 002:005 ?!! ]

ls -l /dev/bus/usb/001/002
crw-rw-r--+ 1 root lp 189, 1 Jan 17 15:36 /dev/bus/usb/001/002

ls -l /dev/bus/usb/001
total 0
crw-rw-r-- 1 root root 189, 0 Jan 17 15:27 001
crw-rw-r--+ 1 root lp 189, 1 Jan 17 15:36 002
crw-rw-r-- 1 root root 189, 2 Jan 17 15:27 003
crw-rw-r-- 1 root root 189, 3 Jan 17 15:27 004
crw-rw-r-- 1 root root 189, 4 Jan 17 15:27 005
crw-rw-r-- 1 root root 189, 5 Jan 17 15:27 006

[Question: According to
https://cromwell-intl.com/open-source/x ... ument.html
the command above should have listed "scanner" but as you can see it's not there]
-------------------
4) I have copied files from lib64 to lib, such as
sudo ln -sf /usr/lib64/libbrscandec*.so* /usr/lib
Reboot but to no avail.
-------------------
5) I added myself to the scanner group:
sudo usermod -a -G scanner (me)
Reboot but to no avail. I also tried

more /etc/group | grep -n scanner

and here's the output:
59:scanner:x:120:saned,(me)
--------------------------------
6) I edited /lib/udev/rules.d/60-libsane1.rules following the heck in (#12 of)

https://easylinuxtipsproject.blogspot.c ... nters.html

Reboot but to no avail.
--------------------------------
7) There is no "brother.conf" in /etc/sane.d
--------------------------------
8) I used synaptic to delete all "brother" related files, reinstall the drivers in (step 0) above, reboot but to no avail.
--------------------------------
I'm at a lost on what to do. The scanner (again, it's USB-based, not wireless) worked until window, but I no longer have access to the window machine and I really need the scanner for work. Your help and advice is most welcome. THANKS!

User avatar
ClixTrix
Level 6
Level 6
Posts: 1069
Joined: Wed Dec 09, 2015 11:40 am
Location: Columbus, Ohio, USA

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by ClixTrix »

Go to the section on "Scanner not detected" in the release notes for 19.1 xfce. Follow the bug report and see if any advice there helps.

https://linuxmint.com/rel_tessa_xfce.php
Linux Mint 19.2 x64 Cinnamon 4.15.0-111-generic
Gigabyte GA-AB350M-D3H (F20) / Ryzen 5 1600 / Micron Ballistix Sport DDR4 2400 2x8GB / Sapphire Radeon HD6450
NVMe-SSD: Samsung 960 EVO 250GB / SATA-SSD: Samsung 850 EVO 250GB + Toshiba OCZ VX500 512GB

getstarted
Level 1
Level 1
Posts: 18
Joined: Sun Jul 03, 2016 2:11 pm

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by getstarted »

ClixTrix wrote:
Thu Jan 17, 2019 5:36 pm
Go to the section on "Scanner not detected" in the release notes for 19.1 xfce. Follow the bug report and see if any advice there helps.

https://linuxmint.com/rel_tessa_xfce.php
Thanks. Except for non-brother-specific hecks I have already taken into accounts all the advice there. I also consulted

https://wiki.debian.org/Scanner

and I notice that in the example there,

scanimage -L and sane-find-scanner

returns the same device address, but on my machine I got different result:

scanimage -L --> device `brother2:bus2;dev5' is a Brother MFC-7420 USB scanner

sane-find-scanner --> found USB scanner (vendor=0x04f9, product=0x0180) at libusb:001:002

I wonder if that's the source of my problem, and how might I fix that? Note that my printer does work. THANKS!

User avatar
ClixTrix
Level 6
Level 6
Posts: 1069
Joined: Wed Dec 09, 2015 11:40 am
Location: Columbus, Ohio, USA

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by ClixTrix »

I see where someone just added your scanner to the bug report. Guessing you did.

Have you tried?

Code: Select all

scanimage --test
Linux Mint 19.2 x64 Cinnamon 4.15.0-111-generic
Gigabyte GA-AB350M-D3H (F20) / Ryzen 5 1600 / Micron Ballistix Sport DDR4 2400 2x8GB / Sapphire Radeon HD6450
NVMe-SSD: Samsung 960 EVO 250GB / SATA-SSD: Samsung 850 EVO 250GB + Toshiba OCZ VX500 512GB

getstarted
Level 1
Level 1
Posts: 18
Joined: Sun Jul 03, 2016 2:11 pm

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by getstarted »

ClixTrix wrote:
Thu Jan 17, 2019 7:17 pm
I see where someone just added your scanner to the bug report. Guessing you did.

Have you tried?

Code: Select all

scanimage --test
scanimage --test
scanimage: open of device brother2:bus2;dev5 failed: Invalid argument

I'm really curious as to why scanimage and lsusb return different /dev address (see item (3) of my original post). Like I said this is brand new install of LM xfce 19.1 from scratch. THANKS!

brian_p
Level 6
Level 6
Posts: 1219
Joined: Thu Jan 17, 2019 9:20 am

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by brian_p »

scanimage -L --> device `brother2:bus2;dev5' is a Brother MFC-7420 USB scanner

sane-find-scanner --> found USB scanner (vendor=0x04f9, product=0x0180) at libusb:001:002
lsusb and sane-find-scanner both put the scanner at libusb:001:002. The brother2 backend thinks (incorrectly) it is at libusb:002:002. You could try with

Code: Select all

scanimage --test  -d brother2:bus1;dev2
--
Brian.

User avatar
ClixTrix
Level 6
Level 6
Posts: 1069
Joined: Wed Dec 09, 2015 11:40 am
Location: Columbus, Ohio, USA

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by ClixTrix »

That address problem is odd. I like brian_p's suggestion.

I have a Brother MFC-440CN all-in-one being dropped off this morning. It would not detect scanner under Mint 19 Cinnamon for a friend. I swapped in an HP all-in-one, so I could do some tests and held back for a while to make sure the HP was doing the job. I will install it to the test machine with Cinnamon and xfce and see if I can duplicate the problem
Linux Mint 19.2 x64 Cinnamon 4.15.0-111-generic
Gigabyte GA-AB350M-D3H (F20) / Ryzen 5 1600 / Micron Ballistix Sport DDR4 2400 2x8GB / Sapphire Radeon HD6450
NVMe-SSD: Samsung 960 EVO 250GB / SATA-SSD: Samsung 850 EVO 250GB + Toshiba OCZ VX500 512GB

brian_p
Level 6
Level 6
Posts: 1219
Joined: Thu Jan 17, 2019 9:20 am

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by brian_p »

scanimage --test -d brother2:bus1;dev2
Thinking on - that would be better off being
scanimage --test -d "brother2:bus1;dev2"
because the shell will act on the semi-colon in the line.
--
Brian.

brian_p
Level 6
Level 6
Posts: 1219
Joined: Thu Jan 17, 2019 9:20 am

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by brian_p »

I see where someone just added your scanner to the bug report. Guessing you did.
Messages #84 and #195 display the same disparity that getstarted observes. One device is an Epson; the other is an HP.
--
Brian.

getstarted
Level 1
Level 1
Posts: 18
Joined: Sun Jul 03, 2016 2:11 pm

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by getstarted »

ClixTrix wrote:
Thu Jan 17, 2019 7:17 pm
I see where someone just added your scanner to the bug report. Guessing you did.

Have you tried?

Code: Select all

scanimage --test
I turned off my desktop (but not the scanner) overnight. When I turned it back on the scanner's address has changed! I did reboot my desktop after each of the steps outlined in the OP so I'm baffled. In any case, I turned off and on both the desktop+scanner and here's the info you sought:
--------
sane-find-scanner | grep -n scanner
14:found USB scanner (vendor=0x04f9, product=0x0180) at libusb:001:006
--------
lsusb | grep -n Brother
6:Bus 001 Device 006: ID 04f9:0180 Brother Industries, Ltd MFC-7420
--------
scanimage --test -d brother2:bus2;dev1
scanimage: open of device brother2:bus2 failed: Invalid argument
(I tried sudo as well and got the same error message)

EDIT: I tried scanimage --test -d "brother2:bus2;dev1" and got the same error message.
--------
The mystery continues...

brian_p
Level 6
Level 6
Posts: 1219
Joined: Thu Jan 17, 2019 9:20 am

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by brian_p »

lsusb | grep -n Brother
6:Bus 001 Device 006: ID 04f9:0180 Brother Industries, Ltd MFC-7420
--------
scanimage --test -d brother2:bus2;dev1
scanimage: open of device brother2:bus2 failed: Invalid argument
(I tried sudo as well and got the same error message)

EDIT: I tried scanimage --test -d "brother2:bus2;dev1" and got the same error message.

I has high hopes for the outcome of that command :( . We suppose

Code: Select all

scanimage --test -d "brother2:bus1;dev6"
fails in the same way?
The mystery continues...
It has been with us for a while:

viewtopic.php?t=192903
--
Brian.

brian_p
Level 6
Level 6
Posts: 1219
Joined: Thu Jan 17, 2019 9:20 am

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by brian_p »

The mystery continues...
Anything in journalctl output when you attempt scanning?
--
Brian.

getstarted
Level 1
Level 1
Posts: 18
Joined: Sun Jul 03, 2016 2:11 pm

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by getstarted »

brian_p wrote:
Fri Jan 18, 2019 12:46 pm
The mystery continues...
Anything in journalctl output when you attempt scanning?
First: I turned off the desktop for a while, and when I turn it back on the scanner's address changes again! (back to what it was in the OP):

scanimage -L
device `brother2:bus2;dev5' is a Brother MFC-7420 USB scanner

lsusb | grep -n Brother
6:Bus 001 Device 002: ID 04f9:0180 Brother Industries, Ltd MFC-7420

Here's the output from journalctl, from xsane followed by scanimage --test (I didn't specify the address since I don't know which one to use):

Jan 18 14:07:51 desktop kernel: usb 1-3: usbfs: interface 0 claimed by usblp while 'xsane' sets config #1
Jan 18 14:07:51 desktop kernel: usb 1-3: usbfs: process 3299 (xsane) did not claim interface 1 before use

Jan 18 14:08:20 desktop kernel: usb 1-3: usbfs: interface 0 claimed by usblp while 'scanimage' sets config #1
Jan 18 14:08:20 desktop kernel: usb 1-3: usbfs: process 3328 (scanimage) did not claim interface 1 before use

brian_p
Level 6
Level 6
Posts: 1219
Joined: Thu Jan 17, 2019 9:20 am

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by brian_p »

usbfs: interface 0 claimed by usblp while 'xsane' sets config #1
It is tempting to try to get usblp out of the picture by editing /etc/modprobe.d/blacklist

Code: Select all

blacklist usblp
and see what happens.
--
Brian.

brian_p
Level 6
Level 6
Posts: 1219
Joined: Thu Jan 17, 2019 9:20 am

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by brian_p »

/etc/modprobe.d/blacklist.conf
--
Brian.

getstarted
Level 1
Level 1
Posts: 18
Joined: Sun Jul 03, 2016 2:11 pm

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by getstarted »

brian_p wrote:
Fri Jan 18, 2019 7:34 pm
usbfs: interface 0 claimed by usblp while 'xsane' sets config #1
It is tempting to try to get usblp out of the picture by editing /etc/modprobe.d/blacklist

Code: Select all

blacklist usblp
and see what happens.
I added the line "blacklist usblp" to /etc/modprobe.d/blacklist, and then reboot the desktop + scanner. First, the address of the scanner changed again! Second, the scanner still did not work (but lpq did find the printer -- I did not try to actually print anything). BUT: When I typed the commands

scanimage --test and xsane

there was no error message in journalctl as I saw two posts earlier. Is that the expected behavior? (newbie confession: I don't know what journlctl or modprobe.d do)

When I removed the blacklist line from modprobe.d and rebooted the machine, the scanner address changed again, and upon reissuing the two commands above journalctl spitted out the same error message again (and scanner still does not work).

brian_p
Level 6
Level 6
Posts: 1219
Joined: Thu Jan 17, 2019 9:20 am

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by brian_p »

journalctl displays the machine behaviour. The messages you get indicate a problem which makes it impossible for the scanner to get a USB interface for scanning because the usblp module gets it first. usblp is a kernel module and the kernel will have priority over a user action like plugging in a scanner. Preventing the module from loading, however, does not appear sufficient. I experienced something similar a few years ago with an Epson. My solution was to put the device on a different machine and share it over the network:

https://wiki.debian.org/SaneOverNetwork

BTW: the address of the scanner changing is normal when it is replugged or on a reboot.

My final throw of the die is:

https://forums.mageia.org/en/viewtopic.php?f=24&t=11854

--
Brian.
--
Brian.

getstarted
Level 1
Level 1
Posts: 18
Joined: Sun Jul 03, 2016 2:11 pm

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by getstarted »

brian_p wrote:
Sat Jan 19, 2019 6:53 am
journalctl displays the machine behaviour. The messages you get indicate a problem which makes it impossible for the scanner to get a USB interface for scanning because the usblp module gets it first. usblp is a kernel module and the kernel will have priority over a user action like plugging in a scanner. Preventing the module from loading, however, does not appear sufficient. I experienced something similar a few years ago with an Epson. My solution was to put the device on a different machine and share it over the network:

https://wiki.debian.org/SaneOverNetwork

BTW: the address of the scanner changing is normal when it is replugged or on a reboot.

My final throw of the die is:

https://forums.mageia.org/en/viewtopic.php?f=24&t=11854

--
Brian.
Thanks for all your help. Sharing the scanner over the (home) network sounds like an interesting idea. Newbie Question: If I can't get the scanner to work on my desktop why would it work on another machine? (I only have linux boxes) Are you suggesting that a xsane + LM 19.1 would work under different hardware?

THANKS!

brian_p
Level 6
Level 6
Posts: 1219
Joined: Thu Jan 17, 2019 9:20 am

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by brian_p »

Newbie Question: If I can't get the scanner to work on my desktop why would it work on another machine? (I only have linux boxes) Are you suggesting that a xsane + LM 19.1 would work under different hardware?
Box X is set up with the software to do scanning. As we have unfortunately seen, we cannot get it to work from X. But the scanner can be shared with box A (your desktop). On box A you can then run scanimage -L, xsane etc.

Why did it work for me? I've no real idea and never went into it deeply. I was just pleased to get scanning going. However, on my box A:

Code: Select all

brian@desktop:~$ scanimage -L
device `net:192.168.7.40:epson:libusb:002:024' is a Epson RX420 flatbed scanner
I think it has something to do with using net as the backend instead of just epson or epson2, as it would on box B.
--
Brian.

User avatar
ClixTrix
Level 6
Level 6
Posts: 1069
Joined: Wed Dec 09, 2015 11:40 am
Location: Columbus, Ohio, USA

Re: xsane fails to open brother scanner (linux mint xfce 19.1)

Post by ClixTrix »

Success USB!

OK.....I followed the standard install for the MFC-440CN and got no joy. I installed using the same printer installer 2.2.1-1 and the rule-type1 deb from download as OP. I added "scanner" to my user account group and still no joy.

Looking through the discussion at the bug report, I tried adding the linkages and the rule .59 for brother in post #36. It works. Both Simple Scan and XSane detect the scanner.

Edit: Here's the detected/working scanner checks.

Code: Select all

danno@Moneual:~$ lsusb
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 11b0:6888 ATECH FLASH TECHNOLOGY 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 04f9:01af Brother Industries, Ltd MFC-440CN
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
danno@Moneual:~$ sane-find-scanner

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.

could not open USB device 0x1d6b/0x0001 at 007:001: Access denied (insufficient permissions)
could not open USB device 0x11b0/0x6888 at 002:002: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0002 at 002:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0001 at 006:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0001 at 005:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0002 at 001:001: Access denied (insufficient permissions)
found USB scanner (vendor=0x04f9, product=0x01af) at libusb:004:002
could not open USB device 0x1d6b/0x0001 at 004:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0001 at 003:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0003 at 009:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0002 at 008:001: Access denied (insufficient permissions)
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

  # You may want to run this program as root to find all devices. Once you
  # found the scanner devices, be sure to adjust access permissions as
  # necessary.

danno@Moneual:~$ scanimage -L
device `brother2:bus6;dev1' is a Brother MFC-440CN USB scanner
device `imagescan:esci:networkscan://192.168.1.102:1865' is a Epson WF-2760 
danno@Moneual:~$ scanimage --test
scanimage: rounded value of br-x from 215.9 to 215.88
scanimage: rounded value of br-y from 355.6 to 355.567
scanimage: scanning image of size 1648x2314 pixels at 24 bits/pixel
scanimage: acquiring RGB frame, 8 bits/sample
scanimage: reading one scanline, 4944 bytes...	PASS
scanimage: reading one byte...		PASS
scanimage: stepped read, 2 bytes... 	PASS
scanimage: stepped read, 4 bytes... 	PASS
scanimage: stepped read, 8 bytes... 	PASS
scanimage: stepped read, 16 bytes... 	PASS
scanimage: stepped read, 32 bytes... 	PASS
scanimage: stepped read, 64 bytes... 	PASS
scanimage: stepped read, 128 bytes... 	PASS
scanimage: stepped read, 256 bytes... 	PASS
scanimage: stepped read, 512 bytes... 	PASS
scanimage: stepped read, 1024 bytes... 	PASS
scanimage: stepped read, 2048 bytes... 	PASS
scanimage: stepped read, 4096 bytes... 	PASS
scanimage: stepped read, 8192 bytes... 	PASS
scanimage: stepped read, 8191 bytes... 	PASS
scanimage: stepped read, 4095 bytes... 	PASS
scanimage: stepped read, 2047 bytes... 	PASS
scanimage: stepped read, 1023 bytes... 	PASS
scanimage: stepped read, 511 bytes... 	PASS
scanimage: stepped read, 255 bytes... 	PASS
scanimage: stepped read, 127 bytes... 	PASS
scanimage: stepped read, 63 bytes... 	PASS
scanimage: stepped read, 31 bytes... 	PASS
scanimage: stepped read, 15 bytes... 	PASS
scanimage: stepped read, 7 bytes... 	PASS
scanimage: stepped read, 3 bytes... 	PASS
danno@Moneual:~$
Also did successful scans using Simple Scan and XSane. :)
Linux Mint 19.2 x64 Cinnamon 4.15.0-111-generic
Gigabyte GA-AB350M-D3H (F20) / Ryzen 5 1600 / Micron Ballistix Sport DDR4 2400 2x8GB / Sapphire Radeon HD6450
NVMe-SSD: Samsung 960 EVO 250GB / SATA-SSD: Samsung 850 EVO 250GB + Toshiba OCZ VX500 512GB

Post Reply

Return to “Printers & Scanners”