NSLU2-Linux
view · edit · print · history

HowTo.AddPrinter History

Hide minor edits - Show changes to markup

December 13, 2013, at 04:11 AM by Benalua --
Changed lines 242-244 from:
  I could only get local printing to work with HPIJS and the usblp module with a lot of work.  By the way, if you use any hplip function such as scanning or checking ink, this knocks out the usblp module so I have a script to check this and remove and restore the module so I can print again.  Most of the problems were related again to not quite being optware conformant.  I had to edit foomatic-rip to make use of /opt instead of /usr locations.  Ghostscript also does not conform to the /opt standard so in /etc/profile, I had to place export GS_OPTIONS=-sGenericResourceDir="/opt/share/ghostscript/8.71/Resource/" to get the filters to work.  This should have worked for every ghostscript call but I had to manually edit the PPDs? in /opt/etc/cups/ppd and place -sGenericResourceDir=/opt/share/ghostscript/8.71/Resource/ after -dBatch at the gs call entry.  The pdftops filter in /opt/lib/cups/filter is too restrictive and fails a lot so I had to do a google search and get an alternate from here https://launchpadlibrarian.net/27756565/pdftops .  I had to modify this script for optware and fix its permission.  I also had to install bc for calculations.  To get the corresponding pdftops utility, I first installed xpdf.  This did not turn out well since manually converting a pdf file to ps and sending it directly to the printer device would lock up the printer.  I therefor humbly request that somebody test these XPDF utilites and fix the package.  The pdf2ps does a good job of translating, although rather intensive and creates large files, but I actually needed pdftops so I downloaded poppler and built it.  This worked pretty well so I have my hpij foomatic driver for printing locally.
  It's good enough for local stuff but since my slug is a print server also, I use the hp990c raw printer driver, which uses the usblp module for really fast network printing.  As before, I have a regular scheduled script to fix the usblp module after any hplip functions such as scanning or interrogating status.  So, I basically have three printers setup.  One for status, another one for local printing, and another for network raw printing.  This could be cut down if somebody fixed the Ghostscipt, XPDF, and HPLIP packages.  You could also supplement XPDF with a properly working poppler.  This setup has worked well for me for a while.
to:

I could only get local printing to work with HPIJS and the usblp module with a lot of work. By the way, if you use any hplip function such as scanning or checking ink, this knocks out the usblp module so I have a script to check this and remove and restore the module so I can print again. Most of the problems were related again to not quite being optware conformant. I had to edit foomatic-rip to make use of /opt instead of /usr locations. Ghostscript also does not conform to the /opt standard so in /etc/profile, I had to place export GS_OPTIONS=-sGenericResourceDir="/opt/share/ghostscript/8.71/Resource/" to get the filters to work. This should have worked for every ghostscript call but I had to manually edit the PPDs? in /opt/etc/cups/ppd and place -sGenericResourceDir=/opt/share/ghostscript/8.71/Resource/ after -dBatch at the gs call entry. The pdftops filter in /opt/lib/cups/filter is too restrictive and fails a lot so I had to do a google search and get an alternate from here https://launchpadlibrarian.net/27756565/pdftops . I had to modify this script for optware and fix its permission. I also had to install bc for calculations. To get the corresponding pdftops utility, I first installed xpdf. This did not turn out well since manually converting a pdf file to ps and sending it directly to the printer device would lock up the printer. I therefor humbly request that somebody test these XPDF utilites and fix the package. The pdf2ps does a good job of translating, although rather intensive and creates large files, but I actually needed pdftops so I downloaded poppler and built it. This worked pretty well so I have my hpij foomatic driver for printing locally.

It's good enough for local stuff but since my slug is a print server also, I use the hp990c raw printer driver, which uses the usblp module for really fast network printing. As before, I have a regular scheduled script to fix the usblp module after any hplip functions such as scanning or interrogating status. So, I basically have three printers setup. One for status, another one for local printing, and another for network raw printing. This could be cut down if somebody fixed the Ghostscipt, XPDF, and HPLIP packages. You could also supplement XPDF with a properly working poppler. This setup has worked well for me for a while.

December 13, 2013, at 04:09 AM by Benalua -- Added info to local printing and noted some optware deficiencies.
Added lines 239-244:

12/12/2013 Currently have local printing, scanning, and print server on my NSLU2 running SlugOS. I've had to do some strange things to get my setup functional. For scanning, using the guides here to set up my scanner worked well. This is using hplip since I have a psc all in one printer. Ive set up my printer with the hplip hpcup driver not for printing, which I couldn't get to work, but so the hplip utilities can be used. I can use the hp-level and other commands to interrogate my printer to get status and ink levels. I created my own webpage to give me ink status. HPLIP does not work for printing, seems to have some problems, probably related to the optware conversion or building setup. For example, HPLIP still looks for it's configuration on /usr/etc than /opt/etc.

  I could only get local printing to work with HPIJS and the usblp module with a lot of work.  By the way, if you use any hplip function such as scanning or checking ink, this knocks out the usblp module so I have a script to check this and remove and restore the module so I can print again.  Most of the problems were related again to not quite being optware conformant.  I had to edit foomatic-rip to make use of /opt instead of /usr locations.  Ghostscript also does not conform to the /opt standard so in /etc/profile, I had to place export GS_OPTIONS=-sGenericResourceDir="/opt/share/ghostscript/8.71/Resource/" to get the filters to work.  This should have worked for every ghostscript call but I had to manually edit the PPDs? in /opt/etc/cups/ppd and place -sGenericResourceDir=/opt/share/ghostscript/8.71/Resource/ after -dBatch at the gs call entry.  The pdftops filter in /opt/lib/cups/filter is too restrictive and fails a lot so I had to do a google search and get an alternate from here https://launchpadlibrarian.net/27756565/pdftops .  I had to modify this script for optware and fix its permission.  I also had to install bc for calculations.  To get the corresponding pdftops utility, I first installed xpdf.  This did not turn out well since manually converting a pdf file to ps and sending it directly to the printer device would lock up the printer.  I therefor humbly request that somebody test these XPDF utilites and fix the package.  The pdf2ps does a good job of translating, although rather intensive and creates large files, but I actually needed pdftops so I downloaded poppler and built it.  This worked pretty well so I have my hpij foomatic driver for printing locally.
  It's good enough for local stuff but since my slug is a print server also, I use the hp990c raw printer driver, which uses the usblp module for really fast network printing.  As before, I have a regular scheduled script to fix the usblp module after any hplip functions such as scanning or interrogating status.  So, I basically have three printers setup.  One for status, another one for local printing, and another for network raw printing.  This could be cut down if somebody fixed the Ghostscipt, XPDF, and HPLIP packages.  You could also supplement XPDF with a properly working poppler.  This setup has worked well for me for a while.
August 18, 2010, at 08:57 PM by Armin --
Changed line 443 from:

Please note that newest version of cups does not supply module printer.o anymore. You have to install manually as follows:

to:

Please note that newest version 1.4.4 of cups does not supply module printer.o anymore. You have to install manually as follows:

August 18, 2010, at 08:46 PM by Armin --
Changed lines 442-443 from:
to:

Armin 10-18-2010 Please note that newest version of cups does not supply module printer.o anymore. You have to install manually as follows: Telnet or SSH into slug

wget http://ipkg.nslu2-linux.org/feeds/unslung/modules/cross/unstable/kernel-module-printer_2.4.22.l2.3r76-r0_nslu2be.ipk

ipkg install /root/kernel-module-printer_2.4.22.l2.3r76-r0_nslu2be.ipk

Restart cups:

/opt/etc/init.d/S88cups stop

/opt/etc/init.d/S88cups start

Now your printer is available again under /dev/lp0


+-----------------
January 04, 2010, at 04:07 AM by RomanG --
Added lines 82-87:

I ran in to similar problem as mentioned above (access to admin web page causing 403 error page). Solution (although temporary) was to comment out lines "# AuthType? Basic" and "AuthClass? System" in "<Location /admin>" section (end of the cupsd.conf file). However, when I try to add or modify printer through web interface, after entering all parameters and hitting Modify Printer or Add Printer button, I get Error message forbidden. (Roman)

October 19, 2009, at 06:46 AM by quantumphaze -- Long line of = messes up the horizontal size of the page
Changed lines 80-81 from:

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

to:

Changed lines 121-122 from:

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

to:

August 31, 2009, at 07:19 AM by GNewt -- Remove erroneous netmask interpretation
Changed lines 423-424 from:

If your network is ,for example, on the 192.168.0.xxx network and xxx is less then 24 then it should work. If your network is on the 192.168.0.xxx network and xxx is greater then 24, change 24 to the highest number on your network.

to:

If your network is ,for example, on the 192.168.0.xxx network then it should work.

Changed line 428 from:

Again if your network is on the 192.168.1.xxx network and xxx is greater then 24, change 24 to the highest number on your network.

to:
Added lines 433-434:

Note that the "/24" represents 24 mask bits - in other words a netmask of 255.255.255.0 NOT the range of the last octet of the IP address.

April 09, 2009, at 02:05 AM by jacek --
Changed lines 53-58 from:
to:
  • It is also possible that you need to add your external IP for cups to be listened on, i.e., in cupsd.conf add/modify:
    • "Listen 192.168.1.77:631" (your external slug IP, by default it only listens to localhost)
    • "Allow 192.168.1.0/24" (in "<Location />" section, or you can be more specific, stating only one computer that will manage cups)
    • "Allow 192.168.1.0/24" (in "<Location /admin>" - same as above)
    • You may want to disable https requirement for "/admin" if you have problems with openssl (SlugOS 5.3) - comment "# Encryption Required" in "<Location /admin>" section, and you are OK with security issues that this is causing
April 08, 2009, at 10:41 AM by NewUser -- fix formating
Changed lines 9-10 from:

In order to print graphics, some printers may require you to insta[@ll additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

to:

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

March 02, 2009, at 05:46 PM by Maurice --
Changed lines 80-81 from:
  The advantage with openssh is that you can install nano (ipkg update; ipkg install nano) for editing the config files if needed. I didn't get nano to work in a telnet window.
to:

The advantage with openssh is that you can install nano (ipkg update; ipkg install nano) for editing the config files if needed. I didn't get nano to work in a telnet window.

Changed lines 83-84 from:
  You should see something like this:
to:

You should see something like this:

Changed lines 104-105 from:

You should get something like this

to:

You should get something like this:

Added line 108:
March 02, 2009, at 05:44 PM by Maurice --
Changed lines 75-81 from:

5. I followed the above guide and it worked for my Epson SX105? allinone I have just a few remarks: (Maurice)

  1) The best way to do this is not through telnet, but with openssh follow the guide http://www.nslu2-linux.org/wiki/HowTo/UseOpenSSHForRemoteAccess .

The advantage with openssh is that you can install nano (ipkg update; ipkg install nano) for editing the config files if needed. I didn't get nano to work in a telnet window.

  2) When after finishing the above guide do enter the following command at the commandline: tail -f /var/log/messages Then connect or reconnect your printer and look at the messages. 

You should see something like this:

to:

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

I followed the above guide and it worked for my Epson SX105? allinone I have just a few remarks: (Maurice)

1) The best way to do this is not through telnet, but with openssh follow the guide http://www.nslu2-linux.org/wiki/HowTo/UseOpenSSHForRemoteAccess .

  The advantage with openssh is that you can install nano (ipkg update; ipkg install nano) for editing the config files if needed. I didn't get nano to work in a telnet window.

2) When after finishing the above guide do enter the following command at the commandline: tail -f /var/log/messages Then connect or reconnect your printer and look at the messages.

  You should see something like this:
Changed line 103 from:
  3) Check by entering  /opt/lib/cups/backend/parallel at the commandline if your printer is recognized at the usbport
to:

3) Check by entering /opt/lib/cups/backend/parallel at the commandline if your printer is recognized at the usbport

Changed lines 112-115 from:
  4) Because I only need to print from windows I just added a network printer in windows like mentioned below. I also didn't change anything in the printers.conf so just leaving the deviceuri on parallel: /dev/lp0 
to:

4) Because I only need to print from windows I just added a network printer in windows like mentioned below. I also didn't change anything in the printers.conf so just leaving the deviceuri on parallel: /dev/lp0

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

March 02, 2009, at 05:40 PM by Maurice --
Changed lines 75-76 from:
  1. I followed the above guide and it worked for my Epson SX105? allinone I have just a few remarks: (Maurice)

1) The best way to do this is not through telnet, but with openssh follow the guide http://www.nslu2-linux.org/wiki/HowTo/UseOpenSSHForRemoteAccess .

to:

5. I followed the above guide and it worked for my Epson SX105? allinone I have just a few remarks: (Maurice)

  1) The best way to do this is not through telnet, but with openssh follow the guide http://www.nslu2-linux.org/wiki/HowTo/UseOpenSSHForRemoteAccess .
Changed line 79 from:

2) When after finishing the above guide do enter the following command at the commandline: tail -f /var/log/messages Then connect or reconnect your printer and look at the messages.

to:
  2) When after finishing the above guide do enter the following command at the commandline: tail -f /var/log/messages Then connect or reconnect your printer and look at the messages. 
Changed lines 92-95 from:

Very important is that you get something like the last line I mentioned, because if you don't your printer is not recognized. I had some troubles with this, because I first connected my printer through a (powered) usb hub on disk1, because on disk2 I have a 2Gb flashdisk for unslung and on the hub I had two usb hd (750Gb and 400Gb). I noticed that if I connected the printer directly to disk1. It was getting recognized as above and not like before I only got the first two lines. Now I only had the problem where I could connect my 2 hd disks. Luckily if you have some soldering skills like I you can expand the slug with three extra usb ports. Look at the guide http://www.nslu2-linux.org/wiki/HowTo/EnableExtraUSBPorts . So I did that and added the three extra ports. Now I have connected my printer to port 5 of the slug.

3) Check by entering /opt/lib/cups/backend/parallel at the commandline if your printer is recognized at the usbport

to:

Very important is that you get something like the last line I mentioned, because if you don't your printer is not recognized. I had some troubles with this, because I first connected my printer through a (powered) usb hub on disk1, because on disk2 I have a 2Gb flashdisk for unslung and on the hub I had two usb hd (750Gb and 400Gb). I noticed that if I connected the printer directly to disk1. It was getting recognized as above and not like before I only got the first two lines. Now I only had the problem where I could connect my 2 hd disks. Luckily if you have some soldering skills like I you can expand the slug with three extra usb ports. Look at the guide http://www.nslu2-linux.org/wiki/HowTo/EnableExtraUSBPorts . So I did that and added the three extra ports. Now I have connected my printer to port 5 of the slug.

  3) Check by entering  /opt/lib/cups/backend/parallel at the commandline if your printer is recognized at the usbport
Changed lines 109-112 from:

4) Because I only need to print from windows I just added a network printer in windows like mentioned below. I also didn't change anything in the printers.conf so just leaving the deviceuri on parallel: /dev/lp0

to:
  4) Because I only need to print from windows I just added a network printer in windows like mentioned below. I also didn't change anything in the printers.conf so just leaving the deviceuri on parallel: /dev/lp0 
March 02, 2009, at 05:37 PM by Maurice --
Changed line 79 from:

2) When after finishing the above guide do enter the following command at the commandline: tail -f /var/log/messages Then connect or reconnect your printer and look at the messages.

to:

2) When after finishing the above guide do enter the following command at the commandline: tail -f /var/log/messages Then connect or reconnect your printer and look at the messages.

Changed line 95 from:

3) Check by entering /opt/lib/cups/backend/parallel at the commandline if your printer is recognized at the usbport

to:

3) Check by entering /opt/lib/cups/backend/parallel at the commandline if your printer is recognized at the usbport

March 02, 2009, at 05:35 PM by Maurice --
Changed lines 9-10 from:

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

to:

In order to print graphics, some printers may require you to insta[@ll additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

Added line 84:

[@

Added line 88:

@]

Changed line 99 from:
to:

[@

Changed line 101 from:

EPSON Stylus SX100?;"

to:

EPSON Stylus SX100?;"@]

March 02, 2009, at 05:32 PM by Maurice --
Changed lines 76-78 from:

1) The best way to do this is not through telnet, but with openssh follow the guide [url=http://www.nslu2-linux.org/wiki/HowTo/UseOpenSSHForRemoteAccess]here[/url] The advantage with openssh is that you can install nano (ipkg update; ipkg install nano) for editing the config files if needed. I didn't get nano to work in a telnet window.

to:

1) The best way to do this is not through telnet, but with openssh follow the guide http://www.nslu2-linux.org/wiki/HowTo/UseOpenSSHForRemoteAccess . The advantage with openssh is that you can install nano (ipkg update; ipkg install nano) for editing the config files if needed. I didn't get nano to work in a telnet window.

Added lines 81-83:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

Changed lines 87-88 from:
to:

(:tableend:)

Changed lines 91-92 from:

Now I only had the problem where I could connect my 2 hd disks. Luckily if you have some soldering skills like I you can expand the slug with three extra usb ports. Look at the guide [url=http://www.nslu2-linux.org/wiki/HowTo/EnableExtraUSBPorts]here[url] So I did that and added the three extra ports. Now I have connected my printer to port 5 of the slug.

to:

Now I only had the problem where I could connect my 2 hd disks. Luckily if you have some soldering skills like I you can expand the slug with three extra usb ports. Look at the guide http://www.nslu2-linux.org/wiki/HowTo/EnableExtraUSBPorts . So I did that and added the three extra ports. Now I have connected my printer to port 5 of the slug.

Added lines 95-97:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

Added lines 100-101:

(:tableend:)

March 02, 2009, at 05:29 PM by Maurice -- Succesfull install epson SX105 allinone
Added lines 75-93:
  1. I followed the above guide and it worked for my Epson SX105? allinone I have just a few remarks: (Maurice)

1) The best way to do this is not through telnet, but with openssh follow the guide [url=http://www.nslu2-linux.org/wiki/HowTo/UseOpenSSHForRemoteAccess]here[/url] The advantage with openssh is that you can install nano (ipkg update; ipkg install nano) for editing the config files if needed. I didn't get nano to work in a telnet window. 2) When after finishing the above guide do enter the following command at the commandline: tail -f /var/log/messages Then connect or reconnect your printer and look at the messages. You should see something like this: Mar 1 18:13:06 (none) user.info kernel: usb.c: registered new driver usblp Mar 1 18:13:06 (none) user.info kernel: printer.c: v0.11: USB Printer Device Class driver Mar 1 18:13:40 (none) user.info kernel: printer.c: usblp0: USB Bidirectional printer dev 2 if 1 alt 0 proto 2 vid 0x04B8 pid 0x0841

Press Ctr C to exit the tail. Very important is that you get something like the last line I mentioned, because if you don't your printer is not recognized. I had some troubles with this, because I first connected my printer through a (powered) usb hub on disk1, because on disk2 I have a 2Gb flashdisk for unslung and on the hub I had two usb hd (750Gb and 400Gb). I noticed that if I connected the printer directly to disk1. It was getting recognized as above and not like before I only got the first two lines. Now I only had the problem where I could connect my 2 hd disks. Luckily if you have some soldering skills like I you can expand the slug with three extra usb ports. Look at the guide [url=http://www.nslu2-linux.org/wiki/HowTo/EnableExtraUSBPorts]here[url] So I did that and added the three extra ports. Now I have connected my printer to port 5 of the slug. 3) Check by entering /opt/lib/cups/backend/parallel at the commandline if your printer is recognized at the usbport You should get something like this direct parallel:/dev/lp0 "EPSON Stylus SX100?" "EPSON Stylus SX100? LPT #1" "MFG:EPSON;CMD:ESCPL2?,BDC,D4,D4PX?;MDL:Stylus SX100?;CLS:PRINTER;DES: EPSON Stylus SX100?;" 4) Because I only need to print from windows I just added a network printer in windows like mentioned below. I also didn't change anything in the printers.conf so just leaving the deviceuri on parallel: /dev/lp0

March 01, 2009, at 12:49 PM by Maurice --
Changed line 36 from:
  • cp /opt/doc/cups/S88cups /opt/etc/init.d (assuming /opt/etc/init.d exists)
to:
  • cp /opt/doc/cups/S88cups /opt/etc/init.d (assuming /opt/etc/init.d exists) NOTE: Check first if init.d exist by cd /opt/etc/init.d if you get an error create init.d by mkdir /opt/etc/init.d then use de copy command cp /opt/doc/cups/S88cups /opt/etc/init.d
February 22, 2009, at 01:54 PM by anagnost -- Easy Ubuntu printing
Added lines 78-80:

Printing from UBUNTU

To easy print from UBUNTU (tested on 8.04) select System>Administration>Printing and then add a new printer. Then select "Windows Printer via Samba" and give your printer's URL as above (e.g. http://192.168.1.77:631/printers/hp990c). When finish with the guide, ensure that the "Device URl?" displays correctly. If not, reenter it and you are done. You can now print the test page.

February 13, 2009, at 04:16 PM by Ben -- error printing from vista (cups)
Added lines 292-295:

BEN With CUPS and unslung6.8, to print from vista (home premium), the name of the printer must be simple, like 'laser' with no upper or special characters, otherwize the installation works in vista but nothing is printed. Seems to be a bug in vista. In windows 2000 the problem s not present. ('HL1260eUSB?' don't work)

December 18, 2008, at 02:51 PM by Lars Persson Fink -- information about fix of pstoraster in later ghostscript releases
Added lines 294-297:

The issue with pstoraster is fixed in release 8.62 of ghostscript. I run debian on my slug and upgraded to "Lenny", which includes a version of ghostscript (8.62.dfsg.1-3.1) that contains the fix.

Lars Persson Fink

October 03, 2008, at 12:49 AM by arthur92710 --
Added lines 235-237:
  1. Child exited with status 1!
    • go back to the config file and to the ip address. make sure that the last number is a 0.

ex.192.168.0.0/24 192.168.100.0/255 192.168.177.0/5

September 30, 2008, at 02:26 PM by colin gebhart -- clarification
Changed line 210 from:
  • Make sure that the driver, printer.o, is loaded by typing lsmod.
to:
  • Make sure that the driver, printer.o or printer.c, is loaded by typing lsmod.
September 30, 2008, at 05:35 AM by colin gebhart -- clarification
Changed line 220 from:
  • Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
to:
  • Check that you can reach the printer. Perform a "print to file" on your Windows machine. Sometimes "Print to file" appears as an option when you chose the printer. Otherwise you must install it as a separate printer in Windows. If you must install it, make certain "print to file" is set to use the specific printer driver in Windows that works with the printer you are testing. Otherwise nothing will happen when you do the following test... Transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers on the NSLU2 work.
September 30, 2008, at 04:05 AM by colin gebhart -- Big clarifications
Changed line 30 from:
  • Add DefaultEncryption Never to your /opt/etc/cups/cupsd.conf file, then restart cups $/opt/etc/init.d/S88cups restart. Otherwise you will get a '426 Upgrade Required' message when you try to edit anything on the webpage
to:
  • Add DefaultEncryption Never to your /opt/etc/cups/cupsd.conf file, then restart cups # /opt/etc/init.d/S88cups restart. To access the CUPS webserver username-root, password-whatever password you gave root when setting up Unslung. Otherwise you will get a '426 Upgrade Required' message when you try to edit anything in the CUPS webserver.
Changed line 33 from:
  • You can use the HP990c (as it works for most any USB raw printer), but you may want this to describe your printer.
to:
  • In CUPS you can use the default HP990c. It works for most USB raw printers because it specifies the HP Deskjet Series 1.3 printer language. It is just the default name for inkjet printers in CUPS, there is nothing otherwise special about it. Notice that when you install the printer in Windows you may NOT use the HP990c? printer driver, unless that is really what you have. Otherwise the printer will do nothing.
September 30, 2008, at 03:05 AM by colin gebhart -- new error apparently?
Added line 30:
  • Add DefaultEncryption Never to your /opt/etc/cups/cupsd.conf file, then restart cups $/opt/etc/init.d/S88cups restart. Otherwise you will get a '426 Upgrade Required' message when you try to edit anything on the webpage
September 30, 2008, at 02:37 AM by colin gebhart -- questions for original author and clarifications
Added line 295:
  1. How do you do this? With mknod? What are the major and minor node numbers?
Added line 297:
  1. Assume you do this by # tail -f /var/log/messages and look for printer.c, use ctrl+c to escape from tail
September 29, 2008, at 07:03 PM by colin gebhart -- additional explanation
Changed lines 211-212 from:
  • Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
to:
  • Check /var/log/messages as you connect the printer. To do this, type # tail -f /var/log/messages before connecting the printer, to exit viewing mode, press ctrl+c. Verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
September 28, 2008, at 02:45 AM by colin gebhart -- a few corrections
Changed lines 321-323 from:
  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.
to:
  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/init.d/S88cups restart"
  2. printing should now work. This means when the super user (root) runs the file, root has same privileges as the file owner
September 26, 2008, at 03:00 AM by colin gebhart -- samba isn\'t so easy...
Changed lines 55-56 from:
  1. When you install cups for the first time, or upgrade it, you will want to make sure you have the most recent openldap (ipkg upgrade openldap). You will also want to make sure you have the most recent version of samba (ipkg upgrade samba).
to:
  1. When you install cups for the first time, or upgrade it, you will want to make sure you have the most recent openldap (ipkg upgrade openldap). You will also want to make sure you have the most recent version of samba (ipkg upgrade samba). If you are running Unslung this will update you from Samba 2 to Samba 3. You will have to rebuild your conf file. This is a pretty obtuse activity. If you get it wrong, you will lose your NSLU2 shares, which is it's reason for existing. Proceed with caution!
September 21, 2008, at 02:35 AM by Arthur92710 --
Changed lines 351-352 from:

Go all the way down to

to:

There are 2 places that you have to edit 1.Go all the way down to

Changed lines 364-365 from:
to:

2. Go up a few lines and you will see a similar list, change that as well.

September 20, 2008, at 11:27 PM by Arthur92710 --
Changed line 29 from:
  • Pay particular attention to the allow/deny access privileges near the bottom of the file (by default only 192.168.0.x clients are granted access).
to:
  • Pay particular attention to the allow/deny access privileges near the bottom of the file (by default only 192.168.0.x clients are granted access).*Go down for more info on editing*
Changed lines 347-368 from:
to:

  • Editing the /opt/etc/cups/cupsd.conf *

Open /opt/etc/cups/cupsd.conf with a editer

    ex. nano /opt/etc/cups/cupsd.conf

Go all the way down to

   ## Restrict access to local domain
   Order Deny,Allow
   Deny From All
   Allow From 127.0.0.1
   Allow From 192.168.0.0/24

If your network is ,for example, on the 192.168.0.xxx network and xxx is less then 24 then it should work. If your network is on the 192.168.0.xxx network and xxx is greater then 24, change 24 to the highest number on your network. If your network is on the 192.168.1.xxx change

     "Allow From 192.168.0.0/24" to
     "Allow From 192.168.1.0/24

Again if your network is on the 192.168.1.xxx network and xxx is greater then 24, change 24 to the highest number on your network.


Arthur92710

September 09, 2008, at 07:15 AM by bitbucket --
Added lines 342-344:

After a long struggle to print from my Samsung Ml-1740, I finally figured out that /opt/etc/cups/printers.conf needs to be changed to: DeviceURI? parallel:/dev/lp0.

September 07, 2008, at 10:01 PM by espen -- Unfortunate formating made the commands display wrong
Changed lines 65-71 from:

# lpc status
hp990c:
printer is on device 'usb' speed -1
queuing is enabled
printing is enabled
no entries
daemon present

to:
# lpc status
hp990c:
printer is on device 'usb' speed -1
queuing is enabled
printing is enabled
no entries
daemon present
Changed lines 85-87 from:

mkdir -p /opt/var/spool/Samba
chmod 755 /opt/var/spool
chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

to:
mkdir -p /opt/var/spool/Samba
chmod 755 /opt/var/spool
chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)
Changed lines 95-96 from:

printcap name = /etc/cups/printcap
security = user

to:
printcap name = /etc/cups/printcap
security = user
Changed lines 101-102 from:

printcap name = /etc/printcap
security = share

to:
printcap name = /etc/printcap
security = share
Changed lines 114-123 from:

[printers]
comment = All Printers
path = /opt/var/spool/Samba
read only = yes
printable = yes
use client driver = yes
browseable = yes
print command = lpr -P s -r
lpq command = lpstat -o %p
lprm command = cancel j

to:
[printers]
comment = All Printers
path = /opt/var/spool/Samba
read only = yes
printable = yes
use client driver = yes
browseable = yes
print command = lpr -P %p -o raw %s -r
lpq command = lpstat -o %p
lprm command = cancel %j %p
Changed lines 132-167 from:

#! /bin/sh
# Diversion script: customize before starting crond
#
# Reason: alter samba to include cups
#

# Make sure we have a backup copy of /etc/samba/smb.conf
if [ ! -e /etc/samba/smb.conf.orig ]; then
cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig
fi
# Modify two lines in smb.conf that are always present.
sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' /etc/samba/smb.conf
sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

# If there is no [printers] section (it is normally not), append that section
if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

cat << EOF >> /etc/samba/smb.conf
[printers]
comment = All Printers
path = /opt/var/spool/Samba
read only = yes
printable = yes
use client driver = yes
browseable = yes
print command = lpr -P s -r
lpq command = lpstat -o %p
lprm command = cancel j

EOF
fi
#
# Continue to start samba
#
return 1
# EOF - include this line

to:
#!/bin/sh
# Diversion script: customize before starting crond
#
# Reason: alter samba to include cups
#
# Make sure we have a backup copy of /etc/samba/smb.conf
if [ ! -e /etc/samba/smb.conf.orig ]; then
cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig
fi
# Modify two lines in smb.conf that are always present.
sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' /etc/samba/smb.conf
sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

# If there is no [printers] section (it is normally not), append that section
if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

cat << EOF >> /etc/samba/smb.conf
[printers]
comment = All Printers
path = /opt/var/spool/Samba
read only = yes
printable = yes
use client driver = yes
browseable = yes
print command = lpr -P %p -o raw %s -r
lpq command = lpstat -o %p
lprm command = cancel %j %p

EOF
fi
#
# Continue to start samba
#
return 1
# EOF - include this line
August 26, 2008, at 02:54 AM by Slim72beard --
Changed lines 343-345 from:

Hi Newbie here, please help. I have successfully unslung my slug and i have installed cups and samba with a few other optware packages. When trying to set up cups with the command /opt/etc/cups/cupsd.conf i keep getting permission denied this also happens with my other optware package, I am logged on via telnet with user root and my password from an xp pro with sp3 pc. I am also unable to use the web interface any help would be great many thanks. _________

to:
August 25, 2008, at 07:52 PM by Slim72beard --
August 25, 2008, at 07:51 PM by Slim72beard -- Hi Newbie here, please help.
Added lines 342-345:

Hi Newbie here, please help. I have successfully unslung my slug and i have installed cups and samba with a few other optware packages. When trying to set up cups with the command /opt/etc/cups/cupsd.conf i keep getting permission denied this also happens with my other optware package, I am logged on via telnet with user root and my password from an xp pro with sp3 pc. I am also unable to use the web interface any help would be great many thanks. _________

July 25, 2008, at 05:13 PM by Elfgoat -- sp
Changed lines 51-52 from:
  • Also inspect your slug's system clock from the NSLU2 web interface. The SSL certificates are good for one year, and if created in 1970 will no long be valid.
to:
  • Also inspect your slug's system clock from the NSLU2 web interface. The SSL certificates are good for one year, and if created in 1970 will no longer be valid.
July 25, 2008, at 05:12 PM by Elfgoat -- Slug Clock and SSL
Changed lines 51-52 from:
to:
  • Also inspect your slug's system clock from the NSLU2 web interface. The SSL certificates are good for one year, and if created in 1970 will no long be valid.
July 06, 2008, at 05:53 PM by Dirk H --
Changed line 332 from:

my ubs printer samsung clp-300 not working

to:

my usb printer samsung clp-300 not working

Changed line 336 from:

DeviceURL? parallel:/dev/lp0

to:

"DeviceURL? parallel:/dev/lp0"

July 06, 2008, at 05:52 PM by Dirk H --
Changed lines 329-330 from:
to:

Added lines 339-340:

Dirk H

July 06, 2008, at 05:49 PM by Dirk H --
Added lines 329-338:

for me the /opt/lib/cups/backend/usb command brings no result so i got my ubs printer samsung clp-300 not working and then i tried /opt/lib/cups/backend/parallel and this brings me a : direct parallel:/dev/lp0 "Samsung CLP-300" "Samsung CLP-300 LPT #1" "MFG:Samsung;CMD:SPLC;MDL:CLP-300;CLS:PRINTER;STATUS:BUSY;" after that i add this line in my printers.conf: DeviceURL? parallel:/dev/lp0 and it works fine

July 01, 2008, at 11:26 AM by Seb --
Changed lines 55-57 from:
  1. When you install cups for the first time, or upgrade it, you will want to make sure you have the most recent openldap (ipkg update openldap). You will also want to make sure you have the most recent version of samba.
    • Should this be [ipkg upgrade openldap]?
to:
  1. When you install cups for the first time, or upgrade it, you will want to make sure you have the most recent openldap (ipkg upgrade openldap). You will also want to make sure you have the most recent version of samba (ipkg upgrade samba).
April 10, 2008, at 08:52 AM by Nik Rivers --
Changed line 28 from:
  1. Edit /opt/etc/cups/cupsd.conf for your network and environment.
to:
  1. Edit /opt/etc/cups/cupsd.conf for your network and environment.
Changed lines 30-31 from:
  • Back up your /opt/etc/cups/cupsd.conf file because the web interface likes to overwrite it sometimes, causing '403 forbidden' web interface problems.
  1. Edit /opt/etc/cups/printers.conf for your printer.
to:
  • Back up your /opt/etc/cups/cupsd.conf file because the web interface likes to overwrite it sometimes, causing '403 forbidden' web interface problems.
  1. Edit /opt/etc/cups/printers.conf for your printer.
April 10, 2008, at 08:51 AM by Nik Rivers -- Added install/troubleshooting info regarding 403 forbidden in web interface
Added lines 28-30:
  1. Edit /opt/etc/cups/cupsd.conf for your network and environment.
    • Pay particular attention to the allow/deny access privileges near the bottom of the file (by default only 192.168.0.x clients are granted access).
    • Back up your /opt/etc/cups/cupsd.conf file because the web interface likes to overwrite it sometimes, causing '403 forbidden' web interface problems.
Changed lines 203-204 from:
to:
  • The web interface likes to replace your /opt/etc/cupsd.conf with a file that is formatted differently. If this happens, either restore your backup copy or restore the file from the original /opt/etc/cupsd.conf.O file.
March 06, 2008, at 03:03 PM by pjsmith_injen -- Question
Changed lines 53-54 from:
to:
  • Should this be [ipkg upgrade openldap]?
March 03, 2008, at 06:28 PM by Pete Smith -- Answered 403 error query
Changed lines 47-48 from:
to:
  • Check the cupsd.conf file. There are two places that you need to change ip address. If you miss one, then you will get the 403 error. Look towards the bottom of the file.
January 30, 2008, at 09:16 PM by CM --
Changed lines 46-48 from:
  • Its possible that the web interface can mess up cupd.conf, if all else fails you can overwrite this with the original @@cp /opt/etc/cups/cupsd.conf.O /opt/etc/cups/cupsd.conf
to:
  • Its possible that the web interface can mess up cupsd.conf, if all else fails you can overwrite this with the original cp /opt/etc/cups/cupsd.conf.O /opt/etc/cups/cupsd.conf
January 30, 2008, at 06:04 PM by CM -- .
Changed lines 46-47 from:
to:
  • Its possible that the web interface can mess up cupd.conf, if all else fails you can overwrite this with the original @@cp /opt/etc/cups/cupsd.conf.O /opt/etc/cups/cupsd.conf
January 02, 2008, at 08:17 PM by k1m --
Changed lines 45-46 from:
  • Pls help! ran above line for ssl. filled in certificate information. all seems to work fine, then did restart. adminstration webpage still giving me a 403 error. rebooted, still 403 error. my ssl works fine, the webpage homepage comes up fine. What am I missing?
to:
  • Pls help! ran above line for ssl. filled in certificate information, it all seems to instal fine, then restart cups. adminstration webpage giving me a 403 error. rebooted, still 403 error. my ssl works fine, i ssl into my slug with putty, and the printer webpage homepage comes up fine. What am I missing? when i get this fixed, i will update with additional info in case others run into similar prob.
January 02, 2008, at 04:28 PM by kim --
Changed lines 45-46 from:
  • Pls help! ran above line for ssl. filled in certificate information. all seems to work fine, then did restart. adminstration webpage still giving me a 404 error. rebooted, still 404 error. my ssl works fine, the webpage homepage comes up fine. What am I missing?
to:
  • Pls help! ran above line for ssl. filled in certificate information. all seems to work fine, then did restart. adminstration webpage still giving me a 403 error. rebooted, still 403 error. my ssl works fine, the webpage homepage comes up fine. What am I missing?
January 02, 2008, at 04:27 PM by kim -- cant get adminstration access
Added lines 45-46:
  • Pls help! ran above line for ssl. filled in certificate information. all seems to work fine, then did restart. adminstration webpage still giving me a 404 error. rebooted, still 404 error. my ssl works fine, the webpage homepage comes up fine. What am I missing?
August 30, 2007, at 07:29 AM by Eric -- Added line about the CUPS web interface being part of cups-doc.
Added line 23:
  • Note that the CUPS web interface is part of the cups-doc package.
July 12, 2007, at 12:45 AM by Jeremy Jefferson --
Deleted lines 47-51:

While this will fix cups it may break other packages, including SWAT and samba. To fix this run this command afterwards: ln -s /opt/lib/libldap-2.3.so.0.2.23 /opt/lib/libldap-2.2.so.7

Everything should work fine now. You should reboot the slug as any possible errors from updating openldap will not show themselves until you do.

July 12, 2007, at 12:44 AM by Jeremy Jefferson --
Changed lines 46-47 from:
  1. If when trying to start cups you get an error about libldap-2.3.so.0 is missing, do this: ipkg install http://ipkg.nslu2-linux.org/feeds/unslung/cross/openldap-libs_2.3.35-1_armeb.ipk
to:
  1. When you install cups for the first time, or upgrade it, you will want to make sure you have the most recent openldap (ipkg update openldap). You will also want to make sure you have the most recent version of samba.
July 08, 2007, at 09:36 PM by Jeremy Jefferson --
Added lines 48-52:

While this will fix cups it may break other packages, including SWAT and samba. To fix this run this command afterwards: ln -s /opt/lib/libldap-2.3.so.0.2.23 /opt/lib/libldap-2.2.so.7

Everything should work fine now. You should reboot the slug as any possible errors from updating openldap will not show themselves until you do.

July 07, 2007, at 01:22 AM by Jeremy Jefferson -- note added for the possible libldap-2.3.so.0 error
Added lines 46-47:
  1. If when trying to start cups you get an error about libldap-2.3.so.0 is missing, do this: ipkg install http://ipkg.nslu2-linux.org/feeds/unslung/cross/openldap-libs_2.3.35-1_armeb.ipk
July 03, 2007, at 06:58 PM by nino --
Added line 321:

OK

June 24, 2007, at 10:56 AM by Mr G -- Working out how to print from a Mac was a pain, so I thought I would add something!
Added lines 182-184:

Printing from MAC OS X

Mac OS X uses CUPS to manage printer applications. The standard Mac 'Add Printer' dialogs may not pick up the correct path of your network printer. Instead, open your browser and enter http://localhost:631/admin. This will bring up the standard CUPS admin screen, from which you select 'Add Printer' and follow the same procedure for configuring CUPS above. Select 'Internet Printing' and 'http:'. Enter your printer URL when prompted (e.g. http://192.168.1.77:631/printers/hp990c) and select the appropriate driver for your printer.

June 23, 2007, at 04:52 PM by Mr G -- /opt/etc/init.d isn\'t created by default; the cp command could create a file instead of a directory
Changed lines 30-31 from:
  1. Copy cups startup file for automatic start on bootup.
    • cp /opt/doc/cups/S88cups /opt/etc/init.d
to:
  1. Copy cups startup file for automatic start on bootup.
    • cp /opt/doc/cups/S88cups /opt/etc/init.d (assuming /opt/etc/init.d exists)
June 11, 2007, at 04:30 PM by mekondelta -- openssl instructions on how to get to it if it is not in the PATH
Changed line 40 from:
  • openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
to:
  • openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes. You may have to use /opt/bin/openssl if openssl is not in the path.
April 12, 2007, at 01:28 PM by fcarolo -- link formatting
Changed lines 286-287 from:

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;"

to:

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet 930C;SERN:HU1591R1XYJJ;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000,CP095;VP:0800,FL,B0;VJ: ;"

April 12, 2007, at 01:27 PM by fcarolo -- link formatting
Changed line 283 from:

[@

to:
Changed lines 286-287 from:

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet 930C;SERN:HU1591R1XYJJ;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000,CP095;VP:0800,FL,B0;VJ: ;" @]

to:

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;"

April 12, 2007, at 01:26 PM by fcarolo -- link formatting
Changed lines 283-287 from:

/opt/lib/cups/backend/usb direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet 930C;SERN:HU1591R1XYJJ;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000,CP095;VP:0800,FL,B0;VJ: ;"

to:
/opt/lib/cups/backend/usb

direct [=usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet 930C;SERN:HU1591R1XYJJ;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000,CP095;VP:0800,FL,B0;VJ: ;"=]
April 12, 2007, at 01:25 PM by fcarolo -- link formatting
Changed line 28 from:
  • You can use the HP990c? (as it works for most any USB raw printer), but you may want this to describe your printer.
to:
  • You can use the HP990c (as it works for most any USB raw printer), but you may want this to describe your printer.
Changed lines 64-65 from:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

to:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

Changed lines 211-212 from:
  • WinXP appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment.
to:
  • WinXP appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment.
Changed lines 283-285 from:

/opt/lib/cups/backend/usb

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ? "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ?;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;"

to:

/opt/lib/cups/backend/usb direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet 930C;SERN:HU1591R1XYJJ;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000,CP095;VP:0800,FL,B0;VJ: ;"

Changed line 290 from:
4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf
to:
4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ) into your /opt/etc/cups/printers.conf
April 12, 2007, at 01:21 PM by fcarolo -- link formatting
Changed lines 211-212 from:
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment.
to:
  • WinXP appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment.
Changed line 224 from:
  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
to:
  1. Create a cross build system (follow GettingStarted)
March 29, 2007, at 08:49 PM by ByronT -- printers.conf fixed in ipkg
Changed lines 28-29 from:
  • DeviceURI usb:/dev/lp0 no longer works (this should be fixed in the package).
  • Change above to DeviceURI parallel:/dev/lp0.
to:
  • You can use the HP990c? (as it works for most any USB raw printer), but you may want this to describe your printer.
March 29, 2007, at 08:43 PM by ByronT -- openssl is already dependancy - no need for install instruction
Changed lines 40-41 from:
  1. Ensure that package openssl is installed (openssl is installed with openssh), otherwise do ipkg install openssl.
  2. Create the SSL certificates:
to:
  1. Creating the SSL certificates:
March 29, 2007, at 07:04 PM by ByronT -- No Preview Yet
Changed line 283 from:
  • (:table border=0 width=80% align=center bgcolor=#eeffee:)
to:

(:table border=0 width=80% align=center bgcolor=#eeffee:)

Changed lines 290-292 from:
  1. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf
  2. Start CUPS, print...
to:
4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf
5. Start CUPS, print...
March 29, 2007, at 07:03 PM by ByronT -- Oh Preview....
Changed line 283 from:

(:table border=0 width=100% align=center bgcolor=#eeffee:)

to:
  • (:table border=0 width=80% align=center bgcolor=#eeffee:)
March 29, 2007, at 07:02 PM by ByronT -- I need Preview!
Changed lines 283-284 from:

(:table border=0 width=100% bgcolor=#eeffee:)

to:

(:table border=0 width=100% align=center bgcolor=#eeffee:)

March 29, 2007, at 06:58 PM by ByronT -- Bleh Tables!
Changed lines 50-51 from:
  1. Though the /opt/etc/cups/printers.conf references a HP990c?, any USB printer should work via Windows printing (assuming you followed the above directions.) You may add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer, etc.
to:
  1. Though the /opt/etc/cups/printers.conf references a HP990c, any USB printer should work via Windows printing (assuming you followed the above directions.) You may add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer, etc.
Changed line 56 from:

# lpc status\\

to:

# lpc status\\

Changed line 114 from:

lprm command = cancel j=]

to:

lprm command = cancel j

Changed line 158 from:

# EOF - include this line\\

to:

# EOF - include this line

March 29, 2007, at 06:55 PM by ByronT -- More # fun!
Changed lines 42-45 from:
  • openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  • You will be prompted for information to be placed in the certificate.
  • Restart cups [with /opt/etc/init.d/S88cups restart].
to:
  • openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  • You will be prompted for information to be placed in the certificate.
  • Restart cups [with /opt/etc/init.d/S88cups restart].
Changed lines 66-67 from:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

to:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

Changed lines 69-72 from:

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

to:

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

Changed line 105 from:

[=[printers]\\

to:

[printers]\\

Changed lines 123-127 from:

[=#! /bin/sh
# Diversion script: customize before starting crond
#
# Reason: alter samba to include cups
#\\

to:

#! /bin/sh
# Diversion script: customize before starting crond
#
# Reason: alter samba to include cups
#\\

Changed line 129 from:
  1. Make sure we have a backup copy of /etc/samba/smb.conf\\
to:

# Make sure we have a backup copy of /etc/samba/smb.conf\\

Changed lines 133-135 from:
  1. Modify two lines in smb.conf that are always present.
    sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
    /etc/samba/smb.conf\\
to:

# Modify two lines in smb.conf that are always present.
sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' /etc/samba/smb.conf\\

Changed line 137 from:
  1. If there is no [printers] section (it is normally not), append that section\\
to:

# If there is no [printers] section (it is normally not), append that section\\

Changed line 141 from:

[printers]\\

to:

[printers]\\

Changed lines 154-156 from:

  1. # Continue to start samba
    #\\
to:

#
# Continue to start samba
#\\

Changed line 158 from:
  1. EOF - include this line=]\\
to:

# EOF - include this line\\

Changed line 284 from:
  • (:table border=0 width=100% bgcolor=#eeffee:)
to:

(:table border=0 width=100% bgcolor=#eeffee:)

March 29, 2007, at 06:49 PM by ByronT -- More table fun!
Changed lines 40-41 from:
## Ensure that package openssl is installed (openssl is installed with openssh), otherwise do ipkg install openssl.
## Create the SSL certificates:
to:
  1. Ensure that package openssl is installed (openssl is installed with openssh), otherwise do ipkg install openssl.
  2. Create the SSL certificates:
Changed lines 76-77 from:

mkdir -p /opt/var/spool/Samba chmod 755 /opt/var/spool

to:

mkdir -p /opt/var/spool/Samba
chmod 755 /opt/var/spool\\

Changed line 86 from:

printcap name = /etc/cups/printcap

to:

printcap name = /etc/cups/printcap\\

Changed line 92 from:

printcap name = /etc/printcap

to:

printcap name = /etc/printcap\\

Changed lines 105-113 from:

[=[printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P s -r lpq command = lpstat -o %p

to:

[=[printers]
comment = All Printers
path = /opt/var/spool/Samba
read only = yes
printable = yes
use client driver = yes
browseable = yes
print command = lpr -P s -r
lpq command = lpstat -o %p\\

Changed lines 123-159 from:

#! /bin/sh # Diversion script: customize before starting crond # # Reason: alter samba to include cups # # Make sure we have a backup copy of /etc/samba/smb.conf if [ ! -e /etc/samba/smb.conf.orig ]; then cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig fi # Modify two lines in smb.conf that are always present. sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \ /etc/samba/smb.conf sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf # If there is no [printers] section (it is normally not), append that section if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then cat << EOF >> /etc/samba/smb.conf [printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j EOF fi # # Continue to start samba # return 1 # EOF - include this line

to:

#! /bin/sh\\ # Diversion script: customize before starting crond\\ #\\ # Reason: alter samba to include cups\\ #\\ \\ # Make sure we have a backup copy of /etc/samba/smb.conf\\ if [ ! -e /etc/samba/smb.conf.orig ]; then\\ cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig\\ fi\\ # Modify two lines in smb.conf that are always present.\\ sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' [=\
/etc/samba/smb.conf
sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

# If there is no [printers] section (it is normally not), append that section
if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

cat << EOF >> /etc/samba/smb.conf
[printers]
comment = All Printers
path = /opt/var/spool/Samba
read only = yes
printable = yes
use client driver = yes
browseable = yes
print command = lpr -P s -r
lpq command = lpstat -o %p
lprm command = cancel j

EOF
fi
#
# Continue to start samba
#
return 1
# EOF - include this line=]\\

March 29, 2007, at 06:44 PM by ByronT -- Table fun
Changed lines 28-29 from:
  • DeviceURI? usb:/dev/lp0 no longer works (this should be fixed in the package).
  • Change above to DeviceURI? parallel:/dev/lp0.
to:
  • DeviceURI usb:/dev/lp0 no longer works (this should be fixed in the package).
  • Change above to DeviceURI parallel:/dev/lp0.
Changed lines 35-36 from:
  • Interface is located at http://slug.ip.address:631
  • Example: Slug IP address is 192.168.1.51, then cups interface is http://192.168.1.51:631
to:
  • Interface is located at http://slug.ip.address:631
  • Example: Slug IP address is 192.168.1.51, then cups interface is http://192.168.1.51:631
Changed lines 40-41 from:
  1. Ensure that package openssl is installed (openssl is installed with openssh), otherwise do ipkg install openssl.
  2. Create the SSL certificates:
to:
## Ensure that package openssl is installed (openssl is installed with openssh), otherwise do ipkg install openssl.
## Create the SSL certificates:
Changed lines 56-62 from:
  1. lpc status//

hp990c:// printer is on device 'usb' speed -1// queuing is enabled// printing is enabled// no entries// daemon present//

to:

# lpc status
hp990c:
printer is on device 'usb' speed -1
queuing is enabled
printing is enabled
no entries
daemon present

March 29, 2007, at 06:40 PM by ByronT -- Minor cleaning
Changed lines 56-62 from:
  1. lpc status

hp990c: printer is on device 'usb' speed -1 queuing is enabled printing is enabled no entries daemon present

to:
  1. lpc status//

hp990c:// printer is on device 'usb' speed -1// queuing is enabled// printing is enabled// no entries// daemon present//

March 29, 2007, at 06:33 PM by ByronT -- Overhaul & Cleanup
Added lines 3-4:

Place user notes and potential issues below in the "Notes & Potential Problems" area. If you place them "inline", we end up with a page that is nonsensical and almost worthless due to the conflicting and/or repeated information.

Deleted lines 12-18:

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

Added lines 18-53:

Ensure ipkg is up to date and then install the needed packages:

  1. ipkg update
  2. ipkg install cups
  3. ipkg install cups-doc
    • For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

Post-installation things to do:

  1. Edit /opt/etc/cups/printers.conf for your printer.
    • DeviceURI? usb:/dev/lp0 no longer works (this should be fixed in the package).
    • Change above to DeviceURI? parallel:/dev/lp0.
    • Change permissions of /dev/lp0 with chmod 777 /dev/lp0.
  2. Copy cups startup file for automatic start on bootup.
    • cp /opt/doc/cups/S88cups /opt/etc/init.d
    • Either start cups with /opt/etc/init.d/S88cups start or restart the slug.
  3. Test cups web interface.
    • Interface is located at http://slug.ip.address:631
    • Example: Slug IP address is 192.168.1.51, then cups interface is http://192.168.1.51:631
  4. Ensure administration webpage access.
    • The administration webpages require SSL but SSL certificates are not automatically generated.
    • Correct this by:
    1. Ensure that package openssl is installed (openssl is installed with openssh), otherwise do ipkg install openssl.
    2. Create the SSL certificates:
      • openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
      • You will be prompted for information to be placed in the certificate.
      • Restart cups [with /opt/etc/init.d/S88cups restart].

Notes:

  1. The default settings for the cups web interface allow browsing only from 192.168.1.* network. If your slug is not on this network, you need to modify the /opt/etc/cups/cupsd.conf file and then restart cups.
  2. Though the /opt/etc/cups/printers.conf references a HP990c?, any USB printer should work via Windows printing (assuming you followed the above directions.) You may add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer, etc.
  3. In cups, typing lpc status will give you some status information for your printer. For printing to work it should look like this:
Deleted line 54:

Start with a: ipkg update

Changed lines 56-57 from:

ipkg install cups ipkg install cups-doc

to:
  1. lpc status

hp990c: printer is on device 'usb' speed -1 queuing is enabled printing is enabled no entries daemon present

Changed lines 65-70 from:

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:)

to:

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:)

Changed lines 76-78 from:

dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access.

to:

mkdir -p /opt/var/spool/Samba chmod 755 /opt/var/spool chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

Changed lines 81-84 from:

(:table border=0 width=100% bgcolor=#f0e0e0:)

to:

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:)

Changed lines 86-87 from:

pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs

to:

printcap name = /etc/cups/printcap security = user

Changed lines 89-114 from:

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

I managed to configure USB printing like this:

1. Create device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)

2. Connect printer, verify that the printer module is loaded

3. Run the CUPS USB backend to get your personal printer URL

to:

to:

Changed lines 92-94 from:

/opt/lib/cups/backend/usb

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ? "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ?;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;"

to:

printcap name = /etc/printcap security = share

Changed lines 95-126 from:

4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf

5. Start CUPS, print...

Stefan Willmeroth

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine. --- Pan

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

to:

and add:

Changed lines 98-104 from:

bash-2.05b# lpc status hp990c: printer is on device 'usb' speed -1 queuing is enabled printing is enabled no entries daemon present

to:

printing = cups

Changed lines 101-106 from:

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:)

to:

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:)

Changed lines 105-114 from:

kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work.

to:

[printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j

Changed lines 117-122 from:

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions

to:

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

Changed lines 123-125 from:

mkdir -p /opt/var/spool/Samba chmod 755 /opt/var/spool chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

to:

#! /bin/sh # Diversion script: customize before starting crond # # Reason: alter samba to include cups # # Make sure we have a backup copy of /etc/samba/smb.conf if [ ! -e /etc/samba/smb.conf.orig ]; then cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig fi # Modify two lines in smb.conf that are always present. sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \ /etc/samba/smb.conf sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf # If there is no [printers] section (it is normally not), append that section if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then cat << EOF >> /etc/samba/smb.conf [printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j EOF fi # # Continue to start samba # return 1 # EOF - include this line

Changed lines 162-243 from:

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printcap name = /etc/cups/printcap security = user (:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printcap name = /etc/printcap security = share (:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printing = cups (:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) [printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j (:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) #! /bin/sh # Diversion script: customize before starting crond # # Reason: alter samba to include cups # # Make sure we have a backup copy of /etc/samba/smb.conf if [ ! -e /etc/samba/smb.conf.orig ]; then cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig fi # Modify two lines in smb.conf that are always present. sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \ /etc/samba/smb.conf sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf # If there is no [printers] section (it is normally not), append that section if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then cat << EOF >> /etc/samba/smb.conf [printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j EOF fi # # Continue to start samba # return 1 # EOF - include this line (:tableend:)

to:
Changed lines 186-233 from:
  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl

to:
  1. The startup file S88cups gives me lots of errrors.
    • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  2. When trying to connect to the web interface I get the error "403 Forbidden"
    • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  3. I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
    • It doesn't support it yet. Only inetd/xinetd is supported.
  4. CUPS doesn't see my printer device.
    • Make sure that the driver, printer.o, is loaded by typing lsmod.
    • Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
    • Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  5. lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  6. I can't print from Samba - I get an error message saying "unable to print" or similar.
    • First check that you smb.conf has been modified correctly (e.g. like in on this page).
    • Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
    • Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
    • Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
    • Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
    • Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
    • Check that you are not out of disk space.
  7. The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
    • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this.
    • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment.
  8. The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
    • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.
  9. Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way.
Deleted line 257:
Deleted lines 261-288:

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

Added lines 263-316:

Notes & Potential Problems

Place user notes and potential issues below this. If you place them "inline", we end up with a page that is non-sensical and worthless due to the conflicting and/or repeated information.

Issue with pstoraster

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.)

Uwe

USB Printer (may not be needed).

I managed to configure USB printing like this:

  1. Create device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)
  2. Connect printer, verify that the printer module is loaded
  3. Run the CUPS USB backend to get your personal printer URL
    • (:table border=0 width=100% bgcolor=#eeffee:)

(:cell:) /opt/lib/cups/backend/usb

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ? "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ?;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;" (:tableend:)

  1. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf
  2. Start CUPS, print...

Stefan Willmeroth

Print test page from interface problem.

When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine.

Pan

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Additional Printers?

Note that the CUPS web interface will automatically look in /dev/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.


March 23, 2007, at 04:27 PM by fcarolo -- page is now password protected
Changed lines 365-371 from:

ipkg install openldap-libs

to:

ipkg install openldap-libs


This page is password protected.

The password is "printer". Let's see if that stops the automated wiki spam.

March 23, 2007, at 02:57 PM by Peter Taylor -- More bloody spam - PLEASE LOCK
Changed lines 1-3 from:

<a href=" http://www.vg.edu/title/Buy-Viagra.html ">Buy Viagra</a> <a href=" http://www.vg.edu/title/Buy-Cialis.html ">Buy Cialis</a> <a href=" http://www.vg.edu/title/Buy-Levitra.html ">Buy Levitra</a>

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:) ipkg install cups ipkg install cups-doc (:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

I managed to configure USB printing like this:

1. Create device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)

2. Connect printer, verify that the printer module is loaded

3. Run the CUPS USB backend to get your personal printer URL

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) /opt/lib/cups/backend/usb

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ? "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ?;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;" (:tableend:)

4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf

5. Start CUPS, print...

Stefan Willmeroth

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine. --- Pan

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) bash-2.05b# lpc status hp990c: printer is on device 'usb' speed -1 queuing is enabled printing is enabled no entries daemon present (:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) mkdir -p /opt/var/spool/Samba chmod 755 /opt/var/spool chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770) (:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printcap name = /etc/cups/printcap security = user (:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printcap name = /etc/printcap security = share (:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printing = cups (:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) [printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j (:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) #! /bin/sh # Diversion script: customize before starting crond # # Reason: alter samba to include cups # # Make sure we have a backup copy of /etc/samba/smb.conf if [ ! -e /etc/samba/smb.conf.orig ]; then cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig fi # Modify two lines in smb.conf that are always present. sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \ /etc/samba/smb.conf sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf # If there is no [printers] section (it is normally not), append that section if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then cat << EOF >> /etc/samba/smb.conf [printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j EOF fi # # Continue to start samba # return 1 # EOF - include this line (:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

March 23, 2007, at 02:09 PM by aiizte -- Unknown
Changed lines 1-365 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:) ipkg install cups ipkg install cups-doc (:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

I managed to configure USB printing like this:

1. Create device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)

2. Connect printer, verify that the printer module is loaded

3. Run the CUPS USB backend to get your personal printer URL

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) /opt/lib/cups/backend/usb

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ? "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ?;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;" (:tableend:)

4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf

5. Start CUPS, print...

Stefan Willmeroth

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine. --- Pan

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) bash-2.05b# lpc status hp990c: printer is on device 'usb' speed -1 queuing is enabled printing is enabled no entries daemon present (:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) mkdir -p /opt/var/spool/Samba chmod 755 /opt/var/spool chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770) (:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printcap name = /etc/cups/printcap security = user (:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printcap name = /etc/printcap security = share (:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printing = cups (:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) [printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j (:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) #! /bin/sh # Diversion script: customize before starting crond # # Reason: alter samba to include cups # # Make sure we have a backup copy of /etc/samba/smb.conf if [ ! -e /etc/samba/smb.conf.orig ]; then cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig fi # Modify two lines in smb.conf that are always present. sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \ /etc/samba/smb.conf sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf # If there is no [printers] section (it is normally not), append that section if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then cat << EOF >> /etc/samba/smb.conf [printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j EOF fi # # Continue to start samba # return 1 # EOF - include this line (:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

to:

<a href=" http://www.vg.edu/title/Buy-Viagra.html ">Buy Viagra</a> <a href=" http://www.vg.edu/title/Buy-Cialis.html ">Buy Cialis</a> <a href=" http://www.vg.edu/title/Buy-Levitra.html ">Buy Levitra</a>

March 21, 2007, at 04:52 PM by Stan Zapaticky -- restored page after spam
Changed lines 1-3 from:

<a href=" http://www.vg.edu/title/Buy-Viagra.html ">Buy Viagra</a> <a href=" http://www.vg.edu/title/Buy-Cialis.html ">Buy Cialis</a> <a href=" http://www.vg.edu/title/Buy-Levitra.html ">Buy Levitra</a>

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:) ipkg install cups ipkg install cups-doc (:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

I managed to configure USB printing like this:

1. Create device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)

2. Connect printer, verify that the printer module is loaded

3. Run the CUPS USB backend to get your personal printer URL

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) /opt/lib/cups/backend/usb

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ? "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ?;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;" (:tableend:)

4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf

5. Start CUPS, print...

Stefan Willmeroth

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine. --- Pan

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) bash-2.05b# lpc status hp990c: printer is on device 'usb' speed -1 queuing is enabled printing is enabled no entries daemon present (:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) mkdir -p /opt/var/spool/Samba chmod 755 /opt/var/spool chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770) (:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printcap name = /etc/cups/printcap security = user (:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printcap name = /etc/printcap security = share (:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:) printing = cups (:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) [printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j (:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) #! /bin/sh # Diversion script: customize before starting crond # # Reason: alter samba to include cups # # Make sure we have a backup copy of /etc/samba/smb.conf if [ ! -e /etc/samba/smb.conf.orig ]; then cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig fi # Modify two lines in smb.conf that are always present. sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \ /etc/samba/smb.conf sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf # If there is no [printers] section (it is normally not), append that section if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then cat << EOF >> /etc/samba/smb.conf [printers] comment = All Printers path = /opt/var/spool/Samba read only = yes printable = yes use client driver = yes browseable = yes print command = lpr -P %p -o raw %s -r lpq command = lpstat -o %p lprm command = cancel %p -%j EOF fi # # Continue to start samba # return 1 # EOF - include this line (:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

March 21, 2007, at 04:04 PM by vetfuc -- Unknown
Changed lines 1-365 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

I managed to configure USB printing like this:

1. Create device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)

2. Connect printer, verify that the printer module is loaded

3. Run the CUPS USB backend to get your personal printer URL

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) /opt/lib/cups/backend/usb

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ? "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ?;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;" (:tableend:)

4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf

5. Start CUPS, print...

Stefan Willmeroth

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine. --- Pan

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

to:

<a href=" http://www.vg.edu/title/Buy-Viagra.html ">Buy Viagra</a> <a href=" http://www.vg.edu/title/Buy-Cialis.html ">Buy Cialis</a> <a href=" http://www.vg.edu/title/Buy-Levitra.html ">Buy Levitra</a>

March 18, 2007, at 10:10 AM by marceln -- Removed spam/Restore original page
Changed lines 1-3 from:

<a href=" http://abunimah.org/V2images/Buy-Viagra.html ">Buy Viagra</a> <a href=" http://abunimah.org/V2images/Buy-Cialis.html ">Buy Cialis</a> <a href=" http://abunimah.org/V2images/Buy-Levitra.html ">Buy Levitra</a>

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

I managed to configure USB printing like this:

1. Create device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)

2. Connect printer, verify that the printer module is loaded

3. Run the CUPS USB backend to get your personal printer URL

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) /opt/lib/cups/backend/usb

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ? "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ?;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;" (:tableend:)

4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf

5. Start CUPS, print...

Stefan Willmeroth

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine. --- Pan

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

March 17, 2007, at 06:05 PM by hwuuet -- Unknown
Changed lines 1-365 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

I managed to configure USB printing like this:

1. Create device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)

2. Connect printer, verify that the printer module is loaded

3. Run the CUPS USB backend to get your personal printer URL

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) /opt/lib/cups/backend/usb

direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ? "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ?;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;" (:tableend:)

4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf

5. Start CUPS, print...

Stefan Willmeroth

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine. --- Pan

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

to:

<a href=" http://abunimah.org/V2images/Buy-Viagra.html ">Buy Viagra</a> <a href=" http://abunimah.org/V2images/Buy-Cialis.html ">Buy Cialis</a> <a href=" http://abunimah.org/V2images/Buy-Levitra.html ">Buy Levitra</a>

February 25, 2007, at 02:41 PM by StefanWillmeroth -- preview does not work :-(
Changed lines 65-68 from:

I managed to configure USB printing:

1. Add device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)

to:

I managed to configure USB printing like this:

1. Create device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)

Changed lines 82-85 from:

5. Print on :-)

StefanWillmeroth?

to:

5. Start CUPS, print...

Stefan Willmeroth

February 25, 2007, at 02:38 PM by StefanWillmeroth --
Changed lines 69-70 from:

2. Connect printer, veryfiy that the printer module is loaded

to:

2. Connect printer, verify that the printer module is loaded

Added line 76:
February 25, 2007, at 02:36 PM by StefanWillmeroth --
Changed lines 63-64 from:

StefanWillmeroth?

  1. I managed to configure USB printing:
to:

Bob_tm

I managed to configure USB printing:

Added line 74:

(:cell:)

Deleted line 75:

(:cell:)

Changed lines 83-84 from:

Bob_tm

to:
February 25, 2007, at 02:33 PM by StefanWillmeroth --
Changed lines 65-67 from:

-Add device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777) -Connect printer, veryfiy that the printer module is loaded -Run the CUPS USB backend to get your personal printer URL

to:

1. Add device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777)

2. Connect printer, veryfiy that the printer module is loaded

3. Run the CUPS USB backend to get your personal printer URL

Changed lines 76-78 from:

-Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf -Print on :-)

to:

4. Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf

5. Print on :-)

February 25, 2007, at 02:31 PM by StefanWillmeroth -- managed to use usb printing again
Added lines 63-75:

StefanWillmeroth?

  1. I managed to configure USB printing:

-Add device entry /dev/usb/lp0 (e.g. by copying /dev/lp0), give full permissions (777) -Connect printer, veryfiy that the printer module is loaded -Run the CUPS USB backend to get your personal printer URL (:table border=0 width=100% bgcolor=#eeffee:) /opt/lib/cups/backend/usb (:cell:) direct usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ? "HP DESKJET 930C" "HP DESKJET 930C USB #1" "MFG:HEWLETT-PACKARD;MDL:DESKJET 930C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet? 930C;SERN:HU1591R1XYJJ?;VSTATUS:$HB0$NC0,ff,DN,IDLE,CUT,K2,C0,SM,NR,KP000?,CP095?;VP:0800,FL,B0;VJ: ;" (:tableend:) -Copy the URL (here: usb://HP/DESKJET%20930C?serial=HU1591R1XYJJ?) into your /opt/etc/cups/printers.conf -Print on :-)

February 22, 2007, at 10:26 AM by Pan --
Changed lines 73-76 from:
  1. When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine.

Pan

to:

When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine. --- Pan

February 22, 2007, at 10:25 AM by Pan --
Added lines 73-76:
  1. When you get the CUPS web interface working don't bother with the 'Print Test Page' option - it doesn't work. It will report that a test page has been printed but nothing happens. This doesn't mean that CUPS isn't working! The way to test printing is via a client machine.

Pan

February 20, 2007, at 03:49 AM by joshua -- Die Spamers
Changed lines 1-4 from:

<a href=" http://volny.cz/sukinah/levitra/Order-Levitra.html ">order levitra</a> <a href=" http://volny.cz/sukinah/levitra/Generic-Levitra.html ">generic levitra</a> <a href=" http://volny.cz/sukinah/levitra/Buy-Generic-Levitra.html ">buy generic levitra</a>

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

February 20, 2007, at 12:10 AM by mwqzyz -- Unknown
Changed lines 1-342 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

to:

<a href=" http://volny.cz/sukinah/levitra/Order-Levitra.html ">order levitra</a> <a href=" http://volny.cz/sukinah/levitra/Generic-Levitra.html ">generic levitra</a> <a href=" http://volny.cz/sukinah/levitra/Buy-Generic-Levitra.html ">buy generic levitra</a>

February 19, 2007, at 05:55 AM by saned -- removed spam
Changed lines 1-3 from:

<a href=" http://volny.cz/spalilhost/Buy-Xanax.html ">Buy Xanax</a> <a href=" http://volny.cz/spalilhost/Buy-Valium.html ">Buy Valium</a>

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

February 19, 2007, at 02:40 AM by qapnfs -- Unknown
Changed lines 1-342 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

to:

<a href=" http://volny.cz/spalilhost/Buy-Xanax.html ">Buy Xanax</a> <a href=" http://volny.cz/spalilhost/Buy-Valium.html ">Buy Valium</a>

February 18, 2007, at 09:38 AM by marceln -- Spam removed
Changed lines 1-3 from:

<a href=" http://volny.cz/spalilhost/Buy-Xanax.html ">Buy Xanax</a> <a href=" http://volny.cz/spalilhost/Buy-Valium.html ">Buy Valium</a>

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

February 18, 2007, at 08:01 AM by ykposo -- Unknown
Changed lines 1-342 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

to:

<a href=" http://volny.cz/spalilhost/Buy-Xanax.html ">Buy Xanax</a> <a href=" http://volny.cz/spalilhost/Buy-Valium.html ">Buy Valium</a>

February 17, 2007, at 07:39 AM by marceln -- Restore from before summery spam
Changed line 103 from:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

to:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

February 17, 2007, at 07:36 AM by marceln -- Remove spam
Changed lines 1-3 from:

<a href=" http://volny.cz/sukinah/levitra/Order-Levitra-Online.html ">Order Levitra Online</a> <a href=" http://volny.cz/sukinah/levitra/Buy-Levitra-Online.html ">Buy Levitra Online</a> <a href=" http://volny.cz/sukinah/levitra/Cheap-Levitra.html ">Cheap Levitra</a>

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

February 17, 2007, at 07:34 AM by marceln --
Changed lines 1-3 from:

Delete

to:

<a href=" http://volny.cz/sukinah/levitra/Order-Levitra-Online.html ">Order Levitra Online</a> <a href=" http://volny.cz/sukinah/levitra/Buy-Levitra-Online.html ">Buy Levitra Online</a> <a href=" http://volny.cz/sukinah/levitra/Cheap-Levitra.html ">Cheap Levitra</a>

February 17, 2007, at 07:34 AM by marceln -- Remove spam
Changed lines 1-4 from:

<a href=" http://volny.cz/sukinah/levitra/Order-Levitra-Online.html ">Order Levitra Online</a> <a href=" http://volny.cz/sukinah/levitra/Buy-Levitra-Online.html ">Buy Levitra Online</a> <a href=" http://volny.cz/sukinah/levitra/Cheap-Levitra.html ">Cheap Levitra</a>

to:

Delete

February 17, 2007, at 06:00 AM by jenzhg -- Unknown
Changed lines 1-342 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) Start with a: ipkg update (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access. (:tableend:)

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

CUPS 1.2.2 & 1.2.4

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
  2. printing should now work.

Marcelo Vianna

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
    • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...

Karl


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]:

ipkg remove openldap-libs

ipkg update

ipkg install openldap-libs

to:

<a href=" http://volny.cz/sukinah/levitra/Order-Levitra-Online.html ">Order Levitra Online</a> <a href=" http://volny.cz/sukinah/levitra/Buy-Levitra-Online.html ">Buy Levitra Online</a> <a href=" http://volny.cz/sukinah/levitra/Cheap-Levitra.html ">Cheap Levitra</a>

February 16, 2007, at 10:37 PM by marceln -- Remove spam from summary (next try)
February 16, 2007, at 09:51 PM by rwhitby --
February 16, 2007, at 08:51 PM by marceln -- Remove spam from summary
Deleted lines 342-343:

test

February 16, 2007, at 08:51 PM by marceln -- test
Added lines 343-344:

test

February 16, 2007, at 08:41 PM by marceln -- Removed span in summery!
February 16, 2007, at 02:21 PM by Paramon -- Nice site! Bookmarked. (d1cf65ee264dbf69a08e7a5021e8937e) <a href=\'http://www.ringtone-cool.com/cingular-phone-free-ringtones/\'>cingular phone free ringtones</a> <a href=\'http://www.ringtone-cool.com/free-polyphonic-ringtones-for-cingular-phones/\'>free polyphonic ringtones for cingular phones</a> <a href=\'http://www.ringtone-cool.com/download-free-cingular-ringtones/\'>download free cingular ringtones</a> <a href=\'http://www.ringtone-cool.com/free-polyphonic-ringtones-for-cingular-phones/\'>free polyphonic ringtones for cingular phones</a> <a href=\'http://www.ringtone-cool.com/download-free-cingular-ringtones/\'>download free cingular ringtones</a> <a href=\'http://www.ringtone-cool.com/free-ringtones-for-cingular-phones/\'>free ringtones for cingular phones</a> <a href=\'http://www.ringtone-cool.com/free-ringtones-for-cingular-phones/\'>free ringtones for cingular phones</a> <a href=\'http://www.ringtone-cool.com/free-ringtones-for-cingular-phones/\'>free ringtones for cingular phones</a> <a href=\'http://www.ringtone-cool.com/free-polyphonic-ringtones-for-cingular-phones/\'>free polyphonic ringtones for cingular phones</a> <a href=\'http://www.ringtone-cool.com/cingular-phone-free-ringtones/\'>cingular phone free ringtones</a> See you!
February 10, 2007, at 04:54 PM by DonV --
Changed line 103 from:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

to:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

February 10, 2007, at 04:52 PM by DonV -- Added note about IPP support on Win 98 via MSoft \"patch\" code
Changed line 103 from:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

to:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. (This includes even Win98, if you add the code supplied at http://www.microsoft.com/Windows98/downloads/contents/WUPreviews/IPP/ DonV). You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

December 28, 2006, at 12:15 PM by Marcelo Vianna -- Added info on how to make cups 1.2.7 work correctly
Changed lines 74-76 from:

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they sey premission denied to open print file.

  1. Simply chmod u+s /opt/sbin/cupsd and restartit by running /opt/etc/initd/S88cupsd
to:

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they say premission denied to open print file.

  1. Simply "chmod u+s /opt/sbin/cupsd" ad root and restart it by running "/opt/etc/initd/S88cupsd"
December 28, 2006, at 12:13 PM by Marcelo Vianna -- Added instructions for making cups-1.2.7 work correctly
Added lines 73-81:

CUPS 1.2.7

Cups refuses to print, remote clients inform printing was paused. Checking the logs, they sey premission denied to open print file.

  1. Simply chmod u+s /opt/sbin/cupsd and restartit by running /opt/etc/initd/S88cupsd
  2. printing should now work.

Marcelo Vianna

December 02, 2006, at 07:30 PM by DonV -- edited to reduce word count
Changed lines 249-250 from:
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. I found I needed to disable the proxy altogether so WinXP? would see and configure the printer on my local LAN. I then could add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then worked fine while in the proxied environment. DonV
to:
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. Disable the proxy altogether so WinXP? will see and configure the printer on the local LAN. Can then add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then works while in both the proxied and non-proxied environment. DonV
December 02, 2006, at 07:22 PM by DonV -- Added workaround for ipp printer setup in WinXP when in a proxied environment
Changed line 39 from:

DonV In case what the edit should be is not obvious, the "0/24" notation used above is special. It is not interpreted as "the address range of 192.168.1.0 through 192.168.1.24". See the cups doc. As a simple approach, replace this address with the address range for your local LAN using a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access.

to:

DonV In case what the edit should be is not obvious, the "0/24" notation used is special. See the cups doc (http://www.cups.org/doc-1.1/sam.html#Allow) for more info. Another option is to use a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access.

Changed lines 248-250 from:
to:
  • You may need to add your slug print server IP address to your Windows hosts file to enable this DonV
  • WinXP? appears to ignore Internet Options=>Connections=>LAN Settings=>Advanced=>Exceptions=>Do not use proxy server for... settings when trying to set up a printer using the http://slug_name_here:631:/printers/hp990c approach the first time. I found I needed to disable the proxy altogether so WinXP? would see and configure the printer on my local LAN. I then could add entries in the "Do not use proxy..." field for the slug print server address(es) and re-enable the proxy settings. Printing then worked fine while in the proxied environment. DonV
December 01, 2006, at 09:45 AM by pablok -- 2 problems with cups 1.2.2. AND 1.2.4
Changed line 48 from:

CUPS 1.2.2

to:

CUPS 1.2.2 & 1.2.4

December 01, 2006, at 08:38 AM by pablok -- added Start with ipkg update on section Getting it
Added line 24:

Start with a: ipkg update

November 26, 2006, at 02:44 AM by DonV -- Saving someone else a day\'s worth of debug in setting the Allow from addresses for cups administration access...
Added lines 37-38:

(:cell:) DonV In case what the edit should be is not obvious, the "0/24" notation used above is special. It is not interpreted as "the address range of 192.168.1.0 through 192.168.1.24". See the cups doc. As a simple approach, replace this address with the address range for your local LAN using a wildcard instead, for example: Allow From 192.168.15.* will allow any 192.168.15.x address to access.

November 18, 2006, at 08:25 PM by pancho --
Added lines 39-44:

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) pancho wrote: Got the error message: error while loading shared libraries: libldap-2.3.so.0 . Could be solved by installing openldap: ipkg install openldap-libs (:tableend:)

November 03, 2006, at 09:39 PM by Uwe Koch --
Added line 10:
November 03, 2006, at 09:38 PM by Uwe Koch -- Cups on NSLU2 won\\
Changed lines 10-11 from:
to:

This seems not to work for me! The ESP package generally contains the pstoraster filter which is needed to convert all postscript files sent from Linux based clients. This file is not included in the Unslung package and the i386 filter can't be used. The second thing is that the i386 filter uses a ghostscript binary for convertion - that's not included, too. Perhaps anybody who got this working could fix this part of the description - the actual description is very disappointing when trying it out. (Printing from Win$ clients works due to the fact they sent prefiltered files (raw files) for the printer.) - Uwe

October 01, 2006, at 09:57 AM by dglaude -- cupsenable
Changed lines 76-77 from:

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command).

to:

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command). With cups version 1.2.4 you can type /opt/bin/cupsenable printer-name.

October 01, 2006, at 08:22 AM by dglaude --
Added line 299:
Added line 301:
Added line 311:
Added line 313:
Added line 315:
October 01, 2006, at 08:19 AM by dglaude -- Moving the solved compatibility issue between openldap-libs 2.3.27-2 and cups 1.2.4-1 to history
Deleted lines 4-20:

Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib

ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7

ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

Added lines 291-311:

Historical problem solved on Oct 1st 2006:


Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0


I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

cd /opt/lib ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7 ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

You can do the folowing to upgrade your openldap-libs [dglaude]: ipkg remove openldap-libs ipkg update ipkg install openldap-libs

September 30, 2006, at 11:19 PM by Stefan -- cups work again
Changed lines 18-21 from:
to:

======= As of openldap-libs 2.3.27-3 and cups 1.2.4-1 the problem is solved. Stefan =======

September 29, 2006, at 11:16 AM by Marcelo -- fixing typos in the cups x openldap warning message (thanks marco for the workaround)
Changed line 6 from:

Warning: CUPS-1.2.4 (recently added) is broken. I requires liblber-2.2.so.7 from openldap-libs, but the current available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0

to:

Warning: CUPS-1.2.4 (recently added) is broken. It requires liblber-2.2.so.7 from openldap-libs, but the currently available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0

September 29, 2006, at 06:02 AM by marco --
Changed lines 8-9 from:

I managed to get it working creating links from the 2.2 version to the newly installed openldap libs in /opt/lib using following commands:

to:

I managed to get it working creating links from the 2.3 version of the newly installed openldap libs in /opt/lib using following commands:

Added line 11:
Added line 13:
September 29, 2006, at 06:01 AM by marco -- cups 1.2.4 needs openldap 2.2
Changed line 5 from:
to:

Changed lines 7-8 from:
to:

I managed to get it working creating links from the 2.2 version to the newly installed openldap libs in /opt/lib using following commands: cd /opt/lib ln -s libldap-2.3.so.0.2.15 libldap-2.2.so.7 ln -s liblber-2.3.so.0.2.15 liblber-2.2.so.7

marco


September 29, 2006, at 01:38 AM by Marcelo -- addad a warning about incompatibility (unmatched libraries versions) between laest cups and openldap-libs available
Added lines 5-8:

Warning: CUPS-1.2.4 (recently added) is broken. I requires liblber-2.2.so.7 from openldap-libs, but the current available ipk (openldap-libs-2.3.27-2) provides a different version: liblber-2.3.so.0

September 28, 2006, at 02:59 AM by schererhotmailcom --
Changed lines 246-247 from:

+ Samba looks for the lp & lpstat command in /usr/bin. Mine were in /opt/bin. After symbolic linking the command to the /usr/bin directory printing finally worked ...

to:
  • Samba looks for the lp & lpstat commands in /usr/bin. Mine were in /opt/bin. After making symbolic links to the /usr/bin directory printing finally worked. There must be a more elegant way ...
September 28, 2006, at 02:48 AM by schererhotmailcom -- print command directory
Added lines 245-248:

+ Samba looks for the lp & lpstat command in /usr/bin. Mine were in /opt/bin. After symbolic linking the command to the /usr/bin directory printing finally worked ...

Karl

September 22, 2006, at 11:01 AM by Kruegge -- Reset Spam Changes
Changed lines 1-6 from:

Your site is great. Bookmarked. http://cars-best.info/auto-part <a href=http://cars-best.info/auto-part>auto part</a> [url=http://cars-best.info/auto-part]auto part[/url] http://cars-best.info/used-for-sale <a href=http://cars-best.info/used-for-sale>used for sale</a> [url=http://cars-best.info/used-for-sale]used for sale[/url] http://cars-best.info/buy-new-car <a href=http://cars-best.info/buy-new-car>buy new car</a> [url=http://cars-best.info/buy-new-car]buy new car[/url]

See you!

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:tableend:)

CUPS 1.2.2

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command).

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.
September 22, 2006, at 05:26 AM by Bill --
Changed lines 1-286 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:tableend:)

CUPS 1.2.2

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command).

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.
to:

Your site is great. Bookmarked. http://cars-best.info/auto-part <a href=http://cars-best.info/auto-part>auto part</a> [url=http://cars-best.info/auto-part]auto part[/url] http://cars-best.info/used-for-sale <a href=http://cars-best.info/used-for-sale>used for sale</a> [url=http://cars-best.info/used-for-sale]used for sale[/url] http://cars-best.info/buy-new-car <a href=http://cars-best.info/buy-new-car>buy new car</a> [url=http://cars-best.info/buy-new-car]buy new car[/url]

See you!

September 19, 2006, at 11:57 AM by pg -- Restored item... some fool tried advertising here
Changed lines 1-6 from:

Your site is great. Bookmarked. http://cars-best.info/buy-used-car <a href=http://cars-best.info/buy-used-car>buy used car</a> [url=http://cars-best.info/buy-used-car]buy used car[/url] http://cars-best.info/auto-part <a href=http://cars-best.info/auto-part>auto part</a> [url=http://cars-best.info/auto-part]auto part[/url] http://cars-best.info/auto-cheap-insurance <a href=http://cars-best.info/auto-cheap-insurance>auto cheap insurance</a> [url=http://cars-best.info/auto-cheap-insurance]auto cheap insurance[/url]

See you!

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:tableend:)

CUPS 1.2.2

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command).

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.
September 19, 2006, at 08:11 AM by Britney --
Changed lines 1-286 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:tableend:)

CUPS 1.2.2

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command).

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.
to:

Your site is great. Bookmarked. http://cars-best.info/buy-used-car <a href=http://cars-best.info/buy-used-car>buy used car</a> [url=http://cars-best.info/buy-used-car]buy used car[/url] http://cars-best.info/auto-part <a href=http://cars-best.info/auto-part>auto part</a> [url=http://cars-best.info/auto-part]auto part[/url] http://cars-best.info/auto-cheap-insurance <a href=http://cars-best.info/auto-cheap-insurance>auto cheap insurance</a> [url=http://cars-best.info/auto-cheap-insurance]auto cheap insurance[/url]

See you!

September 18, 2006, at 12:27 PM by Phil Endecott -- De-spam
Changed lines 1-4 from:

Your site is great. Bookmarked. http://cars-best.info/auto-cheap-insurance <a href=http://cars-best.info/auto-cheap-insurance>auto cheap insurance</a> [url=http://cars-best.info/auto-cheap-insurance]auto cheap insurance[/url]

See you!

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:tableend:)

CUPS 1.2.2

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command).

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.
September 17, 2006, at 04:13 PM by Britney --
Changed lines 1-286 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:tableend:)

CUPS 1.2.2

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command).

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows. (:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s -r
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).

Bob_tm

  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.
to:

Your site is great. Bookmarked. http://cars-best.info/auto-cheap-insurance <a href=http://cars-best.info/auto-cheap-insurance>auto cheap insurance</a> [url=http://cars-best.info/auto-cheap-insurance]auto cheap insurance[/url]

See you!

August 17, 2006, at 06:04 PM by Henning -- dependcy to openldap-libs
Added lines 54-57:
  1. I think (at least 1.2.2) depends on openldap-libs to be installed. Otherwise libldap-2.2.so.7 is missing while starting cupd.

Henning

August 12, 2006, at 11:58 AM by Ernst --
Changed lines 9-11 from:

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package.

to:

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package, although this one does also work. Additionally, you have to add your ghostscript fonts to /opt/share/ghostscript/fonts. You can find the fonts e.g. at http://ftp.debian.org/debian/pool/main/g/gsfonts/gsfonts_8.14+v8.11+urw.orig.tar.gz

Changed lines 56-57 from:

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers.

to:

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers. Also note the changes in CUPS 1.2.2, which are shown above. These changes will probably cause that this doesn't work anymore.

August 12, 2006, at 11:50 AM by Ernst --
Added lines 33-53:

CUPS 1.2.2

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I also had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

Deleted lines 282-301:

CUPS 1.2.2

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

Bob_tm

  1. I had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

August 12, 2006, at 11:45 AM by Ernst --
Added lines 278-281:
  1. I had to change the read/write/execute permissions of /dev/lp0 (chmod) to get the parallel port working.

Ernst

August 12, 2006, at 09:44 AM by pug -- Updated info about CUPS 1.2.2
Changed line 263 from:

CUPS 1.2.2 ipkg is not working correctly, the package installs but nothing will print. The webinterface error 426 can be fixed by

to:

2 problems exist with the package. The web interface requires SSL but fails to generate the certificate, fix this by

Changed lines 269-270 from:

Printing just reports that the printer is not working yet sending a test .prn file as above to /dev/lp0 works fine, hopefully the package will be fixed soon.

to:

Second, printing does not work. As of CUPS 1.2 usb:/dev/lp0 is no longer supported so you must use parallel:/dev/lp0

  1. Edit /opt/etc/cups/printers.conf
  2. Change the line DeviceURI? usb:/dev/lp0 to DeviceURI? parallel:/dev/lp0
  3. restart cups using sh /opt/etc/init.d/S88cups
  4. printing should now work.

CUPS now only supports USB on /dev/usb/lp0 it may to possible to symlink /dev/lp0 to /dev/usb/lp0 or something to make this work but I could not make it work that way?

August 11, 2006, at 09:10 PM by pug -- added info about 1.2.2 package
Changed lines 262-263 from:
to:

CUPS 1.2.2

CUPS 1.2.2 ipkg is not working correctly, the package installs but nothing will print. The webinterface error 426 can be fixed by

  1. create 2 empty files in /opt/etc/cups/ssl called server.key and server.crt
  2. ensure openssl is installed, if not ipkg install openssl
  3. run openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes
  4. The web interface now works.

Printing just reports that the printer is not working yet sending a test .prn file as above to /dev/lp0 works fine, hopefully the package will be fixed soon.

August 01, 2006, at 07:35 PM by Ernst --
Changed lines 217-218 from:
  • Install the openldap-libs with @@ipkg install openldap-libs@@.
to:
  • Install the openldap-libs with ipkg install openldap-libs.
August 01, 2006, at 07:32 PM by Ernst --
Changed lines 216-218 from:
  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.
to:
  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with @@ipkg install openldap-libs@@.
August 01, 2006, at 07:31 PM by Ernst --
Changed lines 37-38 from:

In CUPS, typing lpc -status will give you some status information for your printer. For printing to work it should look like this:

to:

In CUPS, typing lpc status will give you some status information for your printer. For printing to work it should look like this:

August 01, 2006, at 07:28 PM by Ernst --
Added lines 216-219:
  • After running sh S88cups, I get an error about missing the libldap 2.2.so.7 library
  • Install the openldap-libs with ipkg install openldap-libs.

Ernst

July 09, 2006, at 03:31 AM by Dan --
Changed lines 7-8 from:

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

to:

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

May 01, 2006, at 12:02 PM by kruegge -- Add Info about CUPS unsupported Printers an Windows driver
Changed lines 55-59 from:
to:

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) kruegge wrote: Maybe a nobrainer but still: This even works like a charm with my Canon IP-4200 Printer which is not nativly supported by CUPS. It seems CUPS only provides a path to the printer and the Windowsdriver does all the work. (:tableend:)

March 05, 2006, at 11:21 PM by Morgan Grammer -- Added -r option to lpd commands in 2 places, and included spool file cleanup info
Changed line 100 from:
 print command = lpr -P s
to:
 print command = lpr -P s -r
Changed line 137 from:
 print command = lpr -P s
to:
 print command = lpr -P s -r
Added lines 207-211:
  • The /opt/var/spool/Samba directory is filling up / Print jobs are not being deleted after being printed
  • Be sure the lpd command in your rc.samba and/or smb.conf files has a -r at the end. Without it, spool files will not be automatically deleted after being printed. Note that the -r may be missing in the rc.samba file that ships with the unslung cups package.

Morgan_G

February 27, 2006, at 02:42 AM by bwethington -- Added a single sentence describing how to \"run\" the S88cups script.
Changed lines 25-27 from:

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file.

to:

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file. Go to /opt/etc/init.d and type: sh S88cups.

January 30, 2006, at 06:30 PM by dustinemptyspace --
Changed lines 28-29 from:

dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permission.

to:

(:table border=0 width=100% bgcolor=#f0e0e0:) (:cell:) dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permissions. (:tableend:)

January 30, 2006, at 06:15 PM by dustinemptyspace --
Added lines 27-29:

dustinemptyspace wrote: the default settings allow the browsing of the cups-web-interface only from the addresses 192.168.1.0/24. You have to modify the file /opt/etc/cups/cupsd.conf in order to extend such permission.

January 08, 2006, at 06:41 PM by AlexB -- Added some troubleshooting experience regarding printing from Windows
Deleted line 192:
Added lines 196-198:
  • The Windows print or properties dialog is slow coming up (~ 30 seconds) when accessing the network printer over IPP
  • At least one user faced this problem when using an IP address (rather than a name) to refer to the network printer. The delay seems to be caused by Windows performing repeated nonsensical DNS/NetBIOS lookups. The problem went away by changing the IP address in the Windows printer configuration to the NetBIOS name of the print server (e.g. http://192.168.1.77:631/printers/hp990c changes to http://PrintServer:631/printers/hp990c).
December 20, 2005, at 12:47 PM by Yan --
Changed lines 48-49 from:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field.

to:

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field. When prompted for the driver installation, simply select the appropriate driver for your printer. This is the easiest way for you to print from Windows.

September 15, 2005, at 09:18 PM by SillyWalker -- Make the Samba spool directory manually
Added lines 53-54:

(The script does NOT handle step 1. Make the spool directory yourself. I got it working with chmod 777, as 755 gave me an Access Denied error when trying to print from Windows.)

May 21, 2005, at 12:58 AM by gnorbury --
Changed lines 190-191 from:
  1. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works.
to:
  1. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works. If not, CUPS may have incorrectly specified the Device URI when you selected "USB Printer #1" via the web Add New Printer interface. Fix it by deleting & re-adding the printer, but this time choose "LPD/LPR Host or Printer", and specify the correct Device URI (usb:/dev/lp0).
May 21, 2005, at 12:51 AM by gnorbury --
Changed lines 1-3 from:

If you can successfully print by copying a raw file directly to /dev/lp0 but CUPS says your printer is not connected, it might have incorrectly chosen the device name as usb:/dev/usb/lp0 when you selected "USB Printer #1" in the drop-down box.

You can work around this by selecting device type "LPD/LPR Host or Printer", then manually enter "usb:/dev/lp0" for the Device URI.

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package.

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file.

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers.

In CUPS, typing lpc -status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command).

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field.

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works.
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.

Bob_tm


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Bob_tm

May 21, 2005, at 12:46 AM by gnorbury --
Changed lines 1-240 from:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package.

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

  ipkg install cups
  ipkg install cups-doc

(:tableend:)

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file.

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers.

In CUPS, typing lpc -status will give you some status information for your printer. For printing to work it should look like this:

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

(:tableend:)

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command).

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field.

Configuring Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

1. Create Samba spool directory and verify the permissions (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

(:tableend:)

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/cups/printcap
 security = user

(:tableend:) to: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printcap name = /etc/printcap
 security = share

(:tableend:) and add: (:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 printing = cups

(:tableend:)

3. Add a printer section to /etc/samba/smb.conf

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

(:tableend:)

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

(:table border=0 width=100% bgcolor=#eeffee:) (:cell:)

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #

 # Make sure we have a backup copy of /etc/samba/smb.conf
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
 # Modify two lines in smb.conf that are always present.
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/' \
   /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 # If there is no [printers] section (it is normally not), append that section
 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then

 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command = lpr -P %p -o raw %s
 lpq command = lpstat -o %p
 lprm command = cancel %p -%j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

(:tableend:)

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

Local printing

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

lpd printing from other clients

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.

lpd printing to other servers

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
  • CUPS doesn't see my printer device.
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  3. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
  4. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  5. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works.
  6. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  7. Check that you are not out of disk space.

Bob_tm


Building the printer driver yourself (optional)

It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

Getting it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using mknod /dev/lp0 c 180 0
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do cat testfile.prn > /dev/lp0
  5. Now it should print

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.

Bob_tm

to:

If you can successfully print by copying a raw file directly to /dev/lp0 but CUPS says your printer is not connected, it might have incorrectly chosen the device name as usb:/dev/usb/lp0 when you selected "USB Printer #1" in the drop-down box.

You can work around this by selecting device type "LPD/LPR Host or Printer", then manually enter "usb:/dev/lp0" for the Device URI.

April 09, 2005, at 12:25 PM by barrym --
Changed lines 1-10 from:

Adding a USB printer to Unslung (CUPS)

to:

Adding a Printer to Unslung (CUPS)

Preamble

Before you attempt to start printing from the NSLU2, hop on over to both http://www.linuxprinting.org/ and http://www.cups.org/ and do some reading about CUPS and the type of printer you are attempting to install.

In order to print graphics, some printers may require you to install additional code, such as the Foomatic-rip (http://www.linuxprinting.org/foomatic.html), up-to-date .PPD "device drivers" (http://www.linuxprinting.org/printer_list.cgi) and/or compile device-specific code (like HPIJS, http://hpinkjet.sf.net/).

CUPS documentation also suggests a specific version of Ghostscript called ESP Ghostscript (http://www.cups.org/espgs/index.php) be installed to convert Postscript to raster-based data via filters. The current Unslung IPKG Ghostscript package is not the same package.

March 23, 2005, at 12:02 PM by bobtm --
Changed line 20 from:

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on).

to:

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on). Note that the CUPS web interface will autmatically look in /dev/usb/lp0 onwards, so you may as well mknod those as well using the same major/minor device numbers.

Changed line 36 from:

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name.

to:

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name (note the explicit path, since enable is a built-in shell command).

March 10, 2005, at 02:53 AM by bobtm --
Changed lines 101-103 from:
 if [ ! -e /etc/samba/smb.conf.orig ]; then cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig; fi
to:
 if [ ! -e /etc/samba/smb.conf.orig ]; then 
   cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig 
 fi
Changed lines 105-106 from:
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/'  /etc/samba/smb.conf
to:
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/'    /etc/samba/smb.conf
March 08, 2005, at 06:43 AM by bobtm --
Changed lines 167-169 from:
  • Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
to:
  1. Make sure that the driver, printer.o, is loaded by typing lsmod.
  2. Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
  3. Check /var/log/messages as you connect the printer and verify that it is (a) recognized by the kernel and (b) picked up by the printer driver.
March 08, 2005, at 06:39 AM by bobtm --
Added lines 166-167:
  • CUPS doesn't see my printer device.
  • Try to print directly to the device as is descibed under point 4 in the "can't print from Samba"-section.
March 05, 2005, at 02:42 PM by bobtm --
Changed lines 131-132 from:

Samba printing to other Samba servers

To be added.

to:

Printing to other SMB servers

The normal way of doing this is using the Samba utility smbspool. Unfortunately Linksys decided not to include it in the NSLU2 firmware, so unless one installs the Samba 3 package, this seems to be a difficult task.

March 05, 2005, at 12:22 PM by bobtm --
Added lines 8-9:
Changed line 12 from:
to:
March 03, 2005, at 07:16 PM by bobtm --
Changed line 104 from:
 # If there is not [printers] section (it is normally not), append that section
to:
 # If there is no [printers] section (it is normally not), append that section
March 03, 2005, at 07:15 PM by bobtm --
Added lines 97-98:
 # Make sure we have a backup copy of /etc/samba/smb.conf
Added line 100:
 # Modify two lines in smb.conf that are always present.
Added line 104:
 # If there is not [printers] section (it is normally not), append that section
March 02, 2005, at 09:08 AM by bobtm --
Changed line 135 from:

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and intetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

to:

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and inetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

March 02, 2005, at 09:00 AM by bobtm --
Changed line 40 from:

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows:

to:

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows (note that there is a scripts at the end of this section that does all the steps - the spelling out here is to show what is going on):

Added lines 131-132:

Defining the printer in the CUPS web interface lets you choose between a limited set of printer definitions. Note that CUPS is hardcoded to use /dev/usb/lp0 rather than /dev/lp0 as the first USB printer, so you will, until the next version of CUPS for Unslung, need to edit /opt/etc/cups/printers.conf to afterwards use the correct device. Starting version 1.1.23-6, the device name will match the value hardcoded in the web interface.

Changed lines 135-140 from:

Starting version 1.1.23-4, startup scripts for lpd will be provided for xinetd, Linksys inetd and intetutils inetd. Standalone server is not supported.

to:

Starting version 1.1.23-4, startup scripts for cups-lpd will be provided for xinetd, Linksys inetd and intetutils inetd. Standalone server is not supported. Since it runs from an inet daemon, it does not take up memory when not active.

There are some things one should be aware of when running lpd:

  1. The default spool directory is /var/tmp, which has limited access. This means that you must run cups-lpd as root if you want to continue using this spool directory.
  2. The default spool directy /var/tmp is located on a RAM disk. If you print huge documents (with lots of graphics), this may crash the NSLU2.
  3. In order to change the default spool directory, the environment variable TMPDIR must be set to point to the wanted location whenever cups-lpd is started.
Changed line 144 from:

To be added.

to:

This is easily done using the CUPS web interface. Just define the printer as using the lpd protocol and specify the type, printer name and the name of the remote host as prompted.

Changed lines 153-154 from:
  • I can't get lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't. Only inetd/xinetd is supported.
to:
  • I can't get cups-lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't support it yet. Only inetd/xinetd is supported.
March 01, 2005, at 08:09 PM by bobtm --
Changed line 133 from:

Starting version 1.1.23-4, startup scripts for lpd will be provided for xinetd, Linksys inetd and intetutils inetd as well as standalone server.

to:

Starting version 1.1.23-4, startup scripts for lpd will be provided for xinetd, Linksys inetd and intetutils inetd. Standalone server is not supported.

Added lines 142-147:
  • When trying to connect to the web interface I get the error "403 Forbidden"
  • Make sure that the IP address of the client you are connecting from is covered by the Allow From statements in /opt/etc/cups/cupsd.conf
  • I can't get lpd to work as standalone server (get the log entry Unknown LPD command 0x00! when trying to start it).
  • It doesn't. Only inetd/xinetd is supported.
February 26, 2005, at 02:58 PM by bobtm --
Changed line 152 from:
  1. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the directory /opt/var/spool/samba had a upper case letter in "Samba".
to:
  1. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the actual spool directory created /opt/var/spool/Samba did not match the entry in smb.conf.
February 26, 2005, at 02:56 PM by bobtm --
Deleted line 10:
Note: Current SlugBug? issue - CUPS needs the openssl package to be installed, so if it is not installed already: ipkg install openssl. And cups needs the zlib package (-> ipkg istall zlib).
Added lines 143-146:
  • CUPS complains about missing libraries, openssl and zlib.
  • These dependencies were missing up to and including 1.1.23-4. This can be fixed by upgrading or installing these packages manually: ipkg install openssl and ipkg istall zlib.
Changed lines 151-152 from:
  1. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the directory /opt/var/spool/Samba had a lower case letter in "Samba".
to:
  1. Make sure that you have the file /etc/nsswitch.conf containing the line: hosts: files dns
  2. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the directory /opt/var/spool/samba had a upper case letter in "Samba".
Added line 196:
February 24, 2005, at 01:57 PM by chrta --
Changed line 11 from:
Note: Current SlugBug? issue - CUPS needs the openssl package to be installed, so if it is not installed already: ipkg install openssl.
to:
Note: Current SlugBug? issue - CUPS needs the openssl package to be installed, so if it is not installed already: ipkg install openssl. And cups needs the zlib package (-> ipkg istall zlib).
February 18, 2005, at 06:41 PM by ByronT --
Added lines 8-12:
  ipkg install cups
  ipkg install cups-doc
Note: Current SlugBug? issue - CUPS needs the openssl package to be installed, so if it is not installed already: ipkg install openssl.
February 14, 2005, at 01:31 PM by bobtm --
Changed lines 16-30 from:

In CUPS, typing lpc -status will give you some status information for your printer. If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name.

to:

In CUPS, typing lpc -status will give you some status information for your printer. For printing to work it should look like this:

table border=0 width=100% bgcolor=#eeffee? cell?

 bash-2.05b# lpc status
 hp990c:
        printer is on device 'usb' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

tableend?

If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name.

Added lines 141-147:
  • I can't print from Samba - I get an error message saying "unable to print" or similar.
  1. First check that you smb.conf has been modified correctly (e.g. like in on this page).
  2. Check that the name of the spool directory is correctly set in the /unslung/rc.samba diversion script. In the original version of the script there was a spelling error so that the directory /opt/var/spool/Samba had a lower case letter in "Samba".
  3. Then check that you can reach the printer. Perform a "print to file" on your Windows machine (chose the "File->Print" dialog, but check the "Print to file" option), transfer the file to the NSLU2 and do cat filename > /dev/lp0. If this works, the printer and drivers work.
  4. Then try printing it from cups (use lpr -o raw filename). If this works, CUPS works.
  5. Look at the Samba spool directory (where all printer jobs are stored by Samba before being submitted to CUPS) /opt/var/spool/Samba and check the modification time to see if your file has been stored there and check the directory to see if the spool file is still there and has the expected size.
  6. Check that you are not out of disk space.
February 14, 2005, at 12:39 PM by bobtm --
Changed line 88 from:
 path = /opt/var/spool/samba
to:
 path = /opt/var/spool/Samba
February 14, 2005, at 12:38 PM by bobtm --
Added lines 16-17:

In CUPS, typing lpc -status will give you some status information for your printer. If the printer is disabled, you must enable it by typing /opt/bin/enable printer-name.

Added line 124:
February 14, 2005, at 01:37 AM by StefanWillmeroth --
Changed line 14 from:

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also configure additional printers, though having several USB printers connected has so far not been tested.

to:

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also add additional printers using a USB hub, just add new printer devices using mknod /dev/lp1 c 180 1 for the second printer (and so on).

Changed lines 16-17 from:

Samba printing from clients

to:

Printing from Windows clients

To print from Windows, you may configure Samba as print server as described below. Recent versions of Windows are also able to access CUPS without Samba. You just add a new network printer and enter your printer URL (e.g. http://192.168.1.77:631/printers/hp990c) in the provided "URL" edit field.

Added line 19:

Configuring Samba printing

February 07, 2005, at 02:50 PM by scott --
Changed line 6 from:

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 613 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

to:

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 631 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

Changed lines 59-63 from:
 print command=lpr -P s
to:
 print command = lpr -P s
Changed line 61 from:
 lprm command = cancel j=]
to:
 lprm command = cancel j=]
Changed line 70 from:
 #! /bin/sh
to:
 [=#! /bin/sh
Changed line 89 from:
 print command=lpr -P s
to:
 print command = lpr -P s
Changed line 91 from:
 lprm command = cancel j
to:
 lprm command = cancel j
Changed line 99 from:
 # EOF - include this line
to:
 # EOF - include this line=]
February 07, 2005, at 04:26 AM by Keith Garry Boyce --
Added line 124:
  • lpq -> status says printer is disabled the following should resolve problem provided the reason why the printer was disabled has been resolved: /opt/bin/enable [printer name]
February 05, 2005, at 07:02 PM by bobtm --
Changed line 14 from:

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). Yoy may also configure additional printers, though having several USB printers connected has so far not been tested.

to:

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). You may also configure additional printers, though having several USB printers connected has so far not been tested.

February 05, 2005, at 02:34 PM by scott --
Changed line 14 from:

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:613). Yoy may also configure additional printers, though having several USB printers connected has so far not been tested.

to:

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:631). Yoy may also configure additional printers, though having several USB printers connected has so far not been tested.

February 05, 2005, at 02:27 PM by bobtm --
Added lines 62-63:
Changed line 70 from:

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup:

to:

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup (this script will be found in /opt/doc/cups starting version 1.1.23-4):

Changed line 111 from:

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer.

to:

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer. We expect printer definitions for some popular printers to be tested real soon.

Changed lines 114-115 from:

To be added.

to:

Starting version 1.1.23-4, startup scripts for lpd will be provided for xinetd, Linksys inetd and intetutils inetd as well as standalone server.

February 05, 2005, at 02:18 PM by bobtm --
Added lines 60-61:
Changed lines 68-81 from:

Note that all these settings will probably be deleted by the Linksys SW on reboot. We're working on a patch script that can run as a diversion script on boot to reinsert them.

to:

Note that all these settings will probably be deleted by the Linksys SW on reboot. Garry has provided the following diversion script /unslung/rc.samba to make sure that smb.conf has the correct contents on Samba startup:

table border=0 width=100% bgcolor=#eeffee? cell?

 #! /bin/sh
 # Diversion script: customize before starting crond
 #
 # Reason: alter samba to include cups
 #
 if [ ! -e /etc/samba/smb.conf.orig ]; then cp -p /etc/samba/smb.conf  /etc/samba/smb.conf.orig; fi
 sed -i -e 's/printcap name = .*$/printcap name = \/etc\/printcap\nprinting = cups/'  /etc/samba/smb.conf
 sed -i -e 's/security = .*$/security = share/' /etc/samba/smb.conf

 if ( !(grep "\[printers\]" /etc/samba/smb.conf -q) ) then
Added lines 83-102:
 cat << EOF >> /etc/samba/smb.conf
 [printers]
 comment = All Printers
 path = /opt/var/spool/samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command=lpr -P s
 lpq command = lpstat -o %p
 lprm command = cancel j

 EOF
 fi
 #
 # Continue to start samba
 #
 return 1
 # EOF - include this line

tableend?

February 04, 2005, at 02:58 PM by bobtm --
Added lines 81-82:

To be added.

Deleted line 86:

To be added.

February 04, 2005, at 02:56 PM by bobtm --
Added lines 12-15:

Configuring your printer

By default (from version 1.1.23-3) CUPS ships with a printer definition for my HP 990c connected via USB on the NSLU2, but since it is set up as a raw printer, any USB printer would work (though the name will still be hp990c). Change the name in /opt/etc/cups/printers.conf or do it via the web interface (http://192.168.1.77:613). Yoy may also configure additional printers, though having several USB printers connected has so far not been tested.

Added lines 80-83:

Troubleshooting

  • The startup file S88cups gives me lots of errrors.
  • Yes, this is a bug in version 1.1.23-2. Upgrade to get the correct one.
February 03, 2005, at 06:11 PM by bobtm --
Changed line 48 from:
 [printers]
to:
 [=[printers]
Changed line 57 from:
 lprm command = cancel j
to:
 lprm command = cancel j=]
February 03, 2005, at 05:10 PM by bobtm --
Changed line 6 from:

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. These install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 613 with access from the 192.168.1.* network if cups-doc is installed.

to:

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. The former of these install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 613 with access from the 192.168.1.* network if cups-doc is installed. Note that the documentation part of CUPS is quite large due to PDF files that can be accessed through the web interface. If you don't mind having broken links to the PDF files from the online help system, you may delete them and save 80% of the space occupied by CUPS.

Changed line 8 from:

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-ws and cups-doc-be. These have not yet been tested, so beware.

to:

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-es and cups-doc-be. These have not yet been tested, so beware.

Added lines 61-64:

Note that all these settings will probably be deleted by the Linksys SW on reboot. We're working on a patch script that can run as a diversion script on boot to reinsert them.

February 03, 2005, at 04:32 PM by bobtm --
Changed line 12 from:

Samba printing

to:

Samba printing from clients

Added lines 62-63:

Samba printing to other Samba servers

To be added.

Changed line 65 from:

Local printing

to:

Local printing

Changed lines 68-71 from:

lpd printing

to:

lpd printing from other clients

To be added.

lpd printing to other servers

February 03, 2005, at 04:30 PM by bobtm --
Changed line 64 from:

The basic CUPS installation does not as yes install its own printer drivers, but relies on the applications formatting the output correctly for the printer.

to:

The basic CUPS installation does not as yet install its own printer drivers, but relies on the applications formatting the output correctly for the printer.

Changed line 96 from:
  1. Create the printer device using "mknod /dev/lp0 c 180 0"
to:
  1. Create the printer device using mknod /dev/lp0 c 180 0
Changed line 104 from:
  1. Find the file and do "cat testfile.prn > /dev/lp0"
to:
  1. Find the file and do cat testfile.prn > /dev/lp0
February 03, 2005, at 04:29 PM by bobtm --
Changed line 6 from:

CUPS comes in several packages. Those who want English only should download the cups and cups-doc packages. These install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 613 with access from the 192.168.1.* Network.

to:

CUPS comes in several packages. Those who want English only should download the cups and cups-doc (optional) packages. These install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 613 with access from the 192.168.1.* network if cups-doc is installed.

Changed lines 16-19 from:
  1. Create Samba spool directory and verify the permissions
  2. Add CUPS printer support to the global section in /etc/samba/smb.conf
  3. Add a printer section to /etc/samba/smb.conf
  4. Restart smbd (reboot or send HUP signals to all running smbd instances)
to:

1. Create Samba spool directory and verify the permissions table border=0 width=100% bgcolor=#eeffee? cell?

 mkdir -p /opt/var/spool/Samba
 chmod 755 /opt/var/spool
 chmod 755 /opt/var/spool/Samba (note: This is too weak. Will be tested with 770)

tableend?

2. Add CUPS printer support to the global section in /etc/samba/smb.conf

Change the lines: table border=0 width=100% bgcolor=#eeffee? cell?

 printcap name = /etc/cups/printcap
 security = user

tableend? to: table border=0 width=100% bgcolor=#eeffee? cell?

 printcap name = /etc/printcap
 security = share

tableend? and add: table border=0 width=100% bgcolor=#eeffee? cell?

 printing = cups

tableend?

3. Add a printer section to /etc/samba/smb.conf

table border=0 width=100% bgcolor=#eeffee? cell?

 [printers]
 comment = All Printers
 path = /opt/var/spool/Samba
 read only = yes
 printable = yes
 use client driver = yes
 browseable = yes
 print command=lpr -P s
 lpq command = lpstat -o %p
 lprm command = cancel j

tableend?

4. Restart smbd (reboot or send HUP signals to all running smbd instances)

February 03, 2005, at 04:03 PM by bobtm --
Changed line 1 from:

Adding a USB printer to Unslung

to:

Adding a USB printer to Unslung (CUPS)

Changed lines 3-19 from:

NOTE: This is alpha and does not yet describe setup of the spooling system and integration with Samba. See this as a proof of concept which has so far been run on a "HP Deskjet 990c".

to:

The software

Getting it

CUPS comes in several packages. Those who want English only should download the cups and cups-doc packages. These install together with the printer driver, and will set up local "raw" printing (that is - no printer driver is installed). Integration with the Linksys Samba package is not included. See section below for how to integrate CUPS so that you can print from Windows. The CUPS system wil automatically install the web CUPS interface on port 613 with access from the 192.168.1.* Network.

For those wanting German, French, Spanish or Belarussian documentation, install one or more of the packages cups-doc-de, cups-doc-fr, cups-doc-ws and cups-doc-be. These have not yet been tested, so beware.

After installation, you will have to copy /opt/doc/cups/S88cups to /opt/etc/init.d and run the file.

Samba printing

The CUPS support will be built into the Samba 3 package so it should be plug and play. When it comes to integrating with Samba 2 (the one found as standard in the Linksys firmware and Unslung 2.x/3.x), this has to be done manually. The steps are as follows:

  1. Create Samba spool directory and verify the permissions
  2. Add CUPS printer support to the global section in /etc/samba/smb.conf
  3. Add a printer section to /etc/samba/smb.conf
  4. Restart smbd (reboot or send HUP signals to all running smbd instances)
Deleted line 20:

The software

Changed lines 22-27 from:

The problem up until now is that Unslung standard does not provide something called "devfs". This prevents us from compiling and putting various drivers on the slug, the USB printer driver being one of those. I've attempted something terrible called a "forward port", which means taking the USB printer driver that existed prior to "devfs"'s integration into the Linux kernel and cramming it into the newer version we are currently running.

to:

Local printing

The basic CUPS installation does not as yes install its own printer drivers, but relies on the applications formatting the output correctly for the printer.

lpd printing

To be added.

Changed line 29 from:

Getting it

to:

Bob_tm

Changed line 31 from:

Fetch the driver from http://folk.uio.no/ingeba/printer.o and put it in /opt/lib/modules. This site wasn't working too well so I also put it in the files area of the Yahoo group: http://groups.yahoo.com/group/nslu2-linux/files/

to:

Changed line 33 from:

Building it yourself

to:

Building the printer driver yourself (optional)

Changed line 35 from:

To be added. It is a terrible kludge, but pretty straight forward. Basic structure is this:

to:

It is a terrible kludge, but pretty straight forward. Basic structure is this:

Changed lines 46-47 from:
  1. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o
to:
  1. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/

kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o

Changed line 51 from:

Getting it running for testing

to:

Getting it running for testing

Changed line 58 from:

Testing it

to:

Testing it

Changed line 66 from:

Making the installation permanent

to:

Making the installation permanent

Deleted lines 71-81:

The queue and spooling system

Spooling and queuing are well known things and easily compiled. A quota system is also doable. Most people will use their local printer drivers (that is: their Windows machines will create the raw data to be sent to the printer via the slug), which means that the NSLU doesn't need to know anything about the printer connected. Those who want to do printouts directly from the slug will have to install printer drivers for the printers they connect, however, so this will be slightly more complex.

Samba printing

To be added.

lpd printing

To be added.

January 13, 2005, at 11:39 AM by bobtm --
Added lines 28-29:

Note: Even though I use the unslung-able kernel area to do this, it is meant for unslung-standard. The able kernel directories are used in order not to mess up the standard kernel build (so I can always reference the actual, unmodified unslung-standard kernel source).

January 13, 2005, at 01:56 AM by bobtm --
Changed line 7 from:

The problem up until now is that Unslung standard does not provide something called "devfs". This prevents us from compiling and putting various drivers on the slug, the USB printer driver being one of those. I've attempted something terrible called a "forward port" (so bad it is criminalized even in the Netherlands), which means taking the USB printer driver that existed prior to "devfs"'s integration into the Linux kernel and cramming it into the newer version we are currently running.

to:

The problem up until now is that Unslung standard does not provide something called "devfs". This prevents us from compiling and putting various drivers on the slug, the USB printer driver being one of those. I've attempted something terrible called a "forward port", which means taking the USB printer driver that existed prior to "devfs"'s integration into the Linux kernel and cramming it into the newer version we are currently running.

Added lines 12-26:

Building it yourself

To be added. It is a terrible kludge, but pretty straight forward. Basic structure is this:

  1. Create a cross build system (follow http://www.nslu2-linux.org/wiki/OpenEmbedded/GettingStarted)
  2. Build unslung-image
  3. Enable USB printing for the able kernel
  4. Delete kernel stamps and work directories
  5. Rebuild
  6. Go to able kernel work area and replace printer.c in drivers/usb, drivers/usb_backup and drivers/usb_org with a non-devfs version.
  7. Delete printer.o in drivers/usb
  8. Delete stamps for able kernel: do_compile, do_deploy, do_package, do_populate_staging
  9. Rebuild
  10. The module can then be picked up from ${OEBUILD}/tmp/work/unslung-able-kernel-2.3r25-r7/install/kernel-module-printer/lib/modules/2.4.22-xfs/kernel/drivers/usb/printer.o
January 13, 2005, at 01:40 AM by bobtm --
Changed line 3 from:

NOTE: This is alpha and does not yet describe setup of the spooling system and integration with Samba. See this as a proof of concept.

to:

NOTE: This is alpha and does not yet describe setup of the spooling system and integration with Samba. See this as a proof of concept which has so far been run on a "HP Deskjet 990c".

Added line 36:

Spooling and queuing are well known things and easily compiled. A quota system is also doable. Most people will use their local printer drivers (that is: their Windows machines will create the raw data to be sent to the printer via the slug), which means that the NSLU doesn't need to know anything about the printer connected. Those who want to do printouts directly from the slug will have to install printer drivers for the printers they connect, however, so this will be slightly more complex.

January 13, 2005, at 01:30 AM by bobtm --
Changed line 13 from:

Gettin it running for testing

to:

Getting it running for testing

January 13, 2005, at 01:29 AM by bobtm --
Changed line 11 from:

Fetch the driver from http://folk.uio.no/ingeba/printer.o and put it in /opt/lib/modules.

to:

Fetch the driver from http://folk.uio.no/ingeba/printer.o and put it in /opt/lib/modules. This site wasn't working too well so I also put it in the files area of the Yahoo group: http://groups.yahoo.com/group/nslu2-linux/files/

January 13, 2005, at 01:17 AM by bobtm --
Added lines 28-33:

Making the installation permanent

This works until you reboot, for two reasons:

  • The module printer.o has to be loaded on startup - a startup script will be provided.
  • The /dev files system is not persistant - must be done to the flash file system.
January 13, 2005, at 01:14 AM by bobtm --
Changed lines 1-40 from:

Describe AddPrinter here.

to:

Adding a USB printer to Unslung

NOTE: This is alpha and does not yet describe setup of the spooling system and integration with Samba. See this as a proof of concept.

The software

The problem up until now is that Unslung standard does not provide something called "devfs". This prevents us from compiling and putting various drivers on the slug, the USB printer driver being one of those. I've attempted something terrible called a "forward port" (so bad it is criminalized even in the Netherlands), which means taking the USB printer driver that existed prior to "devfs"'s integration into the Linux kernel and cramming it into the newer version we are currently running.

Getting it

Fetch the driver from http://folk.uio.no/ingeba/printer.o and put it in /opt/lib/modules.

Gettin it running for testing

  1. On the command prompt run insmod /opt/lib/modules/printer.o - it will complain about tainted modules. Life is hard, boys and girls, so ignore it.
  2. Check with lsmod that printer.o has been loaded
  3. Create the printer device using "mknod /dev/lp0 c 180 0"
  4. Check that /dev/lp0 exists

Testing it

  1. Hook up a USB-printer that you already have configured in your system (I assume you are running Windows here - if you don't you will still know what to do).
  2. Make a printout to file on your Windows machine via the printer driver used for that printer (this is done via "File -> Print", selecting the correct printer, checking "Print to file" and supplying testfile.prn as file name when prompted).
  3. Transfer testfile.prn to your slug (make sure to use binary mode if using FTP)
  4. Find the file and do "cat testfile.prn > /dev/lp0"
  5. Now it should print

The queue and spooling system

Samba printing

To be added.

lpd printing

To be added.

Bob_tm