微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI WIFI设计交流 > I have problem when run MQTT_client on CC3200

I have problem when run MQTT_client on CC3200

时间:10-02 整理:3721RD 点击:

Hi TI,

我用CC3200SDK_1.3.0上的MQTT_client,然後在windows上用mosquitto去開一個broker,

並把設定

/*Defining Broker IP address and port Number*/
#define SERVER_ADDRESS "10.35.81.14"
#define PORT_NUMBER 1883

可是執行程式會發生Broker connect fail for conn no. 1

請問是哪邊有誤導致的?要怎樣修改成能成功連線到mosquitto的Broker呢?

請教教我一下,謝謝!

您可以参考下E2E上的帖子 https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/t/417213

在main.c中修改了usr_connect_config

char *security_file_list[] = {"/cert/clientkey.der", "/cert/clientcrt.der", "/cert/cacrt.der"};connect_config usr_connect_config[] =

{

    {

        {

            {

                SL_MQTT_NETCONN_SEC,  //SL_MQTT_NETCONN_URL

                SERVER_ADDRESS,

                PORT_NUMBER,

        SL_SO_SEC_METHOD_SSLv3_TLSV1_2,

        SL_SEC_MASK_SECURE_DEFAULT,

                3,

        security_file_list

            },

            SERVER_MODE,

            true,

        },

        NULL,

        "user1",

        NULL,

        NULL,

        true,

        KEEP_ALIVE_TIMER,

        {Mqtt_Recv, sl_MqttEvt, sl_MqttDisconnect},

        TOPIC_COUNT,

        {TOPIC1, TOPIC2, TOPIC3},

        {QOS2, QOS2, QOS2},

        {WILL_TOPIC,WILL_MSG,WILL_QOS,WILL_RETAIN},

        false

    }

};

请注意MQTT连接的时候有没有enable SSL, 你默认创建的mosquitto是没有SSL连接的吧。你需要在mqtt client上disable SSL.

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top