Last updated Sept 4, 2003

Beta Printer Interface Script for the lpsystem

This script gives access to the advanced features of the Canon B&W imageRUNNERs.
Currently working with Solaris2.6-8, HP-UX 10., SCO 7, and SCO 5

Reynaldo DiPasquale (rdipasquale@cusa.canon.com)sent a printer interface script he has been developing for printing from the lpsystem to the Canon black and white imageRunner products.  He is looking for beta testers and feedback.  If you would be interested, the information is as follows.  If you are not interested, but are going to try and use it anyway....
This is not an official printer interface script.  Rey did this out of kindness, please try and help the cause.  Report any successes and failures, failures in detail please.

Update: December 17, 2001
Rudy Beset has added some functionality to the script as well as Rey fixing some minor syntax.  If you are using this before Dec 17, 2001 you may want to update your script.

Update:  February 13, 2002
Rey sent a new script and readme.  It is setup for the iR5000.  The codes for the iR8500 and iR600 are in the script but commented out.

Update:  Sept 4, 2003
Ronald Bruintjes sent a newly modifed script.  Please see the update section under HP-UX


I (Rick) got it working from Solaris 7, HP-UX 10., and SCO 7  All tests where done with the iR550.  The steps I took are below.
If you getting it working from another lpsystem please write us with the details.  Joe Kroboth sent us SCO 5, see below.

Here is your copy of the Printer interface script (save as...) (There is a newer one in the HP-UX section but it is setup for HP-UX)
For advanced features check this readme (save as...)

Common General Info
Currently you can only print ascii no postscript.
This setup uses two queues.  One local and one remote.  The remote queue name must end in "xfer"
The local queue name should be "ir550"
The remote queue name should be "ir550xfer"
In theory you should be able to replace "ir550" with your model number.  Example ir210, ir400, ... and so on.
I have just tested this on the iR550 but it _should_ work with any B&W EFI controller

Setting up Solaris 7: Command line only.  I couldn't figure out how to use the GUI it's to difficult  ;-)

Rename the file "canon.txt" to "ir550interface" and move it to /usr/lib/lp/model.
Now change the UID and GID to lp and chmod 555
    #chown lp ir550interface
    #chgrp lp ir550interface
    #chmod a+rx ir550interface

don't forget your name resolution. (I have in /etc/hosts  192.168.10.89 ir550)
now setup the local printer:

    #lpadmin -p ir550 -v /dev/null
    #lpadmin -p ir550 -i /usr/lib/lp/model/ir550interface
    #accept ir550
    #enable ir550

now setup the remote queue

    #lpadmin -p ir550xfer -s ir550!print

Now print using
    #lp -d ir550 myfile

do not use
    #lp -d ir550xfer myfile

Setting up HP-UX B.10.20
NOTE: There is a 14 character limitation on file names used.  ie. ir550interface is ok, ir5000interface is not.

Update: Sept 4, 2003

This information was sent to us from Ronald Bruintjes. Thanks Ronald this is great.
Much of this new information will be helpful to others using HP-UX with any of the models.
It is based on HP-UX 11i

--begin--

HP-UX using beta canon.txt

We recently acquired a number of Canon 5020i printers. Setting them up in HP-UX turned out to be a pretty intensive task, since there are no Unix 'drivers' provided.

The canon.txt script didn't seem to work, even though it was modified for HP-UX. BrightQ didn't work (we're a strictly character based shop), and somehow managed to screw up the print spooler.

It finally dawned on me that there might be a way to capture errors in the script, and sure enough, when I changed the device from /dev/null to /tmp/tst5020i, it turned out the TMPDIR is set to /var/sam. This directory is only useable by root, so when I printed as a regular user, it blew up.

The fix is to change the assignment of TMPDIR in canon.txt to the following line:
< : ${TMPDIR:=/tmp}
> TMPDIR=/tmp

This causes the temporary file to be created in /tmp, which in our system is readable and writeable by everyone.

Hope this helps anyone out there...!

--pause--

I emailed back and forth with Ronald and here are the important sections.

--/pause--

it turns out there was a little glitch in the script. When you're specifying more than one option, the script added either the auto-paper select or the paper size letter or even both to the control string. I've commented out the defaults when checking options SOURCE and SIZE, now we can do fancy stuff like
lp -d canon -o PITCH=16.67 -o ORIENTATION=LANDSCAPE -o PAPERSIZE=LEDGER -o PAPERSOURCE=4 filename.txt

The revised canon5020i is attached to this message. Have fun!

Cheers,

Ronald Bruintjes

--end--
Thanks again Ron, and now back to our regularly scheduled document.


Rename the file "canon.txt" to "ir550interface" and move it to /usr/lib/lp/model.  Now changed the UID and GID to bin,  Make sure your minimum permissions are a+r
    #chown bin ir550interface
    #chgrp bin ir550interface
    #chmod a+r ir550interface
don't forget your name resolution. (I have in /etc/hosts  192.168.10.89 ir550)
 

GUI - the easy way (not necessarily easier, but less typing)

1. Login as root.
2. Run Sam.  HP's System Administration Manager.  On my machine running CDE, I open the Application Manager, then the System_Admin group, then double click on Sam.
3. Once Sam is running, open the group Printers and Plotters.
4. Then open the group LP Spooler.
5. Now run printers and plotters.

6. Click on the Actions menu and then on Add Local Printer/Plotter... Then Add Printer with Nonstandard device file...
7. Enter the Printer Name :  ir550
8. Click on [printer model/interface] and select ir550interface from the list.  click ok.
9. Enter the printer device file name : /dev/null
10. Everything else here is optional.  If you are not sure leave it.  I left printer class blank, I don't know if it will effect the script or not.
11. Review your settings and click ok.

Now add the remote printer.

1. Click on the Actions menu and then on Add Remote Printer/Plotter... (not to be confused with Add Local Printer/Plotter)
7. Enter a Printer Name.  ir550xfer
8. Enter The Remote System Name.  This is the name of the host (printer) in the name/address resolution you did before we started.  (it's looking for the fully qualified domain name.)
9. Enter the Remote Printer Name.  This is the queue name on the RIP.  For the queue name for your printer click here.  In most cases it will be 'print'.
10. Click to check the box for 'Remote Printer is on a BSD system'.

11. Under Remote Cancel Model choose rcmodel
12. Under Remote Status Model choose rsmodel
13. Change the Default Request Priority to what you want.  (default is ok)
14. If you want anyone to cancel a request click to check here.  (not recommended)
15. DO NOT make it the default printer.

16. Review your settings and click ok.
17. A note will pop up,  You can disregard this information.  It does not apply to us.  Click ok to close it.

Both of your new printers should now show up in the printer and plotters list.

now test your setup
    # lp -dir550 filename
 

Command Line directions

1. Login as root.  (you have already setup your name/address resolution right?)
2. Stop the lp spooler.
    # /usr/sbin/lpshut
3. Add the local queue
    # /usr/sbin/lpadmin -pir550 -v/dev/null -mir550interface -orc
 4. Accept and enable the new queue
    # /usr/sbin/accept ir550
    # /usr/bin/enable ir550

Cool, now lets add the queue that actually sends the job to the printer.

 5. Add the remote queue
    # /usr/sbin/lpadmin -pir550xfer -v/dev/null -mrmodel -ob3 -ocmrcmodel -osmrsmodel -orc -ormir550 -orpprint
 6. Accept and enable the new printer
    # /usr/sbin/accept ir550xfer
    # /usr/bin/enable ir550xfer
 7. Restart the spooler
    # /usr/sbin/lpsched

Cool, now you are setup, give it a try:
    # lp -dir550 filename
 

Setting up SCO 7: Command line only. I couldn't figure out how to use the GUI it's to difficult (where have I heard that before ;-) )

Rename the file "canon.txt" to "ir550interface" and move it to /usr/lib/lp/model.
Now change the UID and GID to lp and chmod 555
    #chown lp ir550interface
    #chgrp lp ir550interface
    #chmod a+rx ir550interface

Don't forget your name resolution. (I have in /etc/hosts 192.168.10.89 ir600)

Now setup the local printer:
    #lpadmin -p ir550 -v /dev/null -i /usr/lib/lp/model/ir550interface
    #accept ir550
    #enable ir550

Now setup the remote queue
    #lpsystem -t bsd ir600
    #lpadmin -p ir550xfer -s ir600!print
    #accept ir550xfer
    #enable ir550xfer

Now print using
    #lp -d ir550 myfile
 

Setting up SCO 5: Command line only. I couldn't figure out how to use the GUI it's to difficult (I'm not kidding, Have you ever tried to administer UNIX from a GUI)
This information was sent to us by Joe Kroboth of Chernay Printing.  joe_kroboth@chernay.com   (thanks much Joe)

Rename the file "canon.txt" to "ir550interface" and move it to /var/spool/lp/model.
Now change the UID to bin and GID to lp and chmod 555
    #chown bin:lp ir550interface
    #chmod a+rx ir550interface
In the script change the PATH to "HEAD"  from /usr/bin/head to /bin/head (around line 322)

Don't forget your name resolution. (I have in /etc/hosts 192.168.10.89 ir600)

Now setup the local printer:
    #/usr/lib/lpadmin -p ir550 -v /dev/null -i /var/spool/lp/model/ir550interface
    #accept ir550
    #enable ir550

Now setup the remote printer:  (this is copied from the SCO sco5.html 5 page with changes for this script)

rlp

To Install  RLP login in as root and at the command prompt type: mkdev rlp <enter>
The remote printing configuration utility should start.  To install type : i <enter>
If it is already installed you will be informed here and you will go back to the prompt.  If this is the case skip ahead to the rlpconf command down the page.
If it is not yet installed some new directories will be created, some old commands will be backed up, and remote commands installed.
Then : Do you which to change the printer description file /etc/printcap (y/n) : type : y <enter>

rlpconf

This runs rlpconf which will setup your printer.  For those of you who are just joining us now (rlp was already installed) at the command prompt type : rlpconf
This utility does not do exactly what we want it to do but it does take care of a lot of things that would take us a while to do manually.  We will still have to edit the /etc/printcap manually afterwards but a lot less work.
At the first prompt the printer name is ir550xfer  press <enter>
at the next prompt tell the system it is a remote printer : r <enter>
At this prompt enter the host name of the printer as it appears in your /etc/hosts entry: ir600. then hit <enter>
verify this information is correct, type y <enter>
At this prompt enter no we do not support Extended RLP type : n <enter>
Would you like this printer to be the system default ? your choice <enter>
Don't worry about any of the warnings, they don't effect us. : <enter>
The program finishes setting up your printer and goes back to the beginning of the setup to install a new printer, type : q <enter>

For those of you who just joined us for the rlpconf command you should be at a prompt and can skip ahead to editing the /etc/printcap file.  For those of us who are doing a new install will we be asked if we want to start remote daemon now.  type : y <enter>
and now we are back at the prompt too.

/etc/printcap

Using your favorite text editor we are going to edit the /etc/printcap file.  ( vi rocks )
Your /etc/printcap entry should look like this:

ir550xfer:\
        :lp=:rm=ir600:rp=ir550xfer:sd=/usr/spool/lpd/ir550xfer:

change it to :  (just rp=)

canon:\
        :lp=:rm=ir400:rp=print:sd=/usr/spool/lpd/ir550xfer:

Save your changes and you're done.

test the setup
lp -dir550 myfile.txt
 

Home     Back to UNIX

If you find an error or wish to comment please let me know.