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: Sensor to Cloud Iot Example failing to initialise MQTT Library (TIDC-01002)

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

Hi,

I am following tidud09a guide (Sub-1GHzEmbeddedSensorto CloudIndustrialInternetof Things(IoT)GatewayReferenceDesign). I have followed the steps to configure CC3220SF-Launchpad and CC1310 (coop). I've also completed the IBM Cloud setup steps and everything was going well.

I've pulled the Reference code from as stated in the guide.

I am at the stage of connecting my gateway to the cloud via the web front end provided by the gateway and I've noticed that it is is failing to do so.

I've provisioned the gatway to connect to my WiFi, great, get IP and I can access the front end.

I've created the gateway device as per the guide, got a device ID and Authorisation Key/Token too.

I plugged the values into the web form:

When I press Save Changes, I can see in the terminal screen that the device is trying to communicate to the hardcoded URL with the details from the form.

However, as you can see there is an error that is being displayed. Now, I've traced this error down to mqtt_client.c and client_core.c files

client_core.c

int32_t MQTTClientCore_initLib(const MQTTClientCore_LibCfg_t *lib_cfg_local)
{
    if ((NULL == lib_cfg_local) || (NULL == lib_cfg_local->debugPrintf))
    {
        return -1;
    }
    debugPrintf = lib_cfg_local->debugPrintf; /* Facilitate debug */

    if (ModuleState_InitDone == MQTTClientCore_clLibState)
    {
        MQTTCLIENTCORE_USR_INFO("C: Error trying to re-initialize \n\r");
        return -1;
    }

mqtt_client.c

    //
    // Set Client ID
    //
    MQTTClient_Lib_CB.MQTTClient_sem_waitForMqttClose_Created = true;
    if(MqttClientCtxCreate(attrib) )
    {
        UART_PRINT("could not init connection\n\r");
        return NULL;

    }
    MQTTClient_clientContext->clientID = attrib->clientId;
    MQTTClient_clientContext->appCBs = defaultCallback;
    return (NetAppHandle_t)(handle);


I've followed the steps of the guide where I used the Preconfigured Image Creator Project, section 3.2.1.1.4.1

It is strange that an already built image would failt to initialise a specific library, which makes me think it is more likely something wrong with the config.
However, the first error message in terminal is due to the MQTT library not being able to initialise where as the second seems to be due to the library not being initialised.

The actual silicon information is:
CC3220SF
12
TI 6CJ
P55L G4

I would realy like to get this kit working, any advice would be greatly appreciated.

  • I have decided to follow the steps in section 3.2.1.1.4.4 to create the Project Image from source. I've recompiled the the IBM example and created new UniFlash project, reflashed and it seems to connect to the cloud. Great.

    However, there is still a problem with the project as the web front end does not display anything or allow me to Open the network to add sensors.

    I can see loads of Javascript errors in the console.

    There might be some compatibility issues between files in "tidc01002\examples\cc3220_local_web_app\www" and "tidc01002\source\www".

  • This demo has not been updated since SDK v1.5

    I recommend that if you want to use this demo as is, you install SDK1.5 on both the CC13xx and the CC3220. This also includes the service pack on the CC3220.

    Regards,

    AB