scanPrint Version 0.20 ====================== Please report success or problems by mail to jj.sarton@t-online.de Changes: ======== V1.20 Cleanup of sources. removed thinks which are not necessary. V1.19 Internal test version V1.18 Removed rldp xw_print.preload, getInk.preload, epsCmd.preload. Added d4Id Modified Configure according to modifications. V1.17 Modifications for rldp. The check for security is mow made against the library files. Thes file must be owned by root. Little bugs in the library files bugs eliminated. Added library for the control channel. Include an example file for hamdling with the libary files V1.16 Modifications for CUPS. V1.15 Little corrections. V1.14 Added uninstaller. V1.13 Better error handling. V1.12 Signal handling bug in d4lib.c corrected. Added d4Reset (reset printer via d4 communication). Little bugs in Configure corrected. Corrected rldp.c bug and added test for called programs (security hole). V1.11 Cleanup, modified the name of top directory and included graphical configuration and installation. Installation include also file for preloading of our libraries. V1.10 File d4lib.c modified, the printer may expect packets as through a single write. With a printer only I had no troubles. The preloading of the library file was not correct. Added defines in d4lib.h and produce 2 kinds of *.o files, one with references to open,... the other with references to the mOpen,... functions. V0.09 Various modifications (internal version). V0.08 Bug in d4libc.c corrected. First version of the file d4libh.c, a higher level interface. d4stat and d4print modified (problems with the buggy firmware of the Stylus Scanner 2500). Temporary add of scanTest.c (test of IEEE communication for scanner). V0.07 Modified reading of data, work around for buggy USB-printer driver on the 2.2 kernel. V0.06 Added d4stat, reading of status informations for the printer. Various little modifications. V0.05 Modified reading timeout. Modified a few commands (EPSON doesn´t comply to the IEEE spec). Added a lib file. Added the programs d4Print and enterD4 (only for testing) V0.04 Added signal handling, Modification for creditRequest. V0.03 Better error handling. Comments inserted. V0.02 Added time out for writing (printer of). Modified the read function, so we will also leave the read function if there are problems. A few other changes. Added the script genBSStream.sh for test purpose. More in this file. ================================================================= This little program allows printing on combined printer scanner from EPSON. This program requires a bidirectional communication with the device. Due to this you can not redirect the output of this program. The device will be opened by d4Print and the data are to be send via a pipe. Compiling and installation: --------------------------- O Edit the file Makefile, set the correct path for the output device, for example: DEVICE=-DDEVICE=\"/dev/usblp0\" At this time the way is wrong and will be made better at a later release. Attention: on a 2.2.17 kernel this program don´t work if you don´t set the KERNEL_USB_BUG define A test with the 2.4.3-20 Kernel from Mandrake 8.0 was OK (USB printer port). With the /dev/lp? port the program works mostly fine. O call make and then make install. Binding within your print system (lp lprNG): -------------------------------------------- O Modify the /etc/printcap so that the output is not /dev/lp0 or whatever but /dev/null. O Modify the filter entry of the /etc/printcap file :fi=/var/lib/apsfilter/bin/<FILTER>: to :fi=/var/lib/apsfilter/bin/<FILTER>.d4: O Create a new filter named /var/lib/apsfilter/bin/<FILTER>.d4 with following content: ----------------------------------------------------------------- #!/bin/sh /var/lib/apsfilter/bin/<FILTER> "$@" | /usr/bin/d4Print ----------------------------------------------------------------- O Make this script executable chmod +x /var/lib/apsfilter/bin/<FILTER>.scan Printing via CUPS: ================== Printing via cups can be done, but you must modify CUPS a little bit and use a special driver for my XW_TOOLS. This can be send on request. It is also possible to use the provided CUPS driver if a new backend filter is provided. The file d4Parallel is a little script which can be used for taht and will automatically installed if CUPS is detected. Printer to choose: ================== The Stylus Scanner are compatible with the Stylus Color 740. Copyrights: =========== Please refer to the GPL, which shall apply. Author: ======= Jean-Jacques Sarton jj.sarton@t-online.de Background: =========== The EPSON printer, scanner and printer scanner use the IEEE 1284.4 standard in order to communicate over more logical channel with the attached device. A printer has 3 channels: 0 the transaction channel 2 the EPSON-CONTROL channel 64 the EPSON-DATA channel used for printing. The Stylus Scanner has one more: 80 the EPSON-SCAN channel If you use the USB port, you don´t need to have a special handling for the scanner part of an EPSON Stylus Scanner. At this time I have not made support for the scanner. Getting data from the parallel port require a better speed as the mimic build into the lp driver. You will need a 2.4 Kernel and modified scanner applications. After opening the IEEE 1284.4 communication. the program opens a connection to the EPSON-DATA channel and sets the size of the used communication channels according to the reply send by the printer. The next step is to get a credit (number of packets which can be send) and then to send the data read from standard input. I have used a relatively new IEEE 1284.4 document for implementing this program, the spec. used by EPSON seem to be older and there are little differences. The OpenChannel and CreditRequest commands were modified in order to comply with the command expected by EPSON (the reply message includes a value which is not mentioned in the OpenChannel description but seems to be necessary). Scanner: ======== Please use the USB port and the software provided under your distribution. Kernel Bug found the USB printer module: ======================================== All 2.2 kernel I know and the first release of the 2.4 kernel are not correct regarding the read call. This bug was corrected in the last version of the 2.4 kernel. You can also eliminate this bug by modifying the sources and recompiling the modules Moddify the file /usr/src/linux/drivers/usb/printer.c static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t *ppos) { struct usblp *usblp = file->private_data; .... if ((usblp->readcount += count) == usblp->readurb.actual_length) usb_submit_urb(&usblp->readurb); return count; } to static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t *ppos) { struct usblp *usblp = file->private_data; .... if ((usblp->readcount += count) == usblp->readurb.actual_length) { -- usblp->readcount = 0; --------------------------- usblp->readurb.dev = usblp->dev; -------------------------------------- usb_submit_urb(&usblp->readurb); } ---- return count; } The modifications are underligned so you can see what is to be inserted. Generated files: ================ d4lib.o Files that may be bound directly by applications d4libh.o d4Print Filter which gets input from a pipe and send the data to the printer. d4Stat Read status information from the printer and remaining ink quantity. Both files are installed in /usr/bin. d4Reset Reset the printer, installed in /usr/bin. d4Id Print the name of the attached ptinter, installed in usr/local/bin. Other files: ============ d4Parallel This file is a backend for the CUPS system. d4Parallel call, if no arguments are passed the parallel backend and prnt out the informations returned by parallel witj little modifications which make shure that the d4Parallel port will be called for the printers which has to use the D4 protocol. If arguments are passed, d4Parallel ignore all passed arguments and call d4Print. The d4Parallel backend is recognized by CUPS so there is no need to use other tools in order to make it working. After the Installation of this backend you must stop and start CUPS again. Building own applications: ========================== If you build own applications you may bind the *.o files. October 13 2001 Jean-Jacques Sarton