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: CC3220SF : Azure IoT not working

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

Azure sdk = azure_cc3220_2_10_00_04

simplelink sdk = simplelink_cc32xx_sdk_2_40_01_01

servicepack = sp_3.10.0.5_2.0.0.0_2.2.0.6.bin

Azure example = iothub_client_sample_mqtt

I imported (iothub_client_sample_mqtt) example.

Modified :

  1. wifi config(ssid,password,security)
  2. connectionString = "HostName=xxxxxx.azure-devices.net;DeviceId=mydevicex;SharedAccessKey=42PsE57NonbULyT/UwFrAVUGNSakv8gkKXr+ujklsdg=";
  3. sprintf_s(msgText, sizeof(msgText), "{\"deviceId\":\"mydevicex\",\"windSpeed\":%.2f,\"temperature\":%.2f,\"humidity\":%.2f}", avgWindSpeed + (rand() % 4 + 2), temperature, humidity);

Output is :

[Cortex_M4_0] Starting the iohub_client_sample_mqtt example
Current time: Fri Feb 22 10:34:14 2019

CC32XX has connected to AP and acquired an IP address.
IP Address: 192.168.3.150
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 checked with azure side  connecting using connection string and sending data receiving data.  

Questions:

  1. I am not getting conformation SendConfirmationCallback not calling i checked azure side also showing disconnected only why i am not able to connect ?
  2. I missed any thing ?

Thank You 

   Vasu

  • Vasu,

    Are you having issues getting the following string to print? 

    1. sprintf_s(msgText, sizeof(msgText), "{\"deviceId\":\"mydevicex\",\"windSpeed\":%.2f,\"temperature\":%.2f,\"humidity\":%.2f}", avgWindSpeed + (rand() % 4 + 2), temperature, humidity);

    Is this in the function that isn't working for you?

    BR,
    Vince

  • I can confirm that receiving messages from the hub is broken under simplelink_cc32xx_sdk_2_40_01_01. Reverting to simplelink_cc32xx_sdk_2_30_00_05 fixes it. Who should we let know about it?

  • Vasu / Michael - 

    the Azure Plugin release notes state which SDK it is aligned with (in this case v2.30)

    the version which is aligned with SDK v2.40 is in test now. 

      

  • Hi Team,

    Sorry for delayed response i was on leave,

    One method:

    If i import azure example project(iothub_client_sample_mqtt) automatically taking latest version sdk.

    How to change sdk version v2.30 there is no option to change sdk version.

    Another Method :

    I imported empty project(v2.30).

    Added all azure related library (project->properties->include Options and predefined symbols and file search path)

    After modification i am getting error.

    Why i am getting this is error.

    Thank You

        Vasu

     

  • Vasu,

    You can see that the SimpleLink SDK is being provided by a dependency in the project (FreeRTOS builds). You will need to delete this freeRTOS project and reimport the same project from the SDK you wish to use.

    BR,
    Vince

  • Hi Vincent,

    Thank you for your response,

    Finally i can able to communicate Azure IoT hub.

    One more thing free rtos work on FreeRTOSv10.0.1 this version if i use C:\FreeRTOSv10.1.1 this version not working.

    /*String containing Hostname, Device Id & Device Key in the format:                         */
    /*  1 )"HostName=<host_name>;DeviceId=<device_id>;SharedAccessKey=<device_key>"                */
    /*  2 ) "HostName=<host_name>;DeviceId=<device_id>;SharedAccessSignature=<device_sas_token>"    */

    1) Now i am using first one for connection.

    2) if i want to use second one  SharedAccessSignature=<device_sas_token> this field manually i need generate sas token as per document.

        After that i need to pass connection string ? 

    Thank you

       Vasu

  • Vasu,

    Yes i believe that is correct.

    Vince
  • thank you vincent
  • Thanks Josh. Any ETD on the update?
  • Michael,

    No update yet.

    BR,
    Vince
  • Hi Devang,

    Could you please explain how you have solved the issue and able to communicate with IoT-Hub, i am facing the same issue but able to debug that when i try to establish a secure connection with the certificate provided in certs.c in example  but it is giving error "SL_ERROR_BSD_ESECUNKNOWNROOTCA" (-468) as with the descreption it is some error related to playground certificate flashed in device or is it due to the azure-iot hub SSL error, please explain how you have solved the problem

    Regards,

    Chiranth H D

  • Hi Chiranth,

    Give few details

    • Example project (or) your project 
    • cc3220sf sdk version  
    • azure sdk version
    • servicepack

    Now also i checked there is no issue working fine.

    What is your exact problem ?

    Vasu

  • Hi Dhevan,

    Project: Example in <AZURE-SDK-Install-Dir/examples/rtos/CC3220SF_LAUNCHXL/azure/iothub_client_sample_mqtt/tirtos/ccs
    CC3220SF SDK-Version : 2_40_02_00
    Azure SDK-Version: 2_20_00_05
    Service Pack : 3.10.0.5_2.0.0.0_2.2.0.6

    they have given cert.c file which contaions the baltimore root certificate for *.azure-devices.net and flashed in location /certs/ms.pem and used in file <AZURE-INSTALLED-DIR>/source/third_party/azure-iot-pal-simplelink/pal/src/tlsio_sl.c> to open the socket and set credentials, the SlNetSock_startSec() with SLNETSOCK_SEC_START_SECURITY_SESSION_ONLY is giving error SL_ERROR_BSD_ESECUNKNOWNROOTCA (-468) and failing to create secure socket and returning failure error.

    Regards,
    Chirath H D
  • Hi Chirath,

    Azure SDK-Version: 2_20_00_05 this version supports CC32XX SDK 2.40.01.01  sdk use this cc322 sdk version.

    I am not sure new azure sdk version.

    I checked with :

    • Azure sdk 2.10.0.04
    • Simplelink CC32xx sdk 2.30.0.05

    This version working fine check with this version.

    Vasu

  • Hi Dhevan,

    I have not tried with the above mentioned sdk versions by you, but tlsio_sl_open() in azure sdk pal/src/tlsio_sl.c the option to start secure connection " SlNetSock_startSec(clientSd, instance->sec_attrib_hdl, SLNETSOCK_SEC_START_SECURITY_SESSION_ONLY); was returning error " SL_ERROR_BSD_ESECUNKNOWNROOTCA (-468) " and use to return FAILURE by checking for this condition and preceding further ignoring this error is working, i searched for the above mentioned error and not able to get the complete picture, but correct me if i am wrong this error is related to TI's playground catalog file flashed in the CC3220 that it has not been updated with the "Baltimore Root CA" for azure iot-hub, when NWP tries to verify with this it is giving error.

    Regards,
    Chiranth H D.
  • Hi Chiranth,

    This issue on new azure sdk old sdk we using same certificate not showing any error.

    I checked with new azure sdk 2_20_00_05 with CC32XX SDK 2.40.01.01 i am not able connect azure iot hub.

    Issue is there in new sdk.

    better check with old sdk 

    • Azure sdk 2.10.0.04
    • Simplelink CC32xx sdk 2.30.0.05

    If you want to use new azure sdk open new thread rise your problem ti people help you to solve new azure sdk issue.

    Vasu

  • Hi Chiranth, Vasu,

    If the issue is related to the Trusted Root Certificate catalog from the new SDK, that file can be swapped out on the device without switching all of the example code (from one set of SDKs to the other).

    A useful test would be to first flash the Trusted Root Certificate catalog (real, not dummy) from the latest CC32xx SDK to the device using UniFlash ImageCreator. Then run the code example from each sets of SDK to see if the issue occurs for both test runs or only just one.

    If you are referring to the Baltimore CyberTrust Root, it should exist in both catalogs per the README.html inside the tools/cc32xx_tools/certificate-catalog/ folder.

    Best Regards,
    Ben M