socket.getaddrinfo keeps returning OSError: -2

一笑奈何 提交于 2020-12-16 08:05:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!