This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC3220SF-LAUNCHXL:CAN't 连接到专用 MQTT 代理

Guru**** 633810 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/1162773/cc3220sf-launchxl-can-t-connect-to-private-mqtt-broker

器件型号:CC3220SF-LAUNCHXL

我目前正在使用 SimpleLink CC32xx SDK - 6.10.00.05中的'mqt_client'演示、我正在尝试将 C3220S 连接到运行第三方操作系统的 Linux 服务器上的蚊子 MQTT 代理、该操作系统要求用户登录(使用用户名和密码)

尽管输入了正确的 MQTT 代理地址、URL、MQTT_CLIENT_PASSWORD/USERNAME 并保留了连接端口(1883和8883)、但我仍会得到以下错误。

[MQTT_IF:错误]连接失败:-111

MQTT_CLIENT_APP.c 文件中的以下宏是我迄今为止唯一修改过的宏(忽略单个引号)

<

#define MQTT_CLIENT_PASSWORD "insert_provided_MQTT_PASSWORD_HERe"
#define MQTT_CLIENT_USERNAME  'insert_provided_MQTT_USERNAME_HERE'
#define MQTT_CLIENT_KEEPALIVE 0
#define MQTT_CLIENT_CLEAR_CONNECT TRUE
#define MQTT_CLIENT_MQTT_V3_1 true
#define MQTT_CLIENT_Blocking_send true

#ifndef MQTT_SECURE_CLIENT
#define MQTT_CONNECT_FLAGS MQTTCLIENT_NETCONN_URL
#define MQTT_CONNECT_ADDRESS 'insert_server_url_here'//"broker.hivemq.com
#define MQTT_CONNECT_PORT_NUMBER 1883
其他
#define MQTT_CONNECT_FLAGS MQTCLIENT_NETCONN_IP4 | MQTCLIENT_NETCONN_SEC
#define MQTT_CONNECT_ADDRESS 'insert_server_ip_here'//"192.168.178.67"
#define MQTT_CONNECT_PORT_NUMBER 8883

>

无论是使用 SDK 中提供的文件、还是"切换"引发的错误代码、都找不到太多内容、我不确定还有什么要做的。