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: Unable to send MQTT messages to IoT Hub using CC3220SF.

Part Number: CC3220SF-LAUNCHXL

Hi,

I am facing issue in sending messages to IoT Hub using the iothub_client_sample_mqtt example of azure cc3220 sdk. SendConfirmationCallback isn't hit after sending message using API IoTHubClient_LL_SendEventAsync in the example. I am using IAR for compiling the code. Below is the log where the device is getting stuck for reference:

Starting the iohub_client_sample_mqtt example
startSNTP: Current time: Wed Mar 3 11:35:05 2021


CC32XX has connected to AP and acquired an IP address.

IP Address: 192.168.0.102

IoTHubClient_LL_SetMessageCallback...successful.
IoTHubClient_LL_SendEventAsync accepted message [0] for transmission to IoT Hub.

IoTHubClient_LL_SendEventAsync accepted message [1] for transmission to IoT Hub.
IoTHubClient_LL_SendEventAsync accepted message [2] for transmission to IoT Hub.
IoTHubClient_LL_SendEventAsync accepted message [3] for transmission to IoT Hub.
IoTHubClient_LL_SendEventAsync accepted message [4] for transmission to IoT Hub.

Please note that I am able to run simplesample_http example successfully which uses HTTP protocol and could also monitor the message as below

[IoTHubMonitor] [1:32:49 PM] Message received from [MyCDevice]:
{
  "deviceId": "myFirstDevice",
  "ts": "1614758551",
  "temperature": 29.578125
}
Please find the versions used by me below:
Azure CC32xx SDK : 4.10.01..01
SimpleLink CC322xx SDK: 4.10.00.07
Service Pack: sp_3.15.0.1_2.0.0.0_2.2.0.7
Certificate Catalog: certcatalog20190217.lst & certcatalog20190217.lst.signed_3220
FreeRTOS: v10.0.0
Please help me in this regard.
Thanks,
Kishore.
  • What is QoS of the MQTT publish?

    make sure it is at least QOS1 if you expect the confirmation.

    Br,

    Kobi

  • Hi Kobi,

    In this example, I couldn't find any variable to configure QoS.

    Also, Please note that an mqtt connection itself isn't established to go to the publish stage.

    According to the readme of this example, the log should look something like below by just giving proper access point details and connection string (Which are proper in my case as the same works with HTTP protocol) but which isn't same with me:

    Starting the iohub_client_sample_mqtt example
    Current time: Fri Jul 20 21:39:17 2018
    
    CC32XX has connected to AP and acquired an IP address.
    IP Address: 192.168.1.128
    IoTHubClient_LL_SetMessageCallback...successful.
    IoTHubClient_LL_SendEventAsync accepted message [0] for transmission to IoT Hub.
    IoTHubClient_LL_SendEventAsync accepted message [1] for transmission to IoT Hub.
    IoTHubClient_LL_SendEventAsync accepted message [2] for transmission to IoT Hub.
    IoTHubClient_LL_SendEventAsync accepted message [3] for transmission to IoT Hub.
    IoTHubClient_LL_SendEventAsync accepted message [4] for transmission to IoT Hub.
    Confirmation[0] received for message tracking id = 0 with result = IOTHUB_CLIENT_CONFIRMATION_OK
    Confirmation[1] received for message tracking id = 1 with result = IOTHUB_CLIENT_CONFIRMATION_OK
    Confirmation[2] received for message tracking id = 2 with result = IOTHUB_CLIENT_CONFIRMATION_OK
    Confirmation[3] received for message tracking id = 3 with result = IOTHUB_CLIENT_CONFIRMATION_OK
    Confirmation[4] received for message tracking id = 4 with result = IOTHUB_CLIENT_CONFIRMATION_OK

    I did debug further and found that SlNetSock_startSec fuction is failing inside tlsio_sl_open returning (-468) which means SL_ERROR_BSD_ESECUNKNOWNROOTCA.
    But the certificate used in the example is Baltimore Trust Root CA by default which should be okay.

    Please help me in resolving this issue further and establish a proper MQTT connection.

    Thanks,
    Kishore.
  • Can you enable application and library logging? See the Debugging section of the Azure SDK IoT Plugin user's guide.

    Br,

    Kobi

  • Hi Kobi,

    I have found the issue and was able to resolve it. I have ignored SL_ERROR_BSD_ESECUNKNOWNROOTCA error to start a secure tls session to establish MQTT connection using playground certificate catalog and dummy root CA. This way I have resolved this issue.

    Thanks,

    Kishore.