Provisioning Scheme Introduction
Note
This document is automatically translated using AI. Please excuse any detailed errors. The official English version is still in progress.
Attention
The provisioning scheme in this document refers to the scheme for configuring and connecting ESP devices to Wi-Fi in different ways. Other schemes such as BLE-MESH provisioning are not included in this document.
Scheme Overview
During the code development phase, Wi-Fi information (SSID and PASSWORD) is often written directly into the program, which cannot be changed at any time to connect to the desired Wi-Fi, which is obviously impractical. Therefore, we have developed and launched a series of provisioning schemes:
SoftAP Provisioning
Blufi Provisioning
Smartconfig Provisioning
WEB Provisioning
Taking the common application scenario of provisioning smart sockets as an example, as follows.
Allow users to configure Wi-Fi information to ESP devices through mobile phones. Different provisions have their own advantages and disadvantages, and the next section elaborates on the details of these provisioning schemes.
Common Provisioning Application Scenarios
1. Blufi Provisioning (Requires ESP chip to support BLE)
The ESP device will broadcast BLE, and the nearby mobile phone will ask the user whether to connect to the ESP device via BLE after receiving the broadcast. If the connection is selected, the mobile phone can send the Wi-Fi information that the ESP device needs to connect to the ESP device. In this process, the user does not need to switch Wi-Fi networks, but needs to turn on the mobile phone’s Bluetooth. The user experience is relatively better than SoftAP provisioning. However, it is necessary to add Bluetooth-related code on the device side, which will increase the size of the firmware and occupy a certain memory before the provisioning is completed.
Software Code & APP Reference Links:
2. Smartconfig Provisioning
This method does not require the establishment of any communication link. The mobile phone sends UDP broadcast packets of different lengths to represent Wi-Fi information. The ESP device listens to all data frames within the signal coverage range in promiscuous mode and obtains Wi-Fi information through a certain algorithm. The disadvantage is that the success rate of provisioning is greatly affected by the environment.
Software Code & APP Reference Links:
3. SoftAP Provision
The ESP device will establish a Wi-Fi hotspot, and after the user connects their phone to this hotspot, they send the Wi-Fi information that the ESP device needs to connect to. This provisioning mode requires the user to manually connect to the hotspot network of the ESP device, which makes the provisioning process complicated, but this method generally has a higher success rate than Smartconfig provisioning.
Software Code & APP Reference Links:
4. WEB Provision (Currently not recommended, and there are no mature examples)
Establish a hotspot on the ESP device, connect with the phone, and open the configuration page in the browser to complete the provision. This method is very reliable and allows provisioning to be completed on the computer. The disadvantage is that it requires space on the device to embed the webpage.
This solution is currently not recommended. If you still need code references, you can refer to WEB Provision Example
. Please note that this example is very old and it is not guaranteed whether it can be executed normally on the new version of ESP-IDF. It only has some reference value in terms of code logic.
The table below summarizes the key parameters of the four provisioning schemes mentioned above.
Provisioning Scheme |
Need Extra BLE |
Need Extra Mobile APP |
Provisioning Success Rate |
Operation Complexity |
Recommendation Level |
---|---|---|---|---|---|
Blufi Provision |
✔ |
✔ |
High |
Simple |
Recommended |
Smartconfig Provision |
✖ |
✔ |
Relatively High |
Simple |
Medium |
SoftAP Provision |
✖ |
✔ |
High |
Complex |
Medium |
WEB Provision (Currently not recommended) |
✖ |
✖ |
High |
Complex |
Medium |
Reference Materials
The brief summary of the provisioning scheme materials is as follows:
Attention
If you need more references like provision APP, please get the corresponding information in Common Provisioning Application Scenarios.