But, I installed a Debian machine and left it with a default domain name "debian". On PC, using requests, I was able to reach it by just providing debian as address. I was also able to reach debian's web server with http://debian in my address bar on firefox as well.
But, if I use debian as address for ESP32, it reports an error:
Code: Select all
>>> import usocket
>>> usocket.getaddrinfo('debian', 80, 0, usocket.SOCK_STREAM)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: -202
>>> usocket.getaddrinfo('192.168.0.191', 80, 0, usocket.SOCK_STREAM)
[(2, 1, 0, '192.168.0.191', ('192.168.0.191', 80))]
>>>
I wonder if this is only on ESP32 port or all MCU ports.
I also installed the unix port on my debian machine using a snap command. Did the same test and seems fine:
Code: Select all
>>> import usocket
>>> usocket.getaddrinfo('debian', 80, 0, usocket.SOCK_STREAM)
[(2, 1, 6, None, bytearray(b'\x02\x00\x00P\x7f\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00'))]
>>> usocket.getaddrinfo('192.168.0.191', 80, 0, usocket.SOCK_STREAM)
[(2, 1, 6, None, bytearray(b'\x02\x00\x00P\xc0\xa8\x00\xbf\x00\x00\x00\x00\x00\x00\x00\x00'))]