Tuesday, July 21, 2009

Printing in Ubuntu

I had my linux laptop printing to my Brother MFC-210c printer, but since i've changed laptops and now finally got a dedicated linux machine, I wanted to setup a print server. First things first, get the printer to work with CUPS.

Followed instructions from this website:
http://ubuntuforums.org/showthread.php?t=590793

Also very useful was Brother's linux support site (very happy that they're doing this! my next printer is probably going to be Brother too when this one fails!)

*http://solutions.brother.com/linux/en_us/index.html


*http://solutions.brother.com/linux/en_us/instruction_prn1a.html#dpkg1



machine arch: intel p4 HT running ubuntu 8.10

(repeated below for local record)

* install tcsh:


sudo apt-get install tcsh


* download lpd and cups drivers (.dep packages)
from here and here



cd ~/temp/brother-driver
sudo mkdir /var/spool/lpd
sudo dpkg -i --force-all --force-architecture mfc210clpr-1.0.2-1.i386.deb
sudo mkdir /usr/share/cups/model
sudo dpkg -i --force-all cupswrapperMFC210C-1.0.2-3.i386.deb


NB: replace above .deb package with appropriate ones if things change later.

check if the drivers were correctly installed:

dpkg -l | grep --ignore-case brother


The above should generate an output that looks like below:

ii brscan2 0.2.4 Brother Scanner Driver
ii cupswrappermfc210c 1.0.2-3 Brother MFC210C CUPS wrapper driver
ii mfc210clpr 1.0.2-1 Brother lpr Inkjet Printer Definitions


At this point, i was ready to print a test page. However going to System | Administration | Printing showed me two Brother MFC-210C printers. One was listed as a "text only printer", which I simply deleted (because it wasn't working to begin with). Check on the remaining icon that it is listed as "Brother MFC-210C CUPS v1.1" (right click, select Properties).

Print a test page!

Next step, getting the printer shared so that windows machines can print to it.

This needs samba installed and working, which i'm assuming is already done. if not, there's another page on this blog that should help you get up and running.

The following howto page is helpful

http://tldp.org/HOWTO/Debian-and-Windows-Shared-Printing/sharing_with_windows.html

However, these throw open the system to all, so i decided to make some modifications


cd /etc/samba
sudo vi /etc/samba/smb.conf.master


add / modify the following section

[printers]
comment = All Printers
browseable = yes
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
use client driver = yes



restart samba

sudo testparm -s smb.conf.master > smb.conf
sudo /etc/init.d/samba restart


Modify cups files

Windows printer drivers format their output for the printer before sending it across the network. You must configure CUPS to accept the pre-formatted output by uncommenting the following line from


sudo vi /etc/cups/mime.convs



application/octet-stream application/vnd.cups-raw 0 -

Also uncomment the following line from

sudo /etc/cups/mime.types


application/octet-stream

Now CUPS must be told to allow connections from other machines on the network. Add these lines to /etc/cups/cupsd.conf:



AuthType None
Order Deny,Allow
Deny From All
Allow From 192.168.1.*/255.255.255.0




This allows only machines on the local network to access the cups driver.

restart the cups daemon

sudo /etc/init.d/cups restart

No comments: