Re: Printing on sparcstation 5

From: Dr. David Kirkby (david.kirkby_at_onetel.net)
Date: 11/19/03


Date: Wed, 19 Nov 2003 20:04:10 +0000

Anders Rex wrote:
>
> Hi
>
> I recently got myself a sparcstation 5 and now I'm planing to turn it into a printing server. It has two ports on the back that say "Serial A" and "Serial B". Are these normal parallel-ports that I can put my printer in and what /dev/-names do they get in openbsd? bpp0 and bpp1? I've tried to dump some raw text to those devices but my HP Laserjet 1100 doesn't respond in any way. bpp0 is listed in dmesg like this:
> bpp0 at sbus0 slot 5 offset 0xc800000: DMA2
>
> Anders rex

As others have said, you need a special cable to access the parallel
ports. That cable is also used on an SS20, so when looking on eBay or
wherever for it, bear that in mind - it might be listed for an SS20. I
suspect it is the same part - but check. Those cables seemed to fetch
quite a bit.

I assume the printer is not a Postscript device, since most of those
are networked. If you do fix a non-Postscript printer, look at using
Ghostscript to printer to the parallel port, the printer is likely to
be non-postscript, as I think most Postscript printers will have a
network connector, which will be far less hassle.

Someone wrote a web page about doing using Ghostscript in this way,
although there was some comments that the method he used is not 100%
how Solaris intends printing to be done. He has put a note about that.

It wrote this script which seems to work for me, setting up an Epson
on a parallel port. Note it uses /dev/ecpp0, which is the port on the
Ultra range, not on the SPARC 5, which is /dev/bpp0. I'm not saying
the script will work unchanged, but it might give you an idea of how
to go about it.
I script does something to get different resolutions (fast, slow,
photo ..) options to Ghostscript. That part is broken, so ignore that.

The -dBuffer Space=250000000 allocates 250 Mb as a buffer which I'm
told speeds things up a bit. You are not likely to want to do that on
a SPARC 5!!

It uses a file 'psselect -r' to reverse the page order, so page 1 of
the document appears at the top. I think there is a Solaris command
that will do that, so you don't need psselect. But I happen to have it
installed and can't be bothered to change what works.

Anyway, here it is. It's not perfect at all, but possibly semi-useful.

#! /bin/sh
# This script is /usr/local/bin/install_ps
# It sets up an Epson inject printer so that
# it will print postcript, using Ghostcript to do the
# conversion from postscript to Epsons ESC2 language.

# 1) Cancel any print jobs on the printer st850_ps
echo " "
echo "cancelling any print jobs on st850_ps using disable -c st850_ps"
/usr/bin/disable -c st850_ps

# 2) remove any printer under the name st850_ps
echo " "
echo "removing any printer under the name st850_ps using lpadmin -x
st850_ps"
lpadmin -x st850_ps

# 3) Add a script that converts Epson language to Postscript.
echo "#!/bin/sh" > /usr/local/bin/ps_to_epson850
echo "# this is /usr/local/bin/ps_to_epson850" >>
/usr/local/bin/ps_to_epson850
echo "# default to standard resolution" >>
/usr/local/bin/ps_to_epson850

echo "RES=\"@stc800p.upp\"" >> /usr/local/bin/ps_to_epson850
echo "# select high resolution when requested" >>
/usr/local/bin/ps_to_epson850
echo "if [ \"\$1\" = \"high\" ]; then" >>
/usr/local/bin/ps_to_epson850
echo " RES=\"@stc800ih.upp\"" >> /usr/local/bin/ps_to_epson850
echo fi >> /usr/local/bin/ps_to_epson850
# Note, 'psselect -r' just reverses the order of the pages.
echo "exec /usr/local/bin/psselect -r | /usr/local/bin/gs -q
\${RES} -dBuffer
Space=250000000 -sPAPERSIZE=a4 -sOutputFile=- - -c quit" >>
/usr/local/bin/ps_t
o_epson850

# 4) define filter description /etc/lp/fd/PStoEPSON.fd

echo "Input types: postscript" > /etc/lp/fd/PStoEPSON.fd
echo "Output types: ESC2" >> /etc/lp/fd/PStoEPSON.fd
echo "Printer types: any" >> /etc/lp/fd/PStoEPSON.fd
echo "Printers: any" >> /etc/lp/fd/PStoEPSON.fd
echo "Filter type: fast" >> /etc/lp/fd/PStoEPSON.fd
echo "Options: MODES fast = -f" >> /etc/lp/fd/PStoEPSON.fd
echo "Options: MODES slow = -s" >> /etc/lp/fd/PStoEPSON.fd
echo "Options: MODES photo = -p" >> /etc/lp/fd/PStoEPSON.fd
echo "Options: MODES high = -h" >> /etc/lp/fd/PStoEPSON.fd
echo "Options: MODES normal = -n" >> /etc/lp/fd/PStoEPSON.fd
echo "Command: /usr/local/bin/ps_to_epson850" >>
/etc/lp/fd/PStoEPSON.fd

# 5) Change owner and group of the print filter to lp.
echo " "
echo "Changing owner and group of the print filter to lp"
chown lp:lp /etc/lp/fd/PStoEPSON.fd

# 6) Add the filter name PStoEPSON
echo "Adding the filter name PStoEPSON"
/usr/sbin/lpfilter -f PStoEPSON -F /etc/lp/fd/PStoEPSON.fd

# 7) Register the printer
echo "registering the print queue st850_ps"
echo "making it print to the parallel port (/dev/ecpp0)"
echo "on UltraSPARC machines."

/usr/sbin/lpadmin -p st850_ps -v /dev/ecpp0 -I ESC2

# 8) DISABLE THE BANNER AND SET SPEED ON
# the parrallel port to 19200 bits/s.
echo "trying to disable the banner"
replace -es -m 1 nobanner=\"no\" nonbanner=\"yes\"
/etc/lp/interfaces/st850_ps

# 9) ENABLE PRINTER
echo " "
echo "enabling the printer using enable"
enable st850_ps

# 10) ENABLE PRINTER
echo " "
echo "Allowing the printer to accept print requests using accept"
accept st850_ps

# 11) Making the queue st850_ps the default queue.
lpadmin -d st850_ps

# 12) Check the print queue st850_ps is okay
lpstat -t st850_ps

# 13) Make /dev/ecpp0 writable only by its owner (lp)
chmod 600 /dev/ecpp0

# Now replace 'nobanner="no"' with 'nobanner="yes"' in
/etc/lp/interfaces/st850_ps

# This script would then by run, to set up the print queue.
# There is also a script /usr/local/bin/install_nops
# which prints directly to the printer using another
# queue st850_direct. No translation to Postscript
# is done on that queue, so data must be in Epson format.

-- 
"The day Microsoft makes something that doesn't suck is probably 
the day they start making vacuum cleaners." -Ernst Jan Plugge.
Dr. David Kirkby Ph.D
Author of 'atlc' http://atlc.sourceforge.net/


Relevant Pages

  • RE: Installing a Networked Printer
    ... I had to edit the script you sent me due to the fact that it has to run ... neither printer nor port were created. ... > echo Installing Network Printer PRINTERNAME ... >> install a list of printers on my client machines on a PER MACHINE basis. ...
    (microsoft.public.windows.server.scripting)
  • Trouble accessing Outlook Web Access from behind firewall
    ... # Set the maximum number of connections to track. ... # by default due to possible internal machine UDP port scanning ...
    (comp.security.firewalls)
  • Re: transparent printer with pc
    ... forwarded port and nc for windows to receive the job at the windows machine and dump it to LPT: on Windows 98. ... echo "2022"> .ssh_printer chmod 644 .ssh_printer ... S.M. Fabac & Associates ...
    (comp.unix.sco.misc)
  • Re: [PHP] Byte conversion
    ... > echo $char; ... This is *never* going to be true, mainly because $char cannot be equal ... understand the code before attempting to port it. ... and if that value would be the equivalent the Java ...
    (php.general)
  • Re: Running SSHD as non-root user
    ... > compiled, installed into the users home directory, I can get the server ... but it fails on PAM authentication. ... mut run on a port higher than 1024. ... do echo port $PORT is no good, ...
    (comp.security.ssh)