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.

CC3220: cloud_ota provisioning

Part Number: CC3220

Hi,

My program has several threads, one of which is the cloud_ota. I am using http post to provide network credentials to the device when it first turns on (profile_add __SL_P_P*). The device successfully gets the profile but I need to restart it manually for it to connect to my network. Where should I put NWP restart (sl_stop/sl_start) commands in cloud_ota example in order to restart the device as soon as it receives a profile through http post?

Thanks,

David

  • Hi David,

    Is the CC3220 in AP mode, or is it in STA mode when you perform the HTTP post? If it is in AP mode, you will need to switch the device to STA mode and then perform a restart.

    If you are in STA mode, you should just call sl_wlandisconnect() to manually disconnect and force the CC3220 to rescan and connect to the highest priority profile. If your new profile is higher priority than the connection you were previously using, it should automatically connect to the new profile at that point.

    Looking through the cloud_ota code, there are a couple spots where you could potentially handle adding a new profile. The simplest way is to add the sl_wlandisconnect() call within the HTTP post handler. However, running that from an interrupt context might have unintended interactions.

    Another way would be use the SignalEvent() function to push an event to the main OTA message queue. While the SignalEvent() is meant to operate the OTA state machine, you can add a new event to e_AppEvent for your manual disconnect case and then handle it within that main OTA thread. I suggest you look into adding that manual disconnect event, and then handle it within the ota_task by issuing the sl_wlandisconnect().

    Let me know if you need more clarification or help on this issue.

    Regards,
    Michael