Look what you can do

Using Oki printers on SCO Unix

07/06/2006

Question - How can I use Oki printers with SCO Unix?

Answer - The following explains one method of setting up Oki printers under SCO Unix, which has been tested on SCO OpenServer V5.06. Please use the search facility at http://support.caldera.com/caldera and other OKI Knowledgebase articles to find details of other methods. This article uses an Oki C7200 as an example, but can also be applied equally well to other Oki printers containing network cards.

The general idea is that the Oki network printer is treated as a remote Unix machine, with one printer queue installed with the name "lp". To follow this procedure you will need to be logged on as root, or a user with super user privileges.

1 - Set up the IP address for the printer.

The simplest way to do this is to set the IP address on the printer control panel, then to edit /etc/hosts, adding a line such as:
193.132.3.3 C7200
However, this can also be set up using BOOTP or DHCP, if there is a suitable server on the network. Please ask your network support team if you are unsure.

2 - Add printer using SCO Admin Manager.

Open up Admin Manager from the desktop, or by running "scoadmin" from the command line.
Open the "Printer folder", and select "Printer Manager".
Select Printer->Add Remote -> Unix

For Host, give the network name of the printer (same as in /etc/hosts, C7200 in this case).
For Printer choose lp (Do not use the Select button, this only works for remote SCO machines).

You must not select "Use Extended Remote Printing Protocol", as this relies on the presence of SCO-specific protocols in the remote machine.

You may get an error at this point saying that print services have been disabled. If you do, choose the System->Printer Services option in scoadmin Printer Manager to rectify the problem.

Note that using SCO Admin Manager to add the remote printer has the side-effect of enabling the BSD-style print spooler.

3 - Edit /etc/printcap, and change the printer name.

Admin Manager will have added an entry for a queue called lp on the local machine, but you will probably want to change this (e.g. from lp, to C7200_lp), as well as make it more readable, so change it from:

lp:lp=:rm=C7200: ...etc

to:

C7200_lp:
# Printer name
:lp=:
# Device name to open for output
:rm=C7200:
# Machine name for remote printer (i.e. the IP address or name of the printer referred to in /etc/hosts)
:rp=lp:
# Remote printer name argument (this should be left at the default of "lp")
:sd=/usr/spool/lpd/C7200:
# Spool directory
:mx#0:
# Maximum number of blocks (0 = unlimited)

For further details of other options that can be included in the printcap database, please check the online manual pages for printcap.

At this stage the printer has been installed, and you can print to it using the lp command, e.g.:

lp -d C7200_lp

You will be able to print from most applications simply by using this command. However, you will not be able to select options such as media type, duplex mode, Oki's Secure Print or Proof and Print etc, unless these are supported by your application.

4 - To access additional features, you will need to define a printer model.

A printer model can be used to define a filter which will select printer options by sending PCL, PJL or PostScript commands at the start of a print job. You will need to create a local printer queue using the filter, which will then send its output to the remote printer using the lpr command.

Firstly, make a copy of a suitable model which you will modify. For a PCL printer:
cp /usr/spool/lp/model/network /usr/spool/lp/model/C7000_model
or for a PostScript printer:
cp /usr/spool/lp/model/network.ps /usr/spool/lp/model/C7000_model

chgrp lp C7000_model
chown lp C7000_model
chmod 755 C7000_model

These three commands are necessary because, if you are following these steps as root then, by default, the model files are owned by root, of the group sys. Any users who want to print to this printer will need to be a member of the "lp" group. This can be added via scoadmin - choose the "Account Manager" option, move to the user you want to change (indicated by an asterisk) then choose the Users->Modify menu option and finally the "Change Group Membership" option. This can also be done via the GUI Administrative tool.

5 - Edit the model file.

Search through the model file for the part where the output is sent to the remote printer, and add your own commands. The attached files shows possible additions for PostScript or PCL:

PostScriptPCL/Includes/Pages/FileDownload.aspx?id=tcm:119-65313

Note: If using ftp to transfer these files to your Unix machine, ensure that they are copied in binary mode.

The actual changes to make will depend on what features you want to enable. These files can also be used "as is". For example, to select duplex mode in PostScript, you could add the following:

echo "%!"
echo "> setpagedevice"

Note: See the article "Selecting printer specific features under Unix" for further details of how to enable other features.

6 Create a local printer queue.

The following commands will set up a printer queue called C7200_ps, and will use the specified model file to create the printer interface script:

/usr/lib/lpadmin -p C7200_ps -m C7000_model -v /dev/null
/usr/lib/accept C7200_ps
/usr/bin/enable C7200_ps

If you get an error on the accept command, check that the printer service is running as described earlier. If it works successfully, you should get a message saying "destination C7200_ps now accepting requests".

7 Link the local queue to network printer.

Add a line in /usr/spool/lp/remote, e.g. using:

echo "C7200_ps: lp -dC7200_lp" >> /usr/spool/lp/remote

Note: Only run this command once, otherwise you will add multiple entries to the file.

See also

Product Support

Show another product

Product finder
  • BankImage_Banner_SupportMainRightPromo1119618255
  • 3 Year Warranty