WT99C202-S2 Beginner's Guide

  • WT99C202-S2
  • ESP32-C2,CI1302
Update history
Date Version Author Update content
2025-12-23 1.0.0 Lai Initial document release

πŸ“– Project Overview

This SDK is specifically designed for the WT99C202-AI and WT99C302-AI development boards. It is based on the ESP32C2 / ESP32C3 main control chips, the CI1302 voice recognition chip, and the AISpeech platform, providing a complete solution for local voice wake-up and cloud-based real-time voice interaction.

This solution integrates core features such as Wi-Fi provisioning, speech recognition, WebSocket real-time communication, TTS audio playback, OTA upgrades for ESP32C2 / ESP32C3, as well as updating specific versions of wake words and local command words. It is suitable for the development of smart voice assistants and voice-interactive devices.

⭐️ Key Features

  • 🎀 Local voice wake-up and recognition (based on CI1302)
  • 🌐 Real-time cloud voice interaction via WebSocket
  • πŸ“Ά Supports BLUFI Bluetooth provisioning
  • πŸ”Š Local audio playback
  • πŸ”„ Remote OTA upgrades
  • πŸ’Ύ Local configuration and audio resource storage
  • πŸ”” Synchronization and update of multiple prompt tone voices
  • ⏹️ Local interruption mechanism supporting button and voice interruption
  • 🎚️ Supports voice control for volume adjustment and exiting conversations
  • 🎯 Supports local command word recognition on the voice chip
  • πŸ”„ Supports OTA updates of specific wake words and command word models for the voice chip

πŸ”§ Function Overview

  • Wi-Fi Provisioning: Supports one-click configuration, AP/STA mode switching, and network reset
  • CI1302 Driver Support: Efficient UART communication protocol, supporting voice wake-up and command recognition
  • Cloud Conversation: Real-time interaction with AI cloud services via WebSocket protocol, supporting streaming voice transmission
  • Local Playback: Supports local TTS audio playback with compatibility for multiple audio formats
  • OTA Upgrade: Remote firmware update mechanism to ensure continuous feature optimization
  • Button Control: Supports voice wake-up, conversation interruption, session exit, and Wi-Fi reset
  • LED Indicators: Real-time display of device status (network connection, active conversation, standby mode, etc.)
  • Voice Control: Supports local control functions such as volume adjustment and exiting the current conversation via voice commands
  • Local Interruption: Supports local interruption during conversations, significantly improving user interaction experience
  • Local Command Words: After CI1302 recognizes a command word, it notifies ESP32C2 / ESP32C3 for processing. Custom actions can be added in aiha_local_asr_detected_cb

πŸ› οΈ Development Environment

Basic Dependencies

Environment Verification Steps

  1. Ensure that idf.py can successfully compile the ESP-IDF example project get-started/hello_world
  2. Compile an ESP-ADF example project such as player/pipeline_spiffs_mp3 to verify correct ADF configuration
  3. Import the ADF_PATH environment variable and modify CMakeLists.txt as follows:
if(NOT DEFINED ENV{ADF_PATH})
    set(ENV{ADF_PATH} "/home/sorz/environment/esp-adf(installation_directory_of_adf)")
endif()
  1. Compile this project

πŸ“ Project Structure

β”œβ”€β”€ main/ # Main application
β”‚ β”œβ”€β”€ asr_ota_file/ # CI1302 wake word update component
β”‚ β”œβ”€β”€ chat/ # Voice chat control logic
β”‚ β”œβ”€β”€ network/ # Network management and OTA
β”‚ β”œβ”€β”€ tone_res/ # Local prompt tone resources
β”‚ └── debug/ # Debug-related code
β”œβ”€β”€ components/ # Custom components
β”‚ β”œβ”€β”€ ci1302_protocol/ # CI1302 driver, protocol, and voice chip OTA component
β”‚ β”œβ”€β”€ audio_player/ # Audio playback support
β”‚ β”œβ”€β”€ aiha_server/ # WebSocket interaction component
β”‚ β”œβ”€β”€ WT99C202_C302/ # Hardware abstraction layer
β”‚ └── storage_nvs/ # NVS local storage management
β”œβ”€β”€ qmsd_esp32_sdk/ # QMSD platform SDK
└── docs/ # Documentation

πŸš€ User Guide

Startup Flow

  1. After power-on, the device plays a startup welcome message
  2. If no Wi-Fi configuration is detected, the device automatically enters provisioning mode
    (please use the β€œAISpeech AIHA Smart Hardware” mini-program for provisioning)
  3. After successful provisioning, the device enters standby mode and waits for a voice wake-up command
  4. After the user says the preset wake word Hello Xiaoming, the device enters voice conversation mode
  5. Users can interact via voice commands or button operations as needed

Button Function Description

  • Single short press: Exit the current voice session and return to standby mode
  • Six consecutive short presses: Clear saved Wi-Fi configuration and reboot the device

Configuration Notes

  • Volume control range: 0–100 levels, configuration is automatically saved to NVS
  • Wi-Fi configuration: Connection information is automatically saved to NVS and retained after power-off

Build Process

  • Set the IDF and ADF environment variables. It is recommended to use ESP-IDF 5.5 and ESP-ADF 2.7 to ensure optimal compatibility and stability
  • Set the target chip according to the development board
    For WT99C202, use idf.py set-target esp32c2
    For WT99C302, use idf.py set-target esp32c3
  • WT99C202 development board uses a 26 MHz crystal with a default baud rate of 74880; WT99C302 uses a 40 MHz crystal with a baud rate of 115200

Wake Words and Command Words

  • Firmware containing the required wake words and command words is embedded into the ESP32C2 / ESP32C3 firmware
  • After power-on, the device automatically detects and performs OTA updates if needed

How to Flash Factory Firmware

Preparation

For flashing firmware on the WT99C202-AI-S2 development board, the following hardware and software are required:

ESP32-C2 Firmware Flashing

Before flashing, ensure that the wiring has been prepared. Refer to the diagram below for connections:

Wiring Example

Open the flash download tool and double-click the .exe file to enter the tool’s main interface.
Set ChipType to ESP32C2 as shown below:

Flash Tool Entry Page

Click OK to enter the main flashing page.
Fill in the firmware file and the corresponding flash address, and check the checkbox in front of the file.

Flashing Firmware

Click START to begin flashing.

CI1302 Firmware Flashing

Open PACK_UPDATE_TOOL.exe, select the CI130X series and the CI1302 chip, then click Firmware Upgrade.
Follow the on-screen instructions to enter download mode. The interface is shown below:

Flash Tool Interface 1

Enter the main flashing page, load the firmware file, and check the checkbox in front of the file to start flashing.

Flash Tool Interface 2


⚠️ Notes

Performance and Stability

  • Cloud-based conversations may experience slight latency, mainly affected by network transmission speed and VAD (Voice Activity Detection) control strategies
  • It is recommended to operate the device in a stable Wi-Fi environment for optimal performance
  • In the current version (hardware V1.1, software V1.0.0), battery level detection is for reference only
    When no battery is connected or charging, the battery level may be inaccurate
    You may comment out battery_manage_init to disable battery prompts

Development Recommendations

  • It is recommended to view all device runtime logs via a serial monitor for troubleshooting and debugging
  • Ensure that hardware components such as microphones, speakers, and buttons are properly connected
  • If you are not familiar with ESP-IDF, avoid modifying contents under components_adf to prevent build failures

πŸ†˜ FAQ

Issue Solution
Build failure Check IDF/ADF path configuration and version compatibility
Wi-Fi provisioning failure Check Wi-Fi SSID/password and router status
Voice recognition not working Check microphone hardware connection and ambient background noise
Abnormal audio playback Check speaker connection and supported audio encoding formats
Flash runtime error Check flash compatibility with the IDF version, try IDF 5.3.2 or others

πŸ“š Technical Support and Resources