Brother MFC-7220 in Manjaro KDE @ 19/12/17

At time of writing, there is no PKGBUILD for the MFC-7220 that makes it fully functional in Manjaro, ie, Printer and Scanner. For DEB & RPM-based distros Brother provides an installation bash script [http://support.brother.com/g/b/downloadend.aspx?c=us&lang=en&prod=mfc7220_us_as&os=128&dlid=dlf006893_000&flang=4&type3=625] that facilitates both functions of the MFC, but this is not natively executable in Manjaro [as far as i know... EDIT / CORRECTION: I was wrong, it is possible. See later posts in this thread]. Initially i feared i'd need to create a custom PKGBUILD for it [daunting, given i don't know how to, yet; i'm still new to Manjaro]. However after some research in the Manjaro forum, & experimentation, + tricks i learnt in my previous distro, i realised that most of what is needed is already available in Manjaro. Having eventually succeeded today in fully enabling my MFC, i've synthesised the following summary of the methodology. In overview, resolving the printing is "easy", but resolving the scanning is "hard". I offer it here as a tutorial for any current or future Manjaroan with the same model MFC.

Printer Functionality [do these].

  1. https://wiki.manjaro.org/index.php?title=Printing_Enablement
  2. Install these, from AUR: brother-lpr-drivers-laser, brother-cups-wrapper-laser
  3. Configure the MFC per https://wiki.manjaro.org/index.php?title=Printer_Configuration#CUPS_Desktop_Interface_Part_1:_The_Automatic_Method
  4. Downgrade cups-filters from 1.17.9-5 to 1.17.9-3 per Printer quit today after updating, CUPS "filter failed" . <<NB: this is TEMPORARY ONLY until the (apparently) buggy version in "[Stable Update] 2017-12-16 - Kernels, Mesa, Deepin, Firefox, Python, Haskell" is fixed>>

Scanner Functionality [do these].

  1. Install these, from AUR: brscan2, brscan-skey
  2. Enable & Start the service;
   sudo systemctl enable brscan-skey.service
   sudo systemctl start brscan-skey.service
  1. Confirm that /etc/sane.d/dll.conf now contains an entry "brother2" [with NO "#" prefix].
  2. Create new file /etc/udev/rules.d/66-brother.rules with these contents:
#Brother MFC-7220
ATTR{idVendor}=="04f9", ATTR{idProduct}=="0185", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"
  1. If not already so, add the appropriate user accounts to the lp group.
  2. Reboot pc & MFC.
  3. Confirm that brscan-skey service is running:

sudo systemctl status brscan-skey.service

  1. At this point Simple Scan &/or Skanlite can possibly now see the MFC Scanner, but likely still will not scan. If it will scan, be happy. If not, continue...
  2. Conjure the "magic trick". Being an old model, the MFC-7220 [for scanning] not only must be connected to a USB2 port not USB3, but critically important

the chipset controller for that specific port must be ehci-pci [USB2] & not xhci-pci [USB3].

  • It happens that all my Tower's ports are xhci-pci by default, even those that are physically USB2, & so manual intervention is required.
    a. Discern your Chipset by running /sbin/lspci in terminal
    b. Mine is "USB controller: Intel Corporation 9 Series Chipset", & so by luck i was able to apply the method of
    https://forums.opensuse.org/showthread.php/507627-Suse-13-2-scanner-no-longer-working-on-64-bit-version?p=2714695#post2714695 & https://superuser.com/questions/812022/force-a-single-usb-3-0-port-to-work-as-usb-2-0. Thus:
    c. My Tower's MFC-connected port's necessary setpci value for ehci
    is 00003eff, but its default is 00003fff, as seen here:
    sudo setpci -H1 -s 00:14.0 d0.L 00003fff http://www.binaryhexconverter.com/hex-to-binary-converter 00003fff = 11 1111 1111 1111, ie, all 14 ports have their bit set to 1, which makes them all xhci-pci [USB3]. Conversely, 00003eff = 11 1110 1111 1111, & so just the one target port has its bit set to 0, making it ehci-pci [USB2]. Establishing this was by an iterative binary search.
    d. So force it to be USB2:
    sudo setpci -H1 -s 00:14.0 d0.L=3EFF
    e. Verify it is now the needed value:
    sudo setpci -H1 -s 00:14.0 d0.L
    00003eff
    f. Verify this new value is operational:
    dmesg --follow # # # Unplug then replug the USB cable...
    [ 561.915803] usb 1-1.1: new full-speed USB device number 4 using ehci-pci
    Good! It 's USB2.
    [ 562.023092] usblp 1-1.1:1.0: usblp0: USB Bidirectional printer dev 4 if 0 alt 0 proto 2 vid 0x04F9 pid 0x0185
  1. Now... BOTH Simple Scan & Skanlite see the MFC & ... they do SCAN. Oh yes. Dance the happy dance.
  2. Sadly the new port controller value is not permanent; it will reset to default at the next reboot. Hence sudo setpci -H1 -s 00:14.0 d0.L=3EFF will need to be run again next time scanning is needed, if any pc reboots have occurred in the interim.
3 Likes

You do know you can just use the upstream bash script by installing dpkg from the AUR first.

Oh.

Nevertheless, i regard it as a strength of Manjaro that i found ALL the necessary packages herein [including AUR, i mean]. Furthermore, using either the Brother script or AUR does not avoid the tedious necessity of doing the binary search to pin down the requisite bit to turn off to make the target port controller usb2. That's where all the time goes...

PS: Ha, i used to interact with you at Maui, now at Manjaro...

Yes, I'm the Netrunner Rolling edition maintainer.
I've actually been a member of the Manjaro community since Rolands initial version 0.1.x.

Anyway, I always use the brother install script now, I've had other similar issues with the AUR builds in the past.
At one point installing the brscan drivers via the aur, would break printing altogether.

And yes, downgrading cups-filter was required to get my Brother printers working again, so I do thank you for that bit of information. I had no issue with my scanners though, they do not seem to be not effected by the issue.

Very useful tutorial!
Thanks @Kadee :tulip::blossom::star2:
I did some beautification, I hope I did not do any harm.

Wrt the Brother script, following on from your advice that it can in fact be run here with dpkg, I thought i'd try this in a VM. I installed dpkg via Pamac, noted its warning, launched Konsole in that location, & tried this, but as you can see it isn't working for me. I'm not too familiar with dpkg, what am i doing wrong pls? I mean, i actually agree with the error msg; that Brother file begins with
#! /bin/bash
which is why i thought it was a bash script.

[kdemeoz@kdemeoz-pc Downloads]$ sudo dpkg -i linux-brprinter-installer-2.1.1-1
[sudo] password for kdemeoz: 
dpkg-deb: error: 'linux-brprinter-installer-2.1.1-1' is not a debian format archive
dpkg: error processing archive linux-brprinter-installer-2.1.1-1 (--install):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 linux-brprinter-installer-2.1.1-1
[kdemeoz@kdemeoz-pc Downloads]$

Youre right, it is a script, but needs dpkg in order to run.
Just start the script itself in terminal.

Oh dear me, yes, i'm such a dope. Thank you!

Fwiw, here's the output from running the Brother script. I post this here merely for the benefit of any future reader who might not be already familiar with what it does, what its output "looks like" if it runs successfully & correctly sets up your MFC.

Pls note that you must have your MFC connected & powered on prior to initiating this, else no detection occurs.

[kdemeoz@kdemeoz-pc Downloads]$ sudo ./linux-brprinter-installer-2.1.1-1    
[sudo] password for kdemeoz: 
Input model name ->mfc7220

You are going to install following packages.
   brmfc7220lpr-2.0.1-1.i386.deb
   cupswrapperMFC7220-2.0.1-2.i386.deb
   brscan2-0.2.5-1.amd64.deb
   brscan-skey-0.2.4-1.amd64.deb
OK? [y/N] ->y

./linux-brprinter-installer-2.1.1-1: line 1800: apt-get: command not found
./linux-brprinter-installer-2.1.1-1: line 1804: apt-get: command not found
./linux-brprinter-installer-2.1.1-1: line 1808: apt-get: command not found
ln: failed to create symbolic link '/etc/init.d/cupsys': No such file or directory
ln: failed to create symbolic link '/etc/init.d/cups': No such file or directory
ln: failed to create symbolic link '/etc/init.d/lpd': No such file or directory
ln: failed to create symbolic link '/etc/init.d/lprng': No such file or directory
dpkg -x brmfc7220lpr-2.0.1-1.i386.deb /
dpkg -x cupswrapperMFC7220-2.0.1-2.i386.deb /
dpkg-deb: building package 'brmfc7220lpr' in 'brmfc7220lpr-2.0.1-1a.i386.deb'.
dpkg -b ./brother_driver_packdir brmfc7220lpr-2.0.1-1a.i386.deb
dpkg-deb: building package 'cupswrappermfc7220' in 'cupswrapperMFC7220-2.0.1-2a.i386.deb'.
dpkg -b ./brother_driver_packdir cupswrapperMFC7220-2.0.1-2a.i386.deb
dpkg -i --force-all brmfc7220lpr-2.0.1-1a.i386.deb
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package architecture (i386) does not match system (amd64)
(Reading database ... 28 files and directories currently installed.)
Preparing to unpack brmfc7220lpr-2.0.1-1a.i386.deb ...
Unpacking brmfc7220lpr:i386 (2.0.1-1) over (2.0.1-1) ...
Setting up brmfc7220lpr:i386 (2.0.1-1) ...
chown: invalid user: ‘lp’
which: no pstops in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
dpkg -i --force-all cupswrapperMFC7220-2.0.1-2a.i386.deb
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package architecture (i386) does not match system (amd64)
(Reading database ... 28 files and directories currently installed.)
Preparing to unpack cupswrapperMFC7220-2.0.1-2a.i386.deb ...
Unpacking cupswrappermfc7220:i386 (2.0.1-2) over (2.0.1-2) ...
Setting up cupswrappermfc7220:i386 (2.0.1-2) ...                                                                                   
cp: '/usr/lib/cups/filter/brlpdwrapperMFC7220' and '/usr/lib64/cups/filter/brlpdwrapperMFC7220' are the same file                  
#                                                                                                                                  
Will you specify the Device URI? [Y/n] ->                                                                                          
                                                                                                                                   
                                                                                                                                   
0: beh                                                                                                                             
1: cups-pdf:/
2: lpd
3: http
4: ipps
5: socket
6: cups-brf:/
7: hp
8: ipp
9: https
10: usb://Brother/MFC-7220?serial=000E7J793366
11: smb
12: hpfax
13 (I): Specify IP address.
14 (A): Auto. (usb://Brother/MFC-7220?serial=000E7J793366)

select the number of destination Device URI. ->10

lpadmin -p MFC7220 -v usb://Brother/MFC-7220?serial=000E7J793366 -E
Test Print? [y/N] ->y

wait 5s.
lpr -P MFC7220 /usr/share/cups/data/testprint
You are going to install following packages.
   brscan2-0.2.5-1.amd64.deb

This Agreement provides terms and conditions for license grant for use of the software that is distributed with this Agreement ("Software") from Brother Industries, Ltd. ("Brother") to recipients thereof ("You").

Note:
Please click on "I Accept" while holding down "Shift" or right click on "I Accept" and select "Save Target As,,," from the menu. 

1.The Software is comprised of the following software modules:

(1) Certain software modules that is the subject of GNU GENERAL PUBLIC LICENSE ("GPL Modules"), and 
(2) Other software modules ("Non-GPL Modules") 

You may distinguish each of GPL Modules by downloading source files of the Software as Brother separately makes available and reading such files.

2.Your use of all GPL Modules shall be subject to the terms and conditions of GNU GENERAL PUBLIC LICENSE Version 2, June 1991 ("GPLv2"). Please see http://www.brother.com/agreement/English_gpl/agree.html. You shall use GPL Modules in accordance with the terms and conditions of GPLv2. Your use of GPL Modules shall be deemed as your agreement to the terms and conditions of GPLv2.

3.You have the right to use all Non-GPL Modules only in accordance with the following terms and conditions. Your use of Non-GPL Modules shall be deemed as your agreement to the following terms and conditions: 
(1) Brother retains any and all copyrights to Non-GPL Modules. In no case this Agreement shall be construed to assign or otherwise transfer from Brother to you any copyrights or other intellectual property rights to whole or any part of Non-GPL Modules.

(2) Brother grants you a non-exclusive license to reproduce and/or distribute (via Internet or in any other manner) Non-GPL Modules. Brother further grants you a non-exclusive license to modify, alter, translate or otherwise prepare derivative works of Non-GPL Modules and to reproduce and/or distribute (via Internet or in any other manner) such modification, alteration, translation or other derivative works of Non-GPL Modules.

(3) When you distribute (via Internet or in any other manner) Non-GPL Modules or any modification, alteration, translation or other derivative works thereof under the license granted in accordance with subparagraph 3(2) above, you must expressly grant any and all recipient thereof the license equivalent to this Agreement which applies to Non-GPL Modules.

(4) The license of Non-GPL Modules from Brother hereunder is granted "AS IS. BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO NON-GPL MODULES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT. 

(5) To the extent allowed by applicable laws, Brother shall have no liability in contract, tort (including negligence or breach of statutory duty) or otherwise for any interruption of use, loss of data, or for any indirect, incidental, punitive or consequential loss or damage, or for any loss of profit, revenue, data, goodwill or anticipated savings that arises under, out of, or in contemplation of this Agreement or otherwise arises due to any error, inaccuracy or defect in Non-GPL Modules even if Brother has been advised of the possibility of such loss or damage.

(6) The form in which Non-GPL Modules is distributed is subject to Brothers sole discretion. Brother does not have any obligation to distribute or disclose Non-GPL Modules in source code form. In no case shall this Agreement be deemed as Brothers express or implied agreement to disclose source code of Non-GPL Modules.
Do you agree? [Y/n] ->

wget -T 10 -nd --no-cache http://www.brother.com/pub/bsc/linux/packages/brscan2-0.2.5-1.amd64.deb
--2017-12-19 12:16:29--  http://www.brother.com/pub/bsc/linux/packages/brscan2-0.2.5-1.amd64.deb
Resolving www.brother.com... 104.71.131.61, 23.192.239.239
Connecting to www.brother.com|104.71.131.61|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 82566 (81K) [text/plain]
Saving to: ‘brscan2-0.2.5-1.amd64.deb’

brscan2-0.2.5-1.amd64.deb        100%[=========================================================>]  80.63K  --.-KB/s    in 0.06s   

2017-12-19 12:16:30 (1.22 MB/s) - ‘brscan2-0.2.5-1.amd64.deb’ saved [82566/82566]

dpkg -i --force-all brscan2-0.2.5-1.amd64.deb
Selecting previously unselected package brscan2.
(Reading database ... 28 files and directories currently installed.)
Preparing to unpack brscan2-0.2.5-1.amd64.deb ...
Unpacking brscan2 (0.2.5-1) ...
Setting up brscan2 (0.2.5-1) ...
You are going to install following packages.
   brscan-skey-0.2.4-1.amd64.deb

=========================================
Brother License Agreement

Brother retains any and all copyrights to the Software. In no case this Agreement shall be construed to assign or otherwise transfer from Brother to User any copyrights or other intellectual property rights to whole or any part of the Software.

Brother grants User a non-exclusive license: to reproduce and/or distribute (via Internet or in any other manner) the Software. Further, Brother grants User a non-exclusive license to modify, alter, translate or otherwise prepare derivative works of the Software and to reproduce and distribute (via Internet or in any other manner) such modification, alteration, translation or other derivative works for any purpose.

The license of the Software from Brother hereunder is granted "AS IS." BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT.
Brother shall have no liability in contract, tort (including negligence or breach of statutory duty) or otherwise for any interruption of use, loss of data, or for any indirect, incidental, punitive or consequential loss or damage, or for any loss of profit, revenue, data, goodwill or anticipated savings that arises under, out of, or in contemplation of this Agreement or otherwise arises due to any error, inaccuracy or defect in the Software even if Brother has been advised of the possibility of such loss or damage.
Further, Brother shall have no liability to disclose and/or distribute the source cord of the Software to User under any circumstances. In no case shall the above license by Brother to modify, alter, translate or otherwise prepare derivative works of the Software be construed as Brother's implied agreement or undertakings to disclose and/or distribute the source cord of the Software.
=========================================
Do you agree? [Y/n] ->

wget -T 10 -nd --no-cache http://www.brother.com/pub/bsc/linux/packages/brscan-skey-0.2.4-1.amd64.deb
--2017-12-19 12:16:37--  http://www.brother.com/pub/bsc/linux/packages/brscan-skey-0.2.4-1.amd64.deb
Resolving www.brother.com... 23.192.239.239, 104.71.131.61
Connecting to www.brother.com|23.192.239.239|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 50852 (50K) [text/plain]
Saving to: ‘brscan-skey-0.2.4-1.amd64.deb’

brscan-skey-0.2.4-1.amd64.deb    100%[=========================================================>]  49.66K  --.-KB/s    in 0.07s   

2017-12-19 12:16:38 (749 KB/s) - ‘brscan-skey-0.2.4-1.amd64.deb’ saved [50852/50852]

dpkg -i --force-all brscan-skey-0.2.4-1.amd64.deb
Selecting previously unselected package brscan-skey.
(Reading database ... 53 files and directories currently installed.)
Preparing to unpack brscan-skey-0.2.4-1.amd64.deb ...
Unpacking brscan-skey (0.2.4-1) ...
dpkg: brscan-skey: dependency problems, but configuring anyway as you requested:
 brscan-skey depends on libc6 (>= 2.3.4-1); however:
  Package libc6 is not installed.

Setting up brscan-skey (0.2.4-1) ...
Hit Enter/Return key.
[kdemeoz@kdemeoz-pc Downloads]$

Yes, and this too works for network printers (have a print server built in).
I've only had some occasional issues with using dns-sd detected printers, but that is more of a avahi issue.
However, ussing https, ipps, etc, (even jetdirect on some brother models) has always worked well.

I'm not sure sudo is actually needed, from what I remember it will ask you for the root password when the time comes. But then again, I could be thinking of a samsung, canon, epson, hplip, or some other manufacturer installer script, I've used and/or tried out so many over the years. :wink:

That;s cool, thanks @AgentS . It was stupid-o'clock [ie, a couple of hours after midnight] when i wrote my initial post, & i could no longer think straight [but wanted to still write it up before i forgot it all, given my goldfish-memory]. In my over-tired state each time i tried to use the codeboxes they seemed to corrupt much of the text's intended formatting, so i gave up. What you did has improved it [thanks] down to #9, where again the formatting is now wrong, from after the new codebox to beginning of "d.". That was supposed to look like this:

It happens that all my Tower's ports are xhci-pci by default, even those that are physically USB2, & so manual intervention is required.
a. Discern your Chipset by running "/sbin/lspci" in Konsole
b. Mine is "USB controller: Intel Corporation 9 Series Chipset", & so by luck i was able to apply the method of
https://forums.opensuse.org/showthread.php/507627-Suse-13-2-scanner-no-longer-working-on-64-bit-version?p=2714695#post2714695 & https://superuser.com/questions/812022/force-a-single-usb-3-0-port-to-work-as-usb-2-0. Thus:
c. My Tower's MFC-connected port's necessary setpci value for ehci* is 00003eff, but its default is 00003fff, as seen here:
[kdemeoz@GA-Z97-HD3-Tower ~]$ sudo setpci -H1 -s 00:14.0 d0.L
00003fff
* From http://www.binaryhexconverter.com/hex-to-binary-converter it can be seen that 00003fff = 11 1111 1111 1111, ie, all 14 ports have their bit set to 1, which makes them all xhci-pci [USB3]. Conversely, 00003eff = 11 1110 1111 1111, & so just the one target port has its bit set to 0, making it ehci-pci [USB2]. Establishing this was by an iterative binary search.

For me anyway, sudo is needed, otherwise:

[kdemeoz@kdemeoz-pc Downloads]$ ./linux-brprinter-installer-2.1.1-1 
Only root can perform this operation.
[kdemeoz@kdemeoz-pc Downloads]$

Yea, I couldn't remember which ones did, and which ones didn't. :wink:

This topic was automatically closed after 90 days. New replies are no longer allowed.

Forum kindly sponsored by