Solved CUPS with older Brother laser printer

I seldom need to print or scan anything so I've gotten away with ignoring things like CUPS and SANE for a very long time. Recently, I was able to get an old Canon LiDE scanner working. Great. Next up is an old but reliable Brother HL-1240 printer. This is a simple single sided single toner model that can connect by USB 2.0 or a parallel port. I'm using the USB cable.

The printer appears under lpinfo and appears as a choice when adding a printer through the CUPS web interface. I've tried print/brlaser with no success. The closest printer models in the brlaser set appear to be the HL-1200 and HL-1210W. Printing a test page from the CUPS web interface results in a "Not found" error. If I install the printer as a direct model, I get pages with random gibberish.

I do have this old printer working on Windows 11 but I prefer to print directly from FreeBSD. Is there some other way to source or generate a "ppd" file that works with CUPS?

Does anyone have any tips for this specific model?
 
you could try the Foomatic PPD from OpenPrinting.org's PPD generator — this runs print jobs through GhostScript to rasterize them to the printer's format. you'll need to install foomatic-db and foomatic-filters along with ghostscript, probably.
 
If the PPD from open printing doesn't work, you could probably also give the universal driver from Brother a go in the linuxulator. It does use CUPS, so there might be a PPD that can be extracted for use.

EDIT: I downloaded the source and there are specific CUPS wrappers for the HL-1240, so that's probably a possibility.
 
print/brlaser supports the HL-1200 series:

1770121565091.png
 
Print Test Page

Print Test Page HL1240 Error​

Unable to print test page:

Unsupported format "text/plain".
I've no idea where to go next.

E [06/Feb/2026:01:57:06 -0600] [Client 88] Returning IPP client-error-document-format-not-supported for Print-Job (ipp://localhost:631/printers/HL1240) from localhost.
E [06/Feb/2026:01:58:40 -0600] [Client 92] Returning IPP client-error-document-format-not-supported for Send-Document (ipp://localhost:631/printers/HL1240) from localhost.
E [06/Feb/2026:02:00:57 -0600] [Client 93] Returning IPP client-error-document-format-not-supported for Send-Document (ipp://localhost:631/printers/HL1240) from localhost.
E [06/Feb/2026:02:01:12 -0600] [Client 94] Returning IPP client-error-document-format-not-supported for Send-Document (ipp://localhost:631/printers/HL1240) from localhost.
E [06/Feb/2026:02:01:24 -0600] [Client 95] Returning IPP client-error-bad-request for Send-Document (ipp://localhost:631/printers/HL1240) from localhost.
E [06/Feb/2026:02:01:38 -0600] [Client 96] Returning IPP client-error-document-format-not-supported for Send-Document (ipp://localhost:631/printers/HL1240) from localhost.
E [06/Feb/2026:02:03:29 -0600] [Client 106] Returning IPP client-error-document-format-not-supported for Print-Job (ipp://localhost:631/printers/HL1240) from localhost.
 
show the entry for that printer in your printers.conf

Where did you get those errors from? The host that has the printer connected via USB? Then why is it using ipp?
 
The errors are from /var/log/cups/errors_log

# Printer configuration file for CUPS v2.4.16
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
NextPrinterId 13
<Printer HL1240>
PrinterId 12
UUID urn:uuid:a17aeacf-98dd-37fd-4461-89d5737c7ff6
Info HL1240
Location Local Printer
MakeModel Brother HL-1250 - CUPS+Gutenprint v5.3.4 Simplified
DeviceURI usb://Brother/HL-1240%20series?serial=0.0
State Idle
StateTime 1770364586
ConfigTime 1770365311
Type 4180
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
AllowUser unitrunker
OpPolicy default
ErrorPolicy stop-printer
</Printer>
Note: I tried the HL-1240 gutenprint earlier. Just now I was trying the HL-1250. Results are the same.
 
DeviceURI usb://Brother/HL-1240%20series?serial=0.0

This looks a bit weird; usually this should include the full serial number; e.g. from my cups server at home:
Code:
DeviceURI usb://Brother/HL-L2400DW?serial=E83106H3N159171

Does the cups user/group have rw access to the usb port the printer is attached to? ( ll /dev/usb)

If you haven't rebooted that host since installing cups, try re-plugging the printer (and maybe have a look at dmesg | tail if there are any errors) and/or restart devd (and watch dmesg output)

edit:
also check usbconfig -l if the printer is registering correctly, otherwise devd might not trigger the rules in /usr/local/etc/devd/cups.conf. I remember my ancient brother HL2030 also needed some tweaking here...
 
This is indeed weird:

$ mdo usbconfig dump_all_desc ugen0.2
ugen0.2: <HL-1240 Laser Printer Brother Industries, Ltd> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (0mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0100
bDeviceClass = 0x0000 <Probed by interface class>
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0008
idVendor = 0x04f9
idProduct = 0x0006
bcdDevice = 0x0100
iManufacturer = 0x0000 <no string>
iProduct = 0x0000 <no string>
iSerialNumber = 0x0000 <no string>
bNumConfigurations = 0x0001

Configuration index 0

bLength = 0x0009
bDescriptorType = 0x0002
wTotalLength = 0x0020
bNumInterfaces = 0x0001
bConfigurationValue = 0x0001
iConfiguration = 0x0000 <no string>
bmAttributes = 0x0040
bMaxPower = 0x0000

Interface 0
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0000
bAlternateSetting = 0x0000
bNumEndpoints = 0x0002
bInterfaceClass = 0x0007 <Printer device>
bInterfaceSubClass = 0x0001
bInterfaceProtocol = 0x0002
iInterface = 0x0000 <no string>

Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0001 <OUT>
bmAttributes = 0x0002 <BULK>
wMaxPacketSize = 0x0040
bInterval = 0x0000
bRefresh = 0x0000
bSynchAddress = 0x0000

Endpoint 1
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0082 <IN>
bmAttributes = 0x0002 <BULK>
wMaxPacketSize = 0x0040
bInterval = 0x0000
bRefresh = 0x0000
bSynchAddress = 0x0000
The printer literally does not have a serial number.
 
sko I think you called out the problem. I removed the "?serial=0.0" part of the URL, restarted cupsd and clicked "Print Test Page". A formatted page popped out. Whew!
 
ipptool -tv ipp://localhost:631/printers/HL1240 get-printer-attributes.test|grep document-format
also stop cups and try from sh
Code:
echo -n $'\x1b3%-12345X@PJL\r\n@PJL SET RESOLUTION=600\r\nthis text should print\r\nrow 2\r\n\xc' >/dev/usb/actualdevnode
 
Not sure if the serial number actually matters, it just caught my eye. Otherwise the config should be fine.

Also, in all printer.conf with brother printers I usually have some variant of 'using brlaser v6' in the "MakeModel" string. Do you have multiple variants of the printer listed when changing the driver in the cups web-frontend?

edit:
if it was that serial string, I'm glad it was that simple and we found it 👍
Brother printers are really easy to work with IMHO - we completely switched from an assortment of kyocera, canon and HP to brother as they usually 'just work'™ and you can often support various models with the same toner model (makes keeping stocks a lot easier). The only brand I'd choose over brother would be OKI - but they have a wildily different price point...
 
When I click "Modify Printer" - I see two choices.

Current Connection:usb://Brother/HL-1240%20series
Local Printers:Brother HL-1240 series (Brother HL-1240 series)

The service manual says there is a 128 byte EEPROM inside. I'm wondering if the printer's serial # was stored in EEPROM and it failed.

At the moment, the printers.conf says ...
MakeModel Brother A Owl-Maintain/brlaser Test Driver, v6.2.8; compatible with monochrome laser printers
DeviceURI usb://Brother/HL-1240%20series
I'll test drive some of the others to see which works best.
 
If you go 2 steps forward in that "Modify Printer" dialogue without changing anything, you get a list of printer models. I just checked and there's only 'CUPS+Gutenprint' variants for the HL-1240 listed, no brscript (no idea if this printer supports BrScript)


FYI: As a fallback you can usually use the generic 'HP LaserJet Series' (or colorjet) drivers. Brother has an emulation for generic HP in pretty much all printers - in the web interface of the networked printers you can even modify the standard options for that emulation layer.
 
Back
Top