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.

CC3200 Wlan Smartconfig Error [-6]

Other Parts Discussed in Thread: CC3200

Hi 

I am using ti blefi project for Wifi and BLE communication, I also want Smart config feature to set Wifi credentials initially.

But I am getting error after calling sl_WlanSmartConfigStart API.

Code snippet:-

long SmartConfigConnect()
{
    unsigned char policyVal;
    long lRetVal = -1;

    //
    // Clear all profiles 
    // This is of course not a must, it is used in this example to make sure
    // we will connect to the new profile added by SmartConfig
    //
#if 0
    // Not required
    lRetVal = sl_WlanProfileDel(WLAN_DEL_ALL_PROFILES);
    ASSERT_ON_ERROR(lRetVal);
#endif


    //set AUTO policy
    lRetVal = sl_WlanPolicySet(SL_POLICY_CONNECTION,
                                SL_CONNECTION_POLICY(1,0,0,0,0),
                                &policyVal,
                                1  /*PolicyValLen*/);
    ASSERT_ON_ERROR(lRetVal);

    //
    // Start SmartConfig
    // This example uses the unsecured SmartConfig method
    //
    lRetVal = sl_WlanSmartConfigStart(0,                  //groupIdBitmask
                           SMART_CONFIG_CIPHER_NONE,      //cipher
                           0,                             //publicKeyLen
                           0,                             //group1KeyLen
                           0,                             //group2KeyLen
                           NULL,                          //publicKey
                           NULL,                          //group1Key
                           NULL);                         //group2Key      
    ASSERT_ON_ERROR(lRetVal);

    return SUCCESS;
}

 

Error Log :-

[WiFi] Auto Connect Failed, trying SmartConfig...
[WiFi] Please open the SmartConfig Mobile App

Error [-6] at line [104] in function [SmartConfigConnect]

Regards

Harshit

 

  • Hi Harshit,

    For unsecured set cipher=1. See www.ti.com/.../swru368a.pdf section 8.2.2.2

    -Aaron
  • Hi Aaron,

    Even after seting cipher = 1 I am getting same error.

    Error [-6] at line [104] in function [SmartConfigConnect]


    Regards
    Harshit
  • Hi

    I found this issue,
    Before calling SmartConfigConnect I am also calling WlanConnect function, (If Wlan Connection unable to connect then Check Smart Config)

    So I have 3 Questions
    1. Why SmartConfigConnecte failed when calling after WlanConnet ? (Is it not possible to First Check WlanConnect with Stored SSID and Password, if fails then Connect with SmartConfig)

    2. Where SSID and Password stores when Getting ssid and password from SmartConfig ?

    3. What is the Timeout value for SmartConfig ?



    -Harshit
  • Hi Harshit,

    Initiating SmartConfig while the device is in the middle of attempting to connect to the profile supplied via sl_WlanConnect() could cause an issue. To prevent this, you should be able to call sl_WlanDisconnect() to stop any currently running connection process before starting SmartConfig.

    The SSID and Password will be stored as a profile after it is received during SmartConfig. I would have to investigate the exact timeout for SmartConfig, but you can always stop SmartConfig by calling sl_WlanSmartConfigStop() to stop the process before the timeout.

    Best Regards,
    Ben M
  • Thanks Benjamin

    So I don't need to start SmartConfig even after next boot cycle ?
    once Smart Config is done, next time (after reboot) form where it will get SSID and PASSWORD ? will it stores in some internal flash memory ?


    Rgds
    Harshit
  • Hi Harshit,

    That is correct. Provisioning is intended to only be done on first start or whenever the device needs to change which AP it connects to. The CC3200 uses an external serial flash to securely store the network credentials. These will be loaded into the network processor and used to re-establish a connection on subsequent boots as long as the auto connect policy is enabled.


    Best Regards,

    Ben M