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.

LAUNCHCC3220MODASF: Unable to communicate with Azure IOT Hub using iothub_client_sample_mqtt instance from Azure IOT plugin

Part Number: LAUNCHCC3220MODASF
Other Parts Discussed in Thread: CC3220SF-LAUNCHXL, CC3220SF

Hello,

I am 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 : 12.0

>> simplelink_cc32xx_sdk_4_10_00_07

The callback function for "ReceiveMessageCallback" does not get triggered during the execution of the example. Additionally, the messages are not being sent to the Azure Cloud. The console displays the following message

Starting the iohub_client_sample_mqtt example

Current time: Fri September 19 05:57:20 2023

 

CC32XX has connected to AP and acquired an IP address.

IP Address: 172.20.10.2

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 tried to update the service pack sp_3.15.0.1_2.0.0.0_2.2.0.7.bin .But this did not solve the problem

Please help me resolve the issue.

  • Hi,

    Are you starting fresh with Azure? Have you looked into the user guide of the plugin?

    https://dev.ti.com/tirex/explore/node?node=A__AFO7-fE66c6CZmRL83W9ew__com.ti.AZURE_CC32XX__9QUeYYT__LATEST

    Shlomi

  • hi,

    Yes, I am following this document and update the example to use your Azure connection string and Wi-Fi access point information. But I am not able to establish connection with my azure IoT hub

    Please help me resolve the issue.

  • Hi,


    Can you help to enable debug logs
    how to do the first step 
    1. Link against the debug version of the Azure libraries, e.g.
      pal_sl_debug.a, common_sl_debug.a, ...



    We are trying to comment out ENABLING_LOGGING
    Get the following errors

    **** Build of configuration Debug for project iothub_client_sample_mqtt_CC3220SF_LAUNCHXL_tirtos_ccs ****

    "C:\\ti\\ccs1240\\ccs\\utils\\bin\\gmake" -k -j 12 all -O

    Building target: "iothub_client_sample_mqtt_CC3220SF_LAUNCHXL_tirtos_ccs.out"
    Invoking: Arm Linker
    "C:/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=none -me --define=NET_SL --define=USE_BALTIMORE_CERT -g --c99 --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on -z -m"iothub_client_sample_mqtt_CC3220SF_LAUNCHXL_tirtos_ccs.map" -i"C:/ti/azure_cc32xx_4_10_01_01/source" -i"C:/ti/simplelink_cc32xx_sdk_4_10_00_07/source" -i"C:/ti/simplelink_cc32xx_sdk_4_10_00_07/kernel/tirtos/packages" -i"C:/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib" --diag_wrap=off --display_error_number --warn_sections --xml_link_info="iothub_client_sample_mqtt_CC3220SF_LAUNCHXL_tirtos_ccs_linkInfo.xml" --rom_model -o "iothub_client_sample_mqtt_CC3220SF_LAUNCHXL_tirtos_ccs.out" "./syscfg/ti_net_config.obj" "./syscfg/ti_drivers_net_wifi_config.obj" "./syscfg/ti_drivers_config.obj" "./certs.obj" "./iothub_client_sample_mqtt.obj" "./main_tirtos.obj" "./network.obj" "./startsntp.obj" "../CC3220SF_LAUNCHXL_TIRTOS.cmd" -l"C:/ti/azure_cc32xx_4_10_01_01/source/third_party/azure-iot-pal-simplelink/build_all/sdk/lib/ccs/m4/iotclient_sl_release.a" -l"C:/ti/azure_cc32xx_4_10_01_01/source/third_party/azure-iot-pal-simplelink/build_all/sdk/lib/ccs/m4/common_sl_release.a" -l"C:/ti/azure_cc32xx_4_10_01_01/source/third_party/azure-iot-pal-simplelink/build_all/pal/lib/ccs/m4/pal_sl_release.a" -l"C:/ti/simplelink_cc32xx_sdk_4_10_00_07/source/ti/net/sntp/lib/ccs/m4/sntp_release.a" -l"C:/ti/simplelink_cc32xx_sdk_4_10_00_07/source/ti/net/http/lib/ccs/m4/httpclient_release.a" -l"C:/ti/simplelink_cc32xx_sdk_4_10_00_07/source/ti/net/lib/ccs/m4/slnetsock_release.a" -l"C:/ti/simplelink_cc32xx_sdk_4_10_00_07/source/ti/drivers/net/wifi/slnetif/ccs/Release/slnetifwifi.a" -l"C:/ti/simplelink_cc32xx_sdk_4_10_00_07/source/ti/drivers/net/wifi/ccs/rtos/simplelink.a" -l"C:/ti/azure_cc32xx_4_10_01_01/source/third_party/azure-iot-pal-simplelink/build_all/sdk/lib/ccs/m4/umqtt_sl_release.a" -l"ti/display/lib/display.aem4" -l"ti/grlib/lib/ccs/m4/grlib.a" -l"third_party/spiffs/lib/ccs/m4/spiffs.a" -l"ti/drivers/lib/drivers_cc32xx.aem4" -l"third_party/fatfs/lib/ccs/m4/fatfs.a" -l"ti/dpl/lib/dpl_cc32xx.aem4" -l"C:/Users/noush/workspace_v12/tirtos_builds_CC3220SF_LAUNCHXL_release_ccs/Debug/configPkg/linker.cmd" -l"ti/devices/cc32xx/driverlib/ccs/Release/driverlib.a" -llibc.a
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    xlogging_set_log_function ./iothub_client_sample_mqtt.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "iothub_client_sample_mqtt_CC3220SF_LAUNCHXL_tirtos_ccs.out" not built

    >> Compilation failure
    makefile:161: recipe for target 'iothub_client_sample_mqtt_CC3220SF_LAUNCHXL_tirtos_ccs.out' failed
    gmake[1]: *** [iothub_client_sample_mqtt_CC3220SF_LAUNCHXL_tirtos_ccs.out] Error 1
    makefile:154: recipe for target 'all' failed
    gmake: *** [all] Error 2

    **** Build Finished ****

  • you are linking against the "release" libraries, e.g. "C:/ti/azure_cc32xx_4_10_01_01/source/third_party/azure-iot-pal-simplelink/build_all/sdk/lib/ccs/m4/common_sl_release.a" - you should pick the debug libraries instead (e.g. common_sl_debug.a) that you can find in the same folder.

    Go to Project Properties -> Build -> Arm Linker -> File Search Path, and replace the "...release.a" with "...debug.a".

  • Hi,

    We have updated the service pack and root certificate catalog

    console output :

    Starting the iohub_client_sample_mqtt example
    startSNTP: Current time: Wed Oct 4 05:00:43 2023


    CC32XX has connected to AP and acquired an IP address.

    IP Address: 192.168.1.26

    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

    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

    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

    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

    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

    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session

    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session

    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session

    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session

    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session


    But this did not solve the problem

    Please help me resolve the issue

  • This was not supposed to solve anything yet - just to get more info about the problem (we just enabled logs).

    We know now that we had problem to connect to the TLS server, but it doesn't give us enough info (error code).

    The problem is probably related to the certificate that you are using, but to get more info i'll need to exact error code.

    In <plugin-root>/source/third_party/azure-iot-pal-simplelink/pal/src/tlsio_sl.c, look for the the following line (supposed to be line 381 - i don't understand how it is mentioned as line 371 in the log):

    LogError("SlNetSock_startSec failed to start session\n");

    and update it (so we can see the error code from the SlNetSock_startSec):

    LogError("SlNetSock_startSec failed to start session %d\n", status);

    and you will need to re-build the rebuild the Azure PAL libraries:

    Open the Quick Start Guide (in <plugin-root>/docs folder) and check the instructions in "Building the Azure PAL and SDK Libraries".

    Then rebuild the application.

  • Hi,

    here is the debug log with error code status 

    modification in tlsio_sl.c :

    371   LogError("SlNetSock_startSec failed to start session %d\n", status);

    console output :

    Starting the iohub_client_sample_mqtt example
    startSNTP: Current time: Thu Oct 5 11:54:07 2023


    CC32XX has connected to AP and acquired an IP address.

    IP Address: 192.168.1.26

    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 -468

    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 -468

    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 -468

    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 -468

    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 -468

    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session -468

    Error: File:../../pal/src/tlsio_sl.c Func:tlsio_sl_open Line:371
    SlNetSock_startSec failed to start session -468

  • -468 means the Certificate is not included in the installed certificate catalog.

    This is only a warning (the connection is already established) that can be ignored if this is expected (i.e. if you are still using the playground root ca or the new Azure Root CA is not part of the cc32xx official catalog).

    The problem is that seems that the code doesn't ignore this and report this as an error.

    What you can do is changing line 380 of tlsio_sl.c ("if (status < 0) {") as follows:

    if (status < 0 && status != SL_ERROR_BSD_
    ESECUNKNOWNROOTCA) {

    You can read about the CC32xx certificate handling here: https://www.ti.com/lit/pdf/swpu332 (see ch.5 "troubleshooting" for details of the specific error).