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.

CCS/CC3200-LAUNCHXL: how to use client_Mqtt example of cc3200 for cloudMQTT broker?

Part Number: CC3200-LAUNCHXL
Other Parts Discussed in Thread: CC3200SDK, CC3200

Tool/software: Code Composer Studio

i have been testing client_mqtt example on launchpad and it is connected to cloudMQTT broker .....it works fine but after some time like half an hour connection with broker gets closed ...........i want this connection forever .........i don't wanna lose incoming data to cc3200.......how can i overcome this problem??? i have attached screenshot of terminal window..........please check the message shown in red box .........also i get a message on cloudMQTT that "client stopped"

  • Seems like this is due to a time out.

    This is likely an issue on the broker side. Please check the logs there.
  • i checked the log that shows me below messages

    2018-07-04 05:32:06: Received PINGREQ from client_id_1
    2018-07-04 05:32:06: Sending PINGRESP to client_id_1
    2018-07-04 05:32:32: Received PINGREQ from client_id_1
    2018-07-04 05:32:32: Sending PINGRESP to client_id_1
    2018-07-04 05:33:10: Client client_id_1 has exceeded timeout, disconnecting.
    2018-07-04 05:33:10: Socket error on client client_id_1, disconnecting.


    what does that mean??what is the meaning of Keep alive time interval? does it mean that every 25 seconds client sends ping request to broker!!!!!by observing log ,broker is getting ping request from client.........and if client is sending so why broker is disconnecting client after some time ?


    what is the solution if there is an issue on the broker side?...........please guide me 

    i want to ask one more question that if i use same cloudmqtt account credentials to login from different LaunchXL boards simultaneously .......is that ok? or shall i use use different accounts for each LaunchXL board.........i mean i want to connect 5 launchXL boards (running client_mqtt code on it) to cloud_MQTT broker simultaneously......can i login through same account just by changing client id ??so that all clients can simultaneously communicate with broker ?




  • The keep-alive is to keep the connection alive. As you see from the broker logs, about every 25 sec there's a ping. Perhaps you can try with larger value and see if that changes anything. Also, please check on broker logs how many pings before the disconnection occurs (to see if that number is consistent).

    I recommend to speak with the broker support service for possibility of issues there.

    You should be able to use same username/password to connect with same broker.
  •  hi toby,
    i changed my board and on new board above issue is solved dont know how...... but now i want to send data that i receive from cloudMQTT to uart0 but sample code shows so many messages on console window while code is running that i don't want ...........so i commented most of the UART_PRINT(" ") lines in my code but still i am getting some messages......i have attached screenshot of terminal please check that out...........i don't want these messages to be forwarded over uart because i have connected zigbee to UART0........

  • These are debug messages from the mqtt library.
    If you don't need to see those messages, please try changing Mqtt_Client in main.c:
    /* library configuration */
    SlMqttClientLibCfg_t Mqtt_Client={
    0,
    TASK_PRIORITY,
    30,
    false, // disable additional debug info
    0 // no function pointer to print function (UART_PRINT)
    };
  • hi toby

    i made changes as you suggested but i am getting above message.............and also i don't want to disable uart0 completely because i  should be able to get messages published from cloudMQTT on my terminal .........i just want to disable ping packets response that i get after every 25 seconds....

  • Ok, here is another thing to try (according to this post: e2e.ti.com/.../565140 ):

    - Change your Mqtt_Client back to the original

    - Import mqtt library into CCS ( in C:\ti\CC3200SDK_1.3.0\cc3200-sdk\netapps\mqtt\ccs )
        - Note: Do not copy the project into workspace

    - Add pre-defined symbol DEBUG_NET_DEV

    - Rebuild mqtt, then rebuild mqtt_client

  • if i import mqtt library into CCS (in C:\ti\CC3200SDK_1.3.0\cc3200-sdk\netapps\mqtt\ccs )
    it throws me below error
    gmake: *** No rule to make target `C:/ti/CC3200SDK_1.3.0/cc3200-sdk/netapps/mqtt/platform/cc3200_platform.c', needed by `cc3200_platform.obj'. mqtt Unknown C/C++ Problem
  • Please rename cc3200_platform.c to cc32xx_platform.c.
    You can find this file in mqtt/platform