mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-27 04:49:47 +01:00
- Curated guides under docs/; trim China-only integration docs and screenshots - Root and main README set aligned with westernized product positioning - LICENSE text update where applicable
5.2 KiB
5.2 KiB
⚡ Quick Start Guide
Get Xiaozhi ESP32 Server up and running in just 5 minutes! This guide will have you talking to your ESP32 device in no time.
🎯 What We'll Build
By the end of this guide, you'll have:
- ✅ Xiaozhi server running locally
- ✅ ESP32 device connected and configured
- ✅ Voice interaction working
- ✅ Basic voice commands responding
🚀 Step 1: Start the Server (2 minutes)
Option A: Docker (Recommended)
# Clone the repository
git clone https://github.com/lapy/xiaozhi-esp32-server.git
cd xiaozhi-esp32-server
# Start with Docker Compose
docker-compose up -d
Option B: Local Installation
# Clone the repository
git clone https://github.com/lapy/xiaozhi-esp32-server.git
cd xiaozhi-esp32-server
# Install dependencies
cd main/xiaozhi-server
pip install -r requirements.txt
# Start the server
python app.py
✅ Verify Server is Running
Open your browser and go to:
- Web Interface: http://localhost:8001
- OTA Interface: http://localhost:8003/xiaozhi/ota/
You should see the Xiaozhi management interface!
🔧 Step 2: Configure AI Providers (1 minute)
Quick Configuration
- Open the web interface: http://localhost:8001
- Register your first admin account
- Go to Model Configuration → Large Language Model
- Configure OpenAI (or use free alternatives):
# For OpenAI (requires API key)
LLM_OpenAILLM:
api_key: your_openai_api_key_here
model_name: gpt-4o-mini
# For free local setup
LLM_LMStudioLLM:
base_url: http://localhost:1234/v1
model_name: llama3.1:8b
Free Alternative Setup
If you don't have OpenAI API access, use the free local setup:
# Install LMStudio
# Download from: https://lmstudio.ai
# Start LMStudio and load a model
# Use the local API endpoint: http://localhost:1234/v1
🔌 Step 3: Prepare Your ESP32 (1 minute)
Download Firmware
- Go to OTA interface: http://localhost:8003/xiaozhi/ota/
- Copy the WebSocket URL:
ws://YOUR_IP:8000/xiaozhi/v1/ - Download firmware for your ESP32 board
Flash Your ESP32
Method 1: Web-based Flashing
- Go to: ESP-Launchpad
- Upload firmware file
- Connect ESP32 via USB
- Flash the firmware
Method 2: Command Line
# Install esptool
pip install esptool
# Flash firmware
esptool.py --chip esp32s3 --port COM3 --baud 921600 write_flash 0x0 firmware.bin
🎤 Step 4: Connect and Test (1 minute)
Connect Your ESP32
- Power on your ESP32 device
- Wait for connection (LED should indicate connection)
- Check OTA interface for device status
Test Voice Interaction
- Say: "Hello Xiaozhi"
- Wait for response (should hear synthesized speech)
- Try commands:
- "What's the weather?"
- "Tell me a joke"
- "What time is it?"
🎉 Success! What's Next?
🎯 Try These Commands
- "Hello" - Basic greeting
- "What's the weather?" - Weather information
- "Tell me a joke" - Entertainment
- "What time is it?" - Time and date
- "Help" - List available commands
🔧 Customize Your Setup
- Add more AI providers in the web interface
- Configure custom responses in agent settings
- Set up integrations with HomeAssistant or MQTT
- Create custom plugins for specific functionality
🛠️ Troubleshooting
Server Won't Start
# Check Docker status
docker ps
# Check logs
docker logs xiaozhi-esp32-server
# Restart if needed
docker-compose restart
ESP32 Won't Connect
- Check WebSocket URL in OTA interface
- Verify network connection
- Check firewall settings
- Restart ESP32 device
No Voice Response
- Check AI provider configuration
- Verify microphone is working
- Check audio output settings
- Review server logs for errors
📚 Next Steps
Now that you have the basics working, explore more:
- Configuration Guide - Fine-tune your setup
- Hardware Guide - Learn about ESP32 devices
- Features Guide - Explore capabilities
- Integrations Guide - Connect to other systems
🆘 Need Help?
- Issues? Check our Troubleshooting Guide
- Questions? Browse our FAQ
- Community? Join our GitHub Discussions
🎯 Quick Reference
Key URLs
- Web Interface: http://localhost:8001
- OTA Interface: http://localhost:8003/xiaozhi/ota/
- API Documentation: http://localhost:8001/api/docs
Key Commands
# Start server
docker-compose up -d
# Stop server
docker-compose down
# View logs
docker logs xiaozhi-esp32-server
# Restart server
docker-compose restart
Configuration Files
- Server Config:
main/xiaozhi-server/config.yaml - Docker Config:
docker-compose.yml - Environment:
.envfiles
Congratulations! You've successfully set up Xiaozhi ESP32 Server! 🎉