User avatar
mikerr
Posts: 2469
Joined: Thu Jan 12, 2012 12:46 pm
Location: Up north , UK
Contact: Website

Printserver for windows clients (Samba and CUPS)

Mon Sep 17, 2012 11:03 pm

A quick list of how I got my Pi to operate as print server for my windows network,
with a Samsung ML-4500 parallel laser printer.

I thought the parallel port might be a problem, but raspian happily needed zero configuration to use this interface I found in a drawer:

Image
Basically its a USB hub / ps2 kb&mouse / serial / parallel / ethernet all from one USB socket (powered directly by the Pi)


I already had Samba setup for filesharing, so on with the printing:

Install CUPS (Common Unix Printing System)

Code: Select all

sudo apt-get cups
Add the user "Pi" into the printer admin group:

Code: Select all

sudo usermod -a -G lpadmin pi


Now you can use it via the web interface at http://127.0.0.1:631 (on the Pi itself)

From there you can goto the administration section, and add your printer.

Note: to ease load on the Pi, you can set the manufacturer as "Raw" - then later choose the correct driver on the windows PC.

Now to edit samba config file /etc/samba/smb.conf

Code: Select all

# CUPS printing.  See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
   printing = cups
   printcap name = cups
[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = yes
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /usr/share/cups/drivers
   browseable = yes
   read only = yes
   guest ok = no

Restart samab:

Code: Select all

sudo /etc/init.d/samba restart
Then I could browse //raspberrypi from the Windows PC,
Image

Right click connect and windows PCs (and select local drivers) then can then print to the RPi printer over the network.
Last edited by mikerr on Mon Sep 17, 2012 11:30 pm, edited 2 times in total.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: Printserver for windows clients (Samba and CUPS)

Mon Sep 17, 2012 11:26 pm

Not clear.... did you connect the device to the RPi ? Via USB? And then use CUPs to direct print jobs to the RPi which hands them off to the device which is connected to your printer.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

User avatar
mikerr
Posts: 2469
Joined: Thu Jan 12, 2012 12:46 pm
Location: Up north , UK
Contact: Website

Re: Printserver for windows clients (Samba and CUPS)

Mon Sep 17, 2012 11:42 pm

Yes, the printer is connected to the Raspberry Pi:

Pi ->USB->Parallel->Laser Printer

Windows PCs print to it over the network.

The Pi also has a 2TB external HDD attached, serving files to the rest of the house too.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: Printserver for windows clients (Samba and CUPS)

Mon Sep 17, 2012 11:50 pm

mikerr wrote:Yes, the printer is connected to the Raspberry Pi:
RPi -> USB -> Device out of Drawer with Parallel Ports -> Parallel Port -> Laser Printer

Just was trying to make sure since you kind of glossed over the box you pulled out of the draw. So I wasn't sure if you were connecting an actual Parallel port directly to the RPi or if USB to the device using it's parallel ports to the printer.

Very cool BTW.... any description on the interface device you are using?

Assumption you are using a wired network for this... would be interesting if it could handle the load with a WiFi connection... could place it anywhere you could access the WiFi network without cables.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

User avatar
mikerr
Posts: 2469
Joined: Thu Jan 12, 2012 12:46 pm
Location: Up north , UK
Contact: Website

Re: Printserver for windows clients (Samba and CUPS)

Mon Sep 17, 2012 11:58 pm

The unit is this one:

Image

http://www.usbgear.com/dock/ $99 - (though I won't have paid that for it, I've a vague memory of it being £25 ($40) )

It has a socket for 5v power like a hub, but works ok powered directly from the pi
(my Pi has the polyfuses bypassed - like a rev2 Pi)

This Pi sits next to the router, so no need for wireless though it is actually configured - I did used to have a wifi dongle on it.
I also want max network performance out of it as it now serves files too.

I'm also glad to have managed without needing a powered usb hub (saved another power plug!)
- I doubt i'd manage to avoid that if I had wifi + external HDD + docking-station
Last edited by mikerr on Tue Sep 18, 2012 12:21 am, edited 4 times in total.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: Printserver for windows clients (Samba and CUPS)

Tue Sep 18, 2012 12:16 am

Thanks...
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

User avatar
mikerr
Posts: 2469
Joined: Thu Jan 12, 2012 12:46 pm
Location: Up north , UK
Contact: Website

Re: Printserver for windows clients (Samba and CUPS)

Mon Sep 24, 2012 5:00 pm

Also add the line below into the [printers] section:

Code: Select all

use client driver = yes
Without that line windows XP machines can print, but not view/edit the print queue
(and the printer shows up with "printer access denied, unable to connect" in printers and faxes instead of "ready")
Android app - Raspi Card Imager - download and image SD cards - No PC required !

ceteras
Posts: 231
Joined: Fri Jan 27, 2012 1:42 pm
Location: Romania

Re: Printserver for windows clients (Samba and CUPS)

Tue Oct 23, 2012 1:31 pm

Thanks for posting this, I want to do exactly the same thing!

I'm wondering if the HDD goes in standby when not accessed for a while, to conserve power, is that possible on the Pi?

RockMachine
Posts: 61
Joined: Sat Aug 18, 2012 6:30 pm
Location: Italy

Re: Printserver for windows clients (Samba and CUPS)

Wed Nov 21, 2012 5:09 pm

Thanks a lot for this guide!!
I've got a question... I configure my Rasperry Pi as a print server with CUPS and work good only with light files( .docx for example), but when I try to print "big" file such as PDF or jpeg pictures system don't work. Have you got suggest?

In this link you can see my actual configuration. http://uptiki.altervista.org/viewer.php ... 3lhkk6.jpg

Thanks and sorry for my poor english.

ewlie
Posts: 12
Joined: Tue Sep 25, 2012 1:31 pm

Re: Printserver for windows clients (Samba and CUPS)

Tue Nov 27, 2012 12:12 am

The 1st line of the instructions is missing the word install i think:

sudo apt-get install cups

John

ewlie
Posts: 12
Joined: Tue Sep 25, 2012 1:31 pm

Re: Printserver for windows clients (Samba and CUPS)

Wed Dec 05, 2012 6:11 am

I had a lot of trouble with CUPS and my Canon MP800 printer. It would print a page and a bit then hang.
The printer would be crashed, and the rpi not talking to it.
No amount of fiddling with options, reboots etc could get it to work reliably.

In the end I used the p910nd very simple driver that pipes the data straight through (no spooling)
It works a treat.

The link to the details is here:
http://www.raspberrypi.org/phpBB3/viewt ... 90#p227390

Thanks

LyleHaze
Posts: 3
Joined: Sun Dec 30, 2012 6:20 am

Re: Printserver for windows clients (Samba and CUPS)

Sun Dec 30, 2012 6:42 am

This thread was a great start.. Absolutely new to RasPi and Linux, was hoping to make a print server for my cheap old Samsung laser, but I need a special twist: I also have a couple AmigaOS4 machines in the house, and they have very few print drivers, but they DO have a good PostScript driver.. So my goal was to use PS drivers on all clients, and let CUPS handle translation to the local printer.
Yes, it's slower, but it would be grand to get my Amigas printing too!
So far, it works from XP, but after a few hours of idle time the remote admin screen will not open. At that point printing may or may not work. Odd.
I'll go looking for screen blanker/sleep mode timers next.

Regarding the Amiga connections, I've hit a few snags:
We have a lpr driver, but installing LPD on the Pi seems to kick CUPS out, and I need CUPS for postscript translations.
We have Samba, but it is a limited port with no printing support.

After I figure out this sleep issue, I may write a small app that will print anything I FTP into a directory on the Pi.. Any suggestions are welcomed!

StoopKid
Posts: 39
Joined: Thu Jul 19, 2012 5:41 am

Re: Printserver for windows clients (Samba and CUPS)

Sun Jan 20, 2013 2:50 am

I am trying to print from my windows 7 x64 through the raspberry pi to an HP printer on USB. The HP printer does not support windows 7 and the only way to get it to work is to install 1015 drivers(the printer is a 1012) and set the port to Dot4. If I don't do this it simply doesn't work.

I tried installing the printer through CUPS as raw then doing this but with network printing I can't set a port. I also tried just letting cups find a driver for it and that doesn't work either.

What else can I do?

MikeAlx
Posts: 22
Joined: Wed Sep 05, 2012 8:16 am

Re: Printserver for windows clients (Samba and CUPS)

Sun Feb 24, 2013 9:13 am

Hi Stoopkid, don't know if you got a resolution, but for my HP LaserJet P1005 I found installing via CUPS did not work - after some googling, I found I had to download a driver and install tool from HPLIP - see:

http://hplipopensource.com/hplip-web/gethplip.html
http://hplipopensource.com/hplip-web/su ... index.html

hope that helps.

cheers, Mike

colin99
Posts: 1
Joined: Mon Dec 30, 2013 9:39 am

Re: Printserver for windows clients (Samba and CUPS)

Mon Dec 30, 2013 9:50 am

Thanks, some very interesting information here. I'm looking at doing something similar. I've already fixed it on the windows side so the work part of my project is done - this is just a carry-over to give myself some additional familiarity in Raspberry Pi.

Part of my job is to support older technology printers - old enough that flashing new code to them didn't always work using tcp/ip so generally it was done via parallel adapters which all these machines contained. That was an extremely solid way to flash code to them. Then along came new laptops that don't have parallel ports (the IBM/Lenovo T61's were perfect since they had an ultrabay and you could install a true parallel/serial port in the ultrabay). The vendors website had some information on how to use usb->parallel adapter and configure windows printer shares and all of this does work with some tweaking (like realizing that 2 different usb->parallel cables that cost the exact same price are not the same - definitely purchase bidirectional if you ever need to make that purchase; even basic windows printing to Laserjets really expects a bi-di cable and will typically work better with it - the results can be weird if you don't have it. For example it would print the test page only after disconnecting the usb cable from the laptop!).

So now that I've fixed the work side of it, I'm looking at doing something similar using Raspberry Pi as the platform. I just started on the project so I haven't downloaded CUPS yet or gotten very deep but it looks interesting. Also these forums are great by the way!

luuxiii
Posts: 4
Joined: Fri Dec 27, 2013 7:26 pm

Re: Printserver for windows clients (Samba and CUPS)

Mon Dec 30, 2013 12:55 pm

Hello I`m trying to find solution for my problem...
I can print from other PCS in LAN,
but cant print anything from raspPI itself..?
Do you now what could particularly go wrong?

sverkerwahlin
Posts: 2
Joined: Tue Jun 25, 2013 10:42 pm
Contact: Website

Re: Printserver for windows clients (Samba and CUPS)

Sun Jul 13, 2014 3:23 am

[quote="luuxiii"]Hello I`m trying to find solution for my problem...
I can print from other PCS in LAN,
but cant print anything from raspPI itself..?
Do you now what could particularly go wrong?[/quote

This is not my field, but could it be a driver problem? CUPS, as I understand it, allows for the client computers to supply the drivers. ie the pi doesn't have to have drivers, if the PCs have drivers. If the Pi doesn't have drivers, it wouldn't be able to print, even if other computers on the LAN (that have drivers) can...

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 12 guests