0
我试图连接到位于Raspberry Pi上的我的MQTT代理。我正尝试在我的笔记本电脑上使用Wifi远程发布到RPi。我已经证实我可以通过SSH端口22连接到Raspberry Pi。但是,当我尝试运行我的代码时,出现此错误,显然我无法连接到代理。有没有办法来解决这个问题?Socket.error:[Errno 10060]连接到MQTT代理时
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
哦,现在我还记得,我的大学我的大学使用WiFi时,已阻止此端口。谢谢你,先生。任何建议来解决这个问题?改变端口,例如也许? –
是的,您需要使用未被阻止的端口。 – ralight
我的意思是,如果我选择任何随机工作端口,它将与MQTT一起工作吗?例如像端口100? –