Feb 18

I haven’t blogged for a while now, since I am contributing most of my time and efforts into Chakra, a GNU/Linux distribution with an emphasis on KDE/Qt technologies, a unique half-rolling release model, and an amazing community!

But I recently had to workaround an issue with getting a newly purchased HP Envy 4520 wireless printer work on my home network, and this gave me a good opportunity to write this post.

I was pleasantly surprised to find that HP ships GPL drivers to many of its printers, even the newest ones! It provides useful guides to find what driver supports your hardware, and there is also a full list of supported printers. Finally, a guide for running hp-setup to setup your printer is available.

All these, and the fact that this printer had full support on the latest driver for GNU/Linux based distributions, made me give HP my money for the HP Envy 4520 model. =)

Unfortunately, this printer doesn’t have an ethernet port, and HP doesn’t ship a USB cable in the box of this model (which kinda makes sense, as it is advertised as a wireless model). However, you can imagine my disappointment when the hp-setup wizard that comes with the hplip package could not detect my printer. The issue was the same for all three of my laptops (running Chakra, Ubuntu and Lubuntu):  installing hplip and running hpsetup even using the latest driver (at the moment of writing 3.15.11) could not detect the printer on the local wireless network.

I was presented with this error when selecting the network/ethernet/wireless option:

HPLIP cannot detect printers in your network.
This may be due to existing firewall settings blocking the required ports. When you are in a trusted network environment, you may open the ports for network services like mdns and slp in the firewall. For detailed steps follow the link. http://hplipopensource.com/node/374

wireless configuration of hp-setup fails

At the time of writing this post the http://www.hplipopensource.com/node/374 link mentioned in the popup window  above was not available.

To workaround this I had to go through this short procedure, which will probably work for most wireless HP printers:

1. Boot your printer and follow the instructions on its screen to connect it properly to your local network.

2. Then you need to find the IP address of your printer. HP again offers some useful information on their website. The easiest way is to find it through the front panel/display of the printer, by browsing to the wireless configuration. If you can find it there, you can go ahead with step 3.

In case you can’t locate that, you can run ifconfig on your desktop or laptop and get the local IP range (in my case it reported 192.168.1.x, you should replace this with yours accordingly).
Then run nmap -sn 192.168.1.* (special thanks to Ram-Z for introducing me to nmap) to scan for the connected devices on the defined range:

[tetris4@lappy ~]$ nmap -sn 192.168.1.*

Starting Nmap 7.00 ( https://nmap.org ) at 2016-02-17 22:40 CET
Nmap scan report for 192.168.1.1
Host is up (0.0017s latency).
Nmap scan report for 192.168.1.107
Host is up (0.061s latency).
Nmap scan report for 192.168.1.108
Host is up (0.010s latency).
Nmap scan report for 192.168.1.110
Host is up (0.00039s latency).
Nmap scan report for 192.168.1.138
Host is up (0.0076s latency).
Nmap done: 256 IP addresses (5 hosts up) scanned in 3.20 seconds

Knowing the IPs for my laptops and phones (you can check through the settings on your phone and ifconfig on your desktop/laptop), it wasn’t hard to realize that my printer’s IP address is 192.168.1.138.

3. Run again hp-setup, but this time click on Show Advanced Options, enable Manual Discovery and enter the IP address of your printer. Alternatively I could run “hp-setup 192.168.1.138” directly from a terminal.

hp-setup manual configuration

4. Hit next, and your printer should now show up!

hp-setup printer found

5. After that it was as simple as clicking next and next! =)

I hope this post helps someone! If it does I would be happy to read about it, so please leave a comment to let me know!

 

12 Responses to “Setting up a wireless HP printer on GNU/Linux”

  1. FM33 says:

    For me manual discovery doesn’t work neither. Only Ubuntu’s default printer manager can detect the printer. I opened the port mentioned in the link on software and router firewalls but doesn’t change anything.

  2. tetris4 says:

    @FM33
    Did you try running “hp-setup ENTERIPADDRESSHERE” in a terminal and check for the output? Are you using the correct IP address for the printer?

  3. FM33 says:

    @tetris4
    I figured out that hplip works perfectly with the printer added from default printer manager (that selects hplip driver automatically).
    For another machine I was asked to try “hp-setup IP” and it worked fine.

  4. tetris4 says:

    Glad to see you got it working, enjoy! =)

    Am very satisfied with the experience I had with this printer and nowadays recommend HP printers to everyone.

  5. Jelte says:

    Your a hero! Searched for this solution all night! just add the ip after the hp-setup command. thank you

  6. tetris4 says:

    Thanks for your kind words Jelte! It always feels good to know you have helped a fellow Linux user. =D

  7. copernicus says:

    The default default discovery method is with Simple Location Protocol (SLP). The 4520 does not have an SLP agent. Activate Bonjour on the device and choose mdns as the discovery method.

  8. Yoda says:

    I like HP in regards to printers, but they are far from perfect, and you still have to be very careful with what you buy. I like them because they have for many many years had models that have proper back end support where the sources have been released for select models. It’s kinda hard to decipher the documentation and it’s getting harder- but at least we still have options (though apparently fewer and fewer).

    End user support (I don’t mean phone / email I mean documentation for end-users) is another matter entirely these days. I made a mistake and bought a random HP printer. I just spent 12 hours or so working through a half dozen issues with one model HP printer. The documentation from HP has gotten much worse and HP incorrectly labeled this printer as not requiring a plug-in when it in fact does. However that wasn’t even one of the problems I really had with HP today. Today the documentation for the distribution and version I was using was terrible. It was outdated, missing critical information, the server contained corrupted RPM files and then the hp-setup program didn’t work after the fact because apparently there were dependencies which were never made clear needed to be installed for things to work amongst other issues.

    However backing up a moment if you know where to go for select HP printers you can avoid all this. ThinkPenguin.com stocks a dozen or so of HP’s properly supported models (ie sources available, no plug-ins, etc) even models that’ll work out of the box with distributions built off older software stacks like Debian, Cent OS, RHEL, Trisquel, etc. Many models aren’t even available elsewhere because of the fast turn over. Every six months or so HP releases new models and by the time you go to buy a printer the models that your favorite distribution support aren’t available at retail. Think Penguin makes sure to stock some slightly older models (which more often than not actually have the same general spec) to ensure the current and older releases will work out of the box. The company also lists which major distributions and versions will work out of the box and has all sorts of additional documentation and support for GNU/Linux users.

  9. stef says:

    Thanks a lot!

  10. fp says:

    Works perfectly – thanks a lot!

  11. Bill says:

    Thanks! No longer have to boot to Windows to scan.

  12. tetris4 says:

    So glad to see that this post has been useful! Thanks for leaving a comment, every time I see such a post it makes my day. =)

Leave a Reply

preload preload preload