||
2021-03-04T15:55:35 - ERROR - mqtt - Unexpected disconnection from 127.0.0.1:1883 2021-03-04T15:55:35 - INFO - mqtt - Reconnecting to 127.0.0.1:1883 ... 2021-03-04T15:55:35 - ERROR - mqtt - Unexpected disconnection from 127.0.0.1:1883 2021-03-04T15:55:35 - INFO - mqtt - Reconnecting to 127.0.0.1:1883 ... 2021-03-04T15:55:35 - ERROR - mqtt - Unexpected disconnection from 127.0.0.1:1883 2021-03-04T15:55:35 - INFO - mqtt - Reconnecting to 127.0.0.1:1883 ... 2021-03-04T15:55:35 - INFO - job - Starting job "getGGA" for port "com" ... 2021-03-04T15:55:35 - ERROR - mqtt - Publishing message failed: no connection
参考:
https://hbmqtt.readthedocs.io/en/latest/quickstart.html
为了测试HBMQTT是否可以正常连接,在dos界面下测试:
hbmqtt_pub --url mqtt://localhost:1884 -t /test -m "Hello"
[2021-03-04 16:29:50,399] :: INFO - hbmqtt_pub/6976-DESKTOP-N0UE137 Connecting to broker
[2021-03-04 16:29:54,523] :: WARNING - MQTT connection failed: ConnectionRefusedError(22, '远程计算机拒绝网络连接。', None, 1225, None)
[2021-03-04 16:29:54,524] :: INFO - Finished processing state new exit callbacks.
[2021-03-04 16:29:54,530] :: INFO - Finished processing state disconnected enter callbacks.
[2021-03-04 16:29:54,532] :: WARNING - Connection failed: ConnectException(ConnectionRefusedError(22, '远程计算机拒绝网 络连接。', None, 1225, None))
[2021-03-04 16:29:54,533] :: CRITICAL - connection to 'mqtt://localhost:1884' failed: ConnectException(ConnectionRefusedError(22, '远程计算机拒绝网络连接。', None, 1225, None))
可以看到问题显示:
MQTT connection failed: ConnectionRefusedError(22, '远程计算机拒绝网络连接。', None, 1225, None)
测试电脑IP和 端口是否通
https://www.jianshu.com/p/d4f42ca05536
telnet 127.0.0.1 1883
正在连接127.0.0.1...无法打开到主机的连接。 在端口 1883: 连接失败
由此可见,端口1883不通;
还可以通过strsvr查看1883是否通
可以看到output并不通
如何在windows下开启任意端口?
https://jingyan.baidu.com/article/54b6b9c029675e2d583b47aa.html
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2025-1-5 15:40
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社