Richard Scott <Richard.W.Scott@corp.sun.com>
John Ellithorpe firstname.lastname@example.org
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)
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:
3. Create a directory in /var/spool called hp
4. Create the following file in /usr/lib called hplaserjet:
# @(#)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'
if ($status == 0) then
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
$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
* hardware flow control is not listed for setup.
+-----+ TITLE : Unix Systems Administrator
LSI|LOGIC| SUN ID : allen@lonfs01
| | MILSYS ID : talbot@milsys01
+-----+ INTERNET : email@example.com
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