Close

Brother HL2040 configuration files

A project log for Silly software wishlist

Motivation to do some software projects by writing them down.

lion-mclionheadlion mclionhead 07/04/2020 at 22:360 Comments

For 2020 tax filing, the lion kingdom banged on its Brother HL2040 again.  The original configuration files from 2007 were hacked to work & lost when the hard drive was replaced later.  It never could be made to work again with any configuration files Brother released after 2007.  The printer now always feeds 2 sheets & jams while feeding the 2nd sheet.


The 1st hack is in /usr/local/Brother/lpd/filterHL2040, setting the yshift parameter to a small number from 0-100.  The more positive yshift is, the more the printout is shifted up in the page.  The more negative yshift is, the more the printout is shifted down in the page until it starts printing on the 2nd page.  The more positive  xshift is, the more it's shifted right.  The more negative xshift is, the more it's shifted left.

In a configuration which has become very broken since 2007, it picks up RESOLUTION & PAPER_TYPE from /usr/local/Brother/inf/brHL2040rc.  If PaperType=A4 is replaced by PaperType=Letter, it prints properly but still feeds 1.5 sheets.

Then, it uses PAPER_TYPE to extract the WIDTH & HEIGHT from paperinf

It's supposed to extract the xshift & yshift from /usr/local/Brother/inf/brHL2040init, but this file was deleted at some point, so lions just add some hard coded lines inside /usr/local/Brother/lpd/filterHL2040.


There hasn't been a way to stop it from starting a 2nd page without using the manual feeder.  Then, it doesn't try to feed a 2nd sheet.  For a long document, it's a pain to feed 1 sheet at a time.

Lions long ago abandoned the clunky lpr & lpd system.  All you have to do in the lion kingdom is 

cat printout.ps | filterHL2040 > /dev/usb/lp0

For future lions, the hacked configuration files are

https://cdn.hackaday.io/files/1380505906331200/brother.tar.xz

Discussions