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.

CC3100: Device disconnected from the AP on application's request

Part Number: CC3100
Other Parts Discussed in Thread: CC3200

Hi,

  Under what circumstances will "Device disconnected from the AP on application's request" be printed on debug. This text is coming from inside the callback function "SimpleLinkWlanEventHandler()" under switch-case "SL_WLAN_DISCONNECT_EVENT". The reason for which I am asking this is because nowhere in the code I am calling the function "sl_WlanDisconnect()", but still the event says "application requested the disconnection". Is there any other reason under which this event may be triggered from callback function even if "sl_WlanDisconnect()" is not called at all?

-

Thanks

-

Regards

Soumyajit

  • Hi Soumyajit,

    You can find out more information for the reason of the SL_WLAN_DISCONNECT_EVENT by reading the reason code.  For example in the CC3100 1.3 SDK most examples use the snippet below to distinguish whether the disconnect was initiated by the user

    pEventData = &pWlanEvent->EventData.STAandP2PModeDisconnected;
    
    /* If the user has initiated 'Disconnect' request, 'reason_code' is
       SL_USER_INITIATED_DISCONNECTION */
    if(SL_WLAN_DISCONNECT_USER_INITIATED_DISCONNECTION == pEventData->reason_code)
    {
    	CLI_Write(" Device disconnected from the AP on application's request \n\r");
    }
    else
    {
    	CLI_Write(" Device disconnected from the AP on an ERROR..!! \n\r");
    }

  • Hi Austin,
    Thanks for the reply. In my application, I am getting 'pEventData->reason_code' as 'SL_WLAN_DISCONNECT_USER_INITIATED_DISCONNECTION', but nowhere in the code I have called the function 'sl_WlanDisconnect()'.
    My question is whether 'pEventData->reason_code' can have value 'SL_WLAN_DISCONNECT_USER_INITIATED_DISCONNECTION' even if function 'sl_WlanDisconnect()' is not called at all?
    In other way, under which all circumstances the value 'SL_WLAN_DISCONNECT_USER_INITIATED_DISCONNECTION' can be passed on to the callback function 'SimpleLinkWlanEventHandler()' without user calling sl_WlanDisconnect() function?
    -
    Thanks
    -
    Regards
    Soumyajit
  • Hi Soumyajit,

    I am not TI employee, and from this reason I haven't access to source code of CC3100 and I am not able answer your questions. But I have few questions:
    - What SDK version do you use?
    - What ServicePack version do you have uploaded inside your CC3100.

    If will not be complicated for you, captured NWP log can be useful for TI support to determine reason of disconnect. How to capture NWP log you find described here - processors.wiki.ti.com/.../CC3100_&_CC3200_Capture_NWP_Logs

    Jan

  • Hi Soumyajit,

    If you are sure there is not a call to sl_WlanDisconnect(), then as Jan suggested it would be beneficial to capture additional logs. I'd suggest starting by sharing either NWP logs or a Wi-Fi sniffer capture.
  • Hi Austin,
    Since my custom designed board do not have the UART pins taken out, hence collecting of NWP logs is not possible at this moment. So, can I assume that "SL_WLAN_DISCONNECT_USER_INITIATED_DISCONNECTION" will be only returned if 'sl_WlanDisconnect()' is called?
    -
    Thanks
    -
    Regards
    Soumyajit
  • Hi Soumyajit,

    I don't think you can necessarily make that assumption.
  • Thanks Tanner for your reply.
    Understood your point, but the issue still remains unresolved in my project.
    -
    Thanks
    -
    Regards
    Soumyajit
  • Hi Soumyajit,

    Please provide Wi-Fi sniffer captures or NWP logs so we can assist on the question above.

    Also, please share the SDK version being used and the ServicePack version.
  • Hi Austin,
    As I am using a custom designed board, where the MCU is connected to CC3100 only via SPI bus, I am unable to capture any NWP log. The SDK and service pack versions are provided below:
    -
    SDK: [#define SL_DRIVER_VERSION "1.0.1.6"] (as captured from simplelink.h)
    Service Pack: [CC3100_CC3200_ServicePack_1.0.1.11-2.10.0.0] (as captured from folder name under which the service pack resides)
    -
    Thanks
    -
    Regards
    Soumyajit
  • Hi Soumyajit,

    Again, I'd suggest capturing Wi-Fi sniffer logs if you cannot record the NWP logs.

    Also, do you see this behavior at specific lines in your application code? Or, is the event triggered sporadically?
  • Hi Austin,
    The event occurs sporadically.
    -
    Regards
    Soumyajit
  • Hi Soumyajit,

    I haven't received a reply from you with the requested Wi-Fi sniffer captures, so I'll be closing this issue. Please create a new thread with a reference to this post if you have additional questions.
  • Hi Austin,
    Thanks for your support. I'll open up a new thread once I am able to capture some log.
    -
    Thanks
    -
    Regards
    Soumyajit