mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
- Added LiveKit server with proper folder structure - Integrated MQTT gateway for ESP32 communication - Added agent with STT/TTS capabilities - Sanitized .env.example with placeholder API keys - Updated project configuration files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2.4 KiB
2.4 KiB
LiveKit Server Local Setup
This setup uses the existing Redis instance from manager-api running on port 6380.
Prerequisites
- Docker Desktop must be installed and running
- Manager-API Redis must be running on port 6380 with password
redispassword- Start it with:
cd ../manager-api && docker-compose -f "docker-compose (1).yml" up -d manager-api-redis
- Start it with:
Quick Start
Option 1: Start only LiveKit Server
# Windows
start-livekit.bat
# Or manually
docker-compose up -d livekit
Option 2: Start LiveKit Server + Python Agent
# Windows
start-all.bat
# Or manually
docker-compose up --build
Configuration
LiveKit Server
- WebRTC Signaling: ws://localhost:7880
- HTTP API: http://localhost:7882
- TURN/STUN: localhost:7881
- API Key: devkey
- API Secret: secret
Redis Connection
- Host: localhost (or host.docker.internal from Docker)
- Port: 6380
- Password: redispassword
Files Created
- docker-compose.yml - Defines LiveKit server and agent services
- livekit.yaml - LiveKit server configuration
- .env - Environment variables for local development
- start-livekit.bat - Start only LiveKit server
- start-all.bat - Start LiveKit server and agent
Testing the Connection
1. Check if LiveKit is running:
curl http://localhost:7882/healthz
2. View LiveKit logs:
docker-compose logs -f livekit
3. Test with LiveKit CLI:
# Install LiveKit CLI
go install github.com/livekit/livekit-cli@latest
# Create a test room
livekit-cli create-room --api-key devkey --api-secret secret --url ws://localhost:7880 test-room
Switching Between Local and Cloud
To switch back to cloud LiveKit:
- Edit
.envfile - Comment out local configuration
- Uncomment cloud configuration
Troubleshooting
Redis Connection Issues
- Ensure manager-api Redis is running:
docker ps | grep redis - Check Redis logs:
docker logs manager-api-redis
LiveKit Server Issues
- Check logs:
docker-compose logs livekit - Ensure ports 7880-7882 are not in use
- Verify network exists:
docker network ls
Network Issues
If the network doesn't exist:
docker network create manager-api_manager-api-network
Stop Services
# Stop LiveKit and agent
docker-compose down
# Stop only LiveKit, keep agent running
docker-compose stop livekit