[unix-pc.general] Adding new printers to lpsetup on 3b1

erict@flatline.UUCP (j eric townsend) (07/10/88)

Hardware:  3b1, Unix rel 3.0, Legend 808 printer on parallel port.

I'd like to add an entry to the lpsetup for my printer, but I don't
see any way to do it....

I'm running it on "Epson" now, "Other" worked fine too, but I'd like
to take advantage of some of the special functions of my printer
instead of just having a raw dump device.  I'd also like to
take advantage of anything that lp does to format the output.

Any ideas/suggestions?  Email me and I'll summarize.
-- 
Skate UNIX or go home, boogie boy...
J. Eric Townsend ->uunet!nuchat!flatline!erict smail:511Parker#2,Hstn,Tx,77007
             ..!bellcore!tness1!/

lenny@icus.UUCP (Lenny Tropiano) (07/11/88)

In article <1074@flatline.UUCP> erict@flatline.UUCP (j eric townsend) writes:
|>
|>Hardware:  3b1, Unix rel 3.0, Legend 808 printer on parallel port.
|>
|>I'd like to add an entry to the lpsetup for my printer, but I don't
|>see any way to do it....
|>
Well as far as my trusty string table of /usr/bin/lpsetup tells me, you
can look in /etc/printers.  Here's an excerpt:

25 27
ATT455 dumb Parallel
ATT457 dumb Parallel
ATT470 dumb Parallel
ATT471 dumb Parallel
...
ATT435 dumb_S Serial
ATT455 dumb_S Serial
ATT458 dumb_S Serial
ATT475 dumb_S Serial
ATT476 dumb_S Serial

The first number is the # of parallel printers, and likewise the second
number is the number of serial printers.  The format is:

PRINTER_NAME INTERFACE_NAME CLASS_NAME

lpsetup (running as setuid "lp") does a:

/usr/lib/lpadmin -pPRINTER_NAME -i/usr/spool/lp/model/INTERFACE_NAME \
	-cCLASS_NAME -v/dev/XXXX 2> /dev/null
enable PRINTER_NAME > /dev/null 2>&1
/usr/lib/accept PRINTER_NAME CLASS_NAME > /dev/null 2>&1

You can do this by hand if you like.

|>I'm running it on "Epson" now, "Other" worked fine too, but I'd like
|>to take advantage of some of the special functions of my printer
|>instead of just having a raw dump device.  I'd also like to
|>take advantage of anything that lp does to format the output.
|>
All the lp program does is run the output to a shell script (or INTERFACE)
in the /usr/spool/lp/model/ directory.  If you look at 
/usr/spool/lp/interface/Epson you will see it just has some shell commands.

If you need to do some "tricky" formatting stuff, the interface is where
to stick those commands.  (ie.  If you wanted to turn on compressed mode
for your printer, and you knew the escape sequence, you could just do an:

echo "\033\XXX"  replacing XXX with the escape sequence to do your function.

|>Any ideas/suggestions?  Email me and I'll summarize.

I thought this would be worthwhile for the entire net...

-Lenny

-- 
Paper-net: Lenny Tropiano          | @-net:         lenny@icus.UUCP
           ICUS Software Systems   | !-net:      ...att    \
           PO Box 1                |                boulder \
           Islip Terrace, NY 11752 |                talcott  !icus!lenny
Vocal-net: (516) 582-5525 [work]   |                pacbell /
           (516) 968-8576 [home]   |                sbcs   /
Telex-net: 154232428 ICUS          | Another-net:   attmail!icus!lenny

cals@cals01.zone1.com (Charles A. Sefranek) (07/15/88)

In article <419@icus.UUCP> lenny@icus.UUCP (Lenny Tropiano) writes:
> ...
>All the lp program does is run the output to a shell script (or INTERFACE)
>in the /usr/spool/lp/model/ directory.  If you look at 
>/usr/spool/lp/interface/Epson you will see it just has some shell commands.
>

BE ADVISED - There is a bug in the standard dumb_S printer model as
shipped with the machine (3.51 OS). This model is also the template used
when other printers are installed via the UA. The full path name is:
	/usr/spool/lp/model/dumb_S

	The problem ?  The shell commands to send the banner page out to
the printer are done BEFORE the proper printer baud rate is set up!!
Because the default rate is 9600, if you set your (serial) printer up for
that, you won't see the problem. My printer was set for 2400 baud, and I
noticed the problem when I tried to do a "lp -t " to put a title on my
print-outs.
	Oh yeah, the page separator that is used is longer than 80
characters, so that comes out a little messed up too.  I wonder what
else is messed up in the software shipped with the machine?? (I'm 
currently working on the UA Backup script - it has some SERIOUS problems)!!
	If anyone is really concerned about the printer script, email me
and I will send you my hacked-up version. Enough requests and I'll post.

-- 
   	Charlie Sefranek		      c4s@rayssdb.ray.com   (Work)
					    cals@cals01.zone1.com   (Home)
	{sun,cb-att,decuac,gatech,necntc,ukma}!rayssd!rayssdb!c4s   (Work)
{sun,cb-att,decuac,gatech,necntc,ukma}!rayssd!galaxia!cals01!cals   (Home)

-- 
-- 
   	Charlie Sefranek		      c4s@rayssdb.ray.com   (Work)
					    cals@cals01.zone1.com   (Home)
	{sun,cb-att,decuac,gatech,necntc,ukma}!rayssd!rayssdb!c4s   (Work)
{sun,cb-att,decuac,gatech,necntc,ukma}!rayssd!galaxia!cals01!cals   (Home)