Search code examples
iotibm-watsontexas-instrumentswatson-iot

How to subscribe IBM Watson IOT Platform with CC3220s launchpad and Code Composer Studio?


I have been trying to send messages to IBM IOT Platform using CC3220s Launchpad and Code Composer Studio cc32xx SDK, watson_mqttclient_CC3220S_Launchxl_tirtos_ccs project.


I can send the messages to quickstart broker.
However, I got:

  • Invalid userID () for device auth:
    ClientID='d:u45vsd:ti-simplelink:9884e34e0611',
    ClientIP=178.241.108.68

    Connection Log Message on IBM Watson IOT Platform
  • CONNACK:
    Connection Error: 5
    Connection to broker failed, Error code: -5
    BRIDGE DISCONNECTION

    Error on CCS serial terminal

I have done following changes on CCS mqttclient code and IBM Watson IOT Platform:

  1. I have changed the security level as "TLS Optional" on the security options IBM Watson IOT Platform and I have added new device with following informations:

    Organization ID : u45vsd
    Device Type : ti-simplelink
    Device ID : 9884e34e0611
    Authentication Method : use-token-auth
    Authentication Token : zzzzzzzzzzzzz

  2. Following codes were changed in network_if.h:

    define SSID_NAME "Netmaster EB75-G"
    define SECURITY_KEY "password"
    define SECURITY_TYPE SL_WLAN_SEC_TYPE_WPA_WPA2

  3. Following codes were changed in mqtt_client_app.c:

    define SERVER_ADDRESS "u45vsd.messaging.internetofthings.ibmcloud.com"
    char ClientId[64] = "d:u45vsd:ti-simplelink:9884e34e0611";
    const char *ClientUsername = "use-token-auth";
    const char *ClientPassword = "zzzzzzzzzzzzzzzzzzz";
    sprintf(ClientId, "d:u45vsd:ti-simplelink:%02x%02x%02x%02x%02x%02x", macAddress[0], macAddress[1], macAddress[2], macAddress[3], macAddress[4], macAddress[5]);


What am I missing?
Any help will be appreciated.
Thanks in advance.


Solution

  • I have solved my problem with uncomment lines below:

    #define CLNT_USR_PWD
    #define SUBSCRIBE
    

    BR,