AT Network Provisioning Examples
This document mainly introduces the following network provisioning methods supported by ESP-AT:
Provisioning Method |
SmartConfig Provisioning |
SoftAP Provisioning |
WPS Provisioning |
---|---|---|---|
Default Firmware Support |
(Note 1) |
||
Requires BLE |
|||
Requires Additional Mobile App |
(Note 2) |
||
Provisioning Success Rate |
Moderate |
High |
High |
Operation Complexity |
Simple |
Complex |
Complex |
Recommendation Level |
Recommended |
Moderate |
Moderate |
Note 1: If you want to enable SoftAP provisioning in the AT firmware, please refer to: Web Server AT Commands.
Note 2: The AirKiss provisioning in SmartConfig requires the WeChat app, which may be unavailable to users outside China.
SmartConfig Provisioning
AT SmartConfig provisioning offers four types: ESP-TOUCH, AirKiss, ESP-TOUCH+AirKiss, and ESP-TOUCH v2. Below are examples of ESP-TOUCH v2 provisioning.
ESP-TOUCH v2 Provisioning Example
Install the EspTouch app on your mobile device.
Set the ESP device to Station mode.
Command:
AT+CWMODE=1
Response:
OK
Enable SmartConfig on the ESP32-S2 device.
Command:
AT+CWSTARTSMART=4,0,"1234567890123456"
Response:
OK
Perform Wi-Fi provisioning on your mobile device.
Please follow the steps below: enable Wi-Fi on your mobile device and connect to the target network (e.g., SSID: test, password: 1234567890). Then, launch the EspTouch application and click
EspTouch V2
button. On the redirected page, enter the password for the connected Wi-Fi, the number of devices for provisioning, and the AES key, as shown below:Wi-Fi Password: 1234567890 Device Count for Provisioning: 1 AES Key: 1234567890123456
Confirm the successful provisioning on the ESP device.
At this point, the ESP device should output the below information:
smartconfig type:ESPTOUCH_V2 Smart get wifi info ssid:test password:1234567890 WIFI CONNECTED WIFI GOT IP smartconfig connected wifi
At this point, the ESP device’s provisioning has been successfully completed.
Disable SmartConfig on the ESP32-S2 device.
Command:
AT+CWSTOPSMART
Response:
OK
SoftAP Provisioning
AT SoftAP provisioning refers to WEB provisioning. For more details, please refer to Web Server AT Examples.
WPS Provisioning
Prepare a router that supports WPS provisioning (e.g., Wi-Fi SSID: test).
Set the ESP device to Station mode.
Command:
AT+CWMODE=1
Response:
OK
Enable WPS provisioning on the ESP32-S2 device.
Command:
AT+WPS=1
Response:
OK
Enable the WPS provisioning according to the router’s user manual, and wait for a moment. The ESP device should output the below information, indicating that the provisioning has been successfully completed.
WIFI CONNECTED WIFI GOT IP
Query the Wi-Fi information of the connected ESP32-S2 device.
Command:
AT+CWJAP?
Response:
+CWJAP:"test",...... OK
Disable WPS provisioning on the ESP32-S2 device.
Command:
AT+WPS=0
Response:
OK