yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
ESP32 Core Board📖
1. ESP32 Introduction
  • 1. ESP32S3 Overview
  • 2. Environment Setup Introduction
  • 3. Dev Board Introduction
2. ESP-IDF Development Tutorial
1. Before Development
  • 1. Environment Setup (Windows)
  • 2. Environment Setup (Linux)
  • 3. Build and Flash
2. Basic Peripherals
  • 1. LED Control
  • 2. Button Detection
  • 3. Peripheral Interrupts
  • 4. ESP_TIMER
  • 5. GPTIMER
  • 6. Watchdog Timer
  • 7. DMA
  • 8. ADC
  • 9. PWM Breathing LED
  • 10. RGB LED Effects
3. Serial Communication and Storage System
  • 1. Serial UART Communication Experiment
  • 2. I2C_OLED Display Experiment
  • 3. SPI Bus Communication Experiment
  • 4. PSRAM External Memory Experiment
  • 5. Flash Read and Write Experiment
  • 6. USB Emulated Mass Storage Experiment
4. FreeRTOS operating system
  • 1.FreeRTOS Core Concepts Theory
  • 2.Task Creation and Management
  • 3.Queue
  • 4.Binary Semaphore
  • 5.Mutex
  • 6.Event Groups
  • 7.Software Timer
  • 8.Task Scheduler
  • 9.Low Power Mode
  • 10.Deadlock
  • 11.Priority Inversion
5. Network Protocols and Wireless Communication
  • 1. WIFI Network Basics
  • 2. WIFI STA Mode
  • 3. WIFI AP Mode
  • 4. UDP Client Experiment
  • 5. UDP Server Experiment
  • 6. TCP Client Experiment
  • 7. TCP Server Experiment
  • 8. Socket Programming Basics
  • 9. HTTP Client Experiment
  • 10. HTTP Server Experiment
  • 11. MQTT IoT Communication Protocol
  • 12. WIFI OTA Upgrade
  • 13. Bluetooth Fundamentals
  • 14. Bluetooth Slave Mode
  • 15. Bluetooth Master Mode
6. Audio Applications
  • 1.I2S Microphone Recording and U-Disk Playback
  • 2.I2S Audio Playback Experiment
  • 3.Repeater Experiment
7. Xiaozhi AI Voice
  • 1. Burn Xiaozhi Firmware
  • 2. Network and Configuration
  • 3. AI Agent Settings
  • 4. Program Analysis
  • 5. Free Chat
3. Arduino Development Course
1. Before Development
  • 1. Environment Setup
  • 2. Build and Flash
2. Basic Peripherals
  • 1. LED Control
  • 2. Button Detection
  • 3. Peripheral Interrupts
  • 4. ESP_TIMER
  • 5. GPTIMER
  • 6. Watchdog Timer
  • 7. ADC
  • 8. PWM Breathing LED
  • 9. RGB LED Effects
3. Serial Communication and Storage System
  • 1. Serial UART Communication
  • 2. I2C OLED Display
  • 3. SPI Bus Communication
  • 4. Flash Read and Write
  • 5. USB Emulated Mass Storage
4. Network Protocols and Wireless Communication
  • 1. WIFI Network Basics
  • 2. WIFI STA Mode
  • 3. WIFI AP Mode
  • 4. UDP Server Experiment
  • 5. UDP Client Experiment
  • 6. TCP Client Experiment
  • 7. TCP Server Experiment
  • 8. HTTP Client Experiment
  • 9. HTTP Server Experiment
  • 10. MQTT IoT Communication Protocol
  • 11. WIFI OTA Upgrade
  • 12. Bluetooth Fundamentals
  • 13. Bluetooth Slave Mode
  • 14. Bluetooth Master Mode
5. Audio Applications
  • 1.I2S Microphone Recording and U-Disk Playback
  • 2.I2S Audio Playback Experiment
  • 3.Repeater Experiment
4. MicroPython Development Course
1. Before Development
  • 1. Environment Setup
  • 2. Build and Flash
  • 3. Thonny IDE
2. Basic Peripherals
  • 1. LED Control
  • 2. Button Detection
  • 3. Peripheral Interrupts
  • 4. TIMER_IT
  • 5. Watchdog Timer
  • 6. ADC
  • 7. PWM Breathing LED
  • 8. RGB LED Effects
3. Serial Communication and Storage System
  • 1. Serial UART Communication Experiment
  • 2. I2C_OLED Display Experiment
  • 3. SPI Bus Communication Experiment
  • 4. Flash Read and Write Experiment
  • 5. Print Storage
4. Network Protocols and Wireless Communication
  • 1. WIFI Network Basics
  • 2. WIFI STA Mode
  • 3. WIFI AP Mode
  • 4. UDP Client Experiment
  • 5. UDP Server Experiment
  • 6. TCP Client Experiment
  • 7. TCP Server Experiment
  • 8. HTTP Client Experiment
  • 9. HTTP Server Experiment
  • 10. MQTT
  • 11. Bluetooth Fundamentals
  • 12. Bluetooth Slave Mode
  • 13. Bluetooth Master Mode
5. Audio Applications
  • 1. I2S Audio Playback Experiment
  • 2. Repeater Experiment
Download
  • Code
  • Hardware_Info
  • 3D_Model_File
  • Software_Tools
  • VMware
  • VM_File
Download ZIP

Welcome to ESP32 Core Board repository

5. Free Chat

5. Free Chat


5. Free Chat1. Dialogue Interaction Flow2. Wake Word InteractionWake DeviceInterrupt Dialogue3. Button Interaction4. Voice Commands Available During Dialogue5. Common TroubleshootingAppendix A · Hardware Pin Quick ReferenceAppendix B · Reference Resources


1. Dialogue Interaction Flow

Each dialogue of AI Xiaozhi follows this lifecycle:

┌──────────┐
│  IDLE    │  Device idle, waiting for wake-up
│  Idle standby │  LED breathing light / Display shows default expression
└────┬─────┘
     │ Hear "Hi,Andy" (offline wake word detection)
     ▼
┌──────────┐
│LISTENING │  Device enters audio pickup state
│  Listening │  LED lights up / Screen shows "Listening..."
└────┬─────┘
     │ VAD detects speech end / User manually stops
     ▼
┌──────────┐
│CONNECTING│  Send recording data, wait for AI reply
│  Thinking │  Screen shows "Other party is speaking..." / animation
└────┬─────┘
     │ Server returns TTS audio
     ▼
┌──────────┐
│SPEAKING  │  Play AI reply voice
│  Speaking │  LED bounces with speech / Screen shows reply text
└────┬─────┘
     │ Playback complete
     ▼
┌──────────┐
│  IDLE    │  Return to idle, wait for next wake-up
└──────────┘

Three Listening Modes:

ModeBehaviorApplicable Scenario
AutoStop (default)Auto-detect speech end, auto-send after 1.5s silenceDaily conversation
ManualStopUser manually presses button to end recordingLong recording / noisy environment
RealtimeReal-time streaming transmission (requires AEC)Ultra-low latency scenarios

2. Wake Word Interaction

Wake Device

Speak the default wake word "Hi,Andy" (or your custom wake word) toward the device; the device will:

  1. Sound feedback: Emit a short "ding" sound

  2. Visual feedback: LED lights up / screen shows listening status

  3. State switch: Enter Listening state, start recording

x
// Woken from idle
I (18912) Application: Wake word detected: Hi,Andy (state: 0)
I (18914) StateMachine: State: idle -> listening

// User finished speaking, VAD detects silence, auto-send
I (315705) Application: >> How is the weather today.
I (315723) StateMachine: State: listening -> speaking

// Server returns TTS voice
17:00:22.776 -> I (316266) Application: << % get_weather...
17:00:23.778 -> I (317294) Application: << It's sunny and warm in Shenzhen today,
17:00:26.224 -> I (319720) Application: << with a temperature of 33°C. It feels like 36°C, so it's a bit humid.
17:00:31.884 -> I (325374) SystemInfo: free sram: 86003 minimal sram: 77279
17:00:32.620 -> I (326139) Application: << The wind is from the southeast at a gentle breeze.
17:00:35.990 -> I (329499) Application: << Perfect weather for a sunny day!

// Return to idle after playback
I (41580) StateMachine: State: speaking -> idle

Query Weather

Interrupt Dialogue

During AI broadcast, you can interrupt it anytime by speaking the wake word:

// Wake from idle, enter listening
I (13524) Application: Wake word detected: Hi,Andy (state: 0)
I (13540) StateMachine: State: idle -> listening

// User speaks → server replies
I (15057) Application: >> Hi,Andy.
I (15060) StateMachine: State: listening -> speaking
I (15060) Application: << Hi, hello!
I (16888) Application: << What can I help you with today?

// Return to idle after playback
I (16900) StateMachine: State: speaking -> idle

// Wake again, interrupted during broadcast
I (28000) Application: Wake word detected: Hi,Andy (state: 0)
I (28002) StateMachine: State: idle -> listening
I (82904) Application: >> Tell me a story.
I (82944) StateMachine: State: listening -> speaking
I (83511) Application: << Oh, totally!
I (84956) Application: << Once upon a time, in a cozy little village,
I (87664) Application: << there was a tiny blue bird who loved to sing. Every morning, he’d fly to the tallest tree and belt out a cheerful tune.

// User speaks wake word to interrupt playback
I (41356) Application: Wake word detected: Hi,Andy (state: 6)
I (41357) Application: Abort speaking
I (41359) StateMachine: State: speaking -> listening

The interrupt function is implemented through kAbortReasonWakeWordDetected mechanism—immediately stop playback queue and clear audio buffer after wake word is detected.

Interrupt Dialogue

3. Button Interaction

ButtonCurrent StateBehavior After Press
BOOT (GPIO0)Idle / Playing (IDLE / SPEAKING)Enter listening mode, same as saying "Hi,Andy"
BOOT (GPIO0)Listening (LISTENING)Exit listening, return to idle standby
BOOT (GPIO0)Starting (kDeviceStateStarting)Enter Wi-Fi provisioning mode
RSTAny stateHardware reset

4. Voice Commands Available During Dialogue

In addition to free chat, Xiaozhi also provides some built-in commands through MCP tools:

Voice Command ExampleMCP ToolEffect
"Set volume to 50%"set_volumeAdjust playback volume
"What's your name"LLM directly answers"I'm Xiaozhi, your AI assistant"
"Tell a joke"LLM directly answersTell a joke
"What time is it now"NTP syncBroadcast current time

5. Common Troubleshooting

PhenomenonCauseTroubleshooting Steps
No response when saying wake wordWake word model not loadedCheck serial logs for "ESP-SR initialized"
Echo/feedback after wake-upSpeaker sound entering MICEnable AEC (CONFIG_USE_DEVICE_AEC) or lower volume
Dialogue stuck at "Thinking"Server not responding / timeoutCheck network status, view server logs
Incomplete reply voiceTTS output truncatedCheck network latency, consider using faster TTS model
Inaccurate speech recognitionLarge ambient noise / dialectMove closer to MIC, reduce ambient noise, check ASR model configuration
Device frequently disconnectsWi-Fi signal weakMove closer to router, or configure Wi-Fi reconnection strategy
Reboot caused by insufficient PSRAMMemory leak or insufficient resourcesCheck heap memory usage, close unnecessary features
Playback sound choppyInsufficient audio bufferIncrease MAX_PLAYBACK_TASKS_IN_QUEUE

Login to xiaozhi.me console → Dialogue Records, you can view complete ASR text, LLM reply, and TTS text for each dialogue, convenient for locating issues.

Appendix A · Hardware Pin Quick Reference

PinMacroFunction
GPIO15AUDIO_I2S_GPIO_MCLKI2S MCLK
GPIO18AUDIO_I2S_GPIO_WSI2S WS
GPIO16AUDIO_I2S_GPIO_BCLKI2S BCLK
GPIO17AUDIO_I2S_GPIO_DINI2S DIN (MIC)
GPIO8AUDIO_I2S_GPIO_DOUTI2S DOUT (SPK)
GPIO41AUDIO_CODEC_I2C_SDA_PINES8311 I2C SDA
GPIO42AUDIO_CODEC_I2C_SCL_PINES8311 I2C SCL
GPIO7AUDIO_CODEC_PA_PINNS4150 PA enable
GPIO48BUILTIN_LED_GPIOWS2812 RGB LED
GPIO0BOOT_BUTTON_GPIOBOOT button

Appendix B · Reference Resources

ResourceLink
AI Xiaozhi GitHub Repository78/xiaozhi-esp32
Official Server Consolexiaozhi.me
Xiaozhi EncyclopediaFeishu Docs
Beginner Flash TutorialFeishu Docs
Python Serverxinnan-tech/xiaozhi-esp32-server
Java Serverjoey-zhou/xiaozhi-esp32-server-java
Golang ServerAnimeAIChat/xiaozhi-server-go
Assets Online Generator78/xiaozhi-assets-generator
ESP-SR Speech Recognitionespressif/esp-sr
Video Tutorial (BiliBili)Install Camera for Xiaozhi
Program Analysis
Environment Setup

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文