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.

RTOS/CC3220SF: CC3220SF WIFI connection retry issue

Part Number: CC3220SF

Tool/software: TI-RTOS

HI All,

We use CC3220sf MOD for our IOT project, Which connects to the azure cloud.  Below are some version numbers

We use "simplelink_cc32xx_sdk_2_20_00_10" sdk.

service pack is "sp_3.8.0.3_2.0.0.0_2.2.0.6.bin"

Below is the code snippet which we use for wlan connect.

    retVal = sl_WlanConnect((signed char*)wlanProfileToAdd.ssid,
                            wlanProfileToAdd.ssidLengthInBytes,
                            NULL,
                            &secParams,
                            NULL);   

Below is the event handler we use for different cases

 

void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent)
{

    switch (pWlanEvent->Id)
    {
        case SL_WLAN_EVENT_CONNECT:
        {


            /* set the string terminate */
            pWlanEvent->Data.Connect.SsidName[pWlanEvent->Data.Connect.SsidLen] = '\0';
            strcpy(connectedToSsidName, (const char *)pWlanEvent->Data.Connect.SsidName);

       

       OUR code logic


        }
        break;

        case SL_WLAN_EVENT_DISCONNECT:
        {

       OUR code logic

          }}}

So what we have observed is that when ever there is a lost of connection to wifi(I mean we manually switch off the wifi router). We see that the SL_WLAN_EVENT_DISCONNECT case will be executed. And when the router is plugged back in then the case SL_WLAN_EVENT_CONNECT is executed. We never handled any of the reconnection strategies at all. It used to connect back.

Now our problem is :


We have removed power to the router for 1 hr and connected back the power CC3220sf got automatically reconnected. 

We have removed power to the router for 8 hrs and connected back the power CC3220sf got automatically reconnected.

We have removed power to the router for 2 days and connected back the power CC3220sf failed to reconnect. We are not seeing that event is executed.

Please can someone throw us some light on this and help us how to fix this scenario.

Thanks,

krishna

 

 

  • Krishna,

    What connection policy are you using for this example? (www.ti.com/.../swru455g.pdf) 9.4.1

    I believe this a characteristic of either auto, or fast connect.

    Best Regards,
    Vince
  • Hi Vincent,

    below is the code snippent regarding the connection policy

    #define WLAN_CONNECTION_POLICY_AUTO_ENABLED             1
    #define WLAN_CONNECTION_POLICY_FAST_ENABLED             1
    #define WLAN_CONNECTION_POLICY_ANY_P2P_ENABLED          0 
    #define WLAN_CONNECTION_POLICY_AUTOPROVISIONING_ENABLED 0  

        //-------------------------------------------------------
        _i16 status;
        _i8 policy = SL_WLAN_CONNECTION_POLICY(WLAN_CONNECTION_POLICY_AUTO_ENABLED,
                                               WLAN_CONNECTION_POLICY_FAST_ENABLED,
                                               WLAN_CONNECTION_POLICY_ANY_P2P_ENABLED,
                                               WLAN_CONNECTION_POLICY_AUTOPROVISIONING_ENABLED);
        status = sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION, policy, NULL, 0);

    I mean both the policies are set.

    Thanks,

    krishna

  • Guys can some one help us. This is really important for us.

    Thanks,

    krishna

  • Krishna,

    My suggestion for you is to not rely on autoconnect or fastconnect to reconnect you to an AP after a extended period of disconnection. I would do a check for the disconnection event, and if this occurs, then i would periodically try to reconnect to the AP using application code. This way you can devise your own scheme for how to handle this event.

    For example, you could do a telescoping approach and try to reconnect first every 10 seconds, then every minute, then every hour, depending how you want the device to go into power savings modes while waiting.

    BR,
    Vince
  • Hi Vince,

    Please can you say us. What is the current simplelink retry wifi connection strategy is? We want to understand more about how simple link is trying to do

    I have one more observation. we have same two identical devices which are powered by cc3220sf(same code as mentioned in my previous points),  we are doing the wifi re connection testing. The same setup(everything is same, same firmware, same router both are connected to) but both are at different distances. One is near and one is little far.

    I can control both the setups by sending mqtt messages.

    Now I switched off router.

    Both of them are trying to reconnect

    and after 2.5 days I tried to turned the wifi. One which is near got connected automatically. But One which is far was not able to reconnect. I waited for an hour. But on restart, it got automatically connected.

    Vince, We are first trying to understand how simple link retry to connect. Then we want to think about solution later.

    Thanks,

    krishna

  • Krishna,

    I am reaching out to our R&D team. I'll reply back when i get an answer.

    Best Regards,
    Vince
  • Thanks Vince. That is really helpful.

    Krishna

  • Krishna, Just got feedback from R&D. There is no timeout for our connection policies, so you should be able to connect after 2 days without any issue. Can you get logs from the device to try and see if something else is happening in your code that could cause these errors? I would suggest logging all simplelink Callbacks, and log any simplelink API calls you make while not connected.


    Best Regards,
    Vince