TIDUE59A May 2018 – September 2020
AP provisioning is the most common provisioning method. During AP provisioning, an unprovisioned Wi-Fi device temporarily operates as an AP. This method allows a device, such as a smartphone, tablet, or PC, to connect to the AP over Wi-Fi and transmit the information for the desired network connection directly to the device. The CC3220 receives the network credentials through a Restful API based on its internal HTTP server.
It is important to secure the connection between the device sending the network credentials and the CC3220 during AP provisioning. To protect the network credentials and ensure a user does not unknowingly transmit them to an unwanted device, the TIDC-01005 uses WPA2 authentication when a station connects to the CC3220 AP. The TIDC-01005 is also configured to direct incoming connections to a secured HTTP port and establish a TLS session over which the credentials are passed.
SmartConfig is a proprietary provisioning method from TI that uses a smartphone or tablet to broadcast network credentials to a TI Wi-Fi device. The unprovisioned device can scan for SmartConfig broadcasts while operating in station mode or AP mode.
The CC3220S integrates the code needed to run AP and SmartConfig provisioning in the network processor firmware. This saves the user from having to dedicate a large portion of the application memory for implementing provisioning. Instead, the application must only handle the following:
To manage the provisioning process within an application, it is important to understand the internal provisioning flow used by the network processor. When provisioning is first started by the application, the CC3220 device enters the configuration state where it waits to receive the parameters of the network. After receiving the parameters, the device then attempts to connect to the network and provides feedback to the user upon success. A diagram of the provisioning process flow is in the CC3120, CC3220 SimpleLink Wi-Fi Internet-on-a chip Solution Device Provisioning application report.
In the wifi_doorlock example code, the AP provisioning and SmartConfig process is handled by a dedicated provisioning task. The task remains idle until the provisioning state machine is started by the network connection task. When the provisioning state machine is started, the provisioning task puts the network processor in the provisioning state and handles asynchronous events until the system successfully connects to the network. Whenever the application is restarted, the system always attempts to connect to a network based on a stored profile and skip the provisioning process if possible.
Figure 2-6 shows a diagram of the provisioning state machine implemented by the TIDC-01005 software.