[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: CUPS - how to match autodetected printers to physical ones



On 2022-04-10 at 08:38, Brian wrote:

> On Sat 09 Apr 2022 at 20:21:12 -0400, The Wanderer wrote:
> 
>> On 2022-04-09 at 07:56, Brian wrote:

>>> It is straightforward, I don't know about obvious to all users.
>>> 
>>> avahi-browse -rt _ipp._tcp
>> 
>> Does that get the information from CUPS?
>> 
>> It looks to me as if it gets the information from the network, via
>> what are probably the same discovery methods as CUPS used to get
>> it.
>> 
>> That's not the same as getting the information *from CUPS*, which
>> must logically already have that information.
>> 
>> Having a way to get the information at all (and we already seem to
>> have at least two of those, from this thread, one of them being the
>> one you just cited) is not the same as having a way to get the
>> information *from where it must logically already be*, and the
>> apparent lack of the latter is what's bothering me about the
>> described behavior.
> 
> CUPS delegates resolution of hosts and services to mDNS; I am happy 
> to follow in its footsteps.
> 
> CUPS may very well know the IP address but it is not of direct
> interest to the user,

That will very definitely vary depending on the user.

> who is better served by being informed of the URI.

This may be true in some cases, but is very definitely not true in all.

> For various reasons, IP addresses can change, of course; printers
> being moved round the network, for example.

This is based on a set of assumptions which may apply in some cases, but
very definitely do not apply in all cases. I don't want to dive deep
into them, however, since this has already gone on long enough.

>>> CUPS uses mDNS/DNS-sd for discovery. The user does the same:
>>> 
>>> avahi-browse -rt _ipp._tcp
>> 
>> This seems to be confirming the hypothesis above: that this is not 
>> getting CUPS to reveal the information, but performing the same 
>> discovery method that CUPS used to get the information.
> 
> Yes.
> 
>> If, for example, the printer was online when CUPS discovered it and
>> is therefore listed in the CUPS interface, but is offline now
>> (perhaps someone accidentally unplugged the network cable from the
>> printer?), I would be mildly surprised if this would still result
>> in showing the IP address of the printer. CUPS, however, must still
>> have that address, from its past discovery.
> 
> The CUPS web interface is not designed to show the IP address but to 
> display the URI.

This, I think, is exactly the detail that's being complained of. If CUPS
knows the IP address, it should be possible to get CUPS to reveal that
IP address.

If on the other hand CUPS *doesn't* know the IP address, but only the
hostname et cetera (because that's part of the URI, and CUPS only
knows/stores the URI), then that might be reasonable.

(My previous comments were based on the assumption that all
communication with the printer would be done based on IP address, rather
than on symbolic name and on connect-time resolution. That may in turn
be based on my experience in the Windows world, where printer hostnames
and DNS lookup are in my experience wildly unreliable and as a
consequence are very rarely used; I reflexively expect that the parts of
a system which communicate with a printer will always know it primarily,
if not exclusively, by its IP address.)

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: