You are here: Home how to... HL-4040-CN on Kubuntu Gutsy

HL-4040-CN on Kubuntu Gutsy

A tale of how i got our new Brother printer to play nice with our Linux boxes.

Overview

After being pestered by my daughter to get a color printer because it is "required" for homework, i finally broke down and bought her one for christmas. I had just thrown out my old inkjet, because i was tired of having to spend 20 minutes doing the head cleaning dance every time i wanted to print something. I do have a Brother HL-1850 which i'm very happy with. So i ended up getting a HL-4040-CN. It had good reviews (doesn't eat lot's of toner and is very fast). There was also a claim that it worked on Linux.

Install Drivers

The setup was nothing like my old HL-1850 give the PPD to CUPS and go. No, this puppy came with 2 PPDs one for the HL-4050-CDN and one for the HL-4070-CDW neither of those PPDs happened to work with my 4040 :(. So off it was to Brothers website to see what gives. Brother does have instructions on how to make the 4040 work on Linux but things were still a bit bumpy for my Kubuntu Gutsy setup. First of all the instruction from Brother can be found here. There you'll find instructions on where to find the hl4040cnlpr and the hl4040cncups debs. As it says install hl4040cnlpr first.

dpkg -i --force-all --force-architecture hl4040cnlpr-1.0.0-7.i386.deb

This will likely complain about stuff. Don't worry about it.

mkdir: cannot create directory `/var/spool/lpd/hl4040cn': No such file or directory
chown: cannot access `/var/spool/lpd/hl4040cn': No such file or directory
chgrp: cannot access `/var/spool/lpd/hl4040cn': No such file or directory
chmod: cannot access `/var/spool/lpd/hl4040cn': No such file or directory

Then install hl4040cncups:

dpkg -i --force-all --force-architecture hl4040cncups-1.0.0-7.i386.deb

This install is well behaved and restarts CUPS.

Setup

When you point your webbrowser at localhost:631/printers/ to inspect your CUPS configuration you will find that the above debs will have installed a new CUPS printer by the name of HL4040CN. You'll also notice that it has issues. In my case they read

"Filter "/usr/local/Brother/Printer/hl4040cn/cupswrapper/brlpdwrapper_hl4040cn" for printer "HL4040CN" not available: Permission denied"

It turns out after googling a bit and finding this, that there's a program called AppArmor that i never new about before. To make a long story short if you had the error above running

sudo aa-complain cupsd

and then restarting the HL4040CN printer will remedy the problem. By default it is setup on usb:/dev/usb/lp0. I plugged mine into the LAN instead. I also have a FreeBSD gateway running a DHCP server. So i set my printer up to use DHCP, and told my DHCP to give it a static address. If you hit the Minus button on the printer you will get the Machine Info menu. Hitting enter twice prints the settings out. Page 3 has the MAC address of the printer. You can alternatively also just give it a static address using the LAN menu on the printer. As it says in the printer's "Getting Started" instructions, it's probably a good idea not to plug the printer into the LAN until this is setup.

So when you click the "Modify Printer" button on the printers page under the HL4040CN you can adjust the printer settings.

Description
In my case i left the description on the first page alone.
Device
On the second page i chose "LPD/LPR Host or Printer" in the URI i set "lpd://hostname/POSTSCRIPT_P1". hostname is either the IP address or the hostname depending on whether you have DNS setup or not. Brother's website said to use the BINARY_P1 queue, but that gave me problems with OpenOffice. Instead of the printed page i got a bunch of Postscript text.
Make
I left Brother
Model
Again Brother HL-4040-CN series CUPS 1.1 was fine

The print a test page to make sure it works.

GIMP

  • Open an image.
  • Goto File - Print
  • Click "New Printer"
  • Give it a name.
  • Choose "Standard Command" and pick "HL4040CN" from the "Printer Queue" dropdown list. Hit OK.
  • Press "Save Settings" so GIMP remembers
  • Print a test image

TODO

Download the sources and build them on FreeBSD, so i can use the printer there, too.

Document Actions

Copyright © 2007-2015 Mario Theodoridis. All rights reserved. Content licensed under AFL.   Impressum   Datenschutz
Content from the underlying Plone CMS is © 2000-2009 by the Plone Foundation