Printer Connection Problem (really: how to use stty with lpd)

Mark Lawrence mark at drd.UUCP
Wed Jul 20 08:15:33 AEST 1988


In article <60198 at sun.uucp> guy at gorodish.Sun.COM (Guy Harris) wrote:

	a lot of helpful things about termio, tty's and stty in order to
	help me figure out what the blazes is happening between and NEC
	LC-890 PostScript printer and my Sun 3/260.  A large part of the
	problem was my naivete about how to properly use stty and system V
	cousin (unix tools are like a two-edged sword: parry and thrust and
	sometimes lop one's own foot off).  Anyway, in my little over two
	years of experience with Unix, I never knew the following about how
	to use stty properly with serial ports that the line printer daemon
	deals with and thought it might be generally useful.
	
>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.

	It turns out that stty (1V) simply brings up stty (1) which of course
	mentions nothing about termio(4).  tty(4) gives no cross reference
	either.  Guy's pointer was invaluable.  Another thing the man pages
	don't clue you into is the proper use of the < and > when using stty.
	With /bin/stty, the use is counter-intuitive, IMHP.

I did not realize that the serial in port in question had to be queried
*while* a print was in progress.  Lpd evidently sets the port characteristics
for every job and then resets them.  I, of course, queried the port while
it *wasn't* printing.  Following the right method (and running the
interface at 19200), I get:

	old tty, speed 9600 baud, 0 rows, 0 columns
	even odd -raw -nl echo -lcase -tandem tabs -cbreak 
	-nopost -noisig -stopb 
	erase  kill   intr   quit   stop   eof
	^?     ^U     ^C     ^\     ^S/^Q  ^D  

and

	new tty, speed 19200 baud, 0 rows, 0 columns
	-raw nl -echo -lcase tandem tabs cbreak 
	-crtbs -crterase -crtkill -ctlecho -prterase -tostop 
	-tilde -flusho -mdmbuf litout -pass8 -nohang 
	-pendin decctlq -noflsh 
	-nopost -noisig -stopb 
	erase  kill   werase rprnt  flush  lnext  susp   intr   quit   stop   eof
	^?     ^U     ^W     ^R     ^O     ^V     ^Z/^Y  ^C     ^\     ^S/^Q  ^D   

before and during the print job from /bin/stty.  Also during the print, I get:

	speed 19200 baud; line = 0; intr = ^c; quit = ^|; erase = DEL; kill = ^u; eof = ^a; eol = ^`; swtch = ^z
	-parenb -parodd cs8 -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 

from /usr/5bin/stty.  I guess this is what is meant by learning the
right incantation.  

Question:  Is there a convenient way to monitor what is coming back from
the printer to see if it is issuing any XOFF's so that I may eliminate
flow control as the source of my problem?  I'd like to verify that the
tty driver is truly suspending output so that I can go back to the
printer manufacturer and ask WTFO.

 Mark--
-- 
 DRD Corporation                     | [uunet!apctrc,romed,tulsun]!drd!mark
 6111 East Skelly Drive Suite 415    |     apctrc!drd!mark at uunet.UU.NET
 Tulsa, OK 74135       (918)664-9010 |      mlawrence at jarsun1.ZONE1.COM
+------------------------------------+--------------------------------------+



More information about the Comp.unix.questions mailing list