AT Network Provisioning Examples

[中文]

This document mainly introduces the following network provisioning methods supported by ESP-AT:

Summary of Key Parameters for Provisioning Methods

Provisioning Method

SmartConfig Provisioning

SoftAP Provisioning

WPS Provisioning

Default Firmware Support

icon-green-check

icon-red-cross (Note 1)

icon-green-check

Requires BLE

icon-red-cross

icon-red-cross

icon-red-cross

Requires Additional Mobile App

icon-green-check (Note 2)

icon-green-check

icon-red-cross

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

  1. Install the EspTouch app on your mobile device.

  2. Set the ESP device to Station mode.

    Command:

    AT+CWMODE=1
    

    Response:

    OK
    
  3. Enable SmartConfig on the ESP32-S2 device.

    Command:

    AT+CWSTARTSMART=4,0,"1234567890123456"
    

    Response:

    OK
    
  4. 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
    
  5. 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.

  6. 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

  1. Prepare a router that supports WPS provisioning (e.g., Wi-Fi SSID: test).

  2. Set the ESP device to Station mode.

    Command:

    AT+CWMODE=1
    

    Response:

    OK
    
  3. 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
    
  4. Query the Wi-Fi information of the connected ESP32-S2 device.

    Command:

    AT+CWJAP?
    

    Response:

    +CWJAP:"test",......
    OK
    
  5. Disable WPS provisioning on the ESP32-S2 device.

    Command:

    AT+WPS=0
    

    Response:

    OK