SUMMARY:Setting up parallel printer

From: Lau, Victoria H (vlau@msmail2.hac.com)
Date: Tue Aug 01 1995 - 06:55:18 CDT


About 10 days ago, I posted a question on how to set up a parallel
printer on Solaris 2.X. I only received one response from Monty B.
Peffley. I came across a SUMMARY on a similar print problem posted by
Andrew Watkins so I emailed Andrew directly for help. Both responses
are posted at the end of the summary. I would like to thank both of
you for your time and valuable information.

I'd also contacted SUN technical support (Chris and Cindy) who
helped me patiently in setting up the printer *almost* to the way
which my clients had requested, except for printing raster files.

I WELCOME any comment on the solution.

====================================================================
Original question:

OS: Solaris 2.3
HW: C3 4/600
Printer: TI MicroPro 600, parallel, supports PS level 2 and HP
Parallel port: CoALM (/dev/term/8)

I'd used the manual procedures to set up a local parallel printer. The
lp service acknowleged the print job; the printer went through the cycles
of "Processing data...Waiting...Idle" but no output; lpstat showed the
job was still in the queue [...info deleted...] I can print ASCII and
PS files with "cat filename > /dev/term/8."

====================================================================
SOLUTION:

Install lp jumbo patch 101317-10 on the print server and all print
clients.

Set up local printer
====================
[I'm using /dev/term/8 as my parallel printer port; my printer name
is lz101, and print server name is tchs]

# Make sure lp jumbo patch has been installed

  showrev -p | grep 101317-10

# Make lp own the port device and the only user who can access
# the printer port

  chown lp /dev/term/8
  chmod 600 /dev/term/8

# Give the local printer a unique name--note that we use "-T unknown"
# and not PS for it did not work for us, even though we have a PS
# printer

  lpadmin -p lz101 -v /dev/term/8 -T unknown -I postscript

# Establish lz101 as the default printer

  lpadmin -d lz101

# Attach a description to the printer

  lpadmin -p lz101 -D "Local coalm parallel printer"

# Initialize the print filters (to be done ONLY ONCE on a local
# printer when you set up the first printer on this node, unless
# other printers on this node require different filters which
# you must create (this will create a roadmap /etc/lp/filter.table)
# [I'm using csh]

  cd /etc/lp/fd

  foreach i (`ls | sed 's/.fd$//'`)
  ? lpfilter -f $i -F ${i}.fd
  ? end

# Shut down the lp services to edit the printer file,
# /etc/lp/interfaces/lz101

  lpshut

  cd /etc/lp/interfaces

  vi lz101

  [Search for "case "${TERM}" in" and add the following stack ABOVE
  PS | PSR--this is required if you want to print a cover page.
  We'll create a filter to convert the ASCII cover page to postscript
  and also to send a ^D to notify the printer of the end of the cover
  page...I also changed the font and font size of the cover page
  text]

    case "${TERM}" in
    unknown )
      banner_filter="/usr/lib/lp/postscript/postprt -fTimes-Roman -s18"
      LPTELL_OPTS="-l"
      ;;
    PS | PSR )
      banner_filter=....

  [Optional: Search for "regular_banner ()" and replace the original
  code with the following--sample only!!!]

    # THE title VARIABLE FROM PRINT JOBS SUBMITTED FROM PRINT
    # CLIENTS INCLUDES DUPLICATION OF THE NODE NAME--WE WANT TO CUT
    # THAT OUT
    echo ${title} > /tmp/title.$$
    title=`cat /tmp/title.$$ | sed '2,3d'`
    rm /tmp/title.$$

    echo "${CR}\c"
    echo "${NL}\c"
    echo "${NL}\c"
    echo "${NL}\c"
    echo "${NL}\c"
    echo "=================================================="
    echo "${NL}\c"
    echo "User: ${user_name}${NL}\c"
    echo "${NL}\c"
    echo "Date: `date '+%a %H:%M %h %d, 19%y'`${NL}\c"
    echo "${NL}\c"
    echo "File: ${title}${NL}\c"
    echo "${NL}\c"
    echo "=================================================="

  [Go to the end of the printer document and add the following line
  ABOVE ${DRAIN} to send a ^D to the printer to notify it of the
  end of document--to type ^D in vi: hold down CTRL key, type VD.

    /usr/ucb/echo -n "^D"

    ${DRAIN}
    exit_code=0 exit 0

  [COMMENT: If you do not want to turn on the banner/cover page,
  search for "nobanner" and change the "no" to "yes"]

# Create the filter for the cover page:

  cd /usr/lib/lp/postscript

  vi postprt
  #!/bin/sh
  /usr/lib/lp/postscript/postprint $1 $2 $3 $4 $5 $6 $7
  /usr/ucb/echo "^D"

  [To create ^D in vi: hold down CTRL key and type VD]

  chmod 755 postprt

  chown lp postprt

  chgrp lp postprt

# Restart the scheduler

  /usr/lib/lpsched

# Enable printer to accept print requests

  accept lz101

  enable lz101

# Check msgs displayed to verify that the printer is accepted and
# enabled

  lpstat -t

  lpstat -p -l

*******************
I don't quite understand why I can't use the lp options at this point.
I hope someone could advise me on this. Thank you--Vicky Lau
*******************

# The lp command does not accept any options except:
# -t filename: to print the filename on the cover page
# -d printer: to select a printer
# We use a combination of pr (to print file name and page number
# on every text page), postprint (to use its options), and lp
# to send a job to print--the following shows a few of these examples

# Print in landscape mode
  pr filename | /usr/lib/lp/postscript/postprint -y0 -pland \
    -l46 | lp -t filename -d printer_name

# Print in vertical mode
  pr filename | /usr/lib/lp/postscript/postprint -y0 -l64 | \
    lp -t filename -d printer_name

# Print in vertical mode with 1-inch left margin for 3-ring binders
  pr filename | /usr/lib/lp/postscript/postprint -x1.0 -y0 -l64 | \
    lp -t filename -d printer_name

# Print in vertical mode with a different font and font size
  pr filename | /usr/lib/lp/postscript/postprint -y0 -l64 \
    -fTimes-Roman -s12 | lp -t filename -d printer_name

# Print file without header on the text page
  lp -d printer_name filename

Set up printer server
=====================

# To enable all clients to access the server (this command adds an
# entry into /etc/lp/Systems
# The type "-t" must be bsd, even for System V or Solsaris 2.X, or
# you would run into a lot of trouble (per Sun)

  lpsystem -t bsd +

# Verify if the server is running--status for tcp must be ENABLED

  sacadm -l
  PMTAG PMTYPE ... STATUS COMMAND
  tcp listen ENABLED /usr/lib/saf/listen tcp #

# There should be three service tags generated: lp, lpd, and 0,
# all of type "listen"

  pmadm -l
  PMTAG PMTYPE SVCTAG ...
  tcp listen lp ...
  tcp listen lpd ...
  tcp listen 0 ...

# Check the printer server log

  cat /var/saf/tcp/log

Set up printer clients
======================

# Make sure lp jumbo patch has been installed

  showrev -p | grep 101317-10

# Check the printer content type and printer type on the print
# server,tchs

  rsh tchs lpstat -p lz101 -l

# Identify the print server system and specify its type--use -t bsd for
# Solaris 2.X

  lpsystem -t bsd tchs

# Specify the printer type as "unknown" since the actual printer type
# is specified on the print server; specify the file content type
# as "any" as it causes files to be filtered on the print server
# according to the file contents set up there (you may specify other
# file content type (like simple, postscript) if you really want
# filtering to be done on the print client--all printer info will
# be added to /etc/lp/Systems

  lpadmin -p lz101 -s tchs -T unknown -I any

# Attach a printer description to the remote printer

  lpadmin -p lz101 -D "coalm parallel on tchs"

# Specify this printer as the default, if desired

  lpadmin -d lz101

# If you want filtering to be done on the client, install the supplied
# filters for PS printers on the client

  cd /etc/lp/fd

  foreach i (`ls | sed 's/.fd$//'`
  ? lpfilter -f $i -F ${i}.fd
  ? end

# Optional: To use an alias on a client

  lpadmin -p lz101_remote -s tchs\!lz101

# Enable printer to accept print requests

  accept lz101

  enable lz101

  lpstat -t

====================================================================
====================================================================
Response from Monty B. Peffley:

It's very possible that some of your problems are hardware related.

See Sun bug reports: #1185275 and #1201749

You'll see the TI Microline Pro 600 specifically mentioned.
The culprit in my case was the /dev/bpp0 port on SS10's and SS20's.
It works with some printers, but not others, and the fault is
in the /dev/bpp0 hardware.

I gather you have a different parallel port, but there may be
some related problem. When I saw "parallel" and TI Pro 600,
I had to reply!

Monty Peffley
====================================================================

Monty was kind enough to send me more info on the above bug reports
when requested:

I got it off of "SunSolve Online" (http://sunsolve.sun.com/ ) but
it may only work for "contract customers". If you are such a person,
see the "Search the SunSolve Online Database" option under "Services"
If not, you may be able to find it under one of the other parts of
that WWW page.

I'll include the 3 bug reports I saved as attachments to this message:

Monty
----------
X-Sun-Data-Type: default
X-Sun-Data-Description: default
X-Sun-Data-Name: bug.1185275
X-Sun-Content-Lines: 58

Bug Report for BugID hardware/peripheral/1185275

      
[ Notify of changes | Mark bug for later retrieval ]

 Bug Id: 1185275
 Category: hardware
 Subcategory: peripheral
 Release summary: p2, p0
 Synopsis: SS20 parallel port is not compatible with some printers, printing
fails
        Integrated in releases:
 Patch id:
Description:

I have tested with the customers HP deskjet 1200C/PS color printer using cabel
530-1857.

This works fine on a SS10 Sol 2.X, SS5 Sol 2.4, SS1+ with SPARCprinter card,
SS20 with
SPARCprinter card (501-1910 SPARCPrinter Printer Card + 530-1680 cabel):

    # cd /usr/openwin/share/images/PostScript
    # cat parrot.ps > /dev/bpp0
    #
It prints out fine.

But the same test with HP deskjet 1200C/PS connected to onboard parallel port
with
cable 530-1857 on SS20 with Sol 2.3 or Sol 1.1.1 rev B, gives:

    # cat parrot.ps > /dev/bpp0
    cat: write error: No such device or address
    #

Customer have tested on 2 dfferent SS20, I have tested with customers printer
on 2
other SS20. I have tested with Sol 2.4 bpp-driver from SS5 on SS20 w. Sol2.3,
no print out.

The printers DIP-Switch at the back was from 1 to 8 : ON, ON, OFF, ON, OFF
OFF, ON, OFF in all my tests.
                              12/13/94 -Erik
Work around:
Using the parallel port on the SPARCprinter Printer Card - 501-1910 and cabel
530-1680
on the SS20 instead of onboard port, does work. 12/13/94 -Erik
 Summary:
Some printers - like HP DeskJet 1200C/PS or Texas Instrument microlaser Pro
600 - does
not work on SS20 parallel port.
History:
        Submitter: alberius Date: 12/13/94
        Dispatch Operator: bugtraq Date: 12/13/94
        Evaluator: ddnguyen Date: 06/08/95
        Closeout Operator: ddnguyen Date: 06/08/95

Comments and suggestions?

Copyright 1994 Sun Microsystems, Inc. 2550 Garcia Ave., Mt. View, CA
94043-1100 USA. All rights reserved.

----------
X-Sun-Data-Type: default
X-Sun-Data-Description: default
X-Sun-Data-Name: bug.1192553
X-Sun-Content-Lines: 83

Bug Report for BugID hardware/other/1192553

      
[ Notify of changes | Mark bug for later retrieval ]

 Bug Id: 1192553
 Category: hardware
 Subcategory: other
 Release summary: p0
 Synopsis: Parallel port (/dev/bpp0) on SS20 doesn't work with HP Printer
PaintJet XL300
        Integrated in releases:
 Patch id:
Description:

Our problem looks like as the Bug-ID# 1185275 under Solaris 1.1.1b.

We tested this Printer (HP PaintJet XL300) on a SPARCstation 20 on the
parallel Port (onboard) "/dev/bpp0". We had installed with the "admintool"
this printer as a PostScript Printer, because the printer has his own
PostScript
interpreter.

We get the error messages from "lpstat -t"

        spotzl{rainer} lpstat -t
        scheduler is running
        system default destination: test
        device for test: /dev/bpp0
        test accepting requests since Mon Feb 13 15:41:55 MET 1995
        printer test faulted printing test-128. enabled since Mon Feb 13
15:41:55 MET 1995. available.
                printer powered off or disconnected; source: parallel
        character set

Next parallel Port Test:

        spotzl# cat /etc/motd > /dev/bpp0
        /dev/bpp0: Device busy
        spotzl#

We tested this Printer configuration on an SPARCstation 5 with success.

Our Customer tested a SS20 with Solaris 1.1.1B together with NP 2.2 Rev.A,
(Patch-ID# 101678-13) and he got this error message:

        "Printer unplugged"

Is looks like the same problem, the SS20 can't see this printer on his
parallel
port.

Our Customer can't use the WorkAround from the Bug-ID# 1185275, because
all four SBus Slot are used, and he can't switch some SBus Cards in a SBus
Expansion Box.

We'll open an escalation by CTE about this Parallel Port Problem.

HDZAPF another Comment to that problem:

My customer has an c.ito Modell C715A printer which he wants to connect
to bpp0

with prtconf he get's

 SUNW,bpp (driver not attached)

Then he made an boot -r
Power off/on from the printer
then tried

    cat parrot.ps > /dev/bpp0
    cat: write error: No such device or address
So the SS20 doesn't recognize the printer on bpp0
History:
        Submitter: wfisch Date: 02/15/95
        Dispatch Operator: bugtraq Date: 02/15/95

Comments and suggestions?

Copyright 1994 Sun Microsystems, Inc. 2550 Garcia Ave., Mt. View, CA
94043-1100 USA. All rights reserved.

----------
X-Sun-Data-Type: default
X-Sun-Data-Description: default
X-Sun-Data-Name: bug.1201749
X-Sun-Content-Lines: 98

Bug Report for BugID kodiak/parallel/1201749

      
[ Notify of changes | Mark bug for later retrieval ]

 Bug Id: 1201749
 Category: kodiak
 Subcategory: parallel
 Release summary: p2, p0, fcs
 Synopsis: Customer is exhibiting problems similar to those described in bug
id 1136132.
        Integrated in releases:
 Patch id:
Description:
Customer has sparc 20 with novojet 3 (manufactured by ncad) hooked to bpp0.
She is trying to write to the port in her program and she comes back with an
ENXIO error. I had her use the lp command and she gets device busy. I looked
at
bug id 1136132 and I was able to reproduce the problem, the same way as was
documented for the classic and LX systems. Customer tried the BPPIOC_GETERR
ioctl and the error pin was paper empty even thought thatwas not the case.
I sent her a new system board with no change.
she has the 101434-03 lpr jumbo patch loaded with no change. Customer has
20 systems and 10 display the problem. Reboot clears the error and then it
prints fine again until paper out or printer is powered off.

4/23/95

Analysis:
---------

We have 4 printers(hplaserjet,2 hp1200c inkjet, SPARCprinterE) setup in
HW lab and we find out the cause of the problem:
Basically, the printer driver first thing it checks is to look at
the signal called P_PE* to see if it is set or not. If it is set
this means the printer is not online/ready and it will cause the
ioerror if you send a printing job to the printer.
We used a digital scope to look at the signal P_PE* and we see that
this signal is at 4V without the printer cable hookup. This signal
will be driven low(0v-.8v TTL logic) if the printer cable is hooked
up. But we see from the scope that this level varies from 1.08v to 1.8v
and 1.2v is about the voltage threshold that the printer will work even
though at this level, it is still not a TTL logic low. The reason of this
signal is not being driven low because of the combination of weak driving
capability from the printer and motherboard parallel
terminating resistor network(220/330) which demands more current drawn
in order to be driven to TTL logic low. We replace the motherboard
parallel terminating resistor network(220/330), R0706 with a 4.7K pull up
resistor network, and we see that the signals are being driven to TTL logic
 low. Apparently, the parallel terminating resistor network is in violation
of the spec and it is fixed in SS5 and Sbus Zebra card but it was missed in
S10 and SS20 design.

The description field as copied from bug report 1185275 follows:

I have tested with the customers HP deskjet 1200C/PS color printer using cabel
530-1857.

This works fine on a SS10 Sol 2.X, SS5 Sol 2.4, SS1+ with SPARCprinter card,
SS20 with
SPARCprinter card (501-1910 SPARCPrinter Printer Card + 530-1680 cabel):

    # cd /usr/openwin/share/images/PostScript
    # cat parrot.ps > /dev/bpp0
    #
It prints out fine.

But the same test with HP deskjet 1200C/PS connected to onboard parallel port
with
cable 530-1857 on SS20 with Sol 2.3 or Sol 1.1.1 rev B, gives:

    # cat parrot.ps > /dev/bpp0
    cat: write error: No such device or address
    #

Customer have tested on 2 dfferent SS20, I have tested with customers printer
on 2
other SS20. I have tested with Sol 2.4 bpp-driver from SS5 on SS20 w. Sol2.3,
no print out.

The printers DIP-Switch at the back was from 1 to 8 : ON, ON, OFF, ON, OFF
OFF, ON, OFF in all my tests.
                              12/13/94 -Erik
Work around:

This problem only happens with certain new types of printers like hp1200c,
sparcprinter 1200E and etc.... The work around is to use sbus zebra card now
or
wait for new Kodiak board which has the hardware fix(ecr#04065).

The work around field as copied from bug report 1185275 follows:

Using the parallel port on the SPARCprinter Printer Card - 501-1910 and cabel
530-1680
on the SS20 instead of onboard port, does work. 12/13/94 -Erik
History:
        Submitter: sclark@east Date: 04/19/95
        Dispatch Operator: bugtraq Date: 04/19/95
        Evaluator: jacobs@central Date: 04/19/95

Comments and suggestions?

Copyright 1994 Sun Microsystems, Inc. 2550 Garcia Ave., Mt. View, CA
94043-1100 USA. All rights reserved.

====================================================================
Help from Andrew Watkins:

The way to do it is to use the "chroot" command. Its a very nice
way of doing it.

here is a script which shows it:

================================================================
#!/bin/sh
# printer_remote.fin
B=/a # base directory of all absolute paths (/a during installation)

cat <<DONE >$B/tmp/pr.$$
#!/bin/sh
 
/usr/lib/lpsched

# Repeat lpysystem, lpadmin, accept, and enable
# for each remote printer you want to set up.

lpsystem -t bsd machine1
lpsystem -t s5 machine2
lpadmin -p lp -s machine1 -I any
lpadmin -p sumo -s machine2 -I any
accept lp sumo
enable lp sumo
lpshut
DONE

chmod +x $B/tmp/pr.$$

chroot $B /tmp/pr.$$
rm $B/tmp/pr.$$

===============================================================

Good luck

Andrew



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:30 CDT