The Epson CX and DX series is a range of low cost multifunction inkjet printer-scanner devices (some of them also include a card reader) supported by the SANE project for the scanner part, and by CUPS for the printer part.
They work pretty well in FreeBSD in all the three functions. The necessary kernel changes have been integrated in FreeBSD 6.x and higher in fall 2007 and later (as time goes, we need to add USB ids for the various devices). The information below details the things that I did to have the device fully operational.
Model | USB ID | Works | Comments |
---|---|---|---|
DX-3800 | 0x04b8 0x0818 | Yes | no card reader, need to patch the USB ID into uscanner.c |
DX-5050 | 0x04b8 0x082b | Yes | same as DX-5000 |
DX-6000 | 0x04b8 0x082e | Yes | same as DX-6050 |
DX-7400 | 0x04b8 0x0838 | Yes | same as DX-7450 |
DX-8450 | 0x04b8 0x0839 | Yes | |
SX/NX400 | 0x04b8 0x084a | NO | Needs the sane-epkowa backend |
SX/NX100 | 0x04b8 ???? | NO | Not supported at all |
The scanner part of the device can be controlled through the SANE package, which provides an appropriate backend and a couple of frontents (scanimage, which is for the command-line; and xscanimage, graphics). Additionally, I would suggest to install graphics/tesseract, a recently released OCR already available as a FreeBSD port which seems to perform well.
SANE accesses devices through a number of backends, which talk to the scanner using a variety of techniques. For our purposes, the dialogue has to occur over USB, and so there is either direct access through the "uscanner" device, or "indirect" access (issuing usb commands with libusb) through the "ugen" device.
Because the DX-5050 is a multi-function device (i.e. it has multiple "interfaces", in USB terminology) the "ugen" method might not be applicable (ugen might not attach because the printer and card reader interfaces will attach to the respective drivers). As a consequence, we need to patch the kernel to let the "uscanner" driver recognise the scanner and properly attach the interface. This is done in the following steps:
Because the device is usb, the entry is created dynamically, and you need to make sure that device permissions are correct for your use. This step is critical - if the device is not accessible, the various frontends will not be able to access it. One way to achieve this is to put the following entry in /etc/usbd.conf
device "usb scanner for sane" devname "uscanner[0-9]+" attach "/usr/sbin/chown yourname:wheel /dev/${DEVNAME}"(probably you can do something smarter e.g. by reading permissions on /dev/console or /dev/ttyv for the active session, etc.).
In FreeBSD 7.0 and above usbd is deprecated and replaced by devd, the configuration then goes into /etc/devd.conf
attach 10 { # "usb scanner for sane" device-name "uscanner[0-9]+"; action "/usr/sbin/chown yourname:wheel /dev/$device-name"; };
Having done this, and assuming you have installed the two SANE ports (graphics/sane-backends and graphics/sane-frontends), the next thing to do is to tell the "epson" backend where the scanner is. This is done by adding the following line to /usr/local/etc/sane.d/epson.conf:
usb /dev/uscanner0
This should be enough to have the scanner working - you can test it e.g. with "xscanimage".
If for some reason the epson backend does not work for you, (e.g. because you have one of the newer models such as the SX/NX400) you can try an alternate backend called epkowa. The source for the Epkowa backend can be found at the Avasys download page, which lets you download the most recent version of the driver (2.15.0 as of this writing). However this version does not work on FreeBSD as of this writing. A working port of a former version (2.11.0) is available below.
To install epkowa you need to do the following:
usb /dev/uscanner0 # same as you did in epson.confand update /usr/local/etc/sane.d/dll.conf to use the new backend. You might want to remove/comment the same line in epson.conf, or comment out the 'epson' line in dll.conf
At this point all the sane frontends should be able to access the scanner using either 'epson' or 'epkowa' as a backend (xscanimage will present a dialog box to choose the driver).
OCR is not an integral part of scanner support but certainly one convenient option to have. I had poor experience in the past with OCR packages under FreeBSD, but apparently the situation has changed now. There is an interesting OCR review covering some packages freely available under linux, which seem to suggest tesseract as one of the best performing and promising command-line OCR; and ocropus, which also has a GUI and format conversion tools.
I have only tried tesseract as there is a FreeBSD port already,
available as graphics/tesseract. In order to try it, you
should provide a grayscale scan with sufficient resolution,
e.g. 300dpi (or 600dpi if you are using a small font).
You also need ImageMagick to do the format conversion,
as tesseract only reads TIF files.
Another useful tool to have is the
unpaper program,
available as a port (graphics/unpaper) which can
automatically remove some of the artifacts usually appearing
in scanned text pages, including background noise and rotated pages.
The only thing i miss in "unscanner" is some way to improve
contrast - even if you can set the black and white threshold
used for internal feature extraction (e.g. below i use
0.5 (i.e. 128) for black, 0.8 (i.e. approx 200)
for white because my scanner does not give
a lot of contrast), i would like the same range to be stretched
to 0..255 in the output.
A sample test could be done as follows:
scanimage --mode gray --resolution 300 > /tmp/img.pnm unpaper -b 0.5 -w 0.8 -l single /tmp/img.pnm /tmp/img1.pnm convert /tmp/img1.pnm /tmp/img.tif tesseract /tmp/img.tif /tmp/data_out -l ita # change ita to your languageThis produces a text file /tmp/data_out.txt with the conversion results. I was definitely impressed with the results.
For the printer part, as long as you have "device ulpt" in your kernel, the device will be recognised as an usb printer. Don't forget that, same as for the scanner, the device entry must have the correct owner. Unless the print subsystem runs as root, you probably need to put something like the following into /etc/usbd.conf
device "usb printer for cups" devname "ulpt[0-9]+" attach "/usr/sbin/chown cups:cups /dev/${DEVNAME}"Then you need some suitable print subsystem and backend. As a print subsystem, CUPS (print/cups-base) is probably a good choice - once installed, you can easily configure it through the web interface at http://localhost:631/.
The backend for CUPS is provided as part of print/gutenprint. Remember, when you configure it, to enable the CUPS drivers.
Once you have installed the backend, you can configure the printer and select one of the following and as PPD file:
/usr/local/share/cups/model/gutenprint/5.1/C/stp-escp2-cx5000.5.1.ppd.gz /usr/local/share/cups/model/gutenprint/5.1/C/stp-escp2-dx4800.5.1.ppd.gzThe name of the base directory may change depending on the version and the language you want (the ppd is a text file with menu entries and links to files, commands etc. to be used as filters). According to various sources on the net, the CX5000 (US market) and DX5000 DX5050 (european market) are the same thing, with marginal differences in print speed.
The printer comes with a card reader (CompactFlash and SD/XD slots) and an USB connector for printing directly from the camera. The CF/SD slots are simply seen as "umass" devices, so just inserting a card in the slot (one at a time) will make it appear as /dev/da0.