Printer Connection Problem

Guy Harris guy at gorodish.Sun.COM
Sat Jul 16 12:18:45 AEST 1988


> lp|lw|ps|PostScript:\
> 	:lp=/dev/ttya:br#19200:rw:\
> 	:fc#0000374:fs#0000003:xc#0000000:xs#0040040:\
> 	:mx#0:sf:sh:

The mode settings from your "printcap" entry say to:

	turn off EVENP, ODDP
	turn off RAW
	turn off CRMOD
	turn off ECHO
	turn off LCASE
	turn on CBREAK
	turn on TANDEM
	turn on LITOUT

Turning on LITOUT makes the setting of EVENP and ODDP totally irrelevant; it
puts the hardware into 8 bits, no parity mode.  It also makes the setting of
CRMOD and LCASE irrelevant; both of those modes affect special processing of
characters on output, but LITOUT turns off all that processing.

Turning on TANDEM turns on XON/XOFF flow control *TO* the computer, so that if
characters are sent *to* your machine faster than it can process them, it will
try to send out ^S to stop the incoming flow.  (The way this is implemented in
the Version 7 and BSD tty drivers is that it sticks the ^S on the output queue;
this means that if there's other output ahead of it it may not get out for a
while.  The S5 and 4.0 drivers let the ^S "jump the queue".)

This looks like a reasonable set of modes for a laser printer such as that.

> What I don't know is whether to trust what /usr/5bin/stty is telling me
> about that port after refiring up the lpd.

Given that you're not running 4.0, I would suggest that you trust what
"/bin/stty" says instead.  The native mode bits of the pre-4.0 tty driver are
the 4.3BSD ones; the S5 one emulates them.

> It says:
> 
> }112 drd:/etc# /usr/5bin/stty -a < /dev/ttya
> }speed 19200 baud; line = 0; intr = ^c; quit = ^|; erase = DEL; kill = ^u;
> }eof = ^d; eol = ^`; swtch = ^z
> }parenb -parodd cs7 -cstopb -hupcl cread -clocal -loblk 
> }-ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc 
> }ixon ixany -ixoff 
> }isig icanon -xcase echo -echoe echok -echonl -noflsh 
> }opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel 
> 
> I *think* it's saying that even parity is turned on and ignore parity is
> set and that xoff is off.  The man page fails to mention what ANY of
> these codes mean.

You must be looking at the wrong man page; you want either TERMIO(4) or
STTY(1V).  Those describe the S5 tty driver modes, as emulated by SunOS 3.x, or
the S5 "stty" command to set and print them.  TTY(4) and STTY(1) describe the
V7/BSD tty modes, so it's not surprising that it "fails to mention what ANY of
those codes mean" since they're not V7/BSD modes.

However, if it *is* telling the truth, it's saying that the modes specified by
the "printcap" entry are NOT in effect.  It says "cs7" and "parenb", meaning
it's set up for 7 bits plus a parity bit; if LITOUT were on, it should say
"cs8" and "-parenb".  It also says "-ixoff", meaning that TANDEM is off.

Again, I would suggest

	/bin/stty everything >/dev/ttya

to get the "native" modes; it is conceivable that there might be a bug
somewhere in the S5 emulation that causes "/usr/5bin/stty" not to tell the
truth, although I don't expect that to be the case (I just tried setting
"tandem" and "litout on a 3.5 machine and running "/usr/5bin/stty -a", and it
reported "cs8", "-parenb", and "ixoff").

> I tried switching to the DTR (hardware) mode of flow control by clearing
> the TANDEM bit in the flag in the printcap and selecting DTR at the
> printer.  I killed and restarted the lpd.  Is there anything else that I
> must do to make the tty recognize DTR and send DSR?  Anyway, this action
> didn't help matters any.

Well, that's not going to work; turning TANDEM mode off doesn't switch to DTR
flow control.  *Nothing* switches to DTR flow control; SunOS doesn't support
it, so there's nothing you *can* do to make the tty recognize DTR as a
flow-control line.



More information about the Comp.unix.questions mailing list