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.

CC3220S-LAUNCHXL: Connecting/Disconnecting with Simplelink Academy Lab focused on the SimpleLink™ Wi-Fi® MQTT library

Part Number: CC3220S-LAUNCHXL
Other Parts Discussed in Thread: CC3220S

I'm working with some of the demo labs for the CC3220S - Launchpad, and I'm finding a peculiar behavior for the program. It connects successfully, then pulls a "Subscription Error" and disconnects from the broker. It then restarts the program and follows the same error path. Can anybody explain why it behaves like this and if there's any fix? I've found it doesn't start this pattern until I try to connect to the broker using a Remote MQTT Client. 

                 *************************************************
                    CC3220 MQTT client Application
                 *************************************************



Device came up in Station mode
[WLAN EVENT] STA Connected to the AP: DDS - Tech , BSSID: e2:55:7d:a8:67:a1
[NETAPP EVENT] IP acquired by the device

Device has connected to DDS - Tech
Device IP Address is 10.34.150.245

Version: Client LIB 1.1.0, Common LIB 1.2.0.
.C: FH-B1 0x10 to net 0, Sent (57 Bytes) [@ 30]
C: Rcvd msg Fix-Hdr (Byte1) 0x20 from net 0 [@ 30]
C: Cleaning session for net 0
CONNACK:
Connection Success
C: Msg w/ ID 0x0000, processing status: Good
C: FH-B1 0x82 to net 0, Sent (99 Bytes) [@ 30]
C: Net 0, Raw Error -1, Time Out: N [30]
C: RX closing Net 0 [-1]
C: Cleaning session for net 0
C: Net 0 now closed
BRIDGE DISCONNECTION

 Subscription Error

On-board Client Disconnected

[SOCK ERROR] - close socket (0) operation failed to transmit all queued packets
.
TO Complete - Closing all threads and resources
Unsubscribed from the topic /Broker/To/cc32xx
Unsubscribed from the topic /cc3200/ToggleLEDCmdL1
Unsubscribed from the topic /cc3200/ToggleLEDCmdL2
Unsubscribed from the topic /cc3200/ToggleLEDCmdL3

 Client Stop completed

  • Hi Edward,

    Are you following the MQTT Client Demo or the MQTT Client-Server Demo within the SimpleLink Academy?

    It appears a timeout is occurring after sending some message and the device is configured to disconnect from everything and reset when this occurs. Are you using a mobile device as the Remote MQTT Client? Make sure the settings you establish follow those that are in the SimpleLink Academy.

    Best,
    Kevin
  • Hi,

    I have been following the MQTT Client Demo, and unfortunately I do not have an Android phone to test with the same app the instructions do. I was attempting to use a Chrome App "MQTTLens". I'm using m2m.eclipse.org as a host but i've tried it with iot.eclipse.org and neither work.
  • Hi Edward,

    It appears your program is having issues before connecting to your remote client.

    Can you check that your local Access Point parameters are correct within network_if.h (Step 2 of the SimpleLink Academy).

    Also check step 3 settings and make them the default settings if they aren't already.

    Before connecting to the remote client you should see the following in the terminal:

                     *************************************************
                        CC3220 MQTT client Application
                     *************************************************
    
    Device came up in Station mode
    [WLAN EVENT] STA Connected to the AP: simplelinkapps1 , BSSID: xx:xx:xx...
    [NETAPP EVENT] IP acquired by the device
    
    Device has connected to simplelinkapps2
    Device IP Address is 192.168.1.x
    
    Version: Client LIB 1.1.0, Common LIB 1.2.0.
    ..C: FH-B1 0x10 to net 0, Sent (52 Bytes) [@ 7]
    C: Rcvd msg Fix-Hdr (Byte1) 0x20 from net 0 [@ 7]
    C: Cleaning session for net 0
    CONNACK:
    Connection Success
    C: Msg w/ ID 0x0000, processing status: Good
    C: FH-B1 0x82 to net 0, Sent (99 Bytes) [@ 7]
    C: Rcvd msg Fix-Hdr (Byte1) 0x90 from net 0 [@ 7]
    C: Msg w/ ID 0x0001, processing status: Good
    Client subscribed on /Broker/To/cc32xx
    ,Client subscribed on /cc3200/ToggleLEDCmdL1
    ,Client subscribed on /cc3200/ToggleLEDCmdL2
    ,Client subscribed on /cc3200/ToggleLEDCmdL3

    Edited the above...

    Best,

    Kevin

  • Hi,

    So, before I attempt to communicate with the remote client, the terminal shows this:

                     *************************************************
                        CC3220 MQTT client Application
                     *************************************************
    
    
    
    Device came up in Station mode
    [WLAN EVENT] STA Connected to the AP: DDS - Tech , BSSID: e2:55:7d:a8:67:a1
    [NETAPP EVENT] IP acquired by the device
    
    Device has connected to DDS - Tech
    Device IP Address is 10.34.150.245
    
    Version: Client LIB 1.1.0, Common LIB 1.2.0.
    .C: FH-B1 0x10 to net 0, Sent (57 Bytes) [@ 1245]
    C: Rcvd msg Fix-Hdr (Byte1) 0x20 from net 0 [@ 1245]
    C: Cleaning session for net 0
    CONNACK:
    Connection Success
    C: Msg w/ ID 0x0000, processing status: Good
    C: FH-B1 0x82 to net 0, Sent (99 Bytes) [@ 1245]
    C: Rcvd msg Fix-Hdr (Byte1) 0x90 from net 0 [@ 1245]
    C: Msg w/ ID 0x0001, processing status: Good
    Client subscribed on /Broker/To/cc32xx
    ,Client subscribed on /cc3200/ToggleLEDCmdL1
    ,Client subscribed on /cc3200/ToggleLEDCmdL2
    ,Client subscribed on /cc3200/ToggleLEDCmdL3
    ,.
    C: Rcvd msg Fix-Hdr (Byte1) 0x30 from net 0 [@ 1247]
    
    Msg Recvd. by client
    TOPIC: /cc3200/ToggleLEDCmdL1
    PAYLOAD: {"d":{"temp":21.5,"humidity":65,"location":{"longitude":-98.49,"latitude":29.42}}}
    QOS: 0
    C: Msg w/ ID 0x0000, processing status: Good
    C: Rcvd msg Fix-Hdr (Byte1) 0x30 from net 0 [@ 1250]
    
    Msg Recvd. by client
    TOPIC: /cc3200/ToggleLEDCmdL1
    PAYLOAD: {"d":{"temp":23,"humidity":60,"location":{"longitude":-98.49,"latitude":29.42}}}
    QOS: 0
    C: Msg w/ ID 0x0000, processing status: Good
    C: Rcvd msg Fix-Hdr (Byte1) 0x30 from net 0 [@ 1253]
    
    Msg Recvd. by client
    TOPIC: /cc3200/ToggleLEDCmdL1
    PAYLOAD: {"d":{"temp":24,"humidity":53,"location":{"longitude":-98.49,"latitude":29.42}}}
    QOS: 0
    C: Msg w/ ID 0x0000, processing status: Good
    C: Rcvd msg Fix-Hdr (Byte1) 0x30 from net 0 [@ 1256]
    
    

    But when I try to connect with the remote client, it does this:

    Msg Recvd. by client
    TOPIC: /cc3200/ToggleLEDCmdL1
    PAYLOAD: {"d":{"temp":22.2,"humidity":49,"location":{"longitude":-98.49,"latitude":29.42}}}
    QOS: 0
    C: Msg w/ ID 0x0000, processing status: Good
    C: Net 0, Raw Error -1, Time Out: N [1258]
    C: RX closing Net 0 [-1]
    C: Cleaning session for net 0
    C: Net 0 now closed
    BRIDGE DISCONNECTION
    
    On-board Client Disconnected
    
    TO Complete - Closing all threads and resources
    Unsubscribed from the topic /Broker/To/cc32xx
    Unsubscribed from the topic /cc3200/ToggleLEDCmdL1
    Unsubscribed from the topic /cc3200/ToggleLEDCmdL2
    Unsubscribed from the topic /cc3200/ToggleLEDCmdL3
    
    Client Stop completed

    How does this change your previous diagnosis?

  • I think I've isolated the issue to be the MQTTlens Chrome App that I'm using. I was able to use an IOS App to publish a message to the Launchpad. I'd still be interested to know why it disconnects when I try to connect with the Chrome App.
  • Hi Edward,

    I'll have to try the example with the MQTTlens App and see if I can distinguish any issues. Happy you isolated the issue!

    Best,
    Kevin