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.

[参考译文] CCS/CC3200:CC3200 MQTT 客户端示例 SDK 1.4 CAN't 连接代理

Guru**** 2589265 points
Other Parts Discussed in Thread: CC3200SDK, CC3200

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

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/855445/ccs-cc3200-cc3200-mqtt-client-example-sdk-1-4-can-t-connect-with-broker

器件型号:CC3200

工具/软件:Code Composer Studio

您好、TI

现在、我使用 CC3200SDK 1.4中的示例"mqTT_client_tirtos"

它无法与代理连接遵循此配置。

请告诉我、如何将代理连接到此示例。

谢谢你

RATWO

  /*Operate Lib in MQTT 3.1 mode.*/
    #define MQTT_3_1_1              false /*MQTT 3.1.1 */
    #define MQTT_3_1                true /*MQTT 3.1*/
    
    /*Defining Broker IP address and port Number*/
    #define SERVER_ADDRESS           "m2m.eclipse.org"
    #define SERVER_IP_ADDRESS        "192.168.178.67"
    #define PORT_NUMBER              1883
    #define SECURED_PORT_NUMBER      8883
    #define LOOPBACK_PORT            1882
    
    #define MAX_BROKER_CONN         1
    
    #define SERVER_MODE             MQTT_3_1
    /*Specifying Receive time out for the Receive task*/
    #define RCV_TIMEOUT             30
    
    /*Background receive task priority*/
    #define TASK_PRIORITY           3
    
    /* Keep Alive Timer value*/
    #define KEEP_ALIVE_TIMER        25
    
    /*Clean session flag*/
    #define CLEAN_SESSION           true
    
    /*Retain Flag. Used in publish message. */
    #define RETAIN                  1
    
    /*Defining Publish Topic*/
    #define PUB_TOPIC_FOR_SW3       "/cc3200/ButtonPressEvtSw3"
    #define PUB_TOPIC_FOR_SW2       "/cc3200/ButtonPressEvtSw2"
    
    /*Defining Number of topics*/
    #define TOPIC_COUNT             3
    
    /*Defining Subscription Topic Values*/
    #define TOPIC1                  "/cc3200/ToggleLEDCmdL1"
    #define TOPIC2                  "/cc3200/ToggleLEDCmdL2"
    #define TOPIC3                  "/cc3200/ToggleLEDCmdL3"

///----------------------------------------------------------
    /* connection configuration */
    connect_config usr_connect_config[] =
    {
        {
            {
                {
                    SL_MQTT_NETCONN_URL,
                    SERVER_ADDRESS,
                    PORT_NUMBER,
                    0,
                    0,
                    0,
                    NULL
                },
                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
        }
    };
    
    /* library configuration */
    SlMqttClientLibCfg_t Mqtt_Client={
        1882,
        TASK_PRIORITY,
        30,
        true,
        UART_PRINT
    };

e2e.ti.com/.../README.html

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

    您好、Ratwo、

    eclipse.org sandbox MQTT 服务器的服务器地址似乎已更改:

    https://iot.eclipse.org/getting-started/

    新的服务器地址是 iot.eclipse.org。 将服务器地址更改为新地址使示例对我有效、无需任何其他修改。

    请告诉我、这是否对您不起作用、或者如果您对在 CC3200上使用 MQTT 示例有进一步的问题。

    此致、

    Michael

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

    尊敬的 Michael

    我可以通过将"m2m.eclipse.org "更改为"mqtt.eclipse.org "进行连接

    #define SERVER_ADDRESS   "mqtt.eclipse.org"


    Thank you
    RATWO