Difference between revisions of "Brother HL-2040"

From ArchWiki
Jump to navigation Jump to search
m (laserjet is a brand by HP, not a printer type, some style fixes)
(the instructions here are automated in the 'brother-hl2040' AUR pkg, which is mentioned on CUPS printer-specific problems#Brother)
Line 1: Line 1:
#REDIRECT [[CUPS printer-specific problems#Brother]]
This guide explains how to install a Brother HL-2040 laser printer using CUPS.
{{note|If you already attempted (and failed) to install the driver in CUPS, remove it before proceeding with this tutorial.}}
This tutorial assumes you have already configured the [[CUPS]] printer server.  There is plenty of existing information to get this working.
==Download Brother HL-2040 drivers==
Create a temp directory such as {{ic|~/brother}}
Download the RPM packages of the LPR driver ([http://support.brother.com/g/b/downloadend.aspx?c=us&lang=en&prod=hl2040_all&os=127&dlid=dlf005840_000&flang=4&type3=558 HERE]) and the CUPS wrapper ([http://support.brother.com/g/b/downloadend.aspx?c=us&lang=en&prod=hl2040_all&os=127&dlid=dlf005842_000&flang=4&type3=560 HERE]) and place them into your newly created temp dir
You may also download a ppd for HL-2040 from [http://www.profv.de/brother/ here]. This one has the margins problem fixed.
==Extracting the RPM files==
You'll need to grab a script to extract the files from the RPM packages, so first install {{Pkg|rpmextract}}.
Then extract both RPM files:
$ rpmextract.sh brhl2040lpr-2.0.1-1.i386.rpm
$ rpmextract.sh cupswrapperHL2040-2.0.1-1.i386.rpm
You should now have two sub-directories: ''usr'' and ''var''
==Editing files to make them work with Arch==
Arch Linux uses its own filesystem hierarchy, so you must edit some files to match it. We'll assume you created the temp directory <em>brother</em> in your home directory as mentioned earlier.
Use your favorite text editor (i.e. kate, gedit, or vi) and open {{ic|~/brother/usr/local/Brother/cupswrapper/cupswrapperHL2040-2.0.1}}.
Replace all instances of {{ic|/etc/init.d/}} with {{ic|/etc/rc.d/}}
Save and close
Next, edit {{ic|~/brother/usr/local/Brother/inf/setupPrintcap}}.
Replace all instances of {{ic|/etc/printcap.local}} with {{ic|/etc/printcap}}
Save and close
Now we're ready to copy the files to their respective places on our system (you'll need to be root for this)
# cp -r ~/brother/usr/* /usr
# cp -r ~/brother/var/* /var
==Installing the driver and printer==
Now let's run the installation script (again, as root):
# cd /usr/local/Brother/cupswrapper/
# ./cupswrapperHL2040-2.0.1
Upon completion the script will attempt to restart the CUPS daemon if it was running.
Now browse to the CUPS server : http://localhost:631/
Under the Administration category, choose Manage printers. You should now see your HL2040 printer <b>automatically</b> installed and configured.
Print a test page and configure the printer settings to your liking.
===Enable cups daemon===
Enable cups daemon to start cups on every reboot:
systemctl enable org.cups.cupsd.service
==Regional Settings==
Make sure to set your printer preferences to match your region.  For example, if you live in North America (Canada, US, Mexico) your paper size should be changed from the Default "A4" to "Letter".  Sometimes this will be done automatically by your Desktop Environment (e.g. KDE) but it's worthwhile to check it yourself or the text on your pages won't align properly.
== Alternate Method (foomatic) ==
NOTE: If you are having alignment issues using the standard HL 2040 driver, try this method or using the standard CUPS setup to select the 'Brother HL-2400CeN Foomatic/hl1250' driver.
===Install Required Packages===
Install {{Pkg|cups}}, {{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}} and {{Pkg|foomatic-db-nonfree}}.
===Start Cups===
Start/enable {{ic|org.cups.cupsd.service}} [[systemd#Using units|using systemd]].
===Finish Installation from the KDE menu (Optional)===
This assumes that you are:
# Using KDE
# Your printer is connected on LPT1 - parallel port.
<pre>Go to K menu -> settings -> printers
Click administrator mode
Enter root password
Click "add printer"
Click next
Choose local (top one)
Click next...the port should be lpt1
Click it... then next
.......builds database
Choose brother
Then the hlwerfjefja one we all know and love HL-2400CeN hl1250
Click next then test
Set dpi to 600, test again.
no banners... no quota... denied users...
Give it a name
Click next
You should be done</pre>

Revision as of 10:03, 11 September 2015