LoPy socket.getaddrinfo strange return
-
Hi,
on LoPY 0.9.5.b1 socket.getaddrinfo() not alwaysreturn the same result.
Sometimes 0.0.0.0, sometime 10.0.0.0, sometime the good value.os.uname()
(sysname='LoPy', nodename='LoPy', release='0.9.5.b1', version='v1.8.6-13-ge1a0670 on 2016-11-18', machine='LoPy with ESP32')import socket
socket.getaddrinfo('forum.pycom.io', 80)
[(2, 1, 0, '', ('0.0.0.0', 80))]
socket.getaddrinfo('forum.pycom.io', 80)
[(2, 1, 0, '', ('10.0.0.0', 80))]
socket.getaddrinfo('forum.pycom.io', 80)
[(2, 1, 0, '', ('56.137.253.63', 80))]Any idea ?
Thanks
Pascal -
I had the same problem. I was trying to connect to an ntp server and it always returns a random ip. If you however use the ip directly instead of the domain name it works and stays consistent. Try 216.58.214.164 (This is google.com) and you will see what I mean. I will report a bug.
-
@yahia said in LoPy socket.getaddrinfo strange return:
I had the same problem. I was trying to connect to an ntp server and it always returns a random ip. If you however use the ip directly instead of the domain name it works and stays consistent. Try 216.58.214.164 (This is google.com) and you will see what I mean. I will report a bug.
It is a different case. Probably you have used a domain name for a pool of ntp servers instead of a server. In such case you get different server address from the pool.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login