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.

Wrong password / SSID detection

Other Parts Discussed in Thread: CC3200, CC3200SDK

Hi all,

I'm starting a new application with my cc3200 Launchpad, starting from the wlan_station example. I want to give the user the possibility to enter the SSID and password of the local wifi network via a terminal and afterwards call the WlanConnect function from the example. So far so good.

As provided in the warning in the WlanConnect function header the function will be stuck forever in case either the SSID or the password is incorrect. If this is the case I want to prompt to the user which one of the two was incorrect, but it seems to be hard to do this.

How can I detect a wrong SSID or password and call an other function from there? A time out would work for detecting that one of the two is wrong, but this doesn't make a distinction.

Thanks in forward

  • Hi Jan,

    At the example program HTTP Server, there is an internal webpage that you can input SSID and password, maybe you can learn from how that is done.

    From my experience using wlan_station example program, if I input wront SSID and password at common.h, there is some error. So, probably you can add additional code at this error routine, that will serve your purpose.

    - kel
  • Hi Jan,

    There is no event that can tell you if the SSID is wrong. The simplelink device will just continue to look for it.
    However you will get a disconnect event if the key is wrong, so by elimination if you are stopping on a timeout defined by you (I would suggest something around 5sec or more) then the problem is wrong SSID, otherwise if you get a disconnect event you have a wrong key.

    Thanks,
    Alon
  • Hi Alon,

    Thank you for your answer. Can you tell some more about the disconnect event? How is the event generated and how can I catch it?

    Is there an example available where the event is used?

    Thanks.

  • Hello Jan Oene,

    you can find further details within the API documentation (e.g. file:///C:/ti/CC3200SDK_1.1.0/cc3200-sdk/docs/simplelink_api/html/group___user_events.html ).

    You can find the reason and error codes defined in wlan.h (/* WLAN Disconnect Reason Codes */)


    Almost all our examples check the status by parsing within function void SimpleLinkWlanEventHandler()

    Regards,
    Marc
  • Hi Marc,

    When I use the out-of-the-box Wlan-station example, I see that the SimpleLinkWlanEventHandler is defined. However, when I enter a wrong password this event is not triggered. Entering a valid password however, triggers this handler and raises a connect event. What am I doing wrong?
  • Hi Jan,

    Yes, this is true, sorry for that. It is indeed something we need to fix.
    Wrong password event is being caught by the General Event handler, as this is considered an error event and not a graceful disconnect event. (I know it is confusing, sorry for that).
    You will be able to catch this event by implementing a CB to SimpleLinkGeneralEventHandler().
    If you will look at pDevEvent->EventData.deviceEvent.status you will see it is -109 which is SL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_ CONNECT error code.

    Thanks,
    Alon
  • Hi Alon,

    I tried to catch this event in the wlan station example. As the general event handler is already defined, I set a break point there.
    Unfortunately, the event seems not to be triggered if I enter an invalid password.
    How should I modify the example such that this event is triggered?

    Thanks
  • BUMP!

    This seems like an important thing to be able to do. How do you detect an invalid password when the SSID is valid? In my application the SSID is chosen by the user from a list of detected SSIDs (detected by the CC3200) so the SSID is known to be correct. Different routers take differing periods of time to attach, so a simple timeout is dangerous and means the user must wait before they know they have mis-typed  the pw.

    The TI employee above in this thread seems to be guessing how it might work, but surely there is an authorative view from TI? I have tried setting a breakpoint in SimpleLinkGeneralEventHandler(), as per his second guess, and that does not get triggered by an incorrect PW. I think the original poster also tried this.

    Can anyone please help??

    Thanks

    Mike

  • Hi Mike,

    I see this post was missed because it was on an older thread.

    I have verified that the SL_GENERAL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT (-109) error is sent to the SimpleLinkGeneralEventHandler() function when wlanconnect() is called with a valid SSID and incorrect password.

    Are you using the latest ServicePack?

    Thanks,
    Ben M