LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-08-2017, 06:01 PM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
Ancient Brother MFC - cannot scan on CentOS 7


I have an ancient Brother MFC240c. I have used it on Ubuntu going back to 8.04 I believe. I have had it installed and working on CentOS 6 for 7 + years. As I need to upgrade to CentOS 7 some time in the next 4 years I guess I need to get the thing working on 7. Brother has a nice script to automate the installation process. It downloaded and installed the appropriate rpms etc. The printing function works to perfection. The two scanner rpms were also installed without any error message. If I run brscan-skey -l I see the scanner much as it was present on CentOS 6
Code:
CentOS 7
 MFC-240C          : brother2:bus2;dev5  : USB                  Not registered
CentOS 6
 MFC-240C          : brother2:bus3;dev1  : USB                  Not registered
The problem is that neither simpls-scan (Mate desktop) nor xsane (manually installed) will detect the scanner. According to my CentOS 6 build notes I simply performed a yum localinstall on the same rpms - well the bracan2 package was .0.0.1 older on CentOS 6. I did not have to do any voodoo to get the scanner recognized. Any suggestions?

TIA,

Ken
 
Old 01-08-2017, 07:08 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,781

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
Make sure that there is a udev rule for the device perhaps. For reference I have (in /etc/udev/rules.d/55-libsane.rules) this entry
Code:
# Brother MFC-3240C
ATTR{idVendor}=="04f9", ATTR{idProduct}=="0173", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"
A similar thread:
https://www.centos.org/forums/viewtopic.php?t=54890
 
1 members found this post helpful.
Old 01-08-2017, 07:13 PM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,781

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
The other thing that came to mind as you're using a Brother proprietary brscan2 driver - Make sure that /etc/sane.d/dll.conf contains 'brother2' entry uncommented.
 
1 members found this post helpful.
Old 01-08-2017, 08:15 PM   #4
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Thanks ferrari.

I will check that out first thing in the morning.

Ken
 
Old 01-09-2017, 08:01 AM   #5
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Good morning ferrari,

Per your suggestion re. udev rules... There is no libsane rules file on the CentOS 7 machine. Nor is there one on the CentOS 6 machine (which works). Therefore I have nothing to copy from.

Nor does the CentOS 7 machine contain a file /etc/sane.d/dll.conf. The CentOS 6 machine does and the last entry is "brother2". The comment at the top of the file on CentOS 6 states
Quote:
# enable the next line if you want to allow access through the network:
and the next line is "net" uncommented. However, the device in question is connected by USB not on the network.

I tried running simple-scan and xsane as root on the CentOS 7 machine. Same issue - no scanner found. I did get some information from xsane
Quote:
no devices available

Possible reasons:
1 There really is no device that is supported by SANE
2 Supported devices are busy
3 The permissions for the device file do not alloy you to use it - try as root
4 The backend is not loaded by sane (see man sane-dll)
5 The backend is not configured correctly (man sane-"backendname"
6 Possibly there is more than one SANE version installed
I think I will do some research on items 4 and 5 and will post back what I find. I may also try installing it on a "factory" CentOS 7/Gnome 3 install. I have been using my home made CentOS 7 mini + X Windows + Mate system. If that works I will grab the various configuration files and put them on the Mate machine.

Thanks again,

Ken
 
Old 01-09-2017, 01:37 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,781

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
This reads like you're missing the 'sane-backends' package then. That would explain why both of the expected files are missing.
 
1 members found this post helpful.
Old 01-09-2017, 01:55 PM   #7
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
I will check that as soon as I finish installing 47 terabytes of updates to my new CentOS 7 Mate3 install (if it works this time), snagging a snapshot with Clonezilla and then restoring CentOS 7 to my test PC.
 
Old 01-09-2017, 02:59 PM   #8
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Many many thanks ferrari!

sane-backends was missing. I have installed it and - as root at least - xsane will find the machine. I need to tweak the permissions now so that a normal human can access the thing. I will post a final report once I have it working.

Ken
 
Old 01-09-2017, 07:01 PM   #9
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,781

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
Very good. For user access, usually just a matter of the user being a member of the 'lp' group (USB-attached scanners), and of course that's defined by the udev rules included by 'sane-backends'.
 
1 members found this post helpful.
Old 01-09-2017, 08:22 PM   #10
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Actually I was not quite as close as I thought. root could call up xsane and it would find the MFC. However, it would not scan. Still, I am a lot closer with sane-backend installed. Not sure why that was not listed as a dependency in xsane when I installed that package. I will back up and take another run at it tomorrow.

Cheers,

Ken
 
Old 01-09-2017, 08:34 PM   #11
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,781

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
Okay, make sure that /etc/sane.d/dll.conf contains the 'brother2' entry, and that the user is a member of the 'lp' group.

Run these again as user (just so we can see that how scanner is now enumerated)
Code:
sane-find-scanner
Code:
scanimage -L
 
1 members found this post helpful.
Old 01-09-2017, 08:42 PM   #12
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,781

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
Not to confuse you, but Centos 7 may still use the 'scanner' group based on this thread:
https://www.centos.org/forums/viewto...brscan#p245866
Anyway, do check the udev rules provided by 'sane-backends' eg
Code:
rpm -ql sane-backends |grep udev
then look for a rule matching your device productID ie 0173 (or similar)
 
1 members found this post helpful.
Old 01-10-2017, 06:59 PM   #13
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Well this it getting ridiculous I played with my CentOS7 test machine for a while. I found some good although probably out of date information on a couple of Ubuntu sites. So I installed Ubuntu Mate 16.04 and spent a while trying to install the thing there. No luck. Back to CentOS... I restore the CentOS 7 image to the test PC and loaded a CentOS 6 virtual machine from my production PC. It is very basic. I use it generally when I need a clean Firefox profile to test a web site which does not work with my normal browser with privacy addons etc. I tried manually installing the Brother packages as I had done on CentOS 6 several years ago. No luck. I started over clean with a fresh copy of the VM and ran the Brother provided install script. Here is the detail of what it did
Code:
[root@vmCentOS6-64bit Desktop]# ./linux-brprinter-installer-2.1.1-1 
Input model name ->MFC240C

You are going to install following packages.
   mfc240clpr-1.0.1-1.i386.rpm
   mfc240ccupswrapper-1.0.1-1.i386.rpm
   brscan2-0.2.5-1.x86_64.rpm
   brscan-skey-0.2.4-1.x86_64.rpm
OK? [y/N] ->

================================================================================
 Package                 Arch      Version                   Repository    Size
================================================================================
Installing:
 glibc                   i686      2.12-1.192.el6            base         4.4 M
Installing for dependencies:
 nss-softokn-freebl      i686      3.14.3-23.3.el6_8         updates      157 k

Transaction Summary
================================================================================
Install       2 Package(s)

================================================================================
 Package             Arch           Version                Repository      Size
================================================================================
Installing:
 libstdc++           i686           4.4.7-17.el6           base           302 k
Installing for dependencies:
 libgcc              i686           4.4.7-17.el6           base           114 k

Transaction Summary
================================================================================
Install       2 Package(s)

                                                 

rpm -ihv --nodeps --replacefiles --replacepkgs mfc240clpr-1.0.1-1.i386.rpm
Preparing...                ########################################### [100%]
   1:mfc240clpr             ########################################### [100%]
rpm -ihv --nodeps --replacefiles --replacepkgs mfc240ccupswrapper-1.0.1-1.i386.rpm
Preparing...                ##################################################
mfc240ccupswrapper          ##################################################
Stopping cups: [  OK  ]
Starting cups: [  OK  ]


================================================================================
 Package                    Arch       Version                Repository   Size
================================================================================
Installing:
 policycoreutils-python     x86_64     2.0.83-30.1.el6_8      updates     437 k
Installing for dependencies:
 audit-libs-python          x86_64     2.4.5-3.el6            base         63 k
 libcgroup                  x86_64     0.40.rc1-18.el6_8      updates     130 k
 libsemanage-python         x86_64     2.0.43-5.1.el6         base         81 k
 setools-libs               x86_64     3.3.7-4.el6            base        400 k
 setools-libs-python        x86_64     3.3.7-4.el6            base        222 k

Transaction Summary
================================================================================
Install       6 Package(s)

Package policycoreutils-2.0.83-30.1.el6_8.x86_64 already installed and latest version
Nothing to do
semanage fcontext -a -t cupsd_rw_etc_t /usr/local/Brother/Printer/(.*/)?inf(/.*)?
restorecon -R /usr/local/Brother/Printer
semanage fcontext -a -t bin_t /usr/local/Brother/Printer/(.*/)?inf/brprintconf(.*)?
restorecon -R /usr/local/Brother/Printer
semanage fcontext -a -t bin_t /usr/local/Brother/Printer/(.*/)?lpd(/.*)?
restorecon -R /usr/local/Brother/Printer
semanage fcontext -a -t bin_t /usr/local/Brother/Printer/(.*/)?cupswrapper(/.*)?
restorecon -R /usr/local/Brother/Printer
semanage fcontext -a -t bin_t /usr/local/Brother
restorecon -R /usr/local/Brother
restorecon -RFv /usr/lib/cups/filter
restorecon reset /usr/lib/cups/filter/brlpdwrappermfc240c context unconfined_u:object_r:bin_t:s0->system_u:object_r:bin_t:s0
setsebool -P cups_execmem 1
Boolean cups_execmem is not defined
Will you specify the Device URI? [Y/n] -> (answer n)

You are going to install following packages.
   brscan2-0.2.5-1.x86_64.rpm
rpm -ihv --nodeps --replacefiles --replacepkgs brscan2-0.2.5-1.x86_64.rpm
Preparing...                ########################################### [100%]
   1:brscan2                ########################################### [100%]
You are going to install following packages.
   brscan-skey-0.2.4-1.x86_64.rpm
2017-01-10 18:15:31 (196 KB/s) - “brscan-skey-0.2.4-1.x86_64.rpm” saved [53876/53876]

rpm -ihv --nodeps --replacefiles --replacepkgs brscan-skey-0.2.4-1.x86_64.rpm
Preparing...                ########################################### [100%]
   1:brscan-skey            ########################################### [100%]
Hit Enter/Return key.
I then did some testing
Code:
Note: xsane is not installed yet

[ken@vmCentOS6-64bit ~]$sane-find-scanner 

found USB scanner (vendor=0x04f9, product=0x01ab) at libusb:001:004
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

[ken@vmCentOS6-64bit ~]$ scanimage -L
device `brother2:bus1;dev1' is a Brother MFC-240C USB scanner

[ken@vmCentOS6-64bit ~]$ cat /etc/sane.d/dll.conf | grep brother
brother2

[root@vmCentOS6-64bit ken]# rpm -qa sane*
sane-backends-libs-gphoto2-1.0.21-3.el6.x86_64
sane-backends-libs-1.0.21-3.el6.x86_64
sane-backends-1.0.21-3.el6.x86_64

[root@vmCentOS6-64bit ken]# lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 001 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 004: ID 04f9:01ab Brother Industries, Ltd MFC-240C

[root@vmCentOS6-64bit ken]# ll /dev/bus/usb/001
total 0
crw-rw-r--. 1 root root 189, 0 Jan 10 17:58 001
crw-rw-r--. 1 root root 189, 1 Jan 10 17:58 002
crw-rw-r--. 1 root root 189, 2 Jan 10 17:58 003
crw-rw-r--+ 1 root lp   189, 3 Jan 10 17:59 004

[root@vmCentOS6-64bit ken]# groups ken
ken : ken
[root@vmCentOS6-64bit ken]# usermod -G lp ken
[root@vmCentOS6-64bit ken]# groups ken
ken : ken lp

[root@vmCentOS6-64bit ken]# rpm -ql sane-backends |grep udev
/lib/udev/rules.d/65-libsane.rules

[root@vmCentOS6-64bit ken]# less /lib/udev/rules.d/65-libsane.rules | grep MFC-240C
# Brother MFC-240C


[root@vmCentOS6-64bit ken]# yum install xsane

================================================================================
 Package               Arch            Version              Repository     Size
================================================================================
Installing:
 xsane                 x86_64          0.997-8.el6          base          523 k
Installing for dependencies:
 xsane-common          x86_64          0.997-8.el6          base          1.2 M

Transaction Summary
================================================================================
Install       2 Package(s)
I THINK I had checked everything you had mentioned and various things in other posts. I gave it the big try...

xane loaded

I pressed the Scan button and then...
Quote:
Failed to start scanner: Invalid argument.


I wonder if this thing worked under CentOS 6.0 and something needed for the install has been depreciated so that I cannot install it on CentOS 6.8? The CentOS upgrade process has obsoleted 2 video cards so far but other than that I have managed to keep the machine and its peripherals running since 2010 when I moved from Ubuntu.

More likely I have overlooked something. Enough of this for tonight.

Ken
 
Old 01-10-2017, 08:14 PM   #14
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,781

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
Sounds like progress, just some permissions errors I think.
Quote:
I pressed the Scan button and then...
Code:
Failed to start scanner: Invalid argument.
That error can happen when the permissions aren't correct.

This would be slightly more useful as it would show the actual rule (with group assigned)
Code:
less /lib/udev/rules.d/65-libsane.rules | grep MFC-240C -A2
We need to check 'GROUP=' and/or 'MODE=' assignments needed to provide the required r/w access.

Last edited by ferrari; 01-10-2017 at 08:16 PM.
 
1 members found this post helpful.
Old 01-10-2017, 09:07 PM   #15
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Not much in the rules file about this scanner
Code:
[ken@vmCentOS6-64bit ~]$ less /lib/udev/rules.d/65-libsane.rules | grep MFC-240C -A2
# Brother MFC-240C
ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="01ab", ENV{libsane_matched}="yes"
# Brother MFC-7840W
Here is something from the file
Code:
# For Linux >= 2.6.22 without CONFIG_USB_DEVICE_CLASS=y
# If the following rule does not exist on your system yet, uncomment it
# ENV{DEVTYPE}=="usb_device", MODE="0664", OWNER="root", GROUP="root"
CONFIG_USB_DEVICE_CLASS seems to be empty. I un-commented the line and rebooted just to clear/re-read everything. I still cannot scan but I have another thing to check. There is a configuration file in ~/.sane I think. I read something about getting the message when trying to scan too small an area. It appears to be trying to scan a whole page by default but I am going to dig out the config file from the working machine and the VM and compare them. Who knows?

Ken

p.s. The line IS commented on the working CentOS 6 machine.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Brother MFC-J5910DW 100949football Linux - Newbie 40 07-26-2015 05:48 AM
My brothers MFC j430w printer,prints but won't scan, I'm using xsane scan program , jbander Linux - Hardware 4 08-01-2013 05:04 PM
Brother MFC-J280W Printer will only print image files, not text files, won't scan. bplis* Linux - Software 4 11-28-2011 08:34 AM
Brother Mfc-240c owa Linux - Hardware 1 01-21-2008 03:56 PM
Brother MFC-210C juman Slackware 1 02-22-2007 08:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:16 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