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.

LAUNCHXL-CC3235SF: Question about receive MQTT subscribe message

Part Number: LAUNCHXL-CC3235SF
Other Parts Discussed in Thread: CC3235SF

Hello,

Question 1:

I have been working on the CC3235SF LaunchPad for a few days, specifically experimenting with the mqtt_client_CC3235SF_LAUNCHXL_tirtos7_ticlang example. I've successfully managed to publish messages to Thingsboard MQTT server without any issues. However, I am encountering a problem where I am not receiving any response from the subscribed topic from a custom Thingsboard server.

I have confirmed that the Thingsboard server is functioning properly since I am able to receive the expected response using an ESP32 board.

Question 2:

I have noticed that the UART logs are not being displayed after the execution of the SlNetConn_start() function in the mainThread. However, the log messages from the callbacks are still functioning correctly. 

Here is my log

ti_net_SlNet_initConfig
WIFI_IF_init

        ============================================
           MQTT client Example Ver: 2.0.3
        ============================================

         CHIP: 0x31100019
         MAC:  3.7.0.1
         PHY:  3.1.0.26
         NWP:  4.13.0.2
         ROM:  8738
         HOST: 3.0.1.71
         MAC address: 34:03:de:10:f6:f4

        ============================================
SlNetConn_init
SlNetConn_start
[WIFI::INFO]  [SlWifiConnEventHandler] POWERED_UP 
[WIFI::INFO]    MAC address: 34:3:de:10:f6:f4
[WIFI::INFO]   [Event] STA disconnected from AP (Reason Code = 208)
[WIFI::INFO]   [Event] STA connected to AP - BSSID:a2:47:e3:51:81:77, SSID:Wireless_FC
[WIFI::INFO]  [NETAPP EVENT] IP Acquired: IP=192.168.8.170 , Gateway=192.168.8.1
[SlNetConnEventHandler] I/F 1 - CONNECTED (IP LEVEL)!
[SlNetConnEventHandler] I/F 1 - CONNECTED (INTERNET LEVEL)!
[MQTT_APP::INFO]  MQTT_EVENT_CONNACK

[MQTT_APP:[MQTT_APP::INFO]  APP_MQTT_PUBLISH

Here is the image from SimpleLink Academdy. The log " scuscribed to all topics successfully is the log after SlNetConn_start() function.

I would greatly appreciate any assistance or guidance regarding this issue. Thank you for your help.

  • you should see the  "Subscribed to all topics successfully\r\n" message (line 846) as well as "MQTT connection is UP" (line 863) - at least based on SDK7.10. What SDK are you using? 

    if it is not there then something went wrong during the subscription.

    Please check the return code (ret) value.

    Have you changed anything in the original code (other than the server params)?

    You can try moving the MQTT_IF_Subscribe after the the MQTT connection is established (i.e. after line 863).

  • Thank you for your response.

    I am  using the simplelink_cc32xx_sdk_7_10_00_13 with CCS v12.5.0.00007.

    The only parameter I have modified is disabling OTA_SUPPORT, apart from adjusting AP/server parameters. When I set a breakpoint at the if condition after MQTT_IF_Subscribe, the return code from MQTT_IF_Subscribe function is 0.

    In addition, when I move MQTT_IF_Subscribe related function after the MQTT connection, I do receive the message "Subscribed to all topics successfully." However, there is still an issue where some LOG_INFO messages are not appearing on the terminal.

    I have also added breakpoint at BrokerCB function to confirm if MQTT server has sent anything back to the device but this breakpoint never triggered.

    Here is the log from UART console:

    ti_net_SlNet_initConfig
    WIFI_IF_init

    ============================================
    MQTT client Example Ver: 2.0.3
    ============================================

    CHIP: 0x31100019
    MAC: 3.7.0.1
    PHY: 3.1.0.26
    NWP: 4.13.0.2
    ROM: 8738
    HOST: 3.0.1.71
    MAC address: 34:03:de:10:f6:f4

    ============================================
    SlNetConn_init
    SlNetConn_start
    [WIFI::INFO] [SlWifiConnEventHandler] POWERED_UP
    [WIFI::INFO] MAC address: 34:3:de:10:f6:f4
    [WIFI::INFO] [Event] STA connected to AP - BSSID:a2:47:e3:51:81:77, SSID:Wireless_FC
    [WIFI::INFO] [NETAPP EVENT] IP Acquired: IP=192.168.8.170 , Gateway=192.168.8.1
    [SlNetConnEventHandler] I/F 1 - CONNECTED (IP LEVEL)!
    [SlNetConnEventHandler] I/F 1 - CONNECTED (INTERNET LEVEL)!
    [MQTT_APP::INFO] MQTT_EVENT_CONNACK

    [MQTT_APP::INFO] Subscribed to all topics successfully
    [MQTT_APP::INFO] APP_MQTT_PUBLISH

    -----------------------------------

    Here is the log from ESP32 which can publish and subscribe to thingsboard demo server:

    .... (skip unimportant log)

    I (6385) MQTT_EXAMPLE: MQTT_EVENT_CONNECTED
    I (6385) MQTT_EXAMPLE: sent publish successful, msg_id=1291
    I (6385) MQTT_EXAMPLE: sent subscribe successful, msg_id=32672
    I (6745) MQTT_EXAMPLE: MQTT_EVENT_PUBLISHED, msg_id=1291
    I (7045) MQTT_EXAMPLE: MQTT_EVENT_SUBSCRIBED, msg_id=32672
    I (7055) MQTT_EXAMPLE: sent publish successful, msg_id=5052
    I (7355) MQTT_EXAMPLE: MQTT_EVENT_PUBLISHED, msg_id=5052
    I (7355) MQTT_EXAMPLE: MQTT_EVENT_DATA
    TOPIC=v1/devices/me/attributes/response/321
    DATA={"shared":{"updateInterval":60}}

  • After few hours of debug, I have finally resolved my issue by setting MQTT_CLIENT_BLOCKING_SEND to false.

    Thank you for your assistance.