OSError: [Errno 202] EAI_FAIL
-
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 :In the MAIN.py i use a firebase module where all starts
the FIREBASE.py file
the UREQUEST file
-
Do you wait in the
boot.py
until the connection is established, or simply usewlan.connect(...)
and then end the file?
As far as I know, the statement you mention should be true, and the connection you made in theboot.py
file should hold.
You should be able to test this though, through usingfrom 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 holdTrue
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 betweenboot.py
andmain.py
.
-
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
-
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
-
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