问题
i'm trying to run a socket on my esp8266 but keep getting OSError: -2
.
I tried:
>>> addr = socket.getaddrinfo('smart-socket-bdcc5.firebaseio.com', 443)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: -2
and
>>> addr = socket.getaddrinfo('smart-socket-bdcc5.firebaseio.com', 80)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: -2
When I execute it in usual python command line it works ok.
Also I tried usocket
instead of socket
- hasn't helped.
回答1:
The reason was simple: wrong wifi creds
来源:https://stackoverflow.com/questions/48079023/socket-getaddrinfo-keeps-returning-oserror-2