Welcome to ESP32 Core Board repository
2. Network and Configuration
2. Network and Configuration
2. Network and Configuration1. Wi-Fi ProvisioningMethod 1: Hotspot Provisioning (Recommended, No Compilation Required)Method 2: menuconfig Static Configuration (For Development and Debugging)4. Device Activation and First Online4.1 Get Activation Code4.2 Compile and Flash, Observe Network Connection Logs4.3 Verify Device is Online5. Common Network Troubleshooting
1. Wi-Fi Provisioning
AI Xiaozhi supports two Wi-Fi provisioning methods:
Method 1: Hotspot Provisioning (Recommended, No Compilation Required)
When the device starts for the first time, it automatically enters provisioning mode because there are no Wi-Fi credentials—creating a Wi-Fi hotspot named Xiaozhi-XXXX:
Phone connects to hotspot
Xiaozhi-XXXX
Browser visits
http://192.168.4.1
Select your Wi-Fi on the webpage and enter the password

Device automatically connects to Wi-Fi and saves credentials to NVS; it will auto-connect on every power-on


This is the most convenient provisioning method; no code modification or menuconfig required, consistent with smart home device provisioning.
Method 2: menuconfig Static Configuration (For Development and Debugging)
Directly fill in Wi-Fi information in menuconfig:
| Configuration Path | Setting | Value |
|---|---|---|
Xiaozhi → WiFi Configuration → WiFi SSID | Your Wi-Fi name | e.g., MyHomeWiFi |
Xiaozhi → WiFi Configuration → WiFi Password | Your Wi-Fi password | e.g., mypassword123 |
The advantage of this method is no additional provisioning step after compilation, but changing Wi-Fi environment requires recompilation and flashing.
4. Device Activation and First Online
4.1 Get Activation Code
Device activation requires an activation code. Login - Xiaozhi Console to apply for your own Xiaozhi console account, get the device activation code, then continue with this section.

Add device.


If you have already completed AI Agent settings, continue with the following steps.
4.2 Compile and Flash, Observe Network Connection Logs
ESP-IDF Flashing Process: See ESP-IDF Development Tutorial → 1. Before Development → 3. Build and Flash.
After successful flashing, reset the development board and observe serial output; logs for successful network connection should be:
I (2946) WifiStation: Found AP: Yahboom2, RSSI: -22, Channel: 6I (2947) WifiBoard: WiFi connecting to Yahboom2I (7145) wifi:connected with Yahboom2, aid = 5, channel 6I (8193) WifiStation: Got IP: 192.168.11.181I (8194) WifiBoard: Connected to WiFi: Yahboom2I (8198) Application: Network connectedI (8202) StateMachine: State: starting -> activatingI (8256) MODEL_LOADER: Successfully load srmodelsI (8744) HttpClient: Established connection to api.tenclass.net:443I (8979) Ota: Current is the latest versionI (8982) MQTT: Connecting to endpoint mqtt.xiaozhi.meI (9473) MQTT: Connected to endpointI (9473) Application: Activation doneI (9474) StateMachine: State: activating -> idleI (9501) AfeWakeWord: Model 0: wn9s_nihaoxiaozhiI (9589) AFE: AFE Pipeline: [input] -> ... -> WakeNet(wn9s_nihaoxiaozhi) -> [output]I (9604) AudioCodec: Set output enable to trueI (9667) AudioCodec: Set input enable to true
Key Nodes:
| Log Line | Stage | Description |
|---|---|---|
Found AP: Yahboom2, RSSI: -22 | Hotspot scanned | Provisioned hotspot in range |
wifi:connected + Got IP: 192.168.11.181 | Wi-Fi connection | DHCP successfully assigned LAN IP |
Network connected | Network ready | TCP/IP protocol stack ready |
State: starting → activating | Device activation | Connecting to server, sending activation code for verification |
MQTT: Connected to endpoint | Server connection | Connected to mqtt.xiaozhi.me |
Activation done → State: idle | Activation complete | Device activated successfully, entering idle standby |
AfeWakeWord: wn9s_nihaoxiaozhi | Wake word loaded | "Hi,Andy" wake word model loaded |
AFE Pipeline: WakeNet → [output] | Audio pipeline ready | MIC → VAD → wake word detection full link ready |
AudioCodec: output/input enable | Audio channel opened | Speaker + microphone both enabled |
4.3 Verify Device is Online
Login to xiaozhi.me console → Device Management, confirm your device status is Online.
5. Common Network Troubleshooting
| Phenomenon | Cause | Solution |
|---|---|---|
| Wi-Fi keeps connecting | SSID or password error | Check Wi-Fi information in menuconfig |
| Server connection timeout | Server address or port incorrect | Confirm server address and port format are correct |
| WebSocket handshake failed | TLS/SSL configuration mismatch | Check WSS switch and certificate configuration |
| Device activation failed | Activation code invalid or expired | Regenerate activation code at xiaozhi.me |
| Network frequently disconnects | Wi-Fi signal weak | Move closer to router or use 4G module |
| IP address is 0.0.0.0 | DHCP acquisition failed | Check router DHCP service |