You can get the i386 driver working on the Raspberry Pi through emulation, even though it has a different instruction set. It's very slow and takes minutes until the printout arrives, but it works.
I found the hint on this forum post:
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=15526&start=25#p708038
Step 1: Install the driver as instructed on the Brother documentation
You should have a directory such as /opt/brother/Printers/dcp195c/lpd
with the filter binary brdcp195cfilter
. This binary is called by the filterdcp195c
shell script right next to it in the same directory.
I believe they offer an installation script now, but I did it without. There are instructions somewhere what needs to be preinstalled.
Step 2: Get the i386 emulation working
This is following the steps at https://wiki.debian.org/QemuUserEmulation
At the end of step 2, you should be able to run i386 binaries just like regular binaries. In ps ax
, they will show
Install Qemu
Install the packages qemu
, binfmt-support
and qemu-user-static
.
Run update-binfmts --display
to see which binary formats are supported.
They should be automatically enabled on Raspbian and Debian.
Install x86 support libraries
On Raspbian, add a line like this to your /etc/apt/sources.list
:
## Debian i386
deb [arch=i386] http://http.debian.net/debian stable main contrib non-free
Another Debian repository will also do.
The Raspbian repository doesn't have x86 binaries, so add an [arch=armhf]
line to your existing lines starting with deb
. The lines starting with deb-src
can be kept as-is.
Tell Raspbian that you want a multiarch system with i386 packages, and get the i386 libc. For the update
step to work, you'll need to import and trust the Debian GPG keys for package management.
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386
At this point, you should be able to execute the brdcp195cfilter
binary which comes with the driver:
$ ./brdcp195cfilter
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Error: invalid option !!
If you see this output, it worked. The Error: invalid option !!
line is brdcp195cfilter
complaining that you should have passed arguments.
Optional: Remove the ld.so
error message
Raspbian uses /etc/ld.so.preload
to preload the libarmmem
library into all processes. The library replaces some expensive memory routines with faster routines written in ARM assembly, but is not strictly necessary to run Raspbian.
It's safe to ignore the warning, but also safe to remove or comment out that line from /etc/ld.so.preload
. The warning will show up in CUPS error logs if not disabled.
Step 3: Get this working with CUPS
You should have a CUPS installation from following the instructions from the Brother website.
Flaky USB connection
On my Raspberry, the dmesg
log was alternating quickly between these lines at some point:
[58981.586842] usblp0: removed
[59222.794260] usblp 1-1.3:1.0: usblp0: USB Bidirectional printer dev 8 if 0 alt 0 proto 2 vid 0x04F9 pid 0x0222
What fixed it for me was to go to localhost:631
(the CUPS web interface) and modify the printer in the "Printers" section so that it uses the CUPS-recognized USB device rather than the usb://dev/usb/lp0
device.
Let the printer receive data at a normal speed
brdcp195cfilter
is a step in the printing process which receives a huge input bitmap, and converts it to something which later gets piped to the printer device. I measured an input size of ~90MB for a simple "Hello world" message on the top of the page.
The emulation on the Raspberry is not quick enough to keep up with feeding the printer with data. The printing works, but I heard unhealthy noises from the printer motors being active while waiting for data.
To fix this, install the utility sponge
from the moreutils
package and edit filterdcp195c
so that the output of $BRCONV $BRCONV_OP
(a.k.a. brdcp195cfilter
) is piped though sponge
. There should be three lines within the "PostScript", "PDF" and "*" cases at the end of the file, ending in ... | $BRCONV $BRCONV_OP | sponge
.
What this does is to gobble up all output from the long-running converter process and only send it to the printer all-at-once when the converter is done. That way, it takes longer until the printing starts, but the printer is receiving its data at a normal pace.
(sponge
stores the data it buffers in a temporary directory, so you're not limited by the Raspberry Pi's RAM)
Thanks for the answer! I will try this and report if I have success with your solution. – Sven Niehus – 2014-08-01T11:46:10.993
Sorry that it took so long to answer, but I had to install Debian in a VM, because I'm using Windows.
Your solution works. Best thanks! – Sven Niehus – 2014-08-01T14:38:02.537
Since it seems a common problem that one needs to copy the driver file from another computer to the Raspberry's SD card: could somebody maybe share his driver file? I guess quite some folks would appreciate that. – None – 2014-11-22T00:35:10.483
did not work as described, but thank you for the links: installing .deb file solved the problem (elementary.io OS / freya) – avp – 2015-05-05T20:08:00.817
Which steps did you take? – Murmel – 2015-05-06T21:19:41.157