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.

CC3220MODA: MQTT disconnect and reconnect

Part Number: CC3220MODA

Hi,

The microcontroller is acting as an MQTT client. It disconnects after a while, even when the MQTT broker and network were available. When it tries to reconnect, the connection fails and the controller gets struck. When the controller is trying to reconnect the IPv4 is lost(printed on the debugging console). 

I have also tried the demo code, the behavior is the same.  I'm using simplelink_cc32xx_sdk_3_30_01_02. 

Kindly help.

  • Hello,

    You might be having network issues if you're getting IP lost. What events (if any) are you getting from the net app or wlan event handlers? Also, have you tried capturing sniffer logs?

    Jesu

  • Hi Jesu,

    IPv4 lost Id or timeout, Id [0x8]!!! & IPv4 lost Id or timeout, Id [0x9]!!!

    These events occur frequently while debugging code. No, I haven't tried capturing sniffer logs. Can you explain how to do it?

    Also, is there some standard routine to reconnect the MQTT. It seems to hang if I recall MQTT_connect even when the broker is back.

    Regards

  • Hi,

    Are you working off of the mqtt client example? If so, have you made any modification to it? The example is setup to delete the mqtt client instance when a disconnect occurs and attempt to create and re-connect again. 

    IPv4 lost Id or timeout, Id [0x8]!!! & IPv4 lost Id or timeout, Id [0x9]!!!

    I'm not sure what this means. Could you provide some logs or context as to where this came from?

    It seems to hang if I recall MQTT_connect even when the broker is back.

    What do you mean when broker is back? Is your broker going down sometimes?

    Jesu

  • Hi Jesu,

    Sorry for the late reply.

    The IPv4 statement, I'm not sure why it's happening. The network is available at all times. Can you provide me some way to get these network logs?

    MQTT:

    The MQTT is getting disconnected because of two reasons. Firstly, if the broker goes offline, in that case, the disconnect event is triggered in that, I try to reconnect, as the broker is not available, for some reason it hangs. 

    Secondly, after a while(don't know if it's time-dependent or the number of messages being sent/receive) it gets disconnected. In both, cases reconnect sub-routine does not work. I have to reset the device and reconnect it.

  • For the IP issue I was wondering what this is exactly. Are these prints you added? What event handler or function did it come from. Just trying to get more context around this so I could understand what is going on. If the device is reporting IP lost this could indicate there is a problem with the connection to the AP.

    Also, do you know where exactly the re-connect subroutine fails? 

    Jesu