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
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.
4. Hit next, and your printer should now show up!
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!