From owner-freebsd-questions Wed Jan 17 12:42:02 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA06764 for questions-outgoing; Wed, 17 Jan 1996 12:42:02 -0800 (PST) Received: from croute.com (ishm2.croute.com [199.97.106.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA06756 Wed, 17 Jan 1996 12:41:54 -0800 (PST) Received: from by croute.com (4.1/SMI-4.1) id AB22754; Wed, 17 Jan 96 14:49:56 CST Received: from COMPUROUTE/SpoolDir by bldg1.croute.com (Mercury 1.13); Wed, 17 Jan 96 14:44:41 +600 Received: from SpoolDir by COMPUROUTE (Mercury 1.13); Wed, 17 Jan 96 9:41:05 +600 From: "Larry Dolinar" Organization: CompuRoute, Inc. To: questions@freebsd.org Date: Wed, 17 Jan 1996 09:41:01 +600 CDT Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Re: printer and parallel port problems Cc: freebsd-questions@freebsd.org X-Confirm-Reading-To: "Larry Dolinar" X-Pmrqc: 1 Priority: normal X-Mailer: Pegasus Mail v3.22 Message-Id: <14ED9F6113@bldg1.croute.com> Sender: owner-questions@freebsd.org Precedence: bulk Thus spake Doug White (Tue, 9 Jan 1996): | On Mon, 8 Jan 1996, Chris Warth wrote: | | > Can anyone suggest a simple test to see if the parallel port is even | > working? In the meantime I'll try to load windows to see if that can | > talk nicely to the printer. | | Find a big (>1 pg) document and cat it out: | | cat bigdocument > /dev/lpt0 | | If it prints then it's not your printer. | | I'd recommend checking out the Printing guide in the Handbook. It goes | through setup and testing step-by-step, very well put together IMHO. | 1. Make sure irq 7 isn't used by anything else, or use lptcontrol to set the mode to polled. Without reconfig'ng the kernel, polled is much preferrable. 2. Create a simple /etc/printcap as follows; mine's for an HP 540 inkjet (parenthetical comments for reference ONLY): # lp|HP Deskjet 540:\ :lp=/dev/lpt0:\ (output device) :sd=/var/spool/lpd:\ (spool directory) :lf=/var/log/lpd-errs:\ (log file) :if=/usr/local/libexec/if_dj_540:\ (input filter, see comments) :tr=\f:\ (trailing string, " ) :sh:\ (suppress banner) :mx#0: (unlimited job size) The input filter (if) could be anywhere; this one just adds CR to the normal LF sequence of unix: without it, most printers will just stair-step the output, and page printers (lasers/inkjets) will truncate the line. The trailer (tr) is used when the queue empties. I found that the form feed (\f) was basically required for the HP to print properly. 3. Make an input filter similar to the following: # if_dj540 simple parlor trick to add CR to LF for printer # awk '{printf "%s\r\n", $0}' - For those of you that don't see quite what this does: every line of standard input is printed with CRLF attached. There are certainly more elegant ways of doing it, but this one avoids the approach of reprogramming the printer to append CR to LF, then having to undo it at the end of every job (unless you dedicate your printer to FreeBSD 8) ). 4. Just lpr and you should be there... cheers, larry