Rdzleo 63b21fdfed fix(rtc): volc_rtc.c:430 NULL message 判空, idle 后偶发服务端超时不再 panic
火山 RTC SDK 在 ICE Agent 失败路径下 (如服务端 session idle timeout / NAT 表过期)
会用 message=NULL 调用 _on_global_error 回调, 触发 printf("%s", NULL) → strlen(NULL)
→ LoadProhibited panic → 设备无故重启。

实测复现条件:
  - 设备进入 idle 后 10+ 分钟 (无用户活动)
  - RTC 服务端清理 stale signaling 连接 + NAT 表项过期
  - ICE Agent 收到 keepalive failure → state=FAILED
  - ConnectionService.c 触发 _on_global_error(code, message=NULL)
  - panic at strlen ROM 0x400556d5

注意: 这是低频偶发, 不是每次 idle 必触发。同样 idle 20 分钟有时不触发 (取决于
SDK 内部 ICE state machine 错误路径走向)。修复成本极低 (一行判空), 收益是消除
该偶发崩溃风险。

修改:
  components/common/src/volc_rtc.c:430
    LOGI("global error %d %s\n", code, message);
    →
    LOGI("global error %d %s\n", code, message ? message : "(null)");

修复后行为:
  - 服务端 idle 超时仍会触发 _on_global_error
  - 日志正常打印 "global error <code> (null)" 不再 panic
  - 设备继续保持 idle, 下次按 BOOT 时 SDK 自动重新 join_room
  - 软退出+保留 engine 的快速唤醒优化继续生效 (License 节省策略不变)

依赖 commit aeae073: components/common/ 已纳入 git 跟踪

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 13:55:08 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00
2026-01-20 16:55:17 +08:00

XiaoZhi AI Chatbot

(中文 | English | 日本語)

Introduction

👉 Build your AI chat companion with ESP32+SenseVoice+Qwen72B!【bilibili】

👉 Equipping XiaoZhi with DeepSeek's smart brain【bilibili】

👉 Build your own AI companion, a beginner's guide【bilibili】

Project Purpose

This is an open-source project released under the MIT license, allowing anyone to use it freely, including for commercial purposes.

Through this project, we aim to help more people get started with AI hardware development and understand how to implement rapidly evolving large language models in actual hardware devices. Whether you're a student interested in AI or a developer exploring new technologies, this project offers valuable learning experiences.

Everyone is welcome to participate in the project's development and improvement. If you have any ideas or suggestions, please feel free to raise an Issue or join the chat group.

Learning & Discussion QQ Group: 376893254

Implemented Features

  • Wi-Fi / ML307 Cat.1 4G
  • BOOT button wake-up and interruption, supporting both click and long-press triggers
  • Offline voice wake-up ESP-SR
  • Streaming voice dialogue (WebSocket or UDP protocol)
  • Support for 5 languages: Mandarin, Cantonese, English, Japanese, Korean SenseVoice
  • Voice print recognition to identify who's calling AI's name 3D Speaker
  • Large model TTS (Volcano Engine or CosyVoice)
  • Large Language Models (Qwen, DeepSeek, Doubao)
  • Configurable prompts and voice tones (custom characters)
  • Short-term memory, self-summarizing after each conversation round
  • OLED / LCD display showing signal strength or conversation content
  • Support for LCD image expressions
  • Multi-language support (Chinese, English)

Hardware Section

Breadboard DIY Practice

See the Feishu document tutorial:

👉 XiaoZhi AI Chatbot Encyclopedia

Breadboard demonstration:

Breadboard Demo

Supported Open Source Hardware

Firmware Section

Flashing Without Development Environment

For beginners, it's recommended to first use the firmware that can be flashed without setting up a development environment.

The firmware connects to the official xiaozhi.me server by default. Currently, personal users can register an account to use the Qwen real-time model for free.

👉 Flash Firmware Guide (No IDF Environment)

Development Environment

  • Cursor or VSCode
  • Install ESP-IDF plugin, select SDK version 5.3 or above
  • Linux is preferred over Windows for faster compilation and fewer driver issues
  • Use Google C++ code style, ensure compliance when submitting code

Developer Documentation

AI Agent Configuration

If you already have a XiaoZhi AI chatbot device, you can configure it through the xiaozhi.me console.

👉 Backend Operation Tutorial (Old Interface)

Technical Principles and Private Deployment

👉 Detailed WebSocket Communication Protocol Documentation

For server deployment on personal computers, refer to another MIT-licensed project xiaozhi-esp32-server

Star History

Star History Chart
Description
Kapi_Rtc_toy 卡皮吧啦项目_火山RTC版本
Readme MIT 24 MiB
Languages
C++ 66.2%
C 27.3%
Python 5.9%
CMake 0.6%