python - Socket.Error : [Errno 10060] when connecting to MQTT broker

标签 python sockets

我试图连接到位于Raspberry Pi上的MQTT代理。我正在尝试使用笔记本电脑上的Wifi远程发布到RPi。我已经验证可以通过SSH(端口22)连接到Raspberry Pi。但是,当我尝试运行代码时,出现此错误,显然我无法连接到代理。有没有办法来解决这个问题?

  Traceback (most recent call last):
  File "F:/multi_mqtt.py", line 55, in <module>
    client.connect('10.xxx.xxx.xxx', 1883, 60)
  File "C:\Python27\lib\site-packages\paho\mqtt\client.py", line 612, in connect
    return self.reconnect()
  File "C:\Python27\lib\site-packages\paho\mqtt\client.py", line 734, in reconnect
    sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
  File "C:\Python27\lib\socket.py", line 571, in create_connection
    raise err
socket.error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

最佳答案

套接字级别的超时消息表明您的防火墙正在阻止端口1883。

关于python - Socket.Error : [Errno 10060] when connecting to MQTT broker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36660238/

相关文章:

c# - 发送或接收数据的请求被禁止,因为套接字未连接 - 发送数据时

c++ - Windows 上的非阻塞套接字在 send() 调用后不会返回

sockets - erlang中socket如何通过数据包发送数据?

python - 为什么它说 Global Name not Defined 而不是? Python

python - 现代 glTranslate 和 glRotate 的替代品是什么?

java - Malt 解析器抛出类未找到异常

ios - 如何快速打开多个套接字连接?

python - 文本小部件不显示 Unicode 字符

python - Sympy:简化平方的平方根

python - 高负载: Socket.上的Rabbitmq错误[Errno 104]对等重置连接