How I setup my wireless printer
Yesterday I was given an HP Ink Tank Wireless 410 series printer in semi-working condition.
This is the first printer I've ever owned, and I wasn't sure how hard it would be to set it up in Linux.
I decided to connect the printer to directly to my wifi router, to make it available to every device in my home. I supposed that this would use some existing protocol, and I may not need HP-specific drivers.
This part was easy, I just pressed the wifi button on the printer for a few seconds to start WPS, and then I pressed the WPS button on my router, and that's it! This was my first experience with WPS as far as I can remenber, and I was impressed.
Important: This is something I found out after a few days. Make sure you login to your router and you give your printer a static IP!
Then I opened a photograph on my smartphone, pressed print, saw the printer and successfuly printed it! This is going great so far! Now for the hard part, making it work on Linux without a Desktop Environment (Gnome, KDE etc).
So, what do you need?
- The HP drivers:
hplipand The Common Unix Printing System:cups
In Arch linux, it's:
$ sudo pacman -S cups
$ sudo systemctl start cups
$ sudo systemctl enable cups
This will open port 631 locally, and you can configure your printer by opening your browser and going to http://localhost:631. If you're prompted for a username / password (HTTP authentication) just put your current user's credentials.
Here you can add a printer (it was discovered automatically for me), set the default options, see the printing queue etc.
After that, the printer was available in all print dialogs, in Firefox, Chrome, LibreOffice etc.
If you want to print from command line you can use lp as follows:
- Set default printer
$ lpoptions -d <TAB> # autocompleted the printer that I set up in CUPS web interface. - Print
$ lp file.txt $ echo 'cli printing ftw!' | lp