HowTo: Brother MFC-7340, print/scan drivers

Write tutorials here
More tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please, Before you post please read this

HowTo: Brother MFC-7340, print/scan drivers

Postby mechanizedmedic on Mon Jul 23, 2012 8:59 am

i had my brother MFC-7340 multi-function printer working in ubuntu but it took me a bit to get it rolling in LMDE. i created the script below to do most of the work. here's the whole process...

1) copy the script into your favorite text editor and save it as "brothermfc7340_LMDE.sh"
2) make the script executable $ sudo chmod 777 brothermfc7340_LMDE.sh
3) run the script $ sudo ./brothermfc7340_LMDE.sh
4) at the end of the script your browser should open up to the CUPS admin page. add the printer and choose your settings.

NOTES: i'm using xsane for a scanning gui and the permission fix that Brother provides doesn't work, therefore, it has to be run as root. i simply added gksu to the launcher command. there is also a bug in GTK2 that causes xsane to crash with certain themes (like clearlooks). changing themes worked for me.

EDIT (10/23/12): added some tweaks for scanner support. to enable network scanning check out this thread http://ubuntuforums.org/showthread.php?t=1519201

Code: Select all
#!/bin/sh
#designed for LMDE (update 4)
#script_name="brothermfc7340_LMDE.sh"

# Script must run as root
if [ $(id -u) -ne 0 ]; then
        echo "You need to run this script as root."
        echo "Use 'sudo ./$script_name' then enter your password when prompted."
        exit 1
fi

# make the required directories
mkdir -p /var/spool/lpd
mkdir -p /usr/share/cups/model
mkdir -p /usr/lib/sane

#install scan dependancies
apt-get install -y sane-utils psutils tcsh lib32stdc++

#sym link cups/lpd
ln -s /etc/init.d/cups /etc/init.d/lpd

#download and install .deb files
if [ $(uname -m) = "x86_64" ]; then
# 64-bit
  wget http://www.brother.com/pub/bsc/linux/dlf/brmfc7340lpr-2.0.2-1.i386.deb http://pub.brother.com/pub/com/bsc/linux/dlf/cupswrapperMFC7340-2.0.2-1.i386.deb http://pub.brother.com/pub/com/bsc/linux/dlf/brscan3-0.2.11-4.amd64.deb http://www.brother.com/pub/bsc/linux/dlf/brscan-skey-0.2.1-3.amd64.deb http://pub.brother.com/pub/com/bsc/linux/dlf/brmfcfaxcups-1.0.0-1.i386.deb
  dpkg -i --force-all --force-architecture brmfc7340lpr-2.0.2-1.i386.deb cupswrapperMFC7340-2.0.2-1.i386.deb brscan3-0.2.11-4.amd64.deb brscan-skey-0.2.1-3.amd64.deb brmfcfaxcups-1.0.0-1.i386.deb
else
# 32-bit
  wget http://www.brother.com/pub/bsc/linux/dlf/brmfc7340lpr-2.0.2-1.i386.deb http://pub.brother.com/pub/com/bsc/linux/dlf/cupswrapperMFC7340-2.0.2-1.i386.deb http://www.brother.com/pub/bsc/linux/dlf/brscan3-0.2.11-4.i386.deb http://www.brother.com/pub/bsc/linux/dlf/brscan-skey-0.2.1-3.i386.deb http://pub.brother.com/pub/com/bsc/linux/dlf/brmfcfaxcups-1.0.0-1.i386.deb
  dpkg -i --force-all --force-architecture brmfc7340lpr-2.0.2-1.i386.deb cupswrapperMFC7340-2.0.2-1.i386.deb brscan3-0.2.11-4.i386.deb brscan-skey-0.2.1-3.i386.deb brmfcfaxcups-1.0.0-1.i386.deb
fi

#add user to lpr group
usermod -aG lpadmin "$USER"

#enable normal user to access the scanner
sed -i '/autosuspend/i\# Brother scanner\nATTRS{idVendor}=="04f9", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"' /lib/udev/rules.d/60-libsane.rules

#run post installation scripts (fixes)

  /usr/local/Brother/inf/setupPrintcap MFC7340 -i USB
  /usr/local/Brother/inf/braddprinter -i MFC7340

  if [ -d /usr/lib32 ]
    then ln -s /usr/lib/libbrcomplpr2.so /usr/lib32/libbrcomplpr2.so
  fi

  if [ -e /etc/init.d/lprng ]; then
     /etc/init.d/lprng restart
  elif [ -e /etc/init.d/lpd ]; then
     /etc/init.d/lpd restart
  fi

  if [ ! -e /usr/sbin/pstops ]
    then PSTOPS=`which pstops`
      if [ "`echo $PSTOPS | grep -i cups`" != "" ]
   then PSTOPS=""
      fi
      if [ "$PSTOPS" != "" ]
   then   echo [psconvert2]   >>/usr/local/Brother/inf/brMFC7340func
      echo pstops=$PSTOPS >>/usr/local/Brother/inf/brMFC7340func
      fi
  fi

  if [ -e /bin/sh ]
      then sh /usr/local/Brother/cupswrapper/cupswrapperMFC7340-2.0.2 -i
    elif [ -e /bin/bash ]
      then bash /usr/local/Brother/cupswrapper/cupswrapperMFC7340-2.0.2 -i
    else    echo ''
     echo '****** ERROR: bash is required. ******'
  fi

#create symlinks for installed files
ln -s /usr/lib64/sane/libsane-brother3.so.1.0.7 /usr/lib/sane/libsane-brother3.so.1.0.7
ln -s /usr/lib64/sane/libsane-brother3.so.1 /usr/lib/sane/libsane-brother3.so.1
ln -s /usr/lib64/sane/libsane-brother3.so /usr/lib/sane/libsane-brother3.so
ln -s /usr/lib64/libbrscandec3.so /usr/lib/libbrscandec3.so
ln -s /usr/lib64/libbrscandec3.so.1 /usr/lib/libbrscandec3.so.1
ln -s /usr/lib64/libbrscandec3.so.1.0.0 /usr/lib/libbrscandec3.so.1.0.0


#display cups webui
echo ''
echo 'installation completed'
sleep 2
echo 'cups admin will now launch in your browser'
sleep 2

xdg-open http://localhost:631/admin
Last edited by mechanizedmedic on Mon Oct 22, 2012 5:21 am, edited 3 times in total.
mechanizedmedic
Level 1
Level 1
 
Posts: 4
Joined: Mon Jul 23, 2012 8:32 am

Linux Mint is funded by ads and donations.
 

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby jasmineaura on Fri Sep 28, 2012 11:14 am

Cool. would be nice if you could package it, say as printer-brother-mfc-7xxx-nonfree, and you can probably look at flashplugin-nonfree for an example.

Would also be wise to change all instances of `mkdir` to `mkdir -p`, and use "ln -s" to make symbolic links for files from /usr/lib64 to /usr/lib (instead of "cp").
User avatar
jasmineaura
Level 2
Level 2
 
Posts: 60
Joined: Thu Mar 08, 2012 3:38 am
Location: Cairo, Egypt

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby mechanizedmedic on Sat Sep 29, 2012 12:58 am

jasmineaura wrote:Cool. would be nice if you could package it, say as printer-brother-mfc-7xxx-nonfree, and you can probably look at flashplugin-nonfree for an example.

Would also be wise to change all instances of `mkdir` to `mkdir -p`, and use "ln -s" to make symbolic links for files from /usr/lib64 to /usr/lib (instead of "cp").


thanks! i just edited the OP to reflect your later suggestions. i tried a while back to package these for personal use but my high levels of noobishness prevented a functional installation. :oops:
mechanizedmedic
Level 1
Level 1
 
Posts: 4
Joined: Mon Jul 23, 2012 8:32 am

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby rv7charlie on Thu Oct 18, 2012 5:19 pm

Words fail me in expressing my gratitude! I purchased this printer months ago, & have been struggling to get it set up. Using your process, the task was accomplished in only a few minutes. I've been trying hard to wean myself off MS for a while, but persistent issues like printer setup in the various flavors of linux has made it tough for a 'user' like me.

Any idea about whether this process will allow my wife's computer to 'see' this printer with it attached to my computer (set up as shared, and on the same network)?

Thanks,

Charlie
rv7charlie
Level 1
Level 1
 
Posts: 19
Joined: Thu Oct 18, 2012 5:11 pm

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby mechanizedmedic on Thu Oct 18, 2012 6:21 pm

Hi Charlie,

Thanks for the positive feedback. :)

So far as printer sharing, if Windows clients are involved I know that the "easiest" way is Samba. Personally I've never had good/consistent results with Samba so I manually configure CUPS on all of my servers and clients. Since you already have CUPS installed on the computer that has the printer connected, go to http://localhost:631. This is the CUPS admin UI, and you should be able to set printer sharing somewhere in the Administration tab. This will make your computer a print server for that printer. If you need to share to Windows/Mac clients i'm not of much help there but CUPS should be able to do this too.

Also, the Arch Linux wiki has some good info on CUPS setup, but keep in mind some things are going to be different in Mint/Debian.

Cheers,
MechanizedMedic
mechanizedmedic
Level 1
Level 1
 
Posts: 4
Joined: Mon Jul 23, 2012 8:32 am

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby rv7charlie on Thu Oct 18, 2012 8:01 pm

Thanks for the quick reply. I do still have a couple of Windows boxes on the network, but my primary focus is my wife's desktop, which is also running Mint on the network with my Mint desktop. Can I simply run your process on her computer & have it 'see' the printer that's attached through USB to my computer? (My computer is configured to share the printer; I'll attempt to attach a screenshot.)

Again, this 'user level' newbe is very grateful for the help.

Charlie

printerscreenshot_html_17632af2.jpg
printerscreenshot_html_17632af2.jpg (121.99 KiB) Viewed 5404 times
rv7charlie
Level 1
Level 1
 
Posts: 19
Joined: Thu Oct 18, 2012 5:11 pm

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby mechanizedmedic on Thu Oct 18, 2012 9:36 pm

rv7charlie wrote:Thanks for the quick reply. I do still have a couple of Windows boxes on the network, but my primary focus is my wife's desktop, which is also running Mint on the network with my Mint desktop. Can I simply run your process on her computer & have it 'see' the printer that's attached through USB to my computer? (My computer is configured to share the printer; I'll attempt to attach a screenshot.)

Again, this 'user level' newbe is very grateful for the help.

Charlie


I'm at work until the wee hours of the morning, but here is a quick link to an Ubuntu help doc https://help.ubuntu.com/community/NetworkPrintingWithUbuntu#Printing_from_Ubuntu. This should give you a good general idea of the setup. If it doesn't work post back and I'll try to get some better info when I get home.
mechanizedmedic
Level 1
Level 1
 
Posts: 4
Joined: Mon Jul 23, 2012 8:32 am

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby AmigoNico on Thu Dec 06, 2012 2:55 am

Just wanted to say thanks; my 7340 had been a boat anchor since I switched to LMDE, but now it works better than it did on the Ubuntu-based version.
AmigoNico
Level 1
Level 1
 
Posts: 2
Joined: Thu Dec 06, 2012 2:52 am

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby rv7charlie on Thu Dec 27, 2012 7:00 pm

Just tried to do updates to my system & got an error message that says:
"
An error occurred
The following details are provided:

E: The package brmfc7340lpr:i386 needs to be reinstalled, but I can't find an archive for it.
E: Internal error opening chache (1). Please report.
Close
"
None of the numerous listed updates seem to occur, and when I click 'close' on this message, the Update Manager also closes. Synaptic Package Manager also displays the same message. This package name looks similar, but not identical to the package for the Brother printer. Anyone run into this issue recently?

Thanks,

Charlie
rv7charlie
Level 1
Level 1
 
Posts: 19
Joined: Thu Oct 18, 2012 5:11 pm

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby rv7charlie on Tue Jan 01, 2013 6:52 pm

Well, I found a fix for the previous issue, but now have a 'back to square one' issue.

I did a 'clean' install (new hard drive, new computer) of Mint14. I performed the process detailed at the beginning of this thread on the new system. After the process ran & Cups admin opened in my browser, I could not print a test page, nor could I scan an image. Anyone have any thoughts on how I should proceed?

Thanks,

Charlie
that $40 deal on Win8 is starting to look better & better.... :-(
rv7charlie
Level 1
Level 1
 
Posts: 19
Joined: Thu Oct 18, 2012 5:11 pm

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby Conzar on Fri Mar 15, 2013 5:08 am

Thank you very much. Although I am not using mint (yet), your script worked great! Thank you very much for your time and effort putting this together!
Conzar
Level 1
Level 1
 
Posts: 3
Joined: Tue Jun 26, 2012 5:52 pm

Re: HowTo: Brother MFC-7340, print/scan drivers

Postby benf101 on Tue Jul 09, 2013 9:11 pm

In the past I have spent over an hour setting this up with the crazy wrappers and everything. Your script worked awesomely and saved me a LOT of time. Thank you!
benf101
Level 1
Level 1
 
Posts: 1
Joined: Tue Jul 09, 2013 9:07 pm

Linux Mint is funded by ads and donations.
 

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests