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: Not able to communicate with Azure IOT hub with iothub_client_sample_mqtt example from Azure Iot plugin

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: UNIFLASH

Hi,

I'm trying to connect to Azure Iot hub with CC3220SF-LaunchXL using iothub_client_sample_mqtt example from  azure_cc32xx_4_10_01_01 sdk

-> CCS version 10.2.0

-> simplelink_CC32xx_sdk version 4.10 (as azure_cc32xx_4_10_01_01 sdk is built on cc32xx_sdk v4.10)

When I execute the example I'm able to see messages being transmitted but not able to get Message reception confirmation i.e ReceiveMessageCallback not getting invoked.

Console logs:

Starting the iohub_client_sample_mqtt example
startSNTP: Current time: Wed Feb 17 05:26:53 2021


CC32XX has connected to AP and acquired an IP address.

IP Address: 192.168.43.78

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.

I've tried updating the service pack( tried version 3.15 and 3.18 both along with iothub_client_sample_mqtt example binary using uniflash)  as suggested in this post . But it didn't resolve the issue.

Please help me resolve the issue.

Thank you

  • Hi Suhas,

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

    Also, can you check the device connection logs in the cloud service?

    Best regards,

    Sarah

  • Hi Sarah,

    As you mentioned I enabled logging in Azure iot plugin , here are the logs:

    Starting the iohub_client_sample_mqtt example
    startSNTP: Current time: Thu Feb 18 18:14:20 2021


    CC32XX has connected to AP and acquired an IP address.

    IP Address: 192.168.43.249

    IoTHubClient_LL_SetMessageCallback...successful.
    IoTHubClient_LL_SendEventAsync accepted message [0] for transmission to IoT Hub.
    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session

    Error: File:../../sdk/iothub_client/src/iothubtransport_mqtt_common.c Func:SendMqttConnectMsg Line:2282
    failure connecting to address ppiottesthub.azure-devices.net.
    IoTHubClient_LL_SendEventAsync accepted message [1] for transmission to IoT Hub.
    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session

    Error: File:../../sdk/iothub_client/src/iothubtransport_mqtt_common.c Func:SendMqttConnectMsg Line:2282
    failure connecting to address ppiottesthub.azure-devices.net.
    IoTHubClient_LL_SendEventAsync accepted message [2] for transmission to IoT Hub.
    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session

    Error: File:../../sdk/iothub_client/src/iothubtransport_mqtt_common.c Func:SendMqttConnectMsg Line:2282
    failure connecting to address ppiottesthub.azure-devices.net.
    IoTHubClient_LL_SendEventAsync accepted message [3] for transmission to IoT Hub.
    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session

    Error: File:../../sdk/iothub_client/src/iothubtransport_mqtt_common.c Func:SendMqttConnectMsg Line:2282
    failure connecting to address ppiottesthub.azure-devices.net.
    IoTHubClient_LL_SendEventAsync accepted message [4] for transmission to IoT Hub.
    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session

    Note:I've verified that the connection string used in the example to connect to iothub is a valid one. because as mentioned in this post , after changing MQTT_protocol to HTTP_protocol (in  IoTHubClient_LL_CreateFromConnectionString(connectionString, MQTT_Protocol)) the connection to azure cloud is happening and i'm able to get confirmation message and able to see the received messages in azure cloud.

  • Hi Suhas,

    Did you update the certificate catalog according to the plugin user's guide?

    Best regards,

    Sarah

  • Hi Sarah,

    I updated the certificate catalog in Uniflash and tried to flash the board , but I keep getting following error:

    Operation failed: Error: SLImageCreator.exe: fs_programming error: ret: -10287, ex_err: 2633 - FS_ERR_ROOT_CA_IS_UNKOWN

    can you please help me with this?

  • Hi Suhas,

    The Azure IoT plugin library verifies the certificates used for connection against the certificate catalog. The certificate catalog is also used to verify the root certificate to sign your application MCU binary. You have a few options:

    1. Do not flash any application binary, and test using the debugger only. (For development only.)
    2. Sign your application binary with a valid root certificate, instead of the dummy root certificate from the SDK for development. (Required for production.)
    3. Or, make changes directly to the Azure IoT library in task 2, steps 6-10 of this SimpleLink Academy lab: https://dev.ti.com/tirex/explore/node?node=AJ9nHaAsEsae1pf9GfFizw__fc2e6sr__LATEST (For development only.)

    Best regards,

    Sarah