Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] cups + hplip, no mDNS: can't access network printer
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
miket
Guru
Guru


Joined: 28 Apr 2007
Posts: 498
Location: Gainesville, FL, USA

PostPosted: Wed Jun 06, 2012 7:18 pm    Post subject: [solved] cups + hplip, no mDNS: can't access network printer Reply with quote

This started out as a request for a solution to a problem, but I finally found the answer. I'm posting this in the hopes it will be helpful--and that someone can shed light on the remaining issue.

Things used to work so nicely--but Apple and HP had to mess around and make things "easier". It can be a big PITA.

I've got a network with an HP Officejet 7000 printer plugged directly into the network (I love network printers for that). Yes it works, yes it works with other machines on my network, and yes I can reach its setup pages with a web browser from the new computer. For what it's worth, I've got Bind running on this network and the host name ("officejet") resolves properly.

This is the information on the two big packages that ought to work:

net-print/cups-1.5.2-r4 is built with X acl dbus filters gnutls jpeg ldap pam perl png python slp ssl threads tiff usb. Notably absent: avahi. I desperately don't want that or its cousin Zeroconf. If I could get rid of all the *kits, I'd get rid of them too.

net-print/hplip-3.12.4 is built with X acl doc hpcups hpijs kde libnotify (policykit) qt4 snmp. I added snmp in order to make the ebuild add the configuration option network-build.

So now hp-setup finds my printer. Life wass good--until I wanted to print a test page.

In /var/log/messages, I saw a bunch of lines that look like this:
Code:
Jun  6 12:08:09 idea hp-info: io/hpmud/jd.c 800: mdns lookup officejet.local retry 1...
Jun  6 12:08:09 idea hp-info: io/hpmud/jd.c 800: mdns lookup officejet.local retry 2...
Jun  6 12:08:10 idea hp-info: io/hpmud/jd.c 800: mdns lookup officejet.local retry 3...
Jun  6 12:08:10 idea hp-info: io/hpmud/jd.c 800: mdns lookup officejet.local retry 4...
Jun  6 12:08:11 idea hp-info: io/hpmud/jd.c 800: mdns lookup officejet.local retry 5...
Jun  6 12:08:11 idea hp-info: io/hpmud/jd.c 800: mdns lookup officejet.local retry 6...


Why oh why are these mDNS lookups here? I've got SLP set up--why doesn't CUPS use that? I've got a perfectly good regular DNS it could use, but no.

A suggestion I saw was to change the client.conf file, but that didn't work. Another suggestion was to change the DeviceURI for the printer in /etc/cups/printers.conf so that it referred to the IP address rather than the hostname, which was
Code:
hp:/net/Officejet_7000_E809a?z=officejet


Since I didn't have any documentation for the hp: URI scheme, I guessed. None of my guesses worked.

I tried an old standby: the socket: scheme that CUPS supports and documents. Alas, while I could make CUPS print with that, hplip didn't recognize the printer.

Finally, as I perused the HPLIP site, I stumbled upon a reference to the hp-makeuri tool. I tried it out with my printer's IP address and, voila, there was the IP address in the URI and lo it worked.
Code:
hp:/net/Officejet_7000_E809a?ip=192.168.0.40


Works great. No mDNS, no Avahi, no Zeroconf. Also au revoir to Bonjour.

So here's the only issue: I don't know how to make this work with a DNS hostname rather than a literal IP address. (I'm talking about real, honest-to-God port-53 DNS!)


While I'm here, I have a final hint. If you have KDE, as I do, you may have tried going into the printer setup in the KDE system settings. If you did so, you probably experienced a hang and noticed that KDE's usual task killer won't touch it. It does respond to sigkill, though. This'll do the trick:
Code:
killall -s KILL systemsettings


To restore normal behavior, you have to rename a library. Log in as root and do this rename in the /usr/lib64/kde directory:
Code:
mv kpython2.7pluginfactory.so kpythonpluginfactory.so


This worked for me in both for KDE 4.7 and 4.8. It's a Gentoo-specific bug (I found it in the forums) and the bug is already reported.
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Wed Jun 06, 2012 8:39 pm    Post subject: Reply with quote

that's good, but it does not seem to work for my new hp_photosmart_5510

I had to rebuild cups with avahi to print over network and hplip *still*
does not recognize the network printer (works fine if I plug it in).
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
javeree
Guru
Guru


Joined: 29 Jan 2006
Posts: 455

PostPosted: Fri Jun 08, 2012 4:26 pm    Post subject: Reply with quote

About a year ago I had a look at the code to find the answer. It is too long ago to remember exactly, but there was one of two conclusion:
1. hp-setup does not use dns at all, or
2. It can do dns (or maybe I hacjked it in), but translates it into an IP address and hardcodes that IP address once and for all in the url.

So even if setup could work with dns, the resulting setup would still have an IP address hardcoded, which means that if your dhcp server changes the address ....

I tried to hack around it (thinking it would be easy), but it soon began to be to have impact all over the code, and I could at that time not be bothered enough (I submitted a feature request at HP though, including some suggestions ffrom what I already found)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum