Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    socket.getaddrinfo return false values

    Scheduled Pinned Locked Moved LoPy
    5 Posts 2 Posters 1.3k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      PCA
      last edited by

      I did submit this issue a few weeks ago (rel 0.9.6). But no answer. I hoped it would be fixed in the 0.9.7b1 but the issue is always present :

      import socket
      mysite = 'www.pycom.io'
      addr = socket.getaddrinfo(mysite,  80)
      print(mysite,': ',addr)
      
      >>> www.pycom.io :  [(2, 1, 0, '', ('111.99.107.101', 80))]
      

      sometimes return 0.0.0.0
      the good values should be 104.18.45.76 or 104.18.44.76

      Any idea ?

      1 Reply Last reply Reply Quote 0
      • L Offline
        livius
        last edited by

        Info is false but
        did you connected your board to Internet?
        If yes - how?

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • P Offline
          PCA
          last edited by

          @livius yes Lopy is connected to Internet through the wifi interface.
          done in boot.py with a functional dns server specified in the wlan.ifconfig call.
          problem always present in the 1.0.0b1 release.

          1 Reply Last reply Reply Quote 0
          • P Offline
            PCA
            last edited by

            Just tested with 1.0.0b2 but no change

            1 Reply Last reply Reply Quote 0
            • P Offline
              PCA
              last edited by

              Problem is in the static parameters of the wlan.ifconfig()
              see explanations and fix in post :
              ATTENTION: socket.getaddrinfo() resolves to randon false IP Addresses

              1 Reply Last reply Reply Quote 1

              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
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom