[comp.sys.sun] Epson printers on the Sun

pcl%robots.oxford.ac.uk@nss.cs.ucl.ac.uk (Paul Leyland) (12/21/88)

trwspp!spp2!sol!rroux@cs.ucla.edu says:
> I have a Sun 3/50 running SunOS 4.0 and I've attached an Epson FX-80
> printer to it via a serial-to-parallel converter....
> It basically works, except that data at the end of the file that's being
> printed is usually lost....

Yep, we had a  similar problem with our  Epson EX1000 (a  very similar
machine, just a bit newer with a wider carriage).  We fixed it when we
noticed that the ready light wasn't flashing as expected.  The trouble
was  that  the XON/XOFF  handshaking  didn't.  The  following printcap
entry  fixed  it and has  given  us completely reliable communications
since.
____________________

# Epson EX1000 over a tty line.
lp|epson:\
	:lp=/dev/ttyb:\
	:br#9600:fc#0177777:fs#0000002:xc0177777:xs0040440:\
	:tr=\f:of=/usr/lib/lpf:lf=/usr/adm/lpd-errs:
____________________

The downside is that we cannot now use 8-bit (RAW mode) communications
which makes  graphics a bit  trickier.   One day,  I'll  get round  to
writing  a  filter which sets the  interface  in RAW mode  and handles
XON/XOFF coming from the printer, but never meddles with any character
going out.  Why can't the UNIX tty driver provide such an environment?
Surely it must be useful in other circumstances.

Hope this solves your problem.

Paul

guy@uunet.uu.net (Guy Harris) (01/04/89)

 >The downside is that we cannot now use 8-bit (RAW mode) communications
 >which makes  graphics a bit  trickier.   One day,  I'll  get round  to
 >writing  a  filter which sets the  interface  in RAW mode  and handles
 >XON/XOFF coming from the printer, but never meddles with any character
 >going out.  Why can't the UNIX tty driver provide such an environment?
 >Surely it must be useful in other circumstances.

It is useful.  In fact, it's so useful that Berkeley implemented it
somewhere between 4.1BSD and 4.2BSD (and, in 4.3BSD, got rid of the bug
that required you to do an extra "ioctl").  It's supported in all SunOS
releases that I know of (*sans* the bug in question).

See the LITOUT mode in TTY(4) (releases up to but not including 4.0), or
either the LITOUT mode in TTCOMPAT(4M) or a variety of modes in TERMIO(4)
(4.0 and later).

LITOUT gives you a full 8-bit output data path, and performs no processing
on output whatsoever (no tab expansion, no NL->CR/LF mapping, no nothing).
It does not, however, turn XON/XOFF processing off.  It's one of the
"local mode bits", so it should be set with the "xc" capability in
"/etc/printcap" (see PRINTCAP(5)).

In 4.0, the "mc" capability in "/etc/printcap" permits you to set the
modes without having to look up (or, haha, remember) what the octal values
for the various bits are; you can give an "stty"-like specification for
the modes.  If you set "cs8" and clear "parenb", you will get 8 bits and
no parity bit on output; if you set "ixon", you will get XON/XOFF flow
control.  You will, unless you turn "opost" off, get output processing
performed (tab expansion, etc.).  Or, if you just want LITOUT, say
"litout" and be done with it.