在RV1126开发板上使用mqtt向ubuntu服务器推送消息时,得到如下报错。
nitializing for server 'tcp://192.168.1.7:1883'......OKConnecting...
Waiting for the connection...
MQTT error [-1]: TCP/TLS connect failure
于是用telnet命令测试下192.168.1.7的1883端口是否畅通。
telnet 192.168.1.7 1883
telnet: can't connect to remote host (192.168.1.7): Connection refused
在ubuntu服务器上查看mosquitto发现是启动的,
sudo service mosquitto status
sudo service mosquitto stop
sudo service mosquitto start
然后我在ubuntu上同时运行客户端和服务端是可以收到消息的,所以怀疑我的服务起的不对,于是我直接用mosquitto命令前台启动查看打印的日志。
base) root@boyun-DGX-1-with-V100-32:/etc/mosquitto# mosquitto
1635752906: mosquitto version 2.0.13 starting
1635752906: Using default config.
1635752906: Starting in local only mode. Connections will only be possible from clients running