Author Topic: A cups 2.0 "How To": Installing and configuring cups 2.0 and supporting software  (Read 21733 times)

Pete

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 26
  • Posts: 529
    • View Profile
Hi All

Having stated in an OpenOffice4.1.1 discussion that I would "cobble together" a cups 2.0 "how To" I did not realise what a long job it would be. I have finally completed the job - I hope.

I have to apologise that this document has been created from memory - which can be inaccurate at times - and from postings I made about the software in the ecups newsgroup so may be slightly incorrect in software versions used or an incomplete list. It is based mainly on my experience of getting cups 2.0 working with

   1] Epson RX585 USB attached to a wireless connected DLink DP-G310 Print Server
   2] Canon PIXMA MG7550 wireless connected - no MG7550 driver but the earlier MG7150 seems to work OK

So, no experience of setting up a USB printer - but it should not be too difficult...

I did make notes when installing cups 2.0 and supporting software but lost my notes when my hard drive crashed just over a week before Christmas...
To make matters much worse: With my new hard drive installed, LVM'd and volumes formatted I plugged in my USB backup drive to xcopy all the backups made the previous week expecting to be back to a fully working setup after a short period of time spent xcopying. As I turned the usb drive on it made a few beeps followed by "Fizzzllle - BANG!
No, the data is not recoverable from that drive either.
So, it is down to my memory and ecups newsgroups postings...

Luckily my own reinstall of cups 2.0 and supporting software was very easy - as the main cups software is in the root of the same drive and is pretty much "self contained" it was a simple copy down the network from another pc.



1] Getting the software and where to unzip packages to
======================================================


Name and url of software - Unzip to or Copy to or other Instructions


a] The main cups packages
-------------------------


cups 2.0: https://dl.dropboxusercontent.com/u/76425158/cups-2.0.0-os2-20141019.zip - Unzip honouring the zipped directory structure to root of a drive [?]: and copy [?]:\cups\lib\cups20.dll to either [BootDrive]:\ecs\dll or [BootDrive]:\os2\dll - alternatively add [?]:\cups\lib to the config.sys libpath and reboot *before* trying to start the eCUPS Daemon (cupsd.exe) later.


cups filters: http://smedley.id.au/tmp/cups-filters-1.0.61-os2-20141011.zip - Unzip honouring the zipped directory structure to root of same drive as cups2.0

 
ghostscript 9.15: https://dl.dropboxusercontent.com/u/76425158/ghostscript-9.15-os2-20141011.zip - Unzip honouring the zipped directory structure to the directory [same drive as cups2.0]:\gs  resulting in \gs\gs9.15 directory structure


gutenprint 5.2.10: https://dl.dropboxusercontent.com/u/76425158/gutenprint-5.2.10-os2-20141019.zip - Unzip honouring the zipped directory structure to root of same drive as cups2.0



b] Supporting software required
------------------------------------------


GCC491.DLL  http://smedley.id.au/gcc491.zip - Unzip gcc491.dll to either [BootDrive]:\ecs\dll or [BootDrive]:\os2\dll


https://dl.dropboxusercontent.com/u/76425158/coreutils-8.8-os2-20101223.zip - Unzip only these files to \cups\bin:-

    cat.exe
    rm.exe
    printf.exe
    mktemp.exe


http://rpm.netlabs.org/release/00/zip/grep-2_10-2_oc00.zip - Unzip only these files to \cups\bin:-

    grep.exe
    egrep.exe
    fgrep.exe


http://hobbes.ecomstation.co.kr/mirror/os2/hobbes.nmsu.edu/pub/incoming/wget-1.14-1-os2.zip - Unzip *only* this file to
either [BootDrive]:\ecs\dll or [BootDrive]:\os2\dll

    PCRE8.DLL


sed.exe is required.
eCS 2.1/2.2 users will find a copy in [BootDrive]:\ecs\bin which should be copied to /cups/bin/sed.exe
I have not had to find this file online but this build may work http://rpm.netlabs.org/release/00/zip/sed-4_2_1-2_oc00.zip
NOTE: The only file required from this package is sed.exe which should be unzipped to /cups/bin


cupsash.exe is required.
I am using a copy from cups 1.4.8; latest build is https://dl.dropbox.com/u/76425158/cups-1.4.8-os2-20121221.zip
Unzip *only* cupsash.exe to /cups/sbin

sh.exe is required.
I copied /cups/sbin/cupsash.exe to /cups/sbin/sh.exe - seems to work fine



c] Optional supporting packages
-------------------------------

Other software may be required depending on the printer make/model and connection method. This software is usually available from the ecups website http://trac.netlabs.org/ecups/

If you have a USB attached printer then you probably need the libusb package either:-
 ftp://ftp.netlabs.org/pub/ecups/install/libusbdll10.wpi or http://www.altsan.org/os2/printing/ecups/libusbdll10.wpi

If you have a Canon printer that uses the CNBJNP (Canon BJ Network Port?) printer port in Windows you will need the cups-bjnp package not yet listed on the ecups website - I believe it is required for recent/current usb as well as network printers:-

Release build: http://smedley.id.au/tmp/tmp%5Ccups-bjnp-1.2.2-os2-20140526.zip
Beta Build: http://smedley.id.au/tmp/tmp%5Ccups-bjnp-1.9.2-os2-20140526.zip

Unzip bjnp.exe from either of the above honouring the zipped directory structure to the root of the drive with cups 2.0 installed - the file should end up in \cups\lib\cups\backend
I suspect the difference between the 2 builds is how up to date the supported printers list is  - having a current Canon (PIXMA MG7550) I used the 1.9.2 package which is working fine.
When setting up your printer in cups 2.0 you will use bjnp as part of the Device uri. A network printer needs an ip address and port number eg:- bjnp://192.168.7.342:8611; Sorry, I have not attached the printer using usb so do not know what that Device uri would look like.

The cups-bjnp packages require cups17.dll - http://www.os2site.com/sw/drivers/printer/cups/cups-1.7.2-os2-20140517.zip
Unzip *only* cups17.dll honouring the zipped directory structure to the root of the drive with cups 2.0 installed - the file should end up in \cups\lib - not sure whether there should also be a copy in [BootDrive]:\ecs\dll or [BootDrive]:\os2\dll; I seem to recall that cups17.dll is also used by some qt apps so this may be a good move.




The OS/2 printing bits
----------------------


a] The cups port driver - required for printing with cups from OS/2 apps
 
http://www.altsan.org/os2/printing/ecups/cupspdr_103.zip - Unzip *only* ecups.pdr to [BootDrive]:\os2\dll
For the port driver to work you also need to copy \cups\bin\lpr.exe to [BootDrive]:\tcpip\bin\cupslpr.exe
IMPORTANT: Do *NOT* use the cupslpr.exe included in the cupspdr_103.zip file as it will not work with cups 2.0


b] The OS/2 printer driver - required for printing with cups from OS/2 apps

http://www.altsan.org/os2/printing/index.html#psprint - I suggest reading this page before downloading the PSPRINT driver package. When downloaded Unzip to [BootDrive]:\os2\dll\PSPRINT

For the OS/2 postscript printer setup I recommend using the PSPRINT package rather than the usual eCUPS package.
The reason is that the PSPRINT driver produces output from OpenOffice 4.1.1 RC3 and GA whereas using the ECUPS driver always resulted in a failure to print.
The cups error log showed something like "not defined in /mdef" at the point that printing failed.
Using the PSPRINT driver resolves that problem but if using a printer which uses the PostScript ColorModel scheme the printer output is greyscale when colour ouput is selected.
Luckily selecting greyscale output in the Print Job Properties results in colour printing.





2] Making it all work
=====================


a] Configuring the CUPS Printer
-------------------------------


Make sure your printer is powered on and ready to print.

Having unpackaged all required software into the correct locations the next step is to create the eCUPS Daemon in the Startup folder.

Open the Startup folder, RMB (Right Mouse Button) click on the folder to display the popup menu, Select Create New, Program Object and name it eCUPS Daemon.

Open the Properties for the eCUPS Daemon and enter these details:-

   Path and filename:  cmd.exe
   Parameters:  /c detach ?:\CUPS\SBIN\CUPSD.EXE
   Working directory: ?:\CUPS\SBIN

Obviously you need to change the above "?" to the drive letter that cups is installed on.

Having created the eCUPS Daemon double click to start it then open a browser window at http://localhost:631/admin

Click the Add Printer button. If cups reports your printer click Continue and work through the setup pages until you have selected printer Make and Model - The "Simplified" version of the driver is recommended - and clicked the Add Printer button.

If CUPS does not see your printer then you need to use the Command line to create a basic printer that can be modified using the browser interface.

   Open a command line window in \cups\sbin and enter the following command for a network printer:-

   lpadmin -p YourPrinterName -E -v PrinterIP/Port or Queue Name     
          eg:-
      lpadmin -p RX585 -E -v socket://192.168.1.251/IP_192.168.1.251
                 or
      lpadmin -p RX585 -E -v lpd://192.168.1.251/lpt1

   (Sorry, no idea what to do with USB printers here but would expect those to be found by cups)
   
   "Kill" the eCUPS Daemon cupsd.exe, it will take 4 "kills" before it no longer appears in the Process List,
        then (Re)Start the eCUPS Daemon to load the new printer info.

There should now be a \cups\etc\cups\printers.conf file with the basic printer details. This can be Modified using the browser interface. Load http://localhost:631/printers/ then click on your printer under Queue Name. On the next page click the Modify Printer option in the Administration dropdown list and work through the setup pages. When selecting the PPD file make sure to use the "Simplified" version.



If I remember correctly the eCUPS Daemon (cupsd.exe) is stopped and restarted to load the new printer configuration - and the browser may fail to load the printers page due to an incorrect url so point the browser at http://localhost:631/printers/ then click on your printer under Queue Name. Come to think of it you will probably find a few broken urls resulting in pages displaying "Internal Server Error" when using the cups browser interface but the "broken" url is usually easily corrected.

You can then check that Default print options are correct and then print a Test Page from the Maintenance dropdown list.



!Configuration tip!

Edit the PSTOPDF Filter to avoid unnecessary error messages in the cups error log file

Open the file \cups\lib\cups\filter\pstopdf and change the line

                -dPDFSETTINGS=/printer -dUseCIEColor \
to
                -dPDFSETTINGS=/printer \

Save the file and exit the editor.

Reason: The option -dUseCIEColor is no longer supported and simply adds to confusion if you need to debug the cups error log.




b] Configuring the OS/2 Printer
-------------------------------


OK, We have done the easy bits and finally arrived at the fiddly bit.

Before proceeding further read the [BootDrive]:\OS2\DLL\PSPRINT\readme file paying specific attention to adding a PPD file to PSPRINT.DRV

Open a Command Line Window in [BootDrive]:\OS2\DLL\PSPRINT and run these commands:-

   [[BootDrive]:\OS2\DLL\PSPRINT]copy [?]:\cups\etc\cups\ppd\[your CUPS printer name].ppd to [newname].ppd
     eg:-  copy J:\cups\etc\cups\ppd\MG7550.ppd newMG7500.ppd

   [[BootDrive]:\OS2\DLL\PSPRINT]cleanppd [newname].ppd
     eg:-  cleanppd newMG7500.ppd

   [[BootDrive]:\OS2\DLL\PSPRINT]ppdenc [newname].ppd [your CUPS printer name].ppd
     eg:-  ppdenc newMG7500.ppd MG7550.ppd

   [[BootDrive]:\OS2\DLL\PSPRINT]del [newname].ppd
Note: This leaves only [your CUPS printer name].ppd (eg MG7550.ppd) to be added to the driver in the next step - otherwise both PPD files would get added which could cause problems.

   [[BootDrive]:\OS2\DLL\PSPRINT]pin ppd [BootDrive]:\OS2\DLL\PSPRINT [BootDrive]:\OS2\DLL\PSPRINT\PSPRINT.DRV
     eg:-  pin ppd H:\OS2\DLL\PSPRINT H:\OS2\DLL\PSPRINT\PSPRINT.DRV



As long as all the above steps were successful you can Close the Command Line Window.

The next step is to Create an OS/2 Printer.

There seems to be various ways of achieving this depending on which OS/2 and what printer install routines are available so a general guide:-

Start the OS/2 or eCS Create Printer routine and select Local Printer

Name the Printer and then click Install new printer driver

Enter the location of PSPRINT.DRV - [BootDrive]:\OS2\DLL\PSPRINT  - and click Refresh

Select your printer and click Install.

The Create Printer dialog closes and you should have your new printer in the Printers folder.

Open the Properties for the new printer and select the Output Port tab. If you do not have a CUPS port displayed click Install new port and select the CUPS port if available. If it is not available select New port drivers, enter the Directory [BootDrive]:\OS2\DLL and click Refresh. The CUPS port should now be available for selection. The CUPS port will need configuring so double click on it to open the settings.

The CUPS Server is localhost; the CUPS Printer name is [your CUPS printer name] - the same name used in cups.

You may want to have a look through the Job Properties on the Printer Driver tab to make sure all looks about right before closing the Properties.

You should now have a working OS/2 printer that will pass postscript files to the cups printer for printing so, fire up an app and try to print something.



Hopefully the above will be of help in getting cups 2.0 plus necessary supporting software working for you.


Now, back to getting the scanner side of the MG7550 working perfectly with a wireless connection ...


Regards

Pete






 
« Last Edit: January 20, 2015, 01:06:25 am by Pete »



Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 416
    • View Profile
Great job and thanks Pete !

Can I post this on my site ?


Greggory

Pete

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 26
  • Posts: 529
    • View Profile
Hi Greggory

Yes, you certainly can post the "How To" on your website  :-)


Regards

Pete

ivan

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 24
  • Posts: 632
    • View Profile
Thanks for that Pete.

Now a question.  How do you correct the "Internal Server Error"?  I am getting it just about every other mouse click.

Cups on OS/2 still doesn't want to talk to my HP color laserjet 3500 attached to the print server of my DNS-323 NAS yet using a live linux DVD does it without problems - go figure.

Pete

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 26
  • Posts: 529
    • View Profile
Hi ivan

I do not correct the "Internal Server Error" - I figure that is either the cups developers or porters job  ;-)

Usually the error is caused by a failed url redirect so I look at the url and strip out the unwanted bit(s) and press Enter.
I guess an example...

I have just worked through Modify Printer and the browser tried to reload the page specific to the modified printer but used this url

                       http://localhost:631/admin/?OP=redirect&URL=/printers/MG7550

Which resulted in the "Internal Server Error" page loading.

Modifying the url to

                     http://localhost:631/printers/MG7550

works fine. So the usual trick is to remove /admin/?OP=redirect&URL= from the failed url.

Why cups does not work with your HP color laserjet 3500 could be explained by the use of the print server.

So far cups - any build - has *always* failed to "see" my network printers regardless of whether they are usb or lpt attached to a print server or use wireless networking. Of course, if cups cannot "see" the printer it becomes difficult to get past the Connection page of cups configuration.

If this is the case you can try manually creating a printers.conf file, see the section "Configuring the CUPS Printer" in the "How To" for a brief guide.

If it is a different problem then maybe a lot more detail will be of help in trying to figure out the problem.

As to why linux does not have the same problem I do not know...


Regards

Pete

Paul Smedley

  • Sr. Member
  • ****
  • Thank You
  • -Given: 11
  • -Receive: 46
  • Posts: 353
    • View Profile
Hi Ivan,

Thanks for that Pete.

Now a question.  How do you correct the "Internal Server Error"?  I am getting it just about every other mouse click.

Cups on OS/2 still doesn't want to talk to my HP color laserjet 3500 attached to the print server of my DNS-323 NAS yet using a live linux DVD does it without problems - go figure.

A log file with debug logging enabled might help. I've had reports of the error, but can't reproduce it locally. If I can't reproduce it, it can be very difficult to identify the problem. CUPS makes extensive use of sockets and piping output between executables - binary/text output modes on OS/2 make things interesting in this regard....

<sarcasm on>Must be because I run eCS virtualised and don't test on SMP....<sarcasm off>

Paul Smedley

  • Sr. Member
  • ****
  • Thank You
  • -Given: 11
  • -Receive: 46
  • Posts: 353
    • View Profile
Hey Pete,

I do not correct the "Internal Server Error" - I figure that is either the cups developers or porters job  ;-)

Usually the error is caused by a failed url redirect so I look at the url and strip out the unwanted bit(s) and press Enter.
I guess an example...

I have just worked through Modify Printer and the browser tried to reload the page specific to the modified printer but used this url

                       http://localhost:631/admin/?OP=redirect&URL=/printers/MG7550

Which resulted in the "Internal Server Error" page loading.

Modifying the url to

                     http://localhost:631/printers/MG7550

works fine. So the usual trick is to remove /admin/?OP=redirect&URL= from the failed url.

Why cups does not work with your HP color laserjet 3500 could be explained by the use of the print server.

So far cups - any build - has *always* failed to "see" my network printers regardless of whether they are usb or lpt attached to a print server or use wireless networking. Of course, if cups cannot "see" the printer it becomes difficult to get past the Connection page of cups configuration.

If this is the case you can try manually creating a printers.conf file, see the section "Configuring the CUPS Printer" in the "How To" for a brief guide.

If it is a different problem then maybe a lot more detail will be of help in trying to figure out the problem.

As to why linux does not have the same problem I do not know...

I'm guessing you mean that CUPS on OS/2 can't autodetect your network printer? Here it's inconsistent - sometimes it works, sometimes it doesn't. One day I'll get around to trying to track that down. In relation to the Internal Server Error - if you have consistent steps to reproduce, I'm interested, as I get them randomly but not consistently.

Alex Taylor

  • Full Member
  • ***
  • Thank You
  • -Given: 10
  • -Receive: 14
  • Posts: 218
    • View Profile

Pete

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 26
  • Posts: 529
    • View Profile
Hi Paul

The example shown is consistent here ie the close of Modify Printer always results in the Internal Server Error.

The problem with the cups failure to detect a printer is that it is not too obvious how to proceed to get around that - hence the mention in the how to. Sometimes it is useful to know the "Command Line Cowboy" way of doing things  :-)

Regards

Pete

Pete

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 26
  • Posts: 529
    • View Profile
Hi Alex

The "how to" is based on my experience of installing/configuring cups 2.0 plus the software I used.

I'll certainly give cupspdr_104 a go though - can always modify the "how to" after a successful trial  :-)

Having now unzipped cupspdr_104 I think the cupslpr.exe included will probably need to be replaced by the cups 2.0 version to avoid potential "could not connect to cups server" print fail messages.

Maybe you would be better off not including cupslpr.exe in the cupspdr package and explain in the readme that it is necessary to copy the cups\bin\lpr.exe file to tcpip\bin\cupslpr.exe


Regards

Pete

ivan

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 24
  • Posts: 632
    • View Profile
Attached is the error log for those interested in such things.  It was produced when I tried to get it to print a test page.

Pete

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 26
  • Posts: 529
    • View Profile
Hi ivan

A quick look shows this problem occurs several times:-

D [20/Jan/2015:23:20:04 -0100] [Job ???] Auto-typing file...
I [20/Jan/2015:23:20:04 -0100] [Job ???] Request file type is application/vnd.cups-banner.
D [20/Jan/2015:23:20:04 -0100] Print-Job client-error-document-format-not-supported: Unsupported format "application/vnd.cups-banner".
E [20/Jan/2015:23:20:04 -0100] [Client 37] Returning IPP client-error-document-format-not-supported for Print-Job (ipp://localhost:631/printers/lp) from localhost

a little further down I see:-

D [20/Jan/2015:23:20:05 -0100] [CGI] cgiSetVariable: CUPS_VERSION="CUPS v2.0.0"
D [20/Jan/2015:23:20:05 -0100] [CGI] cgiSetArray: document_format[0]="application/vnd.cups-banner"
D [20/Jan/2015:23:20:05 -0100] [CGI] cgiSetVariable: TITLE="Print Test Page"
D [20/Jan/2015:23:20:05 -0100] [CGI] cgiSetVariable: SERVER_NAME="localhost"
D [20/Jan/2015:23:20:05 -0100] [CGI] cgiSetVariable: CUPS_VERSION="CUPS v2.0.0"
D [20/Jan/2015:23:20:05 -0100] [Client 36] CGI data ready to be sent.
D [20/Jan/2015:23:20:05 -0100] [CGI] cgiSetVariable: MESSAGE="Unable to print test page"
D [20/Jan/2015:23:20:05 -0100] [CGI] cgiSetVariable: ERROR="Unsupported format "application/vnd.cups-banner"."


I would expect cups to be able to print it's own test page but obiously something is wrong. May be there is a missing filter in your cups setup?

Does the printer use the cups hplip package?


Regards

Pete

Paul Smedley

  • Sr. Member
  • ****
  • Thank You
  • -Given: 11
  • -Receive: 46
  • Posts: 353
    • View Profile
I [20/Jan/2015:23:20:04 -0100] [Job ???] Request file type is application/vnd.cups-banner.
D [20/Jan/2015:23:20:04 -0100] Print-Job client-error-document-format-not-supported: Unsupported format "application/vnd.cups-banner".
E [20/Jan/2015:23:20:04 -0100] [Client 37] Returning IPP client-error-document-format-not-supported for Print-Job (ipp://localhost:631/printers/lp) from localhost

This one rings a bell. grep'ing the /cups directory for vnd.cups-banner might refresh my memory. IIRC it's a sign of old test files from cups pre-2.0. How was CUPS installed? re-unzipping cups-filters and overwriting the old test files might help

Pete

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 26
  • Posts: 529
    • View Profile
Hi ivan

Having just done a clean install of cups 2.0 on a laptop I printed a test page and then checked the error log.

Your error log snippet posted above shows

  Request file type is application/vnd.cups-banner.

That is wrong; it should show

  Request file type is application/vnd.cups-pdf-banner.


This suggests that you may have installed over an existing cups setup or that some files remained from the existing setup.

I suspect a clean install will resolve the problem - or give us something else to try to resolve  :-)


Regards

Pete
 


ivan

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 24
  • Posts: 632
    • View Profile
Thanks Pete, hopefully I will have time at the weekend - we got a callout and I'm surrounded by cold white stuff at the moment, needed chains on all 4 wheels to get here.

Am I correct in assuming I need the hplip backend because this is an HP printer?