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

    OSError: [Errno 202] EAI_FAIL

    Scheduled Pinned Locked Moved WiPy 2&3
    5 Posts 2 Posters 324 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.
    • J Offline
      Jean Bikie
      last edited by

      Hi
      i'm trying to use the urequests module that i found here : https://github.com/micropython/micropython-lib/blob/master/urequests/urequests.py
      but i've got an error :

      eerno 1.jpg

      In the MAIN.py i use a firebase module where all starts

      eerno 0.jpg

      the FIREBASE.py file

      eerno 00.jpg

      the UREQUEST file

      eerno 2.jpg

      eerno 3.jpg

      1 Reply Last reply Reply Quote 0
      • G Offline
        Gijs
        last edited by

        The EAI_FAIL is related to not being able to resolve the DNS. This means that, for whichever network you are using, the nameserver (like google.com) cannot be resolved to an IP address because the DNS server cannot be reached. This is thus related to the network not being connected to the internet, or the DNS server is not set correctly.

        If you are using a pycom vodafone simcard over a NB-IoT connection, this is an expected result, as the simcards are only meant for connections to pybytes.

        You can check the DNS server setting through using import socket; socket.dnsserver()

        Let me know
        Gijs

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jean Bikie
          last edited by

          I don't use pycom vodafone.
          i'm working with the wipy3 and i connect it to internet through the wifi.

          i'm going to check the DNS server
          i'll come back

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jean Bikie
            last edited by

            I found the problem, it was because i tried the urequest without connected to WIFI but i don't understand because i wrote the connection code on the boot.py butt it only works when i write the connection code on the main.py
            it's not normal , i think

            eerno 1.jpg

            1 Reply Last reply Reply Quote 0
            • G Offline
              Gijs
              last edited by

              Do you wait in the boot.py until the connection is established, or simply use wlan.connect(...) and then end the file?
              As far as I know, the statement you mention should be true, and the connection you made in the boot.py file should hold.
              You should be able to test this though, through using

              from network import WLAN
              wlan = WLAN()
              print(wlan.isconnected())
              

              in the main.py to test if we are connected to a wifi network. If this returns false, there is no connection. This should also hold True if the connection was created in previous 'session' that you ctrl+c'd out of, which is, to my understanding, very similar to the transfer between boot.py and main.py.

              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