summary printcap entries

From: benetton (lsil!mhost!lonfs01!allen@fernwood.mpk.ca.us)
Date: Tue Jun 22 1993 - 08:04:46 CDT


thanks to
Richard Scott <Richard.W.Scott@corp.sun.com>
John Ellithorpe jdell@maggie.mit.edu
for your printcap contributions:

i asked for a printcap entry for a hp laserjet II and here is the
winning entry from richard....
Printing to an HP LaserJet II/III Printer with SunOS 4.x
==========================================================

Here is a step-by-step procedure for setting up the HP LaserJet printer to
print from Sun Microsystems workstations. Although Sun Microsystems, Inc.
provides these steps for the HP LaserJet, the printer is not officially supported.

1. Edit /etc/ttytab and ensure that the following entry is set for
    the tty port that you are connecting the HP to. Assumed that
    the printer is connected to ttya.

ttya "/usr/etc/getty std.9600" unknown off secure (4.0 - 4.0.3 SunOS)

            or

ttya "/usr/etc/getty std.9600" unknown off local secure (4.1-4.1.x SunOS)

2. Edit /etc/printcap and add the following entry:

    lp|hp|hplj|HP_LaserJet:\
        :lp=/dev/ttya:sd=/var/spool/hp:\
        :br#9600:tr=\f:mx#0:sh:\
        :ms=-parity,-cstopb,-clocal,-cread,ixon,-opost:\
        :of=/usr/lib/hplaserjet:

3. Create a directory in /var/spool called hp

4. Create the following file in /usr/lib called hplaserjet:

        #!/bin/csh -f
        #
        # @(#)hplaserjet 1.1 88/10/27 Sun Microsystems Inc 1988
        # This is the output filter form used with HP LaserJet II.
        # All it does is send the escape sequence to the printer, so that:
        # CR is mapped to CR
        # LF is mapped to CR LF
        # FF is mapped to CR FF
        /usr/bin/echo -n 'k2G'
        /usr/bin/cat
        if ($status == 0) then
                exit 0
        else
                exit 1
        endif

    NOTE: Before the characters k2G perform the following commands in "vi":

    CTRL- v CTRL-[ & (In insert mode: Press the CTRL key and the v key at
    the same time, then let go. Do the same for CTRL - [ then type &)

    *CTRL- v is a "vi" specific command to imbed an escape code into the file.

    /usr/bin/echo -n '^[&k2G' This is how you would see it in "vi"
    /usr/bin/echo -n 'k2G' This is how you would see it by doing
                                 a cat of hplaserjet

    This is a good check to make sure the escape characters are inserted
    correctly.

6. Type
                $lpc restart lp
                $lpc up lp
        
    Now you can lpr a test file.

7. If for some reason lpr does not print a file try the following process
    to test the connection between the computer and the printer:

    a. Type this command: (stty -parity 9600; cat /etc/motd) > /dev/ttya

    b. On the HP printer, eject the current page by taking the printer off
        line, pressing FF and then placing printer back on line. A page
        should have ejected with at least one line of information.
                

8. If the above steps didn't work, then verify the printcap entries with the
    hplaserjet file. Make sure that the permissions are set correctly on all
    of the files, spool directory, and serial device. If the above steps did
    not work, then check the cable between the Sun and the printer. The basic
    cable should be setup like this:

                        2 -------- 3
                        3 -------- 2
                        7 -------- 7

9. The HP LaserJet should be setup in the factory default settings as follows:
                
        RS232 mode enabled
        Baud Rate=9600
        DTR Polarity=HI
        I/O=Serial
        Robust XON=ON

      * hardware flow control is not listed for setup.

Yours faithfully,

Allen Talbot
   +-----+ TITLE : Unix Systems Administrator
LSI|LOGIC| SUN ID : allen@lonfs01
   | | MILSYS ID : talbot@milsys01
   +-----+ INTERNET : a.talbot@lsi-logic.co.uk
                    PHONE DIRECT : 0344 413234
           PHONE VIA SWITCHBOARD : 0344 426544 ext 3234



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:57 CDT