Possibly that I am running on a Pico W, and using MicroPython, so the usual tools one might use from the command line on a host aren't available.(But since the OP is normally insightful and resilient I may be missing some deeper significance to the question... )
It seems the 'socket.getaddrinfo(self.server, self.port)' under the hood, a prerequiste to establishing a connnection, can handle named IP Addresses, can lookup internet URL, but doesn't handle an 'mDNS' lookup to find the "Pi3B.local" in my case.
I could write my own code to issue an 'mDNS' lookup packet, handle the reply, but was thinking there must be some other easier way I don't know about, haven't seen. I was sure others must have needed similar, but perhaps not, have usually used Fixed IP as I have.
This is what I would normally use -
Code:
import socketaddr = socket.getaddrinfo("Pi3B.local", 1884)for n in range(0, 5): print("[{}] =".format(n), addr[0][n])
Code:
[0] = AddressFamily.AF_INET[1] = SocketKind.SOCK_STREAM[2] = 6[3] =[4] = ('192.168.0.130', 1884)
Code:
Traceback (most recent call last): File "<stdin>", line 40, in <module>OSError: -2
Statistics: Posted by hippy — Tue Jul 23, 2024 1:22 pm