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.

CC3120: Timeout value for sl_WlanProvisioning

Part Number: CC3120
Other Parts Discussed in Thread: CC31XXEMUBOOST

I am using the CC3120 with MSP432 on a custom board, I am having a small problem while trying to change the timeout value for the sl_WlanProvisioning command. Whatever value I pass to the function, the timeout is always set at 10 minutes.

From my understanding, once the provisioning has timed out I will get an event callback in 

SimpleLinkWlanEventHandler -> SL_WLAN_EVENT_PROVISIONING_STATUS -> SL_WLAN_PROVISIONING_STOPPED -> else if(SL_WLAN_STATUS_DISCONNECTED == pWlanEvent->Data.ProvisioningStatus.WlanStatus)

My problem is whatever value I pass to sl_WlanProvisioning as timeout, the above event is reach after 10 minutes. Below is my code snippet.

....

    iRetVal  = sl_NetAppSet(SL_NETAPP_DEVICE_ID,SL_NETAPP_DEVICE_DOMAIN,strlen(NET_DOMAIN_NAME),(_u8 *)NET_DOMAIN_NAME); //Change domain name 
    iRetVal |= sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(1,0,0,0),NULL,0);                    //Set Connection Policy
    iRetVal |= sl_WlanSetMode(ROLE_STA); //Set Initial Role Mode
    iRetVal |= sl_Stop(0);               //Restart with the above configurations
    iRetVal |=sl_Start(NULL,NULL,NULL);

    if(iRetVal)
    {
        return(0);
    }


    if(!GetSimplelinkConnectionProfiles())       //Check the number of existing profiles 
        sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_START_MODE_APSC, ROLE_STA, 1200, MY_SECRET_KEY, 0x0); //Start provisioning with 1200 seconds timeout.
.....

Below my setup:

Simplelink MS432 SDK V1.40.1.00

Simplelink MSP432 SDK WiFi Plugin 1.40.0.02

TI-RTOS 2.13.1.09

CCS 7.2

  • LazyHD,

    What other values have you tried passing to the function to debug this issue? Have you tried setting the inactivity timeout to 30 seconds? This is the minimum period of time this parameter can be set to.

    Best regards,
    Seong

  • Hi Seong,

    I was aware of the 30 seconds limit, I read it in the documentation. My intention is to set it at 300 seconds but when this failed I tired with multiple other values 1200, 30, 60, 150. Everytime the callback is done after 10 minutes. What am I doing wrong ?

    Thanks
  • LazyHD,

    I've just used the CC3120 BP with an MSP432 LP to run the SDK example, "Provisioning" and I did not run into any issues when I changed the inactivity timeout parameter to different values. I was able to consistently get the event callback by the specified time.

    Try comparing your code with this example and see if there are any differences.

    Regards,
    Seong

  • Hi Seong,

    Before I try what you proposed. Can you confirm that the callback event is where I am expecting it to be?

    Also the timeout will kickoff if I start provisioning on the device and the user does not initiate provisioning using the mobile application or other means, right ?

    Thanks
  • LazyHD,

    Yes, check out the event handler that starts from line 345 in provisioning.c.

    Yes, I've tested the example code several times changing the timeout parameter. After provisioning started, the timeout was enabled after the specified time.

    Regards,

    Seong
  • Hi Seong,

    I followed what you suggested without success. I am using MSP432 launchpad + CC3120 BOOST.
    I imported the provisioning project from resource explorer.
    I changed the definition of PROVISIONING_INACTIVITY_TIMEOUT to 120.
    I put a break-point on line 345.
    The break-point is reached after 10 minutes not 120 seconds.

    Changed the value to 900, still the break-point is reached after 10 minutes not 15 minutes in this case

    Are you using the same SDK version as I am ?

    Thanks
  • LazyHD,

    Yes, I am using the same exact SDK version as you are. Did you program the CC3120 with the latest Service Pack, sp_3.4.0.0_2.0.0.0_2.2.0.5.bin, using the CC31XXEMUBOOST board?

    Regards,

    Seong

  • Hi Seong,

    I updated the chip with the service pack you suggested, I was using an older version. I am still facing the same problem.
    I did the below steps just to make sure:
    I deleted the provisioning project from my workspace.
    I re-installed the MSP432 WiFi SDK.
    Imported the provisioning back to my workspace (P.S: I am using TI-RTOS and CCS compiler)
    Changed the definition of PROVISIONING_INACTIVITY_TIMEOUT to 60
    The console output of the project are shown below:

    ==================================
    Provisioning Example Ver. 01.00.00.10
    ==================================
    ConfigureHttpsServer for secured mode...
    [Provisioning App] HTTP Server Stopped
    [Provisioning App] HTTP Server Re-started

    CHIP 805306368
    MAC 31.2.0.0.0
    PHY 2.2.0.5
    NWP 3.4.0.0
    ROM 0
    HOST 2.0.1.19
    MAC address: f0:c7:7f:18:6c:63


    Starting Provisioning! mode=2 (0-AP, 1-SC, 2-AP+SC, 3-AP+SC+WAC)

    Provisioning stopped: Current Role: STA
    WLAN Status: DISCONNECTED

    "Provisioning stopped: Current Role: STA" takes 10 minutes to be shown on the console. Same for the break-point at line 345 (duh).

    Not sure how it works on your setup and fails on mine. Also I am getting the timeout at 10 minutes consistently either in my project of the fresh provisioning project.

    Thanks for your continuous help.
  • LazyHD,

    I noticed the difference between the console output you posted and what I'm seeing is that you are starting in station role and I am starting in AP role. I repeated the test on my end where I start in station role and the timeout event is not being called after the specified time.

    We will have to look into this issue internally. I will let you know once there are updates.

    Regards,

    Seong

  • Thanks Seong, I appreciate you taking the time to test it.