Printing

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search

This article Based on work by Myno, andre, mindbender, downlalaway, Thorongil, frontalot, and TcT. Originally by downlalaway at Linkstationwiki.org
This is a basic run through of USB devices connecting for Debian on an PPC LinkStation. The USB hard drive is USB 2.0 at 3Mb/s (on a laptop HD). NB. This was based on using the original kernel #990 conversion of the LS 1 and not the Freelink project. It has been updated for use with Freelink 1.11 but requires run-throughs by others to check. USB and hotplug was/is a little flakey on 2.4 kernels in recognising devices. A reboot while the device is in should make things work. The 2.6 debian kernel is highly recommended if hot-swapping of usb devices might occur.

Contents

Printing

CUPS Printer

Assuming you're running testing or unstable then:

apt-get install cupsys cupsys-driver-gutenprint cupsys-pt cups-pdf

As at July 06 cupsys-driver-gutenprint is not in Debian stable 'Sarge' (default freelink 1.11) - you can either dist-upgrade to testing 'etch' (use caution - which is why its not described) or just install the odd package from testing or unstable, such as gutenprint by following: Unstable packages and adjusting as you feel appropriate.

Testing instead of unstable is generally fairly up-to-date but with fewer problems.

apt-get install gs-common gs-esp gs-gpl gsfonts xpdf

for pdf and possibly to help gimp-print drivers

apt-get install hotplug usbview usbutils

for easier usb device info -if you haven't done it already view Hard drive

cd /dev; ./MAKEDEV -v usb             

(probably unnecessary)

mknod /dev/usblp0 c 180 0   

(think this makes the show work)

mknod /dev/usblp1 c 180 0              

(added this for luck)

Personal note: I ran the above three lines, agonized for hours over configuring CUPS, then ended up going to /dev again, deleting usblp0 and usblp1, running ./MAKEDEV again (this time without any parameters), and voila my testpage suddenly appeared (it had been trying to print for a long time, but said the printer was disconnected. I'm not an expert in devices either so I have no idea why this solved my problem - but it seems it did.
Additional note: I had to allow write permission for all users on usblp0 and usblp1 (sudo chmod a+w usblp*) before the testpage would appear. Otherwise, I kept getting the message: Printer not connected, will retry in 30 seconds...

Probably reboot LS (for kernel 2.4.17). Reboot printer then insert.

lsusb
 

It should show the printer connected somewhere

usbview 

This should show it again (in a gui via vnc) and show the Name:usblp and interface number (mine is 1 possibly due to it being also a scanner). Go through the cups web interface http://localhost:631 if you have mozilla running on-board.

Sarge .conf

Alternatively edit cupsd.conf and scroll down to the Allow localhost lines near the bottom and add

Allow From @LOCAL

below the lines:

Allow From 127.0.0.1

This will allow locally networked computers to access and admin the printer config. Turn off the @LOCAL or modify for your IP only if you don't trust everyone to be able to admin it.

NB. Cupsys 1.2 and 1.2.1 have changed a little and have an apparent bug (or zealous security feature):

The Allow From localhost line in the /etc/cups/cupsd.conf line locks out any other added Allow lines, e.g. local network connections. Replace it with Allow 192.168.1.x for the LS's LAN address and add

Allow @LOCAL 

for your lan and any others you need. It seemed to work... Check access with typing http://linkstationip:631 into a browser.

Etching .conf

I needed to change this line in cupsd.conf to be able to get the webpage up:

# Only listen for connections from the local machine.
Listen localhost:631

to

Listen <LinkstationIP>:631

Then add Allow @LOCAL or IP address's as required

Setup

Select printers, add printer, enter the Name, location descripton etc (there are notes about no spaces in names - maybe an old version of cups tho). Select usb #1 interface and then your printer from the next lists. If your printer isn't in gutenprint then you might need to check it in linuxprinting.org. Cupsys-gutenprint gives you every printer possible, a bit unnecessary usually. Hopefully returning to the printer page it should show it on

usb:/dev/usblp0

USB 1 interface number printer gives usblp0, USB 2 interface gives usblp1 etc. Both worked for me!?

Print a test page from the web interface and be very joyful if it works first time. To troubleshoot: Reboot the linkstation, unplug the printer, reboot the printer while plugged in... trying test pages. Often it springs into life when not expecting and then works for evermore. Do usbview through a vnc link to see if it connected properly at each stage.

Now there's two ways of setting up to be able to print from your other networked computers -IPP printing and samba printing. IPP is preferred since samba currently shows delays in printing.

Cups-IPP Printing

You can share you printer to your network without using Samba. Thus, you can easily share your printer without bothering about Samba configs.

Working with RAW printers (you use the driver on your client, simply add the printer with driver "RAW" in CUPS web interface) is in my case sped up by the factor 100, as Windows and Samba and Cups do not need to argue about the driver to be used and access rights.

Personal note: In my CUPS web interface (version 1.2.2), I never got the option of adding a printer with driver "RAW", it just offered me a subset of the available printers, seemingly based on some autoconfiguration options (I only saw HP printers, which is what I have). Disconnecting the printer did not result in RAW being offered. After a great deal of trial and error I removed the "MyPrinterName.ppd" file which was automatically created in /etc/cups/ppd/ . After removing this file, my printer was finally listed as a "Raw Printer" in the CUPS web interface, and I managed to print according to the instructions below (I needed to have my printer driver disk ready to install, since each client needs its own driver due to the lack of a device-specific driver on the server).

For sharing to your net 192.168.0.x, you simply add "allow from 192.168.0.*" to the line configuring access to CUPS in cupsd.conf. Or one can use @LOCAL -see above.

To add the printer in Windows, goto Settings, Printers & Faxes, Add a printer, say "Network printer", now select "Connect to Printer on Internet or your Intranet via HTTP" and put in:

http://<linkstationaddress>:631/printers/<printername>

Now you are prompted for a driver, if CUPS does not provide one. In the case of a RAW printer, you must always select a driver and use it.

Thats it, you are done, wasn't that easier than fumbling around with smbd.conf?

Cups-PDF Printing

Cups-pdf is installed to do a pdf printer, but I think the gs files are needed to allow it to work. xpdf is used to view the pdfs (through a vnc connection). To activate a cups-pdf printer: go to Cups web interface then add printer, insert name etc (no spaces), find Virtual Printer(PDF printer) at bottom, select postscript (I did at least), 'Generic postscript color..' on next page and go back to the start.

One can adjust resolution if needed. Print a test page. It should end up in /root/cups-pdf since logged in as root in the web interface. Otherwise it will print in the /home/username/cups-pdf/. There's error messages available in the web interface too. There appears to be no direct way to change the output directories, but it can be shared by creating a symlink to the /home/username/cups-pdf directory within an area already shared in samba. If samba share permissions allow access to the cups-pdf folder the pdf files will appear in this new directory when you print them. e.g. If you have guest access on the samba share check read permissions for others apply to the cups-pdf folder and pdfs. Also make sure wide links=no is not in smb.conf for that share. A command to create the symlink will go as:

ln -s /home/username/cups-pdf /mnt/sambashare/pdfoutput

Replacing username with your standard samba share user and sambashare with the directory name (or path) that you want the new pdfoutput directory to appear. This needs clarifying a little but should work with a little investigation.

Samba for Printers (although IPP is recommended & faster)

All the following Samba configurations can be done more easily through Webmin (see Articles/DebianWebmin) instead of manually editing the conf file. Samba settings for M$ printing. My config in /etc/samba/smb.conf (relevant section):


[global]
.
.
load printers = yes
printing = cups
printcap name = cups
show add printer wizard = No
guest account = nobody
[printers]
comment = All Printers
path = /tmp
browseable = yes
printable = yes
create mask = 0777
use client driver = yes
print command = lpr -P %p -o raw %s -r
guest ok = yes
guest account = nobody
[print$]
comment = Printer Drivers
path = /etc/samba/drivers
browseable = yes
read only = yes
guest ok = no
write list = root

It works ok for me! Others may wish to change guest access for internal network security.

Do a /etc/init.d/samba restart then switch to your M$ box. Find each printer on your linkstation in network neighbourhood and double click etc and select the correct driver for the physical printer and the Apple Color LW 12/660 PS printer for the PDFprinter. For the PDF printer check that colour is selected in the default printing properties on the M$ box -can default to B&W. All this took a few evenings to finally sort out (thanks for help to wartstew). The breakthrough was getting cups with gimp-print drivers to run (it broke first time) and getting the usb port right.


Enjoy and please carefully comment if it doesn't work or changes needed.

Originally by downlalaway and edited by frontalot, Myno, andre, mindbender, downlalaway, Thorongil and TcT from linkstationwiki.org