*BSD News Article 10687


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA484 ; Sun, 31 Jan 93 14:10:46 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!swrinde!elroy.jpl.nasa.gov!decwrl!csus.edu!netcom.com!alm
From: alm@netcom.com (Andrew Moore)
Subject: Re: [386BSD] Parallel port driver?
Message-ID: <1993Feb2.181331.7320@netcom.com>
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <1993Feb1.182134.12503@netcom.com> <1993Feb2.050853.25091@cc.umontreal.ca>
Date: Tue, 2 Feb 1993 18:13:31 GMT
Lines: 100

In article <1993Feb2.050853.25091@cc.umontreal.ca> you write:
>Ok, I got Eric Haug's patches installed, ... made kernel...         
>but now when I print, using lpr, it just flushes me 2 blank pages.
>and with cat whatever > /dev/lpt1 I get a blank page...

Congratulations!  You are talking to your printer!

>I went on agate and got Terry's lp.c driver... 

Terry says don't use this one.

Here is a recent article from c.u.b. that may provide a clue:


>I successfully installed the lp patches, and the port is seen.
>But when I print, the port or printer seem to just hang. The form feed
>light on the laser comes on, but that is all. Nothing else happens.
>lpc reports the status as printing, but thats it. If I cat directly to 
>/dev/lp ( set up as c 14 0) the same happens.
>
>Can anyone please help me ?


abs@cs.sun.ac.za.
----------

Yes!

   Probably the CR definition of the laserjet isn't setup correctly.
I use an input filter script to set all the correct parameters on the ljet.

here is my /etc/printcap file:
------------------------------ /etc/printcap ----------------------------

#	@(#)printcap	5.3 (Berkeley) 6/30/90

lp|local line printer:\
	:lp=/dev/lpt1:sd=/var/spool/lpd:lf=/var/log/lpd-errs:sh:\
	:if=/usr/local/filters/if_ljet3:\
	:vf=/usr/local/filters/vf_lett3:\
	:df=/usr/local/filters/df_ljet3:
------------------------------------------------------------------------
And this is my homebrew if= input filter script:
( be shure you have the execve magic number patch installed, otherwise
  #!/bin/sh will not work!)
-------------------------- /usr/local/filters/if_ljet3 -----------------

#!/bin/sh
printf "\033E\033&k2G"
cat -
printf "\033E"
--------------------------------------------------------------------------
And here an filter that attempts to print two pages side by side. (use lpr -d)
------------------------- /usr/local/filters/df_ljet3 --------------------

#!/bin/sh
# Page layout variables
LINES=76
TOPMARGIN=5
LEFTMARGIN=0
VMI=5
GUTTER=7
# internal variables: DO NOT CHANGE
width=`expr 162 + 2 \* $GUTTER`
# Reset the printer
printf "\033E"
# set line termination to cr->cr; lf->cr+lf; ff->cr+ff
printf "\033&k2G"
# select landscape orientation
printf "\033&l1O"
# setup the page: vmi, enable perf skip
printf "\033&l${VMI}c1L"
# Top margin TOPMARGIN lines
printf "\033&l${TOPMARGIN}E"
# Text Length $LINES lines
printf "\033&l${LINES}F"
# left margin of LEFTMARGIN chars
printf "\033&a${LEFTMARGIN}L"
# select 16.6 pitch font
printf "\033(s16.6H"
cat - | sed "//d" | pr -2 -n:${GUTTER} -w${width} -e -f -l${LINES}  -v -
printf "\033E"
---------------------------------------------------------------------------

Hope this helps,

Reinier Kleipool.


  /\
-(  )-/##---------------------------------------------------------------------
  }{/   ##    One has to look out  -- Overschie ------------------------------
..====.        for engineers- they  -- Reinier Kleipool  ----------------------
| [] |   begin with sewing machi-  -- Mail -----------------------------------
|    |   nes and  end up with the  -- X400: C=nl A=400net P=hp O=hp S=Kleipool
|    |   atomic bomb.....          -- desk: Reinier Kleipool/ hpitcb/75     --
| [] |              Marcel Pagnol  -- unix: reink@hpuamsa.neth.hp.com       --
------------------------------------------------------------------------------