Solved Port for Brother printer drivers ?

Hi guys,

I'm looking into making my Brother printer (HL-1110) works on FreeBSD by using the Linux drivers.
I managed to do it once but lost my config since.
There are some information here or on other sites (edited with pinned 's link)
- dcp-j772dw : https://forums.freebsd.org/threads/brother-dcp-j772dw-printer-and-freebsd.69677/
- dcp-j140w : https://forums.freebsd.org/threads/any-chance-of-getting-the-brother-dcp-j140w-to-work.38655/
- https://tdotc.eu/2007/06/02/using-the-brother-printer-drivers-with-freebsd/

Basically, we need to edit the installation file to change the paths.

Would it be worth it if I try to make a port for this driver ? As a side note, I've never done any port before.
Thanks,
 
Last edited:
The Linux "driver" executable, which I think in the case of Brother printers is a wrapper, may have to be invoked via Linux emulation, in addition to modifying the paths. I thought I read a thread here a few years ago about that but not sure whether the poster had success.
 
The problem with Brother printers is that Brother has pulled the printing functionality out of hardware and put it in software, which is proprietary. The "driver" is a Linux binary wrapper. Without this wrapper, or native driver in Windows, the printer is useless on FreeBSD unless you can somehow get Linux emulation to run the binary. Far easier, albeit not cheaper, is to only buy PCL/Postscript printers. Possibly not an option for OP, and I get that: you have hardware and would like to use it.

Another option might be to host the Brother printer on another machine running Linux or Windows and share it out so FeeBSD can see it. I have no experience in that though.

EDIT: sorry, to clarify terms: "port" means to re-write a piece of software for a given platform. In the case of the Brother driver, it is provided in binary form and is not port-able because no source code is available.
 
EDIT: sorry, to clarify terms: "port" means to re-write a piece of software for a given platform. In the case of the Brother driver, it is provided in binary form and is not port-able because no source code is available.

Oh, I was under the impression that there was some ports without source code. But https://www.freebsd.org/ports/ says indeed that
Each "port" listed here contains any patches necessary to make the original application source code compile and run on FreeBSD.
 
You cannot "port" (re-write) software from one platform to another without the original source code. If you are referring to the FreeBSD ports, those are source code for applications that have been re-written for FreeBSD, or written only for FreeBSD, and require compilation in order to run. The terms aren't really related, at least to me. Hope I am not confusing the issue.
 
Yes, I was thinking about FreeBSD ports. Thanks for clarifying the issue.
So, if I manage to make it work, is there a central repository to put the FreeBSD-compatible install script ?
Otherwise, I could create a "How-to" thread to the forum and add it as an attachment. At the moment, there are already some threads there and there, but without any scripts.
 
You can post the solution in the how to section I think, and include the code there. The problem you are going to run into is getting the Linux binary wrapper to run. Unless you can just use the printer ppd, but not sure that will work since most of the functionality is rolled up into that binary.
 
Update: I managed to make the driver work (see below) but I've seen they give the source code for the executable. So it may be possible to have a FreeBSD port after all....

(Edit: removed the creation of a script named brprintconflsr3_HL1110 as it's useless)
How to install
Download here the CUPS and LPR drivers :

Then extract all files on / for both driver :
Code:
tar xvzf data.tar.gz -C /
Install psutils and linux_base-c7
Then run commands shown in the postinst script, modified for FreeBSD

Code:
sed -i.bak 's/chown lp/chown root/' /opt/brother/Printers/HL1110/inf/setupPrintcap
sed -i.bak 's/chgrp lp/chgrp daemon/' /opt/brother/Printers/HL1110/inf/setupPrintcap
/opt/brother/Printers/HL1110/inf/setupPrintcap HL1110 -i USB
/opt/brother/Printers/HL1110/inf/braddprinter -i HL1110
echo \[psconvert2\]   >>/opt/brother/Printers/HL1110/inf/brHL1110func
echo pstops=/usr/local/bin/pstops  >> /opt/brother/Printers/HL1110/inf/brHL1110func
ln -s /opt/brother/Printers/HL1110/inf/brHL1110rc       /etc/opt/brother/Printers/HL1110/inf/brHL1110rc


Because it complaints that
/usr/local/libexec/cups/filter/brother_ldwrapper_HL1110 does not exist :

Code:
ln -s /opt/brother/Printers/HL1110/cupswrapper/brother_lpdwrapper_HL1110  /usr/local/libexec/cups/filter

Finally, add the .ppd file in CUPS interface (this is supposed to be done with the postinst file...).
 
I'm having the same issue with a Brother MFC495CW. Do I follow the same instructions? Can I take the Linux wrapper? I'm confused if you are using CUPS or LPR. My printer is networked and works with every phone, tablet and laptop except my FreeBSD install.
 
I'm having the same issue with a Brother MFC495CW. Do I follow the same instructions? Can I take the Linux wrapper? I'm confused if you are using CUPS or LPR. My printer is networked and works with every phone, tablet and laptop except my FreeBSD install.
From brlaser upstream
If your printer isn't included in the list above, just try selecting any entry marked 'brlaser' and see if it works.

If it does, please create a new issue here in Github and include the output of this command:

sudo lpinfo --include-schemes usb -l -v
Then I'll be able to add a proper entry for your printer.
 
I bought a Brother HL-1223WE printer.

I downloaded the driver from Brother's driver page and extract it into /opt. The suggested /etc/printcap file is (mine):
Code:
lp|Brother|Brother HL-1223WE:\
  :mx=0:\
  :sd=/var/spool/lpd:\
  :sh:\
  :lp=:\
  :rm=192.168.100.3:\
  :lf=/var/log/lpd-errs:\
  :if=/opt/brother/Printers/HL1210W/lpd/filter_HL1210W:
As I see the filter (:if:) want use /opt/brother/Printers/HL1210W/lpd/rawtobr3 which is a linux-binary (rawtobr3: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.0, not stripped) - I don't want install about 231 Mb of emulators/linux_base-c7.

I found a rawtobr3 GitHub-repository and tried it:
Bash:
svn checkout https://github.com/k1-801/rawtobr3 # do not have git installed
cd rawtobr3/trunk
clang *.cpp -o rawtobr3
cp /opt/brother/Printers/HL1210W/lpd/rawtobr3{,.orig} # backup of original - who knows?
cp rawtobr3 /opt/brother/Printers/HL1210W/lpd

Restart lpd service: service restart lpd, and works fine.

It does not need print/brlaser and print/cups, only the base system and print/ghostscript9-agpl-base.

I hope it helps somebody.
 
Back
Top