Wireless technology is perhaps the best improvement to home printing for years. Fewer cables, flexibility about where you can put your printer – it’s win-win. Unless you have an older printer.
While it might be easy enough to buy a new printer for under $50, you might have spent enough on your last one, and be unable to justify the outlay. Additionally, your old printer might have a special function, or manage duplexing in a particularly satisfying way, to bother replacing it.
The solution, then, is to make it wireless. Several solutions are available, but one popular choice is to use your Raspberry Pi as a wireless print server.
Benefits Of Wireless Printing
If you haven’t already enjoyed the benefits of wireless printing, then this project is definitely the place to start. Got a big bulky printer taking up space in your office that you don’t use too often? Perhaps the cables get in the way?
With a wireless printer you can move your printing into a separate room (perhaps even your shed) and collect your print jobs when they’re complete. This way, the space taken up by the printer on your desk can be used in other ways. Using wireless technology, printing can also take place via any device you might have, whether it’s a laptop, smartphone or tablet.
Wireless printing really is about making printing flexible rather than “locking” it to the desk. And the Raspberry Pi can help with this.
Preparing For Wireless Printing With The Raspberry Pi
For this project, you’ll need to ensure you have connected and setup a wireless USB dongle for your Raspberry Pi Setting Up Wireless Networking on Your Raspberry Pi Setting Up Wireless Networking on Your Raspberry Pi Virtually every Raspberry Pi project will require a network connection, and considerable flexibility can be gained by ignoring the Ethernet port in favour of a wireless USB dongle. Read More . You should also be using a USB printer. It’s possible to make this work with a parallel printer coupled to a parallel-to-USB adaptor, but you’ll need to research elsewhere if you run into any problems with that.
You’ll also need a USB cable from your printer to your Raspberry Pi.
Finally, if you haven’t already done so, setup your Raspberry Pi with a preferred operating system, and ensure it is up to date (If you haven’t done this before, NOOBS is probably the best solution How NOOBS For Raspberry Pi Can Help First Time Users How NOOBS For Raspberry Pi Can Help First Time Users There is something about the Raspberry Pi that might just put people off: until now, setting it up has not been particularly user friendly. NOOBS aims to change that! Read More .).
To update, enter
sudo apt-get update
followed by
sudo apt-get upgrade
This tutorial was written based on a wireless print server running on Raspbian.
Configuring Your Raspberry Pi As A Print Server With CUPS
With the equipment connected and setup, the first thing to do is ensure that your USB printer is detected.
Open a command line (either on your Raspberry Pi directly or over SSH Setting Up Your Raspberry Pi For Headless Use With SSH Setting Up Your Raspberry Pi For Headless Use With SSH The Raspberry Pi can accept SSH commands when connected to a local network (either by Ethernet or Wi-Fi), enabling you to easily set it up. The benefits of SSH go beyond upsetting the daily screening... Read More ) and enter:
lsusb
A list of attached USB devices should appear. Check it, and identify your printer.
Following this, you’ll need to install Samba, the open source file sharing software. This can be done by entering the command.
sudo apt-get install samba
Follow any instructions that are displayed.
Next, it’s time to install CUPS, the Common Unix Printing System (note that you must install Samba first).
sudo apt-get install cups
CUPS provides drivers for your printer. Many manufacturers now provide Linux drivers, but in the event one isn’t available, use this.
You’re now ready to add the default user to the printer admin group.
sudo usermod –a –G lpadmin pi
Adding Your Printer
Next, you’ll need to setup your printer with your Raspberry Pi. Boot into the GUI with startx, launch your browser and go to 127.0.0.1:631 and switch to the Administration tab.
Select Add new printer, input your Raspbian credentials when requested and then select your printer from the displayed list. Proceed to the next screen, selecting the correct device from the list. In the following screen, confirm the details and assign a name, then check Share This Printer and click Continue.
Depending upon your device manufacturer, the next page may take a while to load. This is because a whole host of device driver names are being loaded up, so if you’ve connected a HP printer you may be in for a long wait. Once the list has downloaded, select the correct printer driver (which should be selected by default) and continue. Alternatively, click Select Another Make/Manufacturer and select Raw. You can let Windows handle the driver!
Click Add Printer, then Set Default Options. A few moments later the printer will be ready to start accepting jobs. To ensure it is working, click Maintenance and select Print Test Page.
Connecting To Your Raspberry Pi From Windows
With that all done, you need to ensure that access from Windows to your Raspberry Pi is enabled so that you can start printing.
This is done by editing the samba config file in /etc/samba/smb.conf – you can do this in the GUI as you should still be in there, although it is simple enough to launch it in bash with a text editor.
The following should be added:
# 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
Next, press CTRL + W to search for “workgroup” and setup as follows (replacing your_workgroup_name as necessary – usually Workgroup):
workgroup = your_workgroup_name
wins support = yes
With that saved, exit the GUI and restart samba:
sudo /etc/init.d/samba restart
Start Printing From Windows & Mac OS X
Once samba restarts – which shouldn’t take more than a few seconds – you can switch to your Windows PC and add a new printer. First check that the Raspberry Pi is visible by opening Windows Explorer > Network.
Go to Control Panel > Hardware and Sound > Devices and Printers > Advanced printer setup and wait for the system to scan. A quicker option is to expand your Raspberry Pi’s entry in Windows Explorer’s Network view, from which you can right-click on the printer, select Connect, select your Windows printer driver and start printing.
Mac users, meanwhile, can add a new printer in the usual way.
Any administration of the print server that needs to be performed can be done by opening http://[RPI.IP.ADDRESS.HERE]:631, which will display the CUPS printer admin web interface on any networked computer.
Have you given new, wireless life to an old printer with your Raspberry Pi? Let us know how it went!
Image Credit: Craig Berscheidt via Flickr, Wireless Printer via Shutterstock
Explore more about: Printing, Raspberry Pi.
Thanks for the article, I have even used udev rules to make it shutdown once the printer is switched off or unplugged since I am using Pi-Zero-w in headless mode. Although it was a bit tricky to find the right parameters to trigger shutdown.
Very good instructions but now print server stopped working.
Raspberry Pi 2 Model B v1.1
With Edimax WiFi Dongle
I set this up as a print server and it was working for a few days printing wirelessly using my Windows Laptop. I then had to unplug and move it into another room.
A few days later I tried printing and my laptop would not connect to the print server.
I reconnected the Pi to my monitor and found that the WiFi was not connecting - even when I manually select my home hub and with the correct wireless key, it will not connect. Even reentering the wireless key.
I’ve ran a few checks and the WiFi dongle is seen by the Raspberry Pi, it’s just not connecting to my home hub.
I also seem unable to connect to CUPS? Is this because the printer is not connecting?
I have realized that if you used any special character like I was using @ in the command line interface the password never let it connect to WiFi. Change hub password to only contain characters and number and see if that works. From Desktop UI it did worked with any special character in WiFi password.
Great Article. Followed the instructions and was able to get my raspberry pi setup for wireless printing. I am able to move my printer away from my desktop to a storage room and save space. Thanks a lot.
- Krishna
This How-To is excellent. I've been using my Raspberry Pi to print wirelessly for about a year now without any issues.
Until now.....
After I updated two Windows 10 machines (that both printed through my Raspberry Pi) with the Spring Creators Update 2018 both machines will no longer print wirelessly through Raspberry Pi. My iPhone will still print without any issues.
I was wondering if anyone else has ran into this? If so what is the workaround?
Thanks in advance.
Check that win+r | appwiz.cpl -> programs and features | turn windows features on or off | smb 1.0/cifs file sharing support | smb 1.0/cifs client is enabled.
A lot of legacy smb, aka samba, based file and printer sharing implementations are based the old smb 1.0 spec that for security reasons isn't enabled by default any more in lieu of the newer smb [3.x] direct protocol.
I did try enabling the | smb 1.0/cifs file sharing support | smb 1.0/cifs client. It didn't work for me.
What did work was a recent Windows 10 update. Not sure which one it was but I am now printing again after the update.
Thanks for your reply though.
thanks for the followup on whether that worked or not. I just followed the instructions to try and enable samba print server access to "hp photosmart 370 series printer" from my windows 10 x64 October 2018 insider slow 17763.1 rs5 install. When I open \\raspberrypi in file explorer I see the "hp photosmart 370 series printer" but when I select "connect" from context menu and pick the matching HP printer driver I get an error dialog stating "Add Printer | Connect to Printer | Windows couldn't connect to the printer. Check the printer name and try again. If this is a network printer, make sure that the printer is turned on, and that the printer address is correct. | OK".
Is that what you were seeing that was eventually fixed? I noted that the instructions above kindof left out need to use "sudo nano /etc/samba/smb.conf" in order to be able to save the additions they note that are necessary before executing "sudo /etc/init.d/samba restart" to put those changes in effect. I also note that the "printing = cups" and "printcap name = cups" settings need to be added below the [global] section heading and not just above the [printers] section heading otherwise they end up being a part of the [homes] section settings when using the default form of that file. This was reinforced by the details displayed in https://linux.die.net/man/8/cupsaddsmb details.
So any thoughts on what I might be overlooking in instructions above that is causing that error given as you noted turning on smb/1.0 cifs client feature makes no difference here?
I just figured out final issue in my case. The issue was I had to use cups administration page [ http://127.0.0.1:631 | administration ] and delete then recreate the shared printer entry after having added the necessary details to /etc/samba/smb.conf and restarted that service. The instructions above have you create the printer entry in cups too early it would seem.
Could I just install Chrome or Chromium on the Pi and use Google Cloud Print? I've never tried this in general, on any device, but I'm curious if it would be a simple option, since I've obviously got a Google account anyway, for my Android devices.
My windows 10 computer can detect the printer wireless, but when I try to print there's an error massage saying "Printer is in Error State". Anyone knows how to fix this? Thanks.
My windows 10 computer can't detect the raspberry pi, I did all the steps. I don't know why it's not working
Check that win+r | appwiz.cpl -> programs and features | turn windows features on or off | smb 1.0/cifs file sharing support | smb 1.0/cifs client is enabled.
A lot of legacy smb, aka samba, based file and printer sharing implementations are based the old smb 1.0 spec that for security reasons isn't enabled by default any more in lieu of the newer smb [3.x] direct protocol.
note response from other party above who said this made no difference on their setup.
Hi
I use win 10, and as others status for printer is error, I have checked SMB 1.0 and it is enabled.
Before printing is status ready, but when I send a doc to printer then it go into error state.
I am using a Epson P50
Regrads
Bjarne
This is a great tutorial and all, but it just doesn't work. Whenever I try to print from my Mac it says that the printer is idle and working, but when I print it says "Hold for Authentication" and when I try again it says "looking for printer" and then a second later "connecting to printer" but then it goes back to "hold for authentication". But, printing the test page from CUPS admin page works. I'd really appreciate help on this because I need this for my family.
hi christ,
I have successfully installed my raspberry pi as print server, and had no problem printing from my ubuntu laptop.
But i have trouble printing from windows 10, I'm able to browse the raspberry pi network printer and connect it through windows explorer's network view, had install the requested printer driver, but failed to print, got error message when printing. Do you have any idea what went wrong?
Hello, I am a newbie to Raspberrypi and i want to do this project. This post mentioned NOOBS OS for Raspi but I am using Raspbian Jessei. So will it work? And I don't understood "Boot into the GUI with startx" Please tell me about it. Thank you.
Hi Ravi
If you already have Jessie running, then you won't need NOOBS.
If you're using Raspbian from the command line, then you can boot into the GUI - graphical user interface, the standard mouse-driven desktop - by entering the startx command.
Thank You Sir! Works like a champ.
Great news, thanks for letting us know, Steve!
I'm going to be trying this in my college dorm on the public wifi. Is it possible to add a password so that not just anyone can print to my printer?
Works an absolute treat, thanks.
can i use hp software to wirelessly scan papers through the raspberry pi?
Unfortunately my HP deskjet f2180 isn't on the CUPs list of support from what I can see and I don't know which driver to choose :( would have been perfect otherwise as I can see it listed on my mac but obviously won't print if the driver isn't right!
I guess I'll have to pay £30 for a wireless printer haha but it's a shame!
Well that's too bad. On the other hand, try it with a generic HP driver before giving up.
Definitely, would have been nice as my first little step into the PI world.
I tried it with the generic HP deskjet one from the list and a few others that looked like they could have been close in model numbers.
Would there be another that could be classed as a generic one that you could suggest?
You might want to look at the hplip package. It's specifically for supporting HP printers, and might have support for your printer...
Hi. I'm facing a similar situation. My printer is HP Ink Advantage 2135. I can't see it in the list either. I also downloaded the HPLIP file. But whenever I double click on it, it opens up in Geany. Can you please help me out? Thanks! :)
Use the Raw driver in CUPS and then choose the right driver on client machines. Actually works better that way even if CUPS does have the right driver for your printer.
Ok, Mats here. I figured it out! My Pi is not listed in my Windows Network, but when I try "\\raspberrypi" in my Windows Explorer, I actually get my printer listed there. From there I can Connect to it. Problem solved! :)
Good to see you got it sorted out!
Hi,
Thank for the good article. I got everything working up until when I need to add the printer to my Windows 10. I don't see my raspberry pi listed in Windows Network, and when I search for a printer from my control panel I don't find any. I have installed samba following your article. What might have gone wrong?
Thanks! /M
I am forbidden to add a new printer, I'm assuming this is because of the problem I have adding me to the printer admin group.
The sudo usermod –a –G lpadmin pi bit on mine just gives a list of other options... Is that right?
Ecountered same problem. Use "sudo adduser ".
"sudo adduser saned lpadmin" for add user "saned" in group "lpadmin" for example.
hi
i am trying to connect my xerox workcenter pe120 to a pi working with raspbian but when i wrote lsusb i cant recognize my printer. i just see the logitech usb and the lan connetion(it is not connected via usb)
do you have any advice?
thank you!
you need to have the printer connected to the Pi via USB if you're looking for it using lsusb, which lists USB devices.
Yes i know.
The printer is connected to the pi via the usb connection but the pi is not recognize it.
There are any drivers that i need to download?
You may find the answer here: http://www.openprinting.org/printer/Xerox/Xerox-WorkCentre_PE120
Essentially, you may need to change the printer's mode.
I have a Brother MFC5980CN printer. I installed the drivers from the Brother support site.
I successfully completed all of the steps in CUPS and it recognizes my printer but when I try to print anything the status says stopped and nothing prints.
I am able to submit a print job from my iPhone as well, but again, nothing prints and jobs stay in the queue showing "stopped"
When I select the Printers | Status page, I see idle - "File "/usr/lib/cups/filter/bripdwrappermfc5890cn" not available: No such file or directory.
I am guessing it is driver problem since the drivers are for Linux Debian and maybe Raspian for the Raspberry Pi is different enough as to prevent it from working?
Anyway, the tutorial was excellent, easy to follow. Just wish it worked with my printer.
I've followed the first few steps but I can't access the local webpage to set it up (127.0.0.1:631) It says the webpage is unavailable.
It only works locally (localhost:631) with default setup. In trusted env (like home network) following should do the trick:
sudo cupsctl --remote-any
sudo /etc/init.d/cups restart
I connected my HP LaserJet 1100 succesfully
Raspberry Pi2 with raspian OS, noname USB netdevice
Connected with and Centronics parallel to USB adapter, noname
Printing from Windows 7 system
Thanks for making this very helpfully page
Is there a way to uninstall this option if no longer using? Thank you.
you should be able to remove the software with sudo apt-get remove
Thanks for the response! As to the Windows driver - I only have one (in fact, I have None - Win 8 doesn't support a Canon ip6600d - but the win7 drivers work fine, I've done it before). However, it's locking up even from the pi itself - printing a page from Xpdf on the pi freezes! It's driving me nuts.
That's weird. Are you using the Pi for any other server-related tasks?
Was hoping to hear someone say they use a single Pi to serve DHCP, CUPS, and squid through a wireless broadband module plugged into the Pi's USB port all without issues. Would that really be too much to ask of a quad-core 1GB RAM Pi2 to offload my wee zyxel broadband modem/router/switch-in-one?
Set this up last night on a RPi2B and a Canon printer. Both Windows and Raspbian test pages worked fine. Easy and quick!
Then I actually tried to print something. Quick print of Raspbian web browser locked up after about three printhead passes, never finished. Print of Xpdf page failed utterly, froze. Print of pdf page from windows, same problem.
Any ideas on buffering/flow control problems? Maybe memory?
Thanks,
Have you tried switching to the alternative driver? You should see two options on the Pi to select in Windows, so select the alternate
You may have to run this command for the CUPS admin page to work.
sudo cupsctl --remote-admin
After a lot of trial and error I kind of got it working. I was able to connect a windows 7 pc to the now networked printer and printed off the test page. However, when trying to connect with my macbook air I get an error message that says it can't connect to the raspberrypi server... I would have thought adding it on the mac would be the easy part...
Regardless of all possible ways the get a printer working wireless its still an interesting article for us that likes to tinker with stuff and try to learn more. Thanks for a good article.
Subject CUPS - not the most difficult. Poor disclosed subject configure AirPrint. Nothing is said about the printer you need to install your driver (HP). I'm not talking about that put CUPS - no problem practically no one, and here is how to configure MFU, especially any Epson with their epkowa - that's what excites me, and not only me ...
I picked up an HP wireless printer add on. Basically you plug the uSB into This and it broadcasts the printer on your network. Pick it and Windows will supply needed drivers and you have wireless printing. It works with other brands as well. Bought at surplus store or on line and it was cheap,
the best and simplest solution.. and available in most computer stores :-)
Also the Apple Airport units do this too :-)
why bother with dropbox when you can just send your legal documents directly to the NSA or Mossad.
If you're worried about someone reading your Cloud Data, simply use SpiderOak. End to end strong encryption, starting with encrypting on your device, and Spider Oak does not hold your security keys. Even if they got your data by court order, there is no way anyone could get your keys except by getting an order to you to hand over the keys. Which requires a hearing or two.
Chinmay S, Dropbox is cloud computing. Cloud computing only ads to more internet traffic. The internet is not capable of all the demands that are being put on it. Also Dropbox requires an internet connection where local WiFi to work only requires that the local network is up. It is a marketing scheme to get people to use the cloud and not your own home network for computing. The cloud should not be used for home computing only for communicating to computers and networks outside of your network.
What a ridiculous comment. The Internet is working just fine with all the demands placed on it, but I would be very interested in seeing your supporting evidence.
Dropbox supports LAN file syncing so no, it doesn't require an Internet connection. Cloud Print via Chrome would also work over a LAN once configured.
Your final sentence regarding the uses of "the cloud" is so subjective that it comes off as satire, but given the lack of quality in the rest of your comment it clearly is not. How about you do whatever you want and let the rest of us do the same?
I agree with Stan & xord - there's lots of wireless routers that support attached storage and printers and doing this with a Raspberry-Pi device might be a little cheaper but not much. If it supported AirPrint natively that would be better.
But without that - once you have you printer on your local WiFi there are cheap (sometimes free) apps that will work in place of AirPrint or whatever Android uses.
In place of the Dropbox solution - could you use Google Cloud print using Christian's solution to provide access to the printer from anywhere?
Yes you can use Google Print with Cristian's great suggestion and it works just fine.
Is there any way to make it supports Android and iOS device (phone/table) ?
There is, and I'm going to be addressing it soon!
This is another myth that for wireless printing you need wireless printer. A wired printer is more than enough. All you need is Dropbox. You put a file inside a folder in Dropbox, a script on computer detects a new file in that folder and sends a print job to the wired printer.
This amazing solution was developed by Amit Agarwal of labnol.org, you can download the VBS script from his site(there are also workarounds for Mac and Linux).
This solution requiring a PC constantly on power to be able to read the change in the Dropbox. Plus there is other simple way to do that using Chrome. This article simply convert the printer to wireless printer with less power than a PC. Although there is other simple way, like using router with built in USB or USB to WiFi converter
But the method described in this article requires all devices to be connected to the same network. In the case of Dropbox printing, you can send print job from 1 corner of the world to another, you just don't need to mess with networks.
@Chinmay,
Run the script on your PI and you have the same solution plus a wireless printer for when you are on the local network.