19 ms·
Making an old USB printer support Apple AirPrint using a Raspberry Pi
- lostgame 5y agoNow do it with a Parallel port printer. :P
- BugsJustFindMe 5y agoI'd very much rather have a way to make a new iPhone support CUPS. :(
- baq 5y agolucky, had Linux ARM drivers for the printer. tried to do the same with a bubblejet Canon, no bueno.
- esemor 5y agoThis is great! Now please make my 900€, 6 year old Sonos speakers work.
- jgrahamc 5y agoWhy don't they work?
- KMnO4 5y agoSonos speakers are weird and I don’t get the hype. They’re not Bluetooth, so playing anything on them has to go through the Sonos app and server. Sonos is also a shady company, doing things like bricking your device if you try to sell it after upgrading, or not letting you use your speaker if you disagree with their privacy policy.
- Aardwolf 5y agoImho, a speaker is an electroacoustic transducer, converting electric current into sound, or at least anything that can output the sound of arbitrary input devices. If it has apps, then it's instead a computer or a stereo system with built-in speakers. So I find speakers a misleading name for this contraption, unless it has an input of some sort that you can connect what you want to.
- miles 5y agoThat was quite the hiatus; previous post was from over a decade ago: "How to write a successful blog post". Good to see another blog making a comeback! EDIT: I was wrong about the hiatus; see brarsanmol's comment below.
- brarsanmol 5y agoOop! I actually think those posts are the most visited on the blog not the most recent as if you link the poster's name on their website you can see a recent post from July 8th!
- miles 5y agoThanks for the correction - subscribed!
- jgrahamc 5y agoI don't have that much time for blogging these days on my personal site because Cloudflare takes up a lot of my time.
- m0zg 5y agoAlso doable with _any_ Linux workstation. It's remarkable when Linux works better with hardware than Windows. I have an old HP Laser Jet 1012 for which Windows no longer has drivers, but Linux does, and as an added bonus it simply shows up on other Linux machines and on iOS devices as well - no set up required at all. Ironically, Windows is the most painful OS to set up to work with a remote CUPS printer. Paraphrasing Microsoft's old motto about Lotus Notes: "It ain't done until your old printer doesn't run."
- chrisseaton 5y ago> Ironically, Windows is the most painful OS to set up to work with a remote CUPS printer. Ironic that Windows doesn't work well with a printer using a Unix interface?
- m0zg 5y agoIronic that everything but Windows works fine with zero setup. iOS is not "UNIX", for example. And because the set-up is onerous but relatively straighforward to someone technical, I'm sure they could easily make it automatic. They just choose not to. God forbid HP makes a few dollars less from their cash cow, or MS engineer gets distracted from rearranging toolbar buttons needlessly for the umpteenth time. Can't have that.
- asveikau 5y agoWindows works out of the box with older "Unix printer interfaces" -- it has a built in driver for lpd printers. I use it, because my printer setup is a raspberry pi with lprng rather than cups.
- easton 5y agoI know it won't happen because of some major vendor using functionality from Windows 3.1, but I kind of wish that Microsoft would just take the printing subsystem out of Windows and replace it with something built around CUPS. It works so darn well, and doesn't require `net stop spooler; net start spooler` to get going. Maybe their Universal Print initiative will help, but that requires a connector or a new printer to work.
- kayodelycaon 5y agoI was all ready to post that Ubuntu natively supports this with no effort and was pleasantly surprised to see a short list of instructions for a simple headless CUPS deployment. :)
- openthc 5y agoThis is a fun trick. We use the PI as print-server for our POS -- cause it can also handle all kinds of crazy receipt printers -- for example, have to complile the filters and stuff for the Star TSC-100 series (and sometimes for Dymo, or obscure Brother label/receipt). But then the PI works to print from Apple, Android, Chromebook, Windows -- desktop, tablet, phoen -- like whatever hardware the store already has -- PI is super amazing for getting a reasonable system (ie: Debian) in a cheap way when the client already has a mixed variety pack of hardware. And we can VPN to the mothership (us) using Wireguard -- Thanks PI!! Thanks Jason!!
- askvictor 5y agoI have an old USB laser printer that used to have an rpi print server to make it 'networked'. Then I installed an apple airport extreme next to it, and figured I could use the USB port on the airport to network it instead. Which it does, but this only effectively makes it USB-over-IP, which works fine for Windows machines, but most 'modern' devices (phones, tablets, chromebooks) can't talk to it for lack of driver interface. So now the house main RPi server (in another part of the house) acts as a print server (CUPS, mDNS, etc) and flings those packets up to the airport, which sends them to the printer. But works pretty well, despite the seemingly needless complexity.
- willswire 5y agoIf you want to manage a fleet of these on an Enterprise network/LAN, check out my balenaPrint project: https://www.balena.io/blog/wifi-enable-usb-printers-with-a-raspberry-pi-and-share-it-over-your-network/ https://www.balena.io/blog/wifi-enable-usb-printers-with-a-r...
- bangonkeyboard 5y agoI did this with a Zero W a while ago. It may be a surprise how much slower printing is.
- LeonidasXIV 5y agoThat's a good point, I also have been wondering why it is this slow. Maybe a good time to replace the Zero W with a Zero W 2.
- reaperducer 5y agoFor those looking for something a little less DIY, get an old Airport Express (Sometimes called an AirMac) from your favorite thrift or auction web site. They have a USB port intended for wireless printing.
- jahewson 5y agoDoes not support AirPrint, only regular wireless Ethernet printing.
- nsxwolf 5y agoWhat’s the difference? My LaserJet is plugged into my Google Wifi Ethernet port, and I thought what I was doing from all my iOS devices was called AirPrint. It’s not?
- tonyedgecombe 5y agoAssuming your LaserJet is reasonably modern it probably supports AirPrint directly. Legacy printers won't.
- zdw 5y agoAirMac is the Japanese name for the same devices, as the Airport name is trademarked by I-O Data in Japan for wireless devices: https://www.iodata.jp/prod/network/wnlan/2004/wn-apga/index.htm https://www.iodata.jp/prod/network/wnlan/2004/wn-apga/index....
- HeavenFox 5y agoMy family printer was bought in 2008. I parted with it when I left for college. After getting by with school printer, office printer and public printer in my apartment building, I finally bought my own after the pandemic. Oh boy are modern printer marvelous. Compared to my old one, the Brother laser printer I bought - Is super compact and can be left anywhere - Connects to home network by WiFi and supports AirPrint etc - Supports automatic duplex printing - Has an automatic document feeder that supports automatic duplex scanning - Has a large touchscreen so I don't have to navigate four levels of menu just to copy something - Can print from and scan to my Dropbox - Has never jammed All for just $160 refurbished. While I am a big fan of reducing e-waste, if I had an old printer and use it with some frequency, I would seriously consider upgrading, now that I know what I am missing out :)
- znpy 5y agoI was super tempted by a Brother printer but ultimately went for a more expensive hp one. The thing is, hp driver support in linux is just the best, hands down.
- 1024core 5y agoJust to piggyback on this comment: whatever you do, don't get a Samsung. I have a Samsung printer, and the Wifi just stopped working. As in, it would lose its settings for no reason. Currently I've given up on trying to fix it, and put the PDFs on a thumb drive and walk over to the printer to print. It is painfully slow. I hate this printer. If I hadn't bought new toner cartridges for it last year, I would have gotten rid of it, the PoS. It's a Samsung C460W, BTW.
- stephen_g 5y agoMy experience with printers was always that Brother ones were a bit of a standout in the consumer space, so your experience might not be representative of the whole consumer market! I haven't bought any printers in years though so maybe things in general have got better.
- captn3m0 5y agoWhich model is this? My Brother doesn’t have scanning and I wouldn’t even call that compact.
- fryman 5y agoRaspberry pi imager has an advanced menu that can be accessed with ctrl+shift+X. It allows you to configure a lot of settings to include networking before even installing the OS to the sd card. I’ve run cups on a pi zero w for a while and it required the occasional restart, took quite a long time to load a job, and the margins were a nightmare to get right. Some of those issues may have had to do with the specific printer/drivers I use. I’ve since moved on.
- FlagsAreFun 5y agoI was unaware of the advanced menu, thanks for the heads up. Could have used this last week with my new Pi Zero 2 W
- sneak 5y agoHeads up: the raspberry pi Imager fits my definition of spyware (it silently transmits your activity off-device without consent or even notification). Block its phone-home with Little Snitch or LuLu.
- AbhyudayaSharma 5y agoThis reminds me of something I did a few years ago. I had an old printer for which the drivers did not work properly on Windows. Connected the printer to a Zero W and it became accessible to every device on my network through CUPS. I even made it print PDF attachments from emails (https://github.com/AbhyudayaSharma/MailPrinter https://github.com/AbhyudayaSharma/MailPrinter)
- nathancahill 5y agoI'd love to build something like this for VPNs. Raspberry Pi connects to the VPN via wifi and allows network printing from devices on the same VPN.
- GhettoComputers 5y agoYou don’t need a a Pi for that, if you have any competent modern router it just needs to be setup. You can look for custom firmware for your router (I use fresh tomato) but if you buy a compatible one it’s very cheap, T-Mobile gives away the AC1900 a rebranded AC68U/R to it’s customers that I flashed immediately so I can’t tell you the default capabilities, I just know it will do everything and more with the firmware I used. They’re under $40 on eBay.
- skoskie 5y agoAn alternative method is possible using Dropbox and a small amount of automation. https://www.dropboxforum.com/t5/Dropbox-installs-integrations/Use-Dropbox-to-Replace-Google-Cloud-Print-or-AirPrint/td-p/469447 https://www.dropboxforum.com/t5/Dropbox-installs-integration...
- rock_artist 5y agoI had this for a while a year or so ago. It was nice but it had few cons that made it less ideal than I’ve wanted. * CUPS AirPrint is generic and provides features that might be unsupported by your printer requires extra settings when printing. * the shared printer wasn’t detected easily by some machines or there was some driver incompatibility. I hoped CUPS could provide some “bridged” printer so you won’t be required to have hard to find drivers but sadly for non AirPrint this solution was worse at least in my case.
- ShockedUnicorn 5y agoI'm probably barking up the wrong tree. I have a printer set up on an Ubuntu machine, using cups. I have tried to share it on the network. My windows machine can find it, but windows complains that there are no drivers available for it. As the printer is 15+ years old, there are no windows 10 drivers. Is there a way to enable "emulation" of a different printer instead, and let cups somehow translate the commands? I currently have a network shared folder that is scanned for pdf's, and will print any new file put there. Often means there's an extra step needed to print, but it works.
- bombcar 5y agoYou can do what you’re doing more automated- I did it years ago. You setup a virtual printer that is something like basic postscript and then have it run Ghostscript to modify it for your actual printer. There should be information on how to setup cups this way.
- jimmies 5y agoFYI: If anyone looking for a label printer, get a Rollo and a Pi. I sell stuff on Ebay from time to time, and one of my pet peeves is not having labels professionally printed and having to tape them. After researching stuff I decided to skip the Dymo stuff and went with Rollo. The Rollo only prints over USB, so I connected it to the Pi0w. It's so godsend nice, I can just shove it into the closet and print from any computer in the network. There is no software to install, it can print from literally any app. Wifi QR codes? Print it and stick it on anything. Instructions to use an appliance or recipes? Print it. Freaking love it. One more thing about the Rollo label printer is that they have some sort of deal with USPS so it's always cheaper to print the label from their "shipping manager" web interface. I haven't even shipped 30 packages from the time I got it two years ago and the printer already made the money I paid for it back.
- sneak 5y agoI rather love my Brother QL810W. WiFi, with airprint, and you can buy like 20 rolls of sticky thermal labels for it for super cheap. I just bought a second one!
- kube-system 5y agoYou can get a brother QL series label printer for around $100 or less that will print the narrow format 7” postage labels. eBay supports this format with USPS and you also get a good discount through them. I don’t think FedEx or UPS support this format, but I rarely ship with them.
- GhettoComputers 5y agoWho is this for? It’s just for enabling CUPS? I don’t get the point of this in 2021, unless you have a very insecure router that isn’t updated or supports basic features you can just connect your printer (even my $99 brother laser the HL-2170W over a decade ago had WiFi and CUPS support) via Ethernet and print with it even if your printer doesn’t support it. That’s been the case with my Tomato firmware compatible routers for over a decade, plus there’s an obsession over PiHole despite the charts not working for anyone using HTTPS, which is essentially just using a weak embedded device to reimplement router functions you probably could have configured. Using everything but the lowest end router you’ll probably have DDWRT (which is offered by default by linksys), Tomato, Merlin (Asus offered default) or OpenWRT (tons of default firmware is based on it) that can do everything and more on your existing hardware like CLI control, CUPS, OpenVPN, DNS, ad blocking (I use a script to update my hosts, I disabled logging since HTTPS masks it), QoS, SAMBA file sharing, signal boosting, and random security features.
- hsbauauvhabzb 5y agoI don’t really want to couple my printer to my router, and I’d rather airgap my printer from the network (for security, user hostile firmware ‘updates’, and general spyware because I don’t trust printer manufacturers). I agree a Pi hole would be better suited towards a computer, if I had a server I would use cups on that, but I wouldn’t discourage people from playing with pis unless more reliable enterprise-ie type concepts were a key goal.
- GhettoComputers 5y agoWhat manufacturer? You can do it via USB and have a script disable mounting or mount on command if you'd like, but if you have a Pi it won't be any different if you use the same network. Still the RT68U I suggested is only $40 if you want to have a secondary network, and you probably have a router laying around that supports custom firmware. I think if you have a Pi the best thing you can use it to prototype if you want dedicated hardware for what the pi is doing, but if you are buying it for the purpose of OP, its not a good use of resources, and anything a Pi can do an old laptop or desktop can do it better and prototype it with no cost and probably better software, but if power usage is an issue dedicated hardware should be considered.
- skoskie 5y agoMy home iMac has a folder action set up to print anything I drop in it. That folder is in Dropbox. So I just put files in there from anywhere and it prints. Surprisingly, it’s really quick. It starts printing within 2-3 seconds. On my iPhone I setup a shortcut that sends things directly to that folder as well. It’s all so smooth, that I have no need to worry about getting AirPrint. Here are instructions: https://www.dropboxforum.com/t5/Dropbox-installs-integrations/Use-Dropbox-to-Replace-Google-Cloud-Print-or-AirPrint/td-p/469447 https://www.dropboxforum.com/t5/Dropbox-installs-integration...
- skoskie 5y agoEdit: Step by step instructions. https://www.dropboxforum.com/t5/Dropbox-installs-integrations/Use-Dropbox-to-Replace-Google-Cloud-Print-or-AirPrint/td-p/469447 https://www.dropboxforum.com/t5/Dropbox-installs-integration...
- anaganisk 5y agoNow this is more “hacker” newsy than the post itself :D
- deleted 5y ago[deleted]
- lostgame 5y agoThis is an incredibly useful hack. I love it! Thanks so kindly for sharing.
- t3ra 5y agoSimilar guide for HP LaserJet 1020 which needed some additional steps because of driver compatibility - https://tripad.medium.com/turning-my-old-printer-into-a-wireless-printer-with-a-raspberry-pi-1fb6d73e35a4 https://tripad.medium.com/turning-my-old-printer-into-a-wire... Apart from some USB port selection issues there has been pretty much no problems running this for over a year
- MrksHfmn 5y agoI got mine in 2006. Hooked up to my NAS and HPLIP and CUPS. Unfortunately foo2zjs is discontinued and there's a bug with HPLIP. You have to power it on twice to load the firmware ... AirPrint does only really work with this script: https://github.com/tjfontaine/airprint-generate https://github.com/tjfontaine/airprint-generate
- TorKlingberg 5y agoI have a similar one and could never get the firmware uploading (foo2zjs / hplip) to work reliably. It would randomly stop working and then need an undetermined number of power cycles / USB repluggings to come back. I should have an other go with that. It was a lovely setup when it worked, printing from any OS incl. mobile without cables or funky drivers.
- rcarmo 5y agoAnnotated version from 2012 with what every command actually does, for the curious: https://taoofmac.com/space/blog/2012/12/16/1730 https://taoofmac.com/space/blog/2012/12/16/1730 I stopped using this setup when I upgraded to a new printer, but it works pretty well when you’re willing to have the Pi do the rasterization and actual printing (for which I would recommend a minimum of 1GB of RAM).
- anshargal 5y agoI have 20 years experience using Linux (user and administrator). Couple of years ago I tried doing roughly the same using Pi and old cheap Xerox laser printer (required some additional CUPS tinkering). It was very unstable, both network-wise and printing-wise, especially when someone was trying to print without me nearby. New printer with AirPrint was way better than this. So while this 'hack' reviving old equipment might be useful for some people, don't expect it to do miracles in every case.
- cstuder 5y agoHeh, I'm doing a similar thing with a random cheap internet radio and Apple AirPlay: My Rasbperry Pi is running AirConnect in a Docker container and converts all UPnP devices to AirPlay recipients. https://github.com/philippe44/AirConnect https://github.com/philippe44/AirConnect
- MayeulC 5y agoFrom my experience, only HP has half-decent linux drivers (works out-of-the-box with gutenprint). Most other manufacturers require proprietary drivers (that often only come for one CPU arch), or hours of fiddling with reverse-engineered drivers. I tried doing the same with a brother MFC printer, but I always had issues with the drivers.
- lmm 5y ago> From my experience, only HP has half-decent linux drivers (works out-of-the-box with gutenprint). Most other manufacturers require proprietary drivers (that often only come for one CPU arch), or hours of fiddling with reverse-engineered drivers. Epson are the other one with decent Linux drivers, but yeah most manufacturers are pretty bad.
- artemonster 5y agoI have brother 4500d, an old laser printer with usb only. It was connected to my pc and it was always a chore to print whenever someone else had to do so in my house. Added raspi, fiddled with settings (windows will lose it if you wont enable spooler service), fiddled with power settings (now it can be automatically powered on) Result? Windows machine, Linux machine, iOS and macos all use happily this printer. Best 50 Eur i‘ve spent in my life.
- harvie 5y agoI don't use apple, but like to use p910nd on my raspberry: http://p910nd.sourceforge.net/ http://p910nd.sourceforge.net/ It is almost zero configuration. You just configure TCP port and usb device to be used. No drivers, no queues (can run on diskless/readonly machines), no bullsh*t, just printing. You need to configure the printer on the client tho. Basicaly it just takes USB printer and converts it to network printer. You don't need any specialized client software as most platforms can already talk to it, configuration is very similar as adding USB printer to individual workstations, but you specify TCP address rather than USB port.
- anotheryou 5y agoAny recommendation on how to do something similar for windows? Can I share a printer in the network through linux? I have an old HP laserjet 100 and back in the days the one roller that wears out came with the cartridge (i think it's the drum the pigment sticks to). It only on windows XP or after long fiddeling with linux can make it print (fun fact: the printer basically forgets it's a printer because it has by design no permanent storage for it's firmware. On each computer boot you need the computer to push a blob of firmware in again). So now I have an old laptop booting up linux just to print. An raspi I could print directly to would be perfect!
- cpach 5y agoI haven’t tried it myself but I imagine that you could follow jgc’s guide to step 6 and then do this: https://paalijarvi.fi/tgblog/2020/05/25/making-windows-10-to-print-to-a-cups-printer-over-the-network/ https://paalijarvi.fi/tgblog/2020/05/25/making-windows-10-to... This page might also be of interest: https://wiki.archlinux.org/title/CUPS/Printer_sharing https://wiki.archlinux.org/title/CUPS/Printer_sharing Best of luck!
- anotheryou 5y agothanks!
- oyagci 5y agoGreat ! This will allow me to never ever again use the Espon iPrint application to print with my phone which is a terrible app
- skocznymroczny 5y agoI have a xerox phaser 3010 which I wish I could plug to raspberry pi to make into a networked printer. Unfortunately the only available driver is for x64 linux, none for ARM :(
- jgrahamc 5y agoNote to self: $ history | curl -d @- https://blog.jgc.org/NEWPOST is a cheap way to create blog posts that are successful on HN.
- roughly 5y agoGenuinely! “Here’s the list of commands to reliably solve this problem” is an actual service to the community. Not everything needs to be a doctorate-level dissertation in memory management on obscure 90s hardware.
- android2222 5y agoI used this to retrofit some old laser MFCs in an office to use AirPrint so real estate agents could print from their iPads.
- tombert 5y agoHey, something I did myself before an HN article about it came out. I had a spare Raspberry Pi lying around, and I have a nearly 20 year old office printer that, while it does support the generic postscript driver and can be used over ethernet, will give me weirdness if I try printing anything without first converting it to PDF. I pretty much only use Pandoc/LaTeX for a majority of my documents since I usually export through pdflatex first, so it took awhile for me to notice, but my wife had issues when she was trying to print out pictures directly and we got weird postscript errors instead. Obviously it's an easy fix, just print to PDF first, but it's also irritating, so I fitted one of my Raspberry Pis with CUPS and it worked great.
- ohples 5y agoIs it me or are a lot of these the "Do X using a Rasberry Pi" really just "Do X on any linux box, maybe a Rasberry pi, but anything that runs linux and has the port you need will work.
- roughly 5y agoYes, but the Pis are cheap, easy to find, basically interchangeable, and have low power draw, all of which makes them more attractive for this kind of project.
- openthc 5y agoExactly my point above -- oh, to fix this client issue I need a relaible system (Debian) -- but I can't run on their own hardware cause they like Windows (and turn machines off) -- so just spend $50-USD for the Pi, Power, SD and software and bing-bam-boom -- great success. Put a camera in their and now you've got a very smart security camera -- for such discount -- this commodity hardware is a game changing thing.
- roughly 5y agoHonestly, if this works reliably, I might plug my existing “AirPrint enabled” printer into it.