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.

CC3220SF-LAUNCHXL: Provisioning without using an app

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: UNIFLASH

Hi Folks,

I'm new to the CC3220 part and to provisioning as well.  I've gone through a lot of the documentation and a couple of the examples (out-of-box, provisioning, network-terminal) and I'm having trouble getting things to work.

I have a small device with a small LCD screen.  I want to provision the device on a home network without using a phone app (just using the web server on the CC3220).

Here are the steps I think I'd like to perform:

1. Start the device for the first time, and enable the web server (with SSL) on the CC3220.  Tell the user to connect their phone to the SSID displayed on the device screen, then browse to "thedevice.net".

2. Create a custom web page that allows the user to enter their home network settings (SSID, encryption, passcode)
I've created a page based on the TI SimpleLink default web page, and it works when I use the network-terminal demo app (non SSL).  Uploaded it to the device with UniFlash.

3. Store the home network config values in the device (persistent) as a profile, then test the connection to the home network.

4. Inform the user that the connection passed/failed either through the webpage or device screen (probably both)

5. Done with provisioning.  Switch over to the home network and send the product off and running.

I started with the out-of-box, then moved over to the network-terminal demo.  I created my custom web page and can store the profile if I use the "wlanconnect" command on the terminal window to get the device connected to the home network, and provisioning web server started.  I can't however get the web page to come up when I use "wlan_ap_start" command to put the device in access point mode.
I also tried the provisioning demo and was able to run it, but was not able to get the web page up after connecting to the access point on the device.

Can someone help point me in the right direction?  What's the best way to go about doing this?
How do I use the formal provisioning features of the processor with my custom page on the web server? 

Any help you can provide would be greatly appreciated!

Thanks so much!

Joe K.

  • Hi Joseph,

    See the NWP manual www.ti.com/.../swru455c.pdf, chapter 9
    For setting a static page, you need to flash the file into the filesystem. The URL of a file named
    example.html which is placed at /www/user_directory/example.html will be
    http ://deviceIP/user_directory/example.html.

    Use index.html to define the default page.

    Also:

    /* set new domain name */
    _i16 Status;
    _u8 *domain_name = "www.myDomain.net";
    Status = sl_NetAppSet(SL_NETAPP_DEVICE_ID,SL_NETAPP_DEVICE_DOMAIN,strlen(domain_name),(_u8 *)
    domain_name);
    if( Status )
    {
    /* error */
    }


    -Aaron

  • Hi Aaron,
    Thanks for the help. I have worked through some of the issues I was having, and am now stuck on the profile confirmation section. Here's what I'm doing:
    1. Set the profile (gets saved on the device)
    2. Call /api/1/wlan/confirm_req from javascript
    3. Wait 5 seconds
    4. get /param_cfg_result.txt using javascript (returns empty string)

    On the device debug window I get a Confirmation Failed message after it connects to the WLAN and acquires an IP.

    How can I get the confirmation using the web-based provisioning?
    The confirmation seems to be required before provisioning is complete - is this true?

    Thanks!
    Joe K.
  • Has anyone done provisioning on the CC3220 this way?  (Only web interface to user's smartphone, no app)

    I'm having trouble getting the last step of profile confirmation to work.

    Thanks for any help!

    Joe K.

  • Or, is there a way to bypass the confirmation and fake the CC3220 into thinking it sent the confirmation successfully? That would work for me too.
    Thanks!
  • Not sure about this, but maybe for
    case SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_SUCCESS_FEEDBACK_FAILED:
    change the signal from
    SignalEvent(AppEvent_PROVISIONING_STARTED);
    to
    SignalEvent(AppEvent_PROVISIONING_SUCCESS);

    -Aaron
  • Hi Aaron,
    Thanks, but this does not solve the issue. I was able to work around the response requirement by using the external provisioning confirmation, but not actually doing the confirmation to the cloud.
    1. start the provisioning with the external confirmation flag:
    retVal = sl_WlanProvisioning(provisioningCmd, ROLE_STA, PROVISIONING_INACTIVITY_TIMEOUT,(char *)&key, (uint32_t)SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION);
    2. Connect from the web browser and set the profile:
    <form method="POST" name="SimpleLink Configuration" action="api/1/wlan/profile_add"> ...
    3. From the web browser, validate the profile:
    (from javascript) a.open("POST", "/api/1/wlan/confirm_req", true);
    4. The host receives SL_WLAN_PROVISIONING_CONFIRMATION_IP_ACQUIRED and stops provisioning:
    slRetVal = sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_STOP, ROLE_STA, 0, NULL, (uint32_t)SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION);
    ASSERT_ON_ERROR(slRetVal);
    5. Set the device in STA mode
    Status = sl_WlanSetMode(ROLE_STA);

    6. Tell the user on the device screen (our LCD connected to CC3220) that provisioning is complete.

    Hope this helps others who have this same issue!

    Joe K.
  • Dear Joe,

    I am learning about CC3220 and would like to provision through a web page and not a mobile application.

    I would really appreciate if you can elaborate on 4th and 5th step please ?

    4. Should I invoke slRetVal = sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_STOP, ROLE_STA, 0, NULL, (uint32_t)SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION); in the block where SL_WLAN_PROVISIONING_CONFIRMATION_IP_ACQUIRED is received ?

    5. Where should I set this Status = sl_WlanSetMode(ROLE_STA);

    Thanks in advance.

  • Dear All,

    As an update to my query, the steps described by Joe would work and below are the details.

    Invoke the below code in switch case inside SimpleLinkWlanEventHandler() method where you receive  SL_WLAN_PROVISIONING_CONFIRMATION_IP_ACQUIRED event.

    slRetVal = sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_STOP, ROLE_STA, 0, NULL, (uint32_t)SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION);

    Do necessary error check and invoke the below code in the same block itself.

    Status = sl_WlanSetMode(ROLE_STA);