Compare commits

...

784 Commits

Author SHA1 Message Date
Xiaoxia 37110a9d05 Fix: esp32camera pixel byte order and uart-uhci compiling error (#1728)
* Fix: uart-uhci compiling errors

* Enhance Esp32Camera functionality by adding optional byte swapping for RGB565 format. Introduce SetSwapBytes method to enable/disable byte order swapping, and update Capture method to utilize an encode buffer for improved memory management and performance during image processing.
2026-02-02 15:33:32 +08:00
小鹏 796312db4c Enhance Otto Robot camera support by adding configuration for OV3660. (#1726) 2026-02-02 10:22:53 +08:00
tkpdx01 9e1724e892 feat: add M5Stack Cardputer Adv board support (#1718)
Add support for M5Stack Cardputer Adv, a card-sized computer based on
ESP32-S3FN8 (Stamp-S3A) with the following features:

Hardware:
- MCU: ESP32-S3FN8 @ 240MHz, 8MB Flash (no PSRAM)
- Display: ST7789V2 1.14" 240x135
- Audio: ES8311 codec + NS4150B amplifier
- Keyboard: 56-key via TCA8418
- IMU: BMI270

Key configurations:
- SPI3_HOST with 3-wire SPI mode for display
- 256Hz PWM frequency for backlight (matching M5GFX)
- ES8311 with use_mclk=false (no MCLK pin)
- Display offset X=40, Y=52 for correct alignment

新增 M5Stack Cardputer Adv 开发板支持

支持基于 ESP32-S3FN8 (Stamp-S3A) 的卡片式电脑 M5Stack Cardputer Adv:

硬件规格:
- MCU: ESP32-S3FN8 @ 240MHz, 8MB Flash (无 PSRAM)
- 显示屏: ST7789V2 1.14" 240x135
- 音频: ES8311 编解码器 + NS4150B 功放
- 键盘: 56键 (TCA8418)
- IMU: BMI270

关键配置:
- 显示使用 SPI3_HOST 和 3-wire SPI 模式
- 背光 PWM 频率 256Hz (与 M5GFX 一致)
- ES8311 设置 use_mclk=false (无 MCLK 引脚)
- 显示偏移 X=40, Y=52 以正确对齐
2026-02-02 10:01:36 +08:00
Xiaoxia 0b3b98eca7 Update esp-ml307 component version to 3.6.2 to support UART DMA (#1724)
* Update esp-ml307 dependency version to ~3.6.0 in idf_component.yml

* Update .gitignore to include 'dist/' directory, add ml307 and dual_network_board source files to CMakeLists.txt, and update esp-ml307 dependency version to ~3.6.2 in idf_component.yml. Refactor CompactWifiBoard and CompactWifiBoardLCD classes to inherit from WifiBoard instead of DualNetworkBoard, simplifying network handling logic.
2026-02-02 09:53:06 +08:00
Xiaoxia abd62648cb Implement early return in AfeWakeWord::Feed to prevent processing when detection is not running. This enhances the robustness of the wake word detection logic. (#1723) 2026-02-01 17:42:34 +08:00
Xiaoxia 0883a36537 Refactor audio channel handling and wake word detection in Application class (#1722)
- Introduced ContinueOpenAudioChannel and ContinueWakeWordInvoke methods to streamline audio channel management and wake word processing.
- Updated HandleToggleChatEvent and HandleWakeWordDetectedEvent to utilize scheduling for state changes, improving UI responsiveness.
- Simplified logic for setting listening modes based on audio channel state, enhancing code clarity and maintainability.
2026-02-01 14:55:47 +08:00
Xiaoxia b6c61fe390 Update project version to 2.2.2, Noto fonts and emoji support. (#1720) 2026-02-01 01:04:24 +08:00
Xiaoxia f7284a57df Enhance memory management in asset download and OTA processes by repl… (#1716)
* Enhance memory management in asset download and OTA processes by replacing static buffer allocations with dynamic memory allocation using heap capabilities. Update SPIRAM configuration values for improved memory usage. Add logging for error handling in buffer allocation failures. Introduce a new parameter in CloseAudioChannel to control goodbye message sending in MQTT and WebSocket protocols.

* Update component versions in idf_component.yml and refactor GIF decoder functions for improved performance. Bump versions for audio effects, audio codec, LED strip, and other dependencies. Change GIF read and seek functions to inline for optimization.

* Update language files to include new phrases for flight mode and connection status across multiple locales. Added translations for "FLIGHT_MODE_ON", "FLIGHT_MODE_OFF", "CONNECTION_SUCCESSFUL", and "MODEM_INIT_ERROR" in various languages, enhancing user experience and localization support.

* fix wechat display
2026-01-31 22:58:08 +08:00
小鹏 96f34ec70f Refactor emoji initialization for Electron and Otto boards to use Assets system (#1704)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug

* 1.增加robot舵机初始位置校准
2.fix(mcp_sever) 超出范围异常捕获类型  bug

* refactor: Update Electron and Otto emoji display implementations

- Removed GIF selection from Kconfig for Electron and Otto boards.
- Updated Electron and Otto bot versions to 2.0.4 in their respective config files.
- Refactored emoji display classes to utilize EmojiCollection for managing emojis.
- Enhanced chat label setup and status display functionality in both classes.
- Cleaned up unused code and improved initialization logging for emoji displays.

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* refactor: Update Otto emoji display configurations and functionalities

- Changed chat label text mode to circular scrolling for both Otto and Electron emoji displays.
- Bumped Otto robot version to 2.0.5 in the configuration file.
- Added new actions for Otto robot including Sit, WhirlwindLeg, Fitness, Greeting, Shy, RadioCalisthenics, MagicCircle, and Showcase.
- Enhanced servo sequence handling and added support for executing custom servo sequences.
- Improved logging and error handling for servo sequence execution.

* refactor: Update chat label long mode for Electron and Otto emoji displays

- Changed chat label text mode from wrap to circular scrolling for both Electron and Otto emoji displays.
- Improved consistency in chat label setup across both implementations.

* Update Otto robot README with new actions and parameters

* Update Otto controller parameters for oscillation settings

- Changed default oscillation period from 500ms to 300ms.
- Increased default steps from 5.0 to 8.0.
- Updated default amplitude from 20 degrees to 0 degrees.
- Enhanced documentation with new examples for oscillation modes and sequences.

* Fix default amplitude initialization in Otto controller to use a single zero instead of two digits.

* chore: update txp666/otto-emoji-gif-component version to 1.0.3 in idf_component.yml

* Refactor Otto controller
- Consolidated movement actions into a unified tool for the Otto robot, allowing for a single action command with various parameters.
- Removed individual movement tools (walk, turn, jump, etc.) and replaced them with a more flexible action system.

* Enhance Otto robot functionality by adding WebSocket control server and IP address retrieval feature. Updated config to support WebSocket, and revised README to include new control options and usage examples.

* Add camera support for Otto Robot board

- Introduced configuration option to enable the Otto Robot camera in Kconfig.
- Updated config.h to define camera-related GPIO pins and settings.
- Modified config.json to include camera configuration.
- Enhanced otto_robot.cc to initialize I2C and camera components when the camera is enabled.
- Adjusted power_manager.h to manage battery updates during camera operations.
- Removed unused SetupChatLabel method from OttoEmojiDisplay class.

* Refactor Otto Robot configuration and initialization

- Removed the camera configuration option from Kconfig and related code.
- Introduced a new HardwareConfig struct to encapsulate hardware pin definitions and settings.
- Updated config.h to define camera and non-camera configurations using the new struct.
- Refactored otto_controller.cc and otto_robot.cc to utilize the HardwareConfig struct for initialization.
- Enhanced camera detection and initialization logic based on hardware version.
- Improved audio codec initialization based on configuration settings.

* Refactor emoji initialization for Electron and Otto boards to use Assets system

- Removed direct emoji initialization from `InitializeElectronEmojis` and `InitializeOttoEmojis` methods, delegating the responsibility to the Assets system.
- Updated `CMakeLists.txt` to set `DEFAULT_EMOJI_COLLECTION` to `otto-gif` for both boards.
- Enhanced `build_default_assets.py` to support alias mapping for Otto GIF emojis.
- Updated `idf_component.yml` to bump `otto-emoji-gif-component` version to `^1.0.5` for improved functionality.
2026-01-31 18:13:15 +08:00
Xiaoxia aad2f60b87 fix: reset esp-box-3 display to lvgl (#1715) 2026-01-31 03:14:50 +08:00
Copilot 5b874bc3ad Fix LVGL object deletion crash and thread safety issues in SetChatMessage (#1708)
* Initial plan

* Fix LVGL object deletion issue in SetChatMessage

- Refresh child_count after deleting first_child to avoid using stale count
- Add lv_obj_is_valid() checks before accessing deleted objects
- Prevent duplicate deletion by refreshing child_count before system message deletion
- Ensures last_child validation before scrolling to it

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

* Address code review feedback on LVGL object deletion fix

- Move last_child retrieval after deletion to avoid stale pointer
- Add child_count > 0 check before scrolling to prevent edge case issues
- Add lv_obj_is_valid() check for last_bubble for consistency

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

* Final review: LVGL object deletion fix complete

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

* Remove std::thread wrappers in display callbacks to fix thread safety

Remove detached threads that were calling SetChatMessage from download/upgrade
progress callbacks. The DisplayLockGuard mutex already provides thread safety,
so we can call display methods directly from the callback thread without
spawning additional threads, which were causing race conditions.

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

* Use Application::Schedule() for display updates in callbacks

Instead of calling SetChatMessage directly from download/upgrade progress
callbacks, queue the updates using Application::Schedule(). This prevents
blocking the network receive task and avoids potential UART FIFO overflow
issues with 4G modems. The scheduled callbacks execute in the main task
thread, maintaining proper thread safety.

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 78 <4488133+78@users.noreply.github.com>
2026-01-31 00:11:42 +08:00
ws-hsw 7d515a8345 add esp32-s3-touch-lcd-4.3c (#1691)
* add esp32-s3-touch-lcd-4.3c

Add clang-format (#1694)

-文件.clang-format配置基于Google C++风格指南,并做了适当调整
1.使用4空格缩进
2.行宽限制为100字符
3.采用风格的大括号和空格规则

-编写code_style.m
1.针对不同开发平台(windows/Linux/macOs)
2.举例进行整体项目格式化(建议owner择机进行)
3.举例单文件格式化、格式检查
4.举例如何跳过特定代码段的格式化(待补充指定跳过文件格式化)
5.IDE集成说明

Co-authored-by: CaptainBarker <1350989027@qq.com>

add 征辰科技 AI camera wifi board and 4G board(26 Resubmit) (#1689)

add esp32-s3-touch-lcd-4.3c

* add esp32-s3-touch-lcd-4.3c

* add esp32-s3-touch-lcd-4.3c

* add esp32-s3-touch-lcd-4.3c
2026-01-30 01:08:05 +08:00
Xiaoxia d9f7682b2d Fix RNDIS board and enhance camera initialization (#1702)
* Add support for RNDIS board and enhance camera initialization

- Included rndis_board.cc in the build for ESP32S3 and ESP32P4 targets.
- Updated camera initialization logic in esp32s3_korvo2_v3_board.cc and esp32s3_korvo2_v3_board.cc to use a more structured camera_config_t setup.
- Improved code readability by refining comments and formatting in the camera initialization functions.

* Remove outdated camera configuration options from esp32s3-korvo2-v3-rndis config.json to streamline setup and improve clarity.

* Update IDF version in build configuration and component dependencies to v5.5.2 for improved compatibility.

* update discord links

---------

Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
2026-01-28 16:11:26 +08:00
Wang is proud f6ca040d19 Change the Bluetooth device name to "Xiaozhi-Blufi" in blufi provisioning. (#1701) 2026-01-28 01:51:42 +08:00
ZhouKe 7ad22d49af Support USB RNDIS (#1655)
* add rndis board support

* 增加代码兼容性处理

* 再次修复代码兼容性问题

* rename board

---------

Co-authored-by: zk <982145@qq.com>
2026-01-27 19:19:44 +08:00
HonestQiao 7fa9056527 Support both ov2640 and ov3660 with esp_video (#1695)
* Support both ov2640 and ov3660 with esp_video

* Use configuration to set up the use of cameras ov3660 and ov2640
2026-01-27 19:12:23 +08:00
Taikoto 62b93f986f add 征辰科技 AI camera wifi board and 4G board(26 Resubmit) (#1689) 2026-01-26 20:45:18 +08:00
Wang is proud b9617368a0 Add clang-format (#1694)
-文件.clang-format配置基于Google C++风格指南,并做了适当调整
1.使用4空格缩进
2.行宽限制为100字符
3.采用风格的大括号和空格规则

-编写code_style.m
1.针对不同开发平台(windows/Linux/macOs)
2.举例进行整体项目格式化(建议owner择机进行)
3.举例单文件格式化、格式检查
4.举例如何跳过特定代码段的格式化(待补充指定跳过文件格式化)
5.IDE集成说明

Co-authored-by: CaptainBarker <1350989027@qq.com>
2026-01-26 20:42:31 +08:00
Wang is proud b217cddbd8 Add an open-source server-related project to the document. (#1688) 2026-01-24 22:01:14 +08:00
Wang is proud 3a52761d30 Fixed compilation errors that occurred after enabling blufi (#1677) 2026-01-24 21:55:24 +08:00
Wang is proud 6b3659c2f5 Fixed an issue where the tail of the sound might be truncated in auto mode. (#1675) 2026-01-24 15:50:46 +08:00
Xiaoxia 734b5b410a Support both esp_video and esp32_camera (#1671)
* Update project version to 2.2.1 and refactor camera component handling

- Incremented project version from 2.2.0 to 2.2.1 in CMakeLists.txt.
- Removed legacy esp32_camera component and replaced it with esp_video for ESP32-S3 and ESP32-P4 boards.
- Updated board implementations to utilize the new esp_video component, ensuring compatibility and improved functionality.
- Cleaned up Kconfig options related to camera selection, streamlining the configuration process.
- Enhanced camera initialization logic across various board files to support the new component structure.

* Refactor camera handling in AtomS3R CAM/M12 EchoBase board

- Replaced the legacy EspVideo component with the new Esp32Camera class for improved camera functionality.
- Updated camera initialization logic to utilize a more structured configuration approach, enhancing clarity and maintainability.
- Removed outdated comments and code related to the previous camera implementation in the README file.

* Update camera configuration for atoms3r-cam-m12-echo-base

- Removed outdated camera configuration options from config.json to streamline the setup.
- Retained essential partition table configuration for improved clarity.

* Enhance Esp32Camera functionality and memory management

- Added esp_timer.h for improved timing functionality.
- Streamlined camera initialization by removing redundant frame buffer setup and logging.
- Improved memory allocation for JPEG encoding and added error handling for unsupported pixel formats.
- Updated comments for clarity and consistency, ensuring better understanding of the code flow.
2026-01-20 22:44:37 +08:00
Kevincoooool d5ec8f7081 Add ESP32-S3 camera component selection and support (#1670)
Introduces a new esp32s3_camera implementation for ESP32-S3 boards using the esp_camera component, with conditional compilation and Kconfig options to select between esp_camera and esp_video. Updates board initialization code and config files to use the new camera class where appropriate, and adjusts build system and dependencies to support both camera components on ESP32-S3 and ESP32-P4 targets.
2026-01-20 19:56:36 +08:00
Xiaoxia 89674f8838 v2.2.0: Add bread-compact-nt26 board (#1663)
* Refactor application error handling and improve network task logic

- Updated error handling for modem initialization failure in Application::Initialize().
- Added new error message for modem initialization in English and Chinese language files.
- Simplified lambda captures in NetworkTask to avoid unnecessary references.
- Set main task priority in Application::Run() for better performance.

* Add support for Bread Compact NT26 board

- Introduced new board configuration for Bread Compact NT26 in CMakeLists.txt and Kconfig.
- Added board-specific implementation in compact_nt26_board.cc and nt26_board.cc.
- Created configuration files for NT26, including config.h and config.json.
- Updated dependencies in idf_component.yml to include uart-eth-modem.
- Translated error messages in config.h for OLED display type selection to English.
- Enhanced display and button initialization logic for NT26 board.

* Update project version and improve build configuration

- Updated project version from 2.1.0 to 2.2.0 in CMakeLists.txt.
- Enabled minimal build configuration to include only essential components.
- Updated README files to replace QQ group links with Discord links for community engagement.

* Update Bread Compact NT26 board configuration name in config.json

* fix compile errors

* Update uart-eth-modem dependency format in idf_component.yml

* fix esp32 compiling errors

* Update CMakeLists.txt to change component dependency from REQUIRES to PRIV_REQUIRES for esp_pm, esp_psram, and esp_driver_gpio

* Refactor CMakeLists.txt to explicitly list board common source files and update include directories for better clarity and organization.

* Add esp_driver_ppa as a dependency in CMakeLists.txt
2026-01-19 21:46:21 +08:00
Tomato Me ed51705240 add waveshare esp32-s3-rlcd-4.2 (#1639) 2026-01-15 19:14:42 +08:00
Y1hsiaochunnn c9fa5fabc5 feat: New support for third-party boards: waveshare ESP32-C6-Touch-AMOLED-1.8 (#1656)
* content: New support for third-party boards: waveshare ESP32-C6-Touch-AMOLED-1.8

* content: Change the TAG of ESP32-C6-Touch-AMOLED-1.8

* content: Change the config.json of ESP32-C6-Touch-AMOLED-1.8
2026-01-15 19:10:28 +08:00
YeezB e3ed350b8b Fix K10 compile doc error (#1654) 2026-01-15 01:12:31 +08:00
唐杰 d963e120db Fix abnormal screen and camera display on DF K10 when running on Box (#1648)
* 解决屏幕和摄像头无法初始化问题

* 修改摄像头时钟

* change readme

* chang config
2026-01-14 17:11:25 +08:00
Xiaoxia 2ff3796289 Enhance audio service: Add mutex for input resampler and reset logic to prevent buffer overflow during mode switching (#1653) 2026-01-14 02:17:41 +08:00
顿玄 b48506171b 修复ESP-Hi报错 (#1643)
* Update esp_hi.cc

* Remove error check for event loop creation

If event loop already created, this function returns ESP_ERR_INVALID_STATE

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2026-01-10 16:29:12 +08:00
espressif2022 7240ea99f1 Fixed build error with IDF v5.4 (#1637) 2026-01-09 17:19:06 +08:00
espressif2022 1e8fefbede feat: update emote display (#1629) 2026-01-07 20:39:17 +08:00
majingjing123 906d819454 feat(audio): Use esp_audio_codec and esp_audio_effects to replace 78opus (#1632) 2026-01-07 18:45:34 +08:00
laride be88719932 feat: Add ESP-SensairShuttle (#1620)
* feat: Add ESP-SensairShuttle

* fix: fix board name
2026-01-02 12:19:46 +08:00
Wang is proud 213117ded2 BLUFI network configuration supports encryption. (#1603) 2025-12-29 15:04:29 +08:00
Wang is proud 76ff1cf0dc Fixed the issue where voice wake-up causes panic when DEBUG is enabled. (#1606) 2025-12-29 15:03:02 +08:00
zczc365 5d44633687 feat: 小智云聊增加两个语音指令 (#1596) 2025-12-26 03:01:18 +08:00
Kevincoooool 5113a5f4bb Add power management for ESP32S3-Korvo2-V3 board (#1591)
Introduces PowerManager and integrates it into the ESP32S3-Korvo2-V3 board class to monitor battery level, charging status, and manage power save mode. Adds power_manager.h with battery ADC reading, calibration, and event callbacks. Updates board initialization to support power management and power save timer functionality.
2025-12-22 20:33:02 +08:00
pfangzhi f501a5f440 add boards waveshare-c6-touch-lcd-1.83 (#1575)
* Update CMakeLists.txt 

WAVESHARE_C6_TOUCH_LCD_1_83

* Update Kconfig.projbuild

WAVESHARE_C6_TOUCH_LCD_1_83

* Create README.md

waveshare-c6-touch-lcd-1.83

* Add files via upload
2025-12-22 14:11:18 +08:00
MOV e9649cfc58 feat: add support for Movecall Moji2 board (ESP32-C5) (#1589)
* add: Moji 2 has built-in ESP32-C5 dual band Wi-Fi

* feat: PowerSaveTimer 160 >> 240
2025-12-21 18:57:53 +08:00
Denis Ryabchikov ee5587019b Fix issue "Missing spaces" (#1582)
Co-authored-by: xuxin <xuxin@espressif.com>
2025-12-18 20:01:00 +08:00
Denis Ryabchikov ebdd58748a echoear: improved quality of audio assets for Russian language (#1584)
Co-authored-by: Рябчиков Денис <DRyabchikov_od@inno.tech>
2025-12-18 07:02:55 +08:00
Wang is proud 99c32d9331 Fixed the bug where BLUFI would output error logs even when the network connection was normal. (#1567) 2025-12-17 06:18:41 +08:00
Kevincoooool cccaf71c3e Enable camera configs and update button/camera logic (#1561)
Added camera-related sdkconfig options to esp32s3-korvo2-v3 and kevin-sp-v4-dev config.json files. Updated esp32s3_korvo2_v3_board.cc to implement button actions for WiFi config and chat state toggling. Refactored kevin-sp-v4_board.cc to unify I2C bus usage for codec and camera, and adjusted SCCB initialization logic.
2025-12-15 20:16:56 +08:00
Xiaoxia 564018c762 Enhance audio feedback mechanism by introducing a flag to play a popup (#1560)
* Enhance audio feedback mechanism by introducing a flag to play a popup sound after transitioning to listening mode. Update Schedule method to accept rvalue references for callbacks. Bump esp-ml307 component version to 3.5.3. Adjust signal strength thresholds in Ml307Board for better accuracy.

* Update esp-wifi-connect component version to 3.0.2 in idf_component.yml

* Adjust Wi-Fi signal strength thresholds in WifiBoard for improved accuracy in network state icon representation.
2025-12-15 12:54:17 +08:00
神奇bug在哪里 0ccdc082b5 feat: BluFi Wi-Fi configuration (#1321)
Signed-off-by: WhereAreBugs <wherearebugs@icloud.com>
2025-12-13 01:43:32 +08:00
laride 4b582f8074 feat: support USB Camera (#1519) 2025-12-11 07:10:12 +08:00
Tomato Me 1f0d2e993b fix incorrect json configuartion (#1541) 2025-12-10 21:07:56 +08:00
Xiaoxia b7db68457c v2.1.0: Upgrade esp-wifi-connect to 3.0; New device state machine (#1528)
* Upgrade component version

* update fonts component version

* Handle OTA error code

* Update project version to 2.1.0 and add device state machine implementation

- Upgrade  esp-wifi-connect to 3.0.0, allowing reconfiguring wifi without rebooting
- Introduce device state machine with state change notification in new files
- Remove obsolete device state event files
- Update application logic to utilize new state machine
- Minor adjustments in various board implementations for state handling

* fix compile errors

* Refactor power saving mode implementation to use PowerSaveLevel enumeration

- Updated Application class to replace SetPowerSaveMode with SetPowerSaveLevel, allowing for LOW_POWER and PERFORMANCE settings.
- Modified various board implementations to align with the new power save level structure.
- Ensured consistent handling of power save levels across different board files, enhancing code maintainability and clarity.

* Refactor power save level checks across multiple board implementations

- Updated the condition for power save level checks in various board files to ensure that the power save timer only wakes up when the level is not set to LOW_POWER.
- Improved consistency in handling power save levels, enhancing code clarity and maintainability.

* Refactor EnterWifiConfigMode calls in board implementations

- Updated calls to EnterWifiConfigMode to use the appropriate instance reference (self or board) across multiple board files.
- Improved code consistency and clarity in handling device state during WiFi configuration mode entry.

* Add cellular modem event handling and improve network status updates

- Introduced new network events for cellular modem operations, including detecting, registration errors, and timeouts.
- Enhanced the Application class to handle different network states and update the display status accordingly.
- Refactored Ml307Board to implement a callback mechanism for network events, improving modularity and responsiveness.
- Updated dual_network_board and board headers to support new network event callbacks, ensuring consistent handling across board implementations.

* update esp-wifi-connect version

* Update WiFi configuration tool messages across multiple board implementations to clarify user actions
2025-12-09 09:24:56 +08:00
小鹏 11c79a7003 Refactor Otto Robot configuration and initialization (#1534)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug

* 1.增加robot舵机初始位置校准
2.fix(mcp_sever) 超出范围异常捕获类型  bug

* refactor: Update Electron and Otto emoji display implementations

- Removed GIF selection from Kconfig for Electron and Otto boards.
- Updated Electron and Otto bot versions to 2.0.4 in their respective config files.
- Refactored emoji display classes to utilize EmojiCollection for managing emojis.
- Enhanced chat label setup and status display functionality in both classes.
- Cleaned up unused code and improved initialization logging for emoji displays.

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* refactor: Update Otto emoji display configurations and functionalities

- Changed chat label text mode to circular scrolling for both Otto and Electron emoji displays.
- Bumped Otto robot version to 2.0.5 in the configuration file.
- Added new actions for Otto robot including Sit, WhirlwindLeg, Fitness, Greeting, Shy, RadioCalisthenics, MagicCircle, and Showcase.
- Enhanced servo sequence handling and added support for executing custom servo sequences.
- Improved logging and error handling for servo sequence execution.

* refactor: Update chat label long mode for Electron and Otto emoji displays

- Changed chat label text mode from wrap to circular scrolling for both Electron and Otto emoji displays.
- Improved consistency in chat label setup across both implementations.

* Update Otto robot README with new actions and parameters

* Update Otto controller parameters for oscillation settings

- Changed default oscillation period from 500ms to 300ms.
- Increased default steps from 5.0 to 8.0.
- Updated default amplitude from 20 degrees to 0 degrees.
- Enhanced documentation with new examples for oscillation modes and sequences.

* Fix default amplitude initialization in Otto controller to use a single zero instead of two digits.

* chore: update txp666/otto-emoji-gif-component version to 1.0.3 in idf_component.yml

* Refactor Otto controller
- Consolidated movement actions into a unified tool for the Otto robot, allowing for a single action command with various parameters.
- Removed individual movement tools (walk, turn, jump, etc.) and replaced them with a more flexible action system.

* Enhance Otto robot functionality by adding WebSocket control server and IP address retrieval feature. Updated config to support WebSocket, and revised README to include new control options and usage examples.

* Add camera support for Otto Robot board

- Introduced configuration option to enable the Otto Robot camera in Kconfig.
- Updated config.h to define camera-related GPIO pins and settings.
- Modified config.json to include camera configuration.
- Enhanced otto_robot.cc to initialize I2C and camera components when the camera is enabled.
- Adjusted power_manager.h to manage battery updates during camera operations.
- Removed unused SetupChatLabel method from OttoEmojiDisplay class.

* Refactor Otto Robot configuration and initialization

- Removed the camera configuration option from Kconfig and related code.
- Introduced a new HardwareConfig struct to encapsulate hardware pin definitions and settings.
- Updated config.h to define camera and non-camera configurations using the new struct.
- Refactored otto_controller.cc and otto_robot.cc to utilize the HardwareConfig struct for initialization.
- Enhanced camera detection and initialization logic based on hardware version.
- Improved audio codec initialization based on configuration settings.
2025-12-08 20:55:23 +08:00
小鹏 f9de29519b Add camera support for Otto Robot board (#1520)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug

* 1.增加robot舵机初始位置校准
2.fix(mcp_sever) 超出范围异常捕获类型  bug

* refactor: Update Electron and Otto emoji display implementations

- Removed GIF selection from Kconfig for Electron and Otto boards.
- Updated Electron and Otto bot versions to 2.0.4 in their respective config files.
- Refactored emoji display classes to utilize EmojiCollection for managing emojis.
- Enhanced chat label setup and status display functionality in both classes.
- Cleaned up unused code and improved initialization logging for emoji displays.

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* refactor: Update Otto emoji display configurations and functionalities

- Changed chat label text mode to circular scrolling for both Otto and Electron emoji displays.
- Bumped Otto robot version to 2.0.5 in the configuration file.
- Added new actions for Otto robot including Sit, WhirlwindLeg, Fitness, Greeting, Shy, RadioCalisthenics, MagicCircle, and Showcase.
- Enhanced servo sequence handling and added support for executing custom servo sequences.
- Improved logging and error handling for servo sequence execution.

* refactor: Update chat label long mode for Electron and Otto emoji displays

- Changed chat label text mode from wrap to circular scrolling for both Electron and Otto emoji displays.
- Improved consistency in chat label setup across both implementations.

* Update Otto robot README with new actions and parameters

* Update Otto controller parameters for oscillation settings

- Changed default oscillation period from 500ms to 300ms.
- Increased default steps from 5.0 to 8.0.
- Updated default amplitude from 20 degrees to 0 degrees.
- Enhanced documentation with new examples for oscillation modes and sequences.

* Fix default amplitude initialization in Otto controller to use a single zero instead of two digits.

* chore: update txp666/otto-emoji-gif-component version to 1.0.3 in idf_component.yml

* Refactor Otto controller
- Consolidated movement actions into a unified tool for the Otto robot, allowing for a single action command with various parameters.
- Removed individual movement tools (walk, turn, jump, etc.) and replaced them with a more flexible action system.

* Enhance Otto robot functionality by adding WebSocket control server and IP address retrieval feature. Updated config to support WebSocket, and revised README to include new control options and usage examples.

* Add camera support for Otto Robot board

- Introduced configuration option to enable the Otto Robot camera in Kconfig.
- Updated config.h to define camera-related GPIO pins and settings.
- Modified config.json to include camera configuration.
- Enhanced otto_robot.cc to initialize I2C and camera components when the camera is enabled.
- Adjusted power_manager.h to manage battery updates during camera operations.
- Removed unused SetupChatLabel method from OttoEmojiDisplay class.
2025-12-05 23:05:44 +08:00
NologoTech d7c1aef77a 增加无名科技星智铝合金 wifi版本 的board支持 (#1352)
* 增加无名科技星智铝合金 wifi版本 的board支持

* 删除多余头文件

* 星智铝合金:触摸单击时间改为200ms

---------

Co-authored-by: Limh2017 <wenwen19115>
2025-12-01 19:38:14 +08:00
Piat Jonathan 33c2fe90a8 Support for DIY AI Watch HU-087 kit (#1445)
* Added new board for hu-087 smart AI watch

* Added a README with link to prouct on Aliexpress

* Trying to control chatbot mode instead of listening state

* Removed the esp32-s3 prefix for the board

* Changed board name to match folder naming

* Fixed formating and long URL

* Fixed typo in README.md
2025-12-01 19:30:40 +08:00
Denis Ryabchikov e8f68a331f Fix: Build fails for esp32s3 Echoear (#1505) (#1507)
Co-authored-by: Рябчиков Денис <DRyabchikov_od@inno.tech>
2025-11-30 12:44:23 +08:00
tojoevan 2d15bef298 Add GetBatteryLevel for Waveshare ESP32-S3-ePaper-1.54 board (#1506) 2025-11-30 11:44:07 +08:00
virgil 28db4bd60a Fix sensecap watcher inference (#1501)
* feat: add keepalive check for Himax client and handle restart

* fix: adjust layout and positioning for top and bottom bars

* fix: fix other param restoring default ​​when modifying one param .
2025-11-30 10:48:14 +08:00
Y1hsiaochunnn 01a12b325f Fix the touch initialization issue. (#1497) 2025-11-28 06:44:59 +08:00
Y1hsiaochunnn c87b1eabf4 Add Camera support for Waveshare's ESP32-P4 series development board (#1459)
* Add Camera support to Waveshare's ESP32-P4 series development board

* Fix i2c handle error
2025-11-22 15:37:22 +08:00
laride 908c9d5708 feat: add esp-spot c5 (#1462)
* feat: add esp-spot c5

* fix: fix table custom filename
2025-11-20 15:52:49 +08:00
laride 860d12a12c feat: support JPEG input (#1455) 2025-11-18 20:34:22 +08:00
Xiaoxia 511349a7bd Change LCD display layout from grids to layers (#1438)
* Upgrade component version

* update fonts component version

* change lcd display layout from grids to layers

* Update English README as default

* Handle OTA error code
2025-11-17 22:38:31 +08:00
小鹏 764f6e3349 Add wechat-mini-program support for otto-robot (#1444)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug

* 1.增加robot舵机初始位置校准
2.fix(mcp_sever) 超出范围异常捕获类型  bug

* refactor: Update Electron and Otto emoji display implementations

- Removed GIF selection from Kconfig for Electron and Otto boards.
- Updated Electron and Otto bot versions to 2.0.4 in their respective config files.
- Refactored emoji display classes to utilize EmojiCollection for managing emojis.
- Enhanced chat label setup and status display functionality in both classes.
- Cleaned up unused code and improved initialization logging for emoji displays.

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* refactor: Update Otto emoji display configurations and functionalities

- Changed chat label text mode to circular scrolling for both Otto and Electron emoji displays.
- Bumped Otto robot version to 2.0.5 in the configuration file.
- Added new actions for Otto robot including Sit, WhirlwindLeg, Fitness, Greeting, Shy, RadioCalisthenics, MagicCircle, and Showcase.
- Enhanced servo sequence handling and added support for executing custom servo sequences.
- Improved logging and error handling for servo sequence execution.

* refactor: Update chat label long mode for Electron and Otto emoji displays

- Changed chat label text mode from wrap to circular scrolling for both Electron and Otto emoji displays.
- Improved consistency in chat label setup across both implementations.

* Update Otto robot README with new actions and parameters

* Update Otto controller parameters for oscillation settings

- Changed default oscillation period from 500ms to 300ms.
- Increased default steps from 5.0 to 8.0.
- Updated default amplitude from 20 degrees to 0 degrees.
- Enhanced documentation with new examples for oscillation modes and sequences.

* Fix default amplitude initialization in Otto controller to use a single zero instead of two digits.

* chore: update txp666/otto-emoji-gif-component version to 1.0.3 in idf_component.yml

* Refactor Otto controller
- Consolidated movement actions into a unified tool for the Otto robot, allowing for a single action command with various parameters.
- Removed individual movement tools (walk, turn, jump, etc.) and replaced them with a more flexible action system.

* Enhance Otto robot functionality by adding WebSocket control server and IP address retrieval feature. Updated config to support WebSocket, and revised README to include new control options and usage examples.
2025-11-17 22:26:58 +08:00
laride 59d08c7612 feat: add camera support for M5Stack Tab5 (#1442) 2025-11-17 22:20:25 +08:00
laride ebbb2fa319 fix: avoid SRAM overflow in software JPEG encode (#1441) 2025-11-17 15:20:37 +08:00
香草味的纳西妲喵 d984cda486 Revise README for ogg_converter clarity and instructions (#1432)
Updated README to clarify the purpose of the OGG converter and provide clearer instructions for downloading and installing FFmpeg.
2025-11-15 13:11:35 +08:00
Y1hsiaochunnn 52f3134f30 Add support for the Waveshare ESP32-C6-Touch-AMOLED-2.06 third-party board (#1342)
* Add support for the Waveshare ESP32-C6-Touch-AMOLED-2.06 third-party board

* Fix the known issues

* Fix the name

* Update screen brightness

* readme content error correction
2025-11-15 13:07:46 +08:00
Tomato Me 7f332f120c Add support for Waveshare ESP32-S3-ePaper-1.54 board (#1375)
* Add support for Waveshare ESP32-S3-ePaper-1.54 board

* 根据审核,做对应的修改

* fix:优化格式,主要是对头文件引用进行修改

---------

Co-authored-by: Tomato Me <55608753+wurongmin@users.noreply.github.com>
2025-11-15 13:01:12 +08:00
Y1hsiaochunnn ba10b2a2d2 fix MIPI_DSI_PHY_CLK_SRC_DEFAULT compile error (#1430)
* Update the default wake-up word configuration for the ESP32-P4 chip

* Refactor DSI bus configuration for LCD panel

* Update MIPI DSI bus configuration for LCD

* Update MIPI DSI bus configuration structure

* Cancel redundant configuration

* Cancel redundant configuration
2025-11-15 12:56:25 +08:00
laride 92de37e182 fix: fix esp_afe_sr_iface_t compile error (#1423)
* fix: fix esp_afe_sr_iface_t compile error

* fix: fix `MIPI_DSI_PHY_CLK_SRC_DEFAULT` compile error in IDF 5.5.2
2025-11-13 20:05:42 +08:00
Create123 30970abd1f board/m5stack-tab5: Add new display st7123 support. (#1409) 2025-11-12 18:32:06 +08:00
so95 06da25fd26 ESP-P4-Function-EV-Board add SD card, camera, and font initialization (#1403)
* feat: add support for ESP32-P4-Function-EV-Board with configuration and display handling

* detect wake word model from index.json

* update wait time before entering wifi configure mode

* feat: Enhance ESP32-P4 Function EV Board support with LCD and touch initialization

* feat: Update ESP32-P4 Function EV Board configuration for improved touch and SD card support

* feat: add touch I2C configuration and improve initialization structure

* Remove ESP hosted configuration from defaults

Removed ESP hosted configuration options.

* chore: update documentation for improved clarity

* refactor: remove obsolete files for ESP32-P4-Function-EV-Board and add updated configurations

* refactor: reintroduce ESP32-P4-Function-EV-Board implementation with updated configurations

* refactor: restore esp32_p4_function_ev_board dependency with updated version

* Remove ESP-P4-Function-EV-Board configuration and update README with detailed features; add SD card, camera, and font initialization in esp-p4-function-ev-board.cc

* Update main/boards/esp-p4-function-ev-board/esp-p4-function-ev-board.cc

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update main/boards/esp-p4-function-ev-board/esp-p4-function-ev-board.cc

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Enhance camera initialization in ESP-P4-Function-EV-Board; add fallback configuration for direct camera setup and update README for clarity

* Update clock source for MIPI DSI configuration in ESP-P4-Function-EV-Board

---------

Co-authored-by: n2flowjs-bot <n2flowjs@gmail.com>
Co-authored-by: Terrence <terrence@tenclass.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-10 21:41:59 +08:00
Spotpear cdb025dd90 sp-esp32-s3-1.28-box (#1397)
* 修复屏幕条纹

* 增加充电标识

---------

Co-authored-by: Spotpear <services01@spotpear.cn>
2025-11-08 07:07:53 +08:00
Tomato Me ce72f196b7 Add support for Waveshare ESP32-C6-Touch-AMOLED-1.32 board (#1376)
* Add support for Waveshare ESP32-C6-Touch-AMOLED-1.32 board

* Modify the config.json to comply with the rules
2025-11-06 15:53:54 +08:00
小鹏 4aa47cc591 Refactor Otto controller (#1388)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug

* 1.增加robot舵机初始位置校准
2.fix(mcp_sever) 超出范围异常捕获类型  bug

* refactor: Update Electron and Otto emoji display implementations

- Removed GIF selection from Kconfig for Electron and Otto boards.
- Updated Electron and Otto bot versions to 2.0.4 in their respective config files.
- Refactored emoji display classes to utilize EmojiCollection for managing emojis.
- Enhanced chat label setup and status display functionality in both classes.
- Cleaned up unused code and improved initialization logging for emoji displays.

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* refactor: Update Otto emoji display configurations and functionalities

- Changed chat label text mode to circular scrolling for both Otto and Electron emoji displays.
- Bumped Otto robot version to 2.0.5 in the configuration file.
- Added new actions for Otto robot including Sit, WhirlwindLeg, Fitness, Greeting, Shy, RadioCalisthenics, MagicCircle, and Showcase.
- Enhanced servo sequence handling and added support for executing custom servo sequences.
- Improved logging and error handling for servo sequence execution.

* refactor: Update chat label long mode for Electron and Otto emoji displays

- Changed chat label text mode from wrap to circular scrolling for both Electron and Otto emoji displays.
- Improved consistency in chat label setup across both implementations.

* Update Otto robot README with new actions and parameters

* Update Otto controller parameters for oscillation settings

- Changed default oscillation period from 500ms to 300ms.
- Increased default steps from 5.0 to 8.0.
- Updated default amplitude from 20 degrees to 0 degrees.
- Enhanced documentation with new examples for oscillation modes and sequences.

* Fix default amplitude initialization in Otto controller to use a single zero instead of two digits.

* chore: update txp666/otto-emoji-gif-component version to 1.0.3 in idf_component.yml

* Refactor Otto controller
- Consolidated movement actions into a unified tool for the Otto robot, allowing for a single action command with various parameters.
- Removed individual movement tools (walk, turn, jump, etc.) and replaced them with a more flexible action system.
2025-11-06 15:52:25 +08:00
Tomato Me 1664fda6e4 Add support for Waveshare ESP32-S3-Touch-AMOLED-1.32 board (#1378)
* Add support for Waveshare ESP32-S3-Touch-AMOLED-1.32 board

* Modify the config.json to comply with the rules
2025-11-05 17:28:46 +08:00
laoshanxi ccee790c0d build fix for image_player (#1387)
* build fix for image_player

* Update image_player version to 1.1.1

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-11-05 17:24:14 +08:00
Xiaoxia c6815c7ad5 Update component version (#1382)
* Add download_github_runs.py

* Update esp-ml307 version

* Update esp-sr to 2.2.0
2025-11-04 18:40:54 +08:00
小鹏 0e51c4c94c chore: update txp666/otto-emoji-gif-component version to 1.0.3 in idf_component.yml (#1381)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug

* 1.增加robot舵机初始位置校准
2.fix(mcp_sever) 超出范围异常捕获类型  bug

* refactor: Update Electron and Otto emoji display implementations

- Removed GIF selection from Kconfig for Electron and Otto boards.
- Updated Electron and Otto bot versions to 2.0.4 in their respective config files.
- Refactored emoji display classes to utilize EmojiCollection for managing emojis.
- Enhanced chat label setup and status display functionality in both classes.
- Cleaned up unused code and improved initialization logging for emoji displays.

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* refactor: Update Otto emoji display configurations and functionalities

- Changed chat label text mode to circular scrolling for both Otto and Electron emoji displays.
- Bumped Otto robot version to 2.0.5 in the configuration file.
- Added new actions for Otto robot including Sit, WhirlwindLeg, Fitness, Greeting, Shy, RadioCalisthenics, MagicCircle, and Showcase.
- Enhanced servo sequence handling and added support for executing custom servo sequences.
- Improved logging and error handling for servo sequence execution.

* refactor: Update chat label long mode for Electron and Otto emoji displays

- Changed chat label text mode from wrap to circular scrolling for both Electron and Otto emoji displays.
- Improved consistency in chat label setup across both implementations.

* Update Otto robot README with new actions and parameters

* Update Otto controller parameters for oscillation settings

- Changed default oscillation period from 500ms to 300ms.
- Increased default steps from 5.0 to 8.0.
- Updated default amplitude from 20 degrees to 0 degrees.
- Enhanced documentation with new examples for oscillation modes and sequences.

* Fix default amplitude initialization in Otto controller to use a single zero instead of two digits.

* chore: update txp666/otto-emoji-gif-component version to 1.0.3 in idf_component.yml
2025-11-04 16:16:54 +08:00
laride 221d4e7f69 feat: support camera image rotation (#1370) 2025-11-04 05:14:00 +08:00
小鹏 bcddbbde26 Update Otto controller parameters for oscillation settings (#1373)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug

* 1.增加robot舵机初始位置校准
2.fix(mcp_sever) 超出范围异常捕获类型  bug

* refactor: Update Electron and Otto emoji display implementations

- Removed GIF selection from Kconfig for Electron and Otto boards.
- Updated Electron and Otto bot versions to 2.0.4 in their respective config files.
- Refactored emoji display classes to utilize EmojiCollection for managing emojis.
- Enhanced chat label setup and status display functionality in both classes.
- Cleaned up unused code and improved initialization logging for emoji displays.

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* refactor: Update Otto emoji display configurations and functionalities

- Changed chat label text mode to circular scrolling for both Otto and Electron emoji displays.
- Bumped Otto robot version to 2.0.5 in the configuration file.
- Added new actions for Otto robot including Sit, WhirlwindLeg, Fitness, Greeting, Shy, RadioCalisthenics, MagicCircle, and Showcase.
- Enhanced servo sequence handling and added support for executing custom servo sequences.
- Improved logging and error handling for servo sequence execution.

* refactor: Update chat label long mode for Electron and Otto emoji displays

- Changed chat label text mode from wrap to circular scrolling for both Electron and Otto emoji displays.
- Improved consistency in chat label setup across both implementations.

* Update Otto robot README with new actions and parameters

* Update Otto controller parameters for oscillation settings

- Changed default oscillation period from 500ms to 300ms.
- Increased default steps from 5.0 to 8.0.
- Updated default amplitude from 20 degrees to 0 degrees.
- Enhanced documentation with new examples for oscillation modes and sequences.

* Fix default amplitude initialization in Otto controller to use a single zero instead of two digits.
2025-11-04 04:07:10 +08:00
小鹏 e39a46c1a0 otto新增动作和AI自定义编程动作MCP工具 (#1365)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug

* 1.增加robot舵机初始位置校准
2.fix(mcp_sever) 超出范围异常捕获类型  bug

* refactor: Update Electron and Otto emoji display implementations

- Removed GIF selection from Kconfig for Electron and Otto boards.
- Updated Electron and Otto bot versions to 2.0.4 in their respective config files.
- Refactored emoji display classes to utilize EmojiCollection for managing emojis.
- Enhanced chat label setup and status display functionality in both classes.
- Cleaned up unused code and improved initialization logging for emoji displays.

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* refactor: Update Otto emoji display configurations and functionalities

- Changed chat label text mode to circular scrolling for both Otto and Electron emoji displays.
- Bumped Otto robot version to 2.0.5 in the configuration file.
- Added new actions for Otto robot including Sit, WhirlwindLeg, Fitness, Greeting, Shy, RadioCalisthenics, MagicCircle, and Showcase.
- Enhanced servo sequence handling and added support for executing custom servo sequences.
- Improved logging and error handling for servo sequence execution.

* refactor: Update chat label long mode for Electron and Otto emoji displays

- Changed chat label text mode from wrap to circular scrolling for both Electron and Otto emoji displays.
- Improved consistency in chat label setup across both implementations.

* Update Otto robot README with new actions and parameters
2025-11-02 18:04:06 +08:00
Clark Scheff 1f602fa3a0 Add support for the Xorigin AiPi Lite (#1330)
* Add support for the Xorigin AiPi Lite

* aipi-lite: correction to README_en.md

* aipi-lite: use 20MHz display clock

Highger speeds might work sometimes but best not to push
it and use a sane speed.

* aipi-lite: change English name and remove Chinese TTS
2025-10-31 22:10:32 +08:00
小鹏 a9413e2d45 otto更新V2分区使用官方gif管理器 (#1359)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug

* 1.增加robot舵机初始位置校准
2.fix(mcp_sever) 超出范围异常捕获类型  bug

* refactor: Update Electron and Otto emoji display implementations

- Removed GIF selection from Kconfig for Electron and Otto boards.
- Updated Electron and Otto bot versions to 2.0.4 in their respective config files.
- Refactored emoji display classes to utilize EmojiCollection for managing emojis.
- Enhanced chat label setup and status display functionality in both classes.
- Cleaned up unused code and improved initialization logging for emoji displays.

* Rename OTTO_ICON_FONT.c to otto_icon_font.c

* Rename OTTO_ICON_FONT.c to otto_icon_font.c
2025-10-31 22:07:42 +08:00
virgil 6fbc60fa9f fix: fix memory leak,fix jpeg memory 16-bit alignment (#1350) 2025-10-30 10:44:18 +08:00
espressif2022 43ef2f4e7f feat: Add emote support for lichuang-dev (#1337) 2025-10-28 14:33:05 +08:00
Xiaoxia 3f54330ac9 Set minimal IDF version to 5.4.0 (#1339)
* version.py: not upload directory

* Downgrade IDF version to 5.4.0

---------

Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
2025-10-28 07:48:47 +08:00
Terrence 99a4fc94bf Normalize board type macros 2025-10-25 22:34:21 +08:00
Terrence c052903ade Bump to 2.0.4 2025-10-25 04:21:46 +08:00
so95 6a4ec9dbbd feat: add support for ESP32-P4-Function-EV-Board (#1210)
* feat: add support for ESP32-P4-Function-EV-Board with configuration and display handling

* detect wake word model from index.json

* update wait time before entering wifi configure mode

* feat: Enhance ESP32-P4 Function EV Board support with LCD and touch initialization

* feat: Update ESP32-P4 Function EV Board configuration for improved touch and SD card support

* feat: add touch I2C configuration and improve initialization structure

* Remove ESP hosted configuration from defaults

Removed ESP hosted configuration options.

* chore: update documentation for improved clarity

* refactor: remove obsolete files for ESP32-P4-Function-EV-Board and add updated configurations

* refactor: reintroduce ESP32-P4-Function-EV-Board implementation with updated configurations

* refactor: restore esp32_p4_function_ev_board dependency with updated version

---------

Co-authored-by: n2flowjs-bot <n2flowjs@gmail.com>
Co-authored-by: Terrence <terrence@tenclass.com>
2025-10-25 03:41:00 +08:00
Y1hsiaochunnn 7a85430465 New Waveshare ESP32-S3-Touch-LCD-1.83 third-party board is available (#1323) 2025-10-25 02:28:02 +08:00
konglingboy e8ed16bb42 修复charging_pin为NC充电时Battery Level不更新的问题 (#1316)
Co-authored-by: Yuv Zhao <admin@yuvcloud.com>
2025-10-21 13:03:26 +08:00
Y1hsiaochunnn 3176a45ebe 同步esp-video组件驱动摄像头的配置(waveshare s3-3.5、s3-3.5b、s3-audio-board) (#1291)
* 同步esp-video组件驱动摄像头的配置

* 修改Waveshare ESP32-S3-AUDIO-Board 摄像头配置。

* Modify the XCLK parameters of the camera, and modify the config.txt to be compatible with 2640 and 5640.

* Update the esp_video component version to 1.3.0

* Downgrade the esp_video component version. There are unfixed bugs.

* Update component version
2025-10-20 21:20:42 +08:00
virgil a601a5cbc1 feat: sensecap watcher add inference (#1312)
* feat: Wake up when a person is detected

* fix: Solve the problem of no sound when using WakeWordInvoke

* fix: Solve the problem of triggering dialogue when the person has not left

* feat(vision): 优化视觉检测逻辑并增加配置接口

本次提交旨在优化视觉检测功能,使其行为更自然、更智能,并为用户提供灵活的配置选项。

主要更新包括:

1. 引入了更精细的检测状态机:

   - IDLE: 空闲状态,等待检测目标。

   - VALIDATING: 验证状态,在检测到目标后,持续一段时间(可配置)以确认其存在,防止误触发。

   - COOLDOWN: 冷却状态,在一次成功交互后进入,避免过于频繁的打扰。

2. 新增了用于配置视觉检测的 MCP 工具:

   - self.vision.get_detection_config: 获取当前的检测参数(阈值、冷却间隔、验证时长、目标类型)。

   - self.vision.set_detection_config: 允许用户动态修改这些参数,以适应不同场景。

3. 性能优化:

   - 增加了配置参数的内存缓存,避免了在检测循环中对 NVS 的频繁访问。

* feat: Inference using Model 4

* feat: default inference disable

* feat: version cmd change to output json

* fix: fix image display

* Fix include directives for esp_check and esp_app_desc

---------

Co-authored-by: Spencer <love4yzp@gmail.com>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-10-20 21:18:44 +08:00
Xiaoxia ac03f8097d Add 16 more languages to locales (#1297)
* Add 16 more languages to locales

* Update esp-wifi-connect component version
2025-10-16 23:22:01 +08:00
yusuhua 92238612b6 Fix LilyGo-T-CameraPlus-S3 Camera (#1295)
* 修改摄像头配置

* Fix lilygo-t-cameraplus-s3 camera

---------

Co-authored-by: yusuhua <yusuhua@baidu.com>
2025-10-15 15:48:41 +08:00
Xiaoxia c62ab7b239 Fix lichuang-dev camera (#1290)
* Fixatk-dnesp32s3 camera

* Update bread s3cam README

* Fix  lichuang-dev camera
2025-10-14 20:44:44 +08:00
DeepStart 992be9a636 将太极派新款和旧款分离 (#1287)
* 将太极派新款和旧款分离

* 新增太极派OTA配置

* 新增OTA配置
2025-10-14 18:52:18 +08:00
laride 60ad1c5afc Refactor: Use esp_video component (#1245)
* refactor: migrate camera module to esp-video library

* refactor: migrate boards to esp-video API (1/2)

* refactor: migrate boards to esp-video API (2/2)

* fix: use ESP-IDF 5.5

* refactor: migrate the JPEG encoder to `esp_new_jpeg`

* feat: add YUV422 support

* feat: improve pixelformat and device selection process

* feat: use ESP32-P4 Hardware JPEG Encoder
2025-10-14 10:44:45 +08:00
Linar Yusupov 4854bda302 add support for Wireless-Tag WTP4C5MP07S ESP32P4 board + 7 inch MIPI DSI LCD display combo (#1281)
* add support for Wireless-Tag WTP4C5MP07S ESP32P4 + 7 inch MIPI DSI LCD display combo

* a minor update of README

* update of the device name/folder

* exclude USE_DEVICE_AEC from the options list
2025-10-13 14:13:48 +08:00
konglingboy 1ccd5108c3 Optimize AdcBatteryMonitor to work without charge detection pin. (#1276)
Co-authored-by: Yuv Zhao <admin@yuvcloud.com>
2025-10-11 21:11:30 +08:00
junchao98 1d1f9ff1ff enable rrti for m5stack-tab5 (#1268) 2025-10-10 10:58:47 +08:00
LILYGO_L 8373a26f85 Add LILYGO T-Display-P4 board adaptation (#1269)
* Adapt for LilyGO-T-Circle-S3 device

* Adapt for LilyGO-T-Circle-S3 device

* Remove comments and modify the size of the lilygo-t-circle-s3 image

* Modify the code style and format to Google C++

* Modify the code style and format to Google C++

* Fixed bugs in the LILYGO T-Circle-S3 board and added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Merge branch 'main' of https://github.com/Llgok/xiaozhi-esp32

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Fix the color display issue for T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Update T-CameraPlus-S3_V1.2 Version Xiaozhi Example

* Resolve the issue where the camera on the T-CameraPlus-S3_V1.2 board cannot be used normally.

* Enhance microphone reception volume

* fix the issue where voice wake-up is not working

* fix the issue where voice wake-up is not working

* Add LILYGO T-Display-P4 board adaptation
2025-10-10 10:57:59 +08:00
Y1hsiaochunnn 6a28a98c8b Added Waveshare ESP32-P4-WIFI6-Touch-LCD-7B third party board (#1243)
* Modify the MIPILCDDISPLAY class

* Added Waveshare ESP32-P4-WIFI6-Touch-LCD-7B third party board

* Add config,json for Waveshare ESP32-P4 series boards

* Fix some errors
2025-10-09 12:00:22 +08:00
Xiaoxia 549399b795 Add esp32c5 configuration (#1258)
* Add esp32c5 configuration

* update idf_component.yml
2025-10-05 09:59:28 +08:00
masc2008 3ee2195340 Change the button array to ADC buttons as in the board for esp32s3-korv2 (#1256)
* Change the button array to ADC buttons as in the board for esp32s3-korv2

* Add MuteVol function to control audio volume
2025-10-03 11:01:00 +08:00
Xiaoxia 2fd0ff0b2a Add SetInputGain(float gain) to AudioCodec (#1252) 2025-10-02 09:55:45 +08:00
Xiaoxia 911fee2d85 Update README (#1251)
* Upgrade to the latest ml307 component

* update README
2025-10-02 03:29:16 +08:00
Toby 68b0e225a2 OTTO 左右腿反了 (#1239) 2025-09-27 05:20:37 +08:00
Xiaoxia dd45d0de26 Bump to 2.0.3 (#1241)
* fix c6 compilation error

* remove afe preferred core

* fix release.py missing board type config

* Bump to 2.0.3

* remove duplicated depends
2025-09-26 08:52:43 +08:00
Xiaoxia 916ea39fad fix emote display errors (#1240) 2025-09-26 06:18:57 +08:00
zczc365 983d86a334 fix:小智云聊some bugfix (#1238) 2025-09-26 05:12:35 +08:00
laride e7fc9ed489 ci: support multiple variants per board (#1036) 2025-09-26 05:09:54 +08:00
DeepStart e329fcc6b8 添加太极派双声道配置 (#1235)
* Add Guition Boards

* Add Product Links

* 适配新版太极派

* 适配新版太极派

* 添加太极派双声道配置

* 添加太极派双声道配置

* 添加太极派双声道配置

* 太极派添加双声道输出配置
2025-09-26 05:04:12 +08:00
Xiaoxia d3e7fee828 fix multiple wakenet words and custom wake word (#1226)
* fix multiple wakenet words and custom wake word

* fix idf_component.yml
2025-09-22 10:49:08 +08:00
Tomato Me 96e39bea1b 添加 Waveshare ESP32-S3-Touch-LCD-3.49 (#1227) 2025-09-22 10:46:33 +08:00
Y1hsiaochunnn a8687f3736 New Waveshare ESP32-S3-Touch-LCD-4B third party board, 86 box form. (#1199)
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-09-19 22:42:30 +08:00
espressif2022 8d58bdb21b feat: add emote style for v2 (#1217)
* feat: add emote style for v2

* feat: delete asset probe apply
2025-09-19 14:14:43 +08:00
ooxxU 4616fa3486 ESP32 Wifi And 4G Merge In All (#1219) 2025-09-19 00:33:33 +08:00
Xiaoxia f11f84dfbd fix: Add function to handle local asset file paths 2025-09-17 08:36:39 +08:00
Xiaoxia f418c16b2c Detect wake word model from index.json (#1211)
* detect wake word model from index.json

* update wait time before entering wifi configure mode
2025-09-17 08:31:51 +08:00
ZhouShaoYuan a1e1f73886 fix: Corrected the inverted touch screen parameter configuration of lichuang_S3_dev, which caused touch offset. (#1209) 2025-09-17 01:18:22 +08:00
Xiaoxia d2e99bae34 fix multinet model for v2 (#1208) 2025-09-16 19:05:28 +08:00
Xiaoxia d188415949 fix: ESP-HI audio sampling problem (#1207) 2025-09-16 17:23:52 +08:00
Xiaoxia 5018f6c03a feat: build default assets instead of downloading and v2 tables for esp-hi, echoear (#1203)
* fix: call flush ready on io ready

* eachear: update to v2 partition table but disable class Assets currently

* stop gif if previewing an image

* feat: build default assets instead of downloading

* version updates

* fix None error

* delay 1s before enter wifi config mode

* fix compiling with v1 partition table

---------

Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
2025-09-16 15:24:24 +08:00
Xiaoxia b413e3ec03 regenerate jpeg encoder (#1198)
* regenerate jpeg encoder

* add README to gif/jpeg

* 开机启动显示开发板信息,提前启动event loop
2025-09-16 05:00:02 +08:00
Terrence fe7ae99a4d Bump to 2.0.1 2025-09-14 18:25:22 +08:00
Xiaoxia 147d71b9f1 feat: add snapshot mcp tool (#1196)
* use main task to execute tool calls

* feat: add snapshot mcp tool

* fix compiling errors

* 取消 audio input 的 pin core,core1留给显示,可能会对aec性能有影响

* update ml307 version

* remove v1 theme colors
2025-09-14 15:16:49 +08:00
zczc365 384da9fd0f fix:小智云聊compile error (#1195) 2025-09-14 13:51:19 +08:00
Xiaoxia ae40f72a39 fix: crash if GIF version is 87a (#1194)
* fix: no tool call reply after self.reboot

* fix: 87a gif error

* append display info to board info
2025-09-13 16:53:10 +08:00
zczc365 d0ba3a923c 添加小智云聊-S3并修改8388支持AEC (#1179) 2025-09-13 14:38:16 +08:00
Terrence 76c19a0f2d fix: compiling errors 2025-09-12 15:55:55 +08:00
Terrence f79506d58b feat: add manual upgrade firmware 2025-09-12 08:45:29 +08:00
Terrence 469ee2d92a rename withSystemTools to withUserTools 2025-09-11 04:22:33 +08:00
Xiaoxia 57c2c64047 feat: Add gif support (#1183)
* feat: Add gif support

* fix: compiling errors

* fix remove bg image
2025-09-11 03:53:12 +08:00
Xiaoxia 4048647ef8 feat: Add lvgl display theme control (#1180)
* feat: Add lvgl display theme control

* fix: compiling errors

* move light/dark themes to lcd display

* fix compile errors

---------

Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
2025-09-10 18:43:47 +08:00
Terrence bce662d135 feat: default to flash non assets 2025-09-10 01:02:23 +08:00
Xiaoxia d04b08133f Move fonts / assets definition from main/boards to CMakeLists.txt (#1174)
* update surfer-c3-1.14tft font size

* Move fonts / assets definition from main/boards to CMakeLists.txt

* fix c3 compiling errors

---------

Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
2025-09-08 17:30:18 +08:00
Terrence 897239e997 fix: c3 lcd stack protected error 2025-09-05 07:55:36 +08:00
Xiaoxia 83f6f8c703 Switch to 2.0 branch (#1152)
* Adapt boards to v2 partition tables

* fix esp log error

* fix display style

* reset emotion after download assets

* fix compiling

* update assets default url

* Add user only tools

* Add image cache

* smaller cache and buffer, more heap

* use MAIN_EVENT_CLOCK_TICK to avoid audio glitches

* bump to 2.0.0

* fix compiling errors

---------

Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
2025-09-04 15:41:28 +08:00
Johnson 3a3dfc003e Fix build error with esp_emote_gfx (#1159)
'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
   11 | #include "decoder/gfx_aaf_format.h"
2025-09-04 15:18:22 +08:00
Xiaoxia fc355605f5 fix compiling errors (#1161) 2025-09-04 15:17:32 +08:00
Xiaoxia 5d3f597137 Bump to v1.9.0 (#1157)
* update v2 partition table readme

* feat: Add user only tool

* Add image cache

* smaller cache and buffer, more heap

* use MAIN_EVENT_CLOCK_TICK to avoid audio glitches

* fix: esp_psram_get_size not found in c3

* Bump to 1.9.0
2025-09-04 12:30:26 +08:00
ggc121238 3e37551923 add waveshare-s3-audio-board (#1139)
* add waveshare-s3-audio-board

* Modify the product link in the readme of the waveshare esp32s3-audio-board

* Modify reset time
2025-09-01 10:50:39 +08:00
Xiaoxia d09537ed5c Add V2 parition tables (#1137)
* v1.9.0: update font icons, add mqtt reconnect

* Add v2 parition tables
2025-08-29 09:04:23 +08:00
Create123 86921f4862 Add M5Stack AtomEchoS3R Board. (#1123)
Signed-off-by: hlym123 <lwylwt@qq.com>
2025-08-26 14:05:10 +08:00
Terrence 7af366b7b2 fix: ES7120_SEL_MIC1 => ES7210_SEL_MIC1 2025-08-23 16:05:49 +08:00
Xiaoxia ddbb24942d v1.8.9: Upgrade component versions (#1118) 2025-08-23 07:12:14 +08:00
Ben 610a4a0703 Update README.md (#1115)
delete '的'
2025-08-22 18:49:26 +08:00
香草味的纳西妲喵 7cd37427b2 feat: 添加批量转换OGG音频的相关脚本,移动声波配网HTML文件到scripts文件夹下 (#1107)
* feat: 添加批量转换OGG音频的相关脚本,移动声波配网HTML文件到scripts文件夹下

* Rename

* moved README.md
2025-08-22 00:53:18 +08:00
laride 2d772dad68 fix: resolve some audio issues on esp-hi (#1027)
* fix: resolve crash when closing codec dev on esp-hi

* fix: fix incorrect status display in non-zh-CN languages

* fix: reduce noise when not in Speaking state
2025-08-19 11:50:00 +08:00
Terrence 156eb15f58 fix: dual mic without afe 2025-08-16 03:08:00 +08:00
Xiaoxia c59c515706 v1.8.8: release with esp-sr==2.1.4 and without font placeholder (#1086) 2025-08-15 04:50:33 +08:00
Terrence 44b8d5e4c1 fix: c3 wakeword not working with esp-sr 2.1.5 2025-08-15 01:07:00 +08:00
Xiaoxia cc07ef447e Revert "camera 优化:在原有的RGB565处理下,容易超时改为JPEG格式 (#1029)" (#1085)
This reverts commit d6b1414967.
2025-08-14 22:23:29 +08:00
Ky1eYang cf4afde88e add: 添加声音检测的可视化以及声波demod的准确度 (#1077)
Co-authored-by: yangkaiyue <yangkaiyue1@tenclass.com>
2025-08-14 22:11:56 +08:00
Dong Ning d6b1414967 camera 优化:在原有的RGB565处理下,容易超时改为JPEG格式 (#1029)
* camera 优化

feat(camera): 修改摄像头配置为JPEG格式并优化图像处理逻辑

将摄像头输出格式从RGB565改为JPEG以提高传输效率,同时调整JPEG质量为10
重构预览图像处理逻辑,支持直接处理JPEG格式并自动转换为RGB565
优化Explain方法中的JPEG队列处理,减少内存分配和拷贝操作

* 修复代码缩进

调整代码缩进格式以提升可读性

* fix(esp32_camera): 修复RGB565格式预览图像的字节序问题

添加字节交换处理,将大端序转换为小端序,确保预览图像显示正确

* 使用旧的处理方式

* refactor(esp32_camera): 移除preview_buffer_直接使用preview_image_.data
2025-08-14 22:11:15 +08:00
Terrence 00dd89079b Bump to 1.8.7 2025-08-13 11:50:27 +08:00
vritser cfb635d870 feat: 适配 ESP-S3-EV-Board-2 开发板 (#1043)
* feat: 适配 ESP-S3-EV-Board-2 开发板

* fix: config name

* fix: ev_board type choice

* fix: remove version config

---------

Co-authored-by: vritser <vritser@gmail.com>
2025-08-12 20:21:18 +08:00
Xiaoxia 9ae34d3b45 feat: Add locales with OGG sounds (#1057)
* fix jiuchuan build problem

* feat: Add locales with OGG sounds

* fix building echoear

* Support ogg files frame duration <= 60
2025-08-12 18:41:00 +08:00
Terrence 08b8b04c6c remove data mutex from read/write 2025-08-12 17:11:57 +08:00
Terrence f890acfc7c fix i2s race condition error 2025-08-12 14:54:16 +08:00
Terrence a4fe4d8d99 fix firmware image size 2025-08-12 14:53:17 +08:00
Xiaoxia 593b495139 xmin-c3 share MCP tool and sleep mode can be disabled (#1054) 2025-08-09 03:08:42 +08:00
Xiaoxia 2a02dd65be fix ReadAudioData frame duration (#1051) 2025-08-08 21:50:28 +08:00
virgil 845b760db3 fix: Delete the esp_jpeg_simd component to resolve function conflicts (#1049) 2025-08-08 21:00:34 +08:00
Xiaoxia f86637cf1c fix: codec unexpectedly closed by timer after open (#1046)
Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
2025-08-08 15:39:12 +08:00
Xiaoxia 363073658a fix: OTA buffer overflow caused by slow SetChatMessage (#1031) 2025-08-06 01:16:52 +08:00
laride da228f2582 fix: ci idf.py not found (#1030) 2025-08-05 22:18:28 +08:00
laride 36476f05cd feat: add build CI (#1028) 2025-08-05 20:03:37 +08:00
flying1425 90602d3802 waveshare-c6-lcd-1.69 新增电池电量显示功能及电池供电状态下的PWR按键开关机功能。 (#1020)
* 新增电池电量显示功能及电池供电状态下的PWR按键开关机功能。

* 代码风格优化

---------

Co-authored-by: flyingtjy <flyingtjy@gmail.com>
2025-08-04 22:38:13 +08:00
Zxczzzzzzz b2e1c5bb5c 添加了一个声波配网的HTML界面 (#996)
* Add HTML page for sonic-based Wi-Fi provisioning

* Add HTML page for sonic-based Wi-Fi provisioning

* Add soundwave provisioning UI and fix bugs

* Add soundwave provisioning UI and fix bugs

* Move sonic_wifi_config.html to the docs folder

---------

Co-authored-by: luyuhan <xiaolumylove@icloud.com>
2025-08-02 14:13:35 +08:00
Terrence d58d55cfe7 Bump to 1.8.5 2025-08-02 01:27:14 +08:00
espressif2022 cd23e0f155 feat: add emote_gfx UI for EchoEar (#1022)
* feat: add emote_gfx UI for EchoEar

* feat: delete local assets
2025-08-01 18:07:13 +08:00
Xiaoxia 26d9ff283f Fix custom wakeword for dual mic (#1018) 2025-08-01 13:30:17 +08:00
Xiaoxia fb85019c3c change bread-compact-wifi-s3cam test gpio num (#1017) 2025-08-01 05:28:27 +08:00
HonestQiao 4859d57fea 修复esp32-p4配网客户端无法连接、连接获取不到ip或者无法打开配置页面的问题 (#1012) 2025-07-31 05:14:17 +08:00
Xiaoxia 03394fe38d update the sleep time of xmini-c3 with wake word to 300s (#1007) 2025-07-30 15:25:39 +08:00
jake12355 e0e12450c5 jiuchuan-s3修改按键定义取消不对话自动关机修复屏幕显示不全 (#997)
* jiuchuan-s3修改按键定义取消不对话自动关机修复屏幕显示不全

* jiuchuan-s3修改按键定义取消不对话自动关机修复屏幕显示不全
2025-07-29 17:28:40 +08:00
Xiaoxia e5ac40aac8 fix audio pm (#1004) 2025-07-29 15:25:40 +08:00
Xiaoxia 345c8be467 Add custom wakeword threshold option (#1003) 2025-07-29 10:56:52 +08:00
香草味的纳西妲喵 def6301292 增加其他分辨率表情转换选项 (#987)
* Create requirements.txt

* Update README.md

* add: 增加其他尺寸表情选项
2025-07-26 02:31:09 +08:00
Xiaoxia df7cbdfcb6 fix esp-hi crashing in esp_codec_dev_close() (#984) 2025-07-25 10:36:56 +08:00
Terrence d38763d5ef Reduce SRAM usage of audio tasks 2025-07-25 08:27:12 +08:00
LILYGO_L e90e540933 增强T-CameraPlus-S3麦克风接收音量 (#958)
* Adapt for LilyGO-T-Circle-S3 device

* Adapt for LilyGO-T-Circle-S3 device

* Remove comments and modify the size of the lilygo-t-circle-s3 image

* Modify the code style and format to Google C++

* Modify the code style and format to Google C++

* Fixed bugs in the LILYGO T-Circle-S3 board and added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Merge branch 'main' of https://github.com/Llgok/xiaozhi-esp32

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Fix the color display issue for T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Update T-CameraPlus-S3_V1.2 Version Xiaozhi Example

* Resolve the issue where the camera on the T-CameraPlus-S3_V1.2 board cannot be used normally.

* Enhance microphone reception volume

* fix the issue where voice wake-up is not working

* fix the issue where voice wake-up is not working
2025-07-23 23:02:45 +08:00
Ky1eYang 656bf3c7fa FIX: 修复双声道声波配网失效, 添加屏幕打印SSID/密码 (#971)
* debug: 添加声波配网的log打印点display

* fix: 修复双声道下声波配网失效的问题

* fix: codec可能为nullptr的问题(需要从单例board获取)

* Update afsk_demod.cc

fix coding style

---------

Co-authored-by: yangkaiyue <yangkaiyue1@tenclass.com>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-07-23 22:59:07 +08:00
Y1hsiaochunnn ca35b0761b Update README.md (#968)
The README text description is incorrect. It needs to be corrected.
2025-07-23 22:47:19 +08:00
Terrence b031a829c0 Bump to 1.8.2 2025-07-22 22:43:41 +08:00
Xiaoxia 3c11cceb43 增加自定义唤醒词启动失败的提升 (#965) 2025-07-22 18:57:25 +08:00
Y1hsiaochunnn 15f233e773 Add compatibility for Waveshare ESP32-S3-Touch-AMOLED-2.06 (#960)
* Add Waveshare ESP32-S3-Touch-AMOLED-2.06

* Update some configuration settings

* Add configuration to the configuration file

* Fix the abnormal areas
2025-07-22 18:02:31 +08:00
Forairaaaaa 721b58f8c7 Fix atoms3 backlight control (#959) 2025-07-22 17:55:33 +08:00
Xiaoxia eb0bba2c89 Update LICENSE 2025-07-22 10:06:11 +08:00
Surfer 0d45c636a8 Surfer-C3-1.14tft 支持默认离线语音唤醒配置等 (#951)
* 添加 Surfer-C3-1.14TFT开发板支持

添加 Surfer-C3-1.14TFT开发板,基于C3的1.14寸LCD开发板,支持GPIO2  ADC 电池电量检测,应用于wifi Modem-Sleep 和低电量提醒。

* 修改surfer-c3-1.14tff电池电量适配值

修改surfer-c3-1.14tff电池电量适配值,电池容量400ma

* 修改支持默认离线语音唤醒配置等

1. 增加 config.json 文件默认支持离线语音唤醒配置和USB_SERIAL_JTAG
2. 微调电池电量值显示范围参数
2025-07-21 22:13:56 +08:00
Wiking_Xu 3e2bc9ee74 新增正点原子BOX2板子,有WIFI版本和4G版本 (#954) 2025-07-21 22:13:12 +08:00
Terrence 6a7a403117 修复C3唤醒提示音 2025-07-21 14:40:35 +08:00
Terrence d1c047d060 Update to esp-ml307@3.1.1 2025-07-21 05:46:05 +08:00
Terrence a35a344f42 Fix frame samples for server AEC 2025-07-20 07:53:52 +08:00
Terrence efc6f238e7 Fix Server AEC 2025-07-20 03:57:36 +08:00
Xiaoxia 3c71558a5f v1.8.0: Audio 代码重构与低功耗优化 (#943)
* Reconstruct Audio Code

* Remove old IoT implementation

* Add MQTT-UDP documentation

* OTA升级失败时,可以继续使用
2025-07-19 22:45:22 +08:00
laride 0621578f55 fix: fix image player compile error (#933) 2025-07-18 14:08:04 +08:00
laride 5c8707075f feat: add state change events and callbacks (#798) 2025-07-18 01:35:31 +08:00
jake12355 c68c959e9b [优化]-jiuchuan-s3-优化电源管理架构 (#875)
* 添加 jiuchuang-s3 开发板支持

* 增加编译指南

* 优开发板支持包文件目录,更新README.md

删除了多余板载文件
[* ]README.md -> 更新了编译指南和烧录指南

* 修改板级支持包名

* 使用乐鑫提供的电源监测

* 修复部分代码格式问题

* 解决合并冲突

* 解决部分合并内容

* 完善合并内容

* 修复电量映射表错误

* 优化电源管理架构-使用rtc-io电源保持

---------

Co-authored-by: unknown <jake12355>
Co-authored-by: Hangon66 <2630612613@qq.com>
2025-07-18 01:29:30 +08:00
ZhouKe 1aea59a472 multinet wakeword (#927)
Co-authored-by: zk <982145@qq.com>
2025-07-18 01:18:40 +08:00
laride be46cf1731 feat: upgrade component versions for esp-hi (#931) 2025-07-18 01:09:40 +08:00
Ky1eYang 0c971f76e3 feat: 添加自定义消息接收并打印在display或串口上 (#921)
* feat: 添加声波配网, 需调整application的ReadAudio公有, 需添加条件编译, 位于'afsk_demod.h'内定义参数

* mod: afsk的重构,旨在提高代码可读性并遵循Google C++代码风格指南

* mod: 更新依赖esp-wifi-connect需求版号

* feat: 添加声波配网, 需调整application的ReadAudio公有, 需添加条件编译, 位于'afsk_demod.h'内定义参数

* mod: afsk的重构,旨在提高代码可读性并遵循Google C++代码风格指南

* mod: 更新依赖esp-wifi-connect需求版号

* mod: 添加判断只有在WiFi配置模式下才会调用ReadAudio, 否则delay(联网成功重启后该任务不会被启动)

* add: 添加USE_ACOUSTIC_WIFI_PROVISIONING进MENU开关声波配网功能

* feat: 添加mqtt自定义消息接收, 修复menu的声波配网config

* 简化接收custom消息的处理, 只打印或处理payload字段

* fix: 修复payload在执行时指向被释放的线程不安全问题

---------

Co-authored-by: yangkaiyue <yangkaiyue1@tenclass.com>
2025-07-18 01:07:57 +08:00
Xiaoxia 6bb95073a4 v1.7.7: 支持 EC801E 模组,增加 xmini-c3-v3, xmini-c3-4g (#930) 2025-07-17 20:18:21 +08:00
diskman88 ea8769e1fc add labplus-Ledong-v2 and labplus-mpython-v3 board: (#897)
* add labplus-Ledong-v2 and labplus-mpython-v3 board:
	modified:   main/CMakeLists.txt
	modified:   main/Kconfig.projbuild
	new file:   main/boards/labplus-Ledong-v2/README.md
	new file:   main/boards/labplus-Ledong-v2/config.h
	new file:   main/boards/labplus-Ledong-v2/config.json
	new file:   main/boards/labplus-Ledong-v2/labplus_Ledong_v2.cc
	new file:   main/boards/labplus-mpython-v3/README.md
	new file:   main/boards/labplus-mpython-v3/config.h
	new file:   main/boards/labplus-mpython-v3/config.json
	new file:   main/boards/labplus-mpython-v3/mpython_pro.cc

* Changes to be committed:
	new file:   .clangd

* 修改板名:labplus-Ledong-v2 -> labplus-ledong-v2
	modified:   main/CMakeLists.txt
	modified:   main/Kconfig.projbuild
	renamed:    main/boards/labplus-Ledong-v2/README.md -> main/boards/labplus-ledong-v2/README.md
	renamed:    main/boards/labplus-Ledong-v2/config.h -> main/boards/labplus-ledong-v2/config.h
	renamed:    main/boards/labplus-Ledong-v2/config.json -> main/boards/labplus-ledong-v2/config.json
	renamed:    main/boards/labplus-Ledong-v2/labplus_Ledong_v2.cc -> main/boards/labplus-ledong-v2/labplus_ledong_v2.cc
2025-07-17 00:12:53 +08:00
wurongmin 0b0e1391f0 添加微雪电子 esp32-c6-touch-amoled-1.43 和 esp32-c6-touch-amoled-1.43-b的支持 (#907)
* 添加微雪电子 esp32-c6-touch-amoled-1.43 和 esp32-c6-touch-amoled-1.43-b的支持

* Fix: 根据PR评论优化代码格式
2025-07-15 00:27:30 +08:00
Surfer 0b364a83b3 添加 Surfer-C3-1.14TFT开发板支持 (#914)
* 添加 Surfer-C3-1.14TFT开发板支持

添加 Surfer-C3-1.14TFT开发板,基于C3的1.14寸LCD开发板,支持GPIO2  ADC 电池电量检测,应用于wifi Modem-Sleep 和低电量提醒。

* 修改surfer-c3-1.14tff电池电量适配值

修改surfer-c3-1.14tff电池电量适配值,电池容量400ma
2025-07-15 00:26:20 +08:00
DeepStart 5da837541b 增加新版太极小派适配 (#902)
* Add Guition Boards

* Add Product Links

* 适配新版太极派

* 适配新版太极派
2025-07-11 05:46:49 +08:00
Terrence cec0b5b273 防止误刷xmini-c3固件导致永久性损害 2025-07-10 15:53:09 +08:00
virgil 8e0f76c0ef fix: fix wakenet model index (#893)
* fix: fix wakenet model index

* fix:Fix warning

* feat: Use jarvis and sophia as wakeup words
2025-07-09 03:19:08 +08:00
小林同志 f556e72604 规范函数名,修复一个重写错误 (#894)
Co-authored-by: smalllin0 <aslinqf@163.com>
2025-07-09 03:14:20 +08:00
ning yuxiang 2cdec25162 Add support for EchoEar V1.2 version PCB. (#891)
Co-authored-by: NingYuxiang <ningyuxiang@espressif.com>
2025-07-09 03:10:43 +08:00
flying1425 f002a1185b 添加对微雪电子 ESP32-S3-Touch-LCD-3.5B 开发板的支持 (#849)
* 添加对微雪电子 ESP32-S3-Touch-LCD-3.5B 开发板的支持

* 更改config.json的错误

* 修改板子的id以waveshare开头

* 更改config.json

* 修改config.json的 name

---------

Co-authored-by: flyingtjy <flyingtjy@gmail.com>
2025-07-05 18:09:23 +08:00
小林同志 1314ccfc0f 使用原始字符串字面量代替转义,提高可读性 (#861)
* 使用原始字符串字面量代替转义,提高可读性

* 使用原始字符串字面量代替转义,提高可读性

* 增加一个使用ESP-IDF Monitor作为输出显示内容的类

* 修改代码风格
2025-07-05 15:11:02 +08:00
laride b7c1989a34 fix: resolve potential crash on touch isr (#885) 2025-07-05 14:56:11 +08:00
Ky1eYang 10016a3ea5 feat: 添加声波配网, 需调整application的ReadAudio公有, 需添加条件编译, 位于'afsk_demod.h'内定义参数 (#852)
* feat: 添加声波配网, 需调整application的ReadAudio公有, 需添加条件编译, 位于'afsk_demod.h'内定义参数

* mod: afsk的重构,旨在提高代码可读性并遵循Google C++代码风格指南

* mod: 更新依赖esp-wifi-connect需求版号

* feat: 添加声波配网, 需调整application的ReadAudio公有, 需添加条件编译, 位于'afsk_demod.h'内定义参数

* mod: afsk的重构,旨在提高代码可读性并遵循Google C++代码风格指南

* mod: 更新依赖esp-wifi-connect需求版号

* mod: 添加判断只有在WiFi配置模式下才会调用ReadAudio, 否则delay(联网成功重启后该任务不会被启动)

* add: 添加USE_ACOUSTIC_WIFI_PROVISIONING进MENU开关声波配网功能

---------

Co-authored-by: yangkaiyue <yangkaiyue1@tenclass.com>
2025-07-05 14:45:48 +08:00
0x1abin f744c9bf3e 添加编译优化配置以减小生成的固件大小 (#864)
先合并进来看看大家的反馈。
2025-07-02 06:05:58 +08:00
laride ad2c187433 添加 EchoEar 喵伴 (#869)
* add EchoEar

Co-authored-by: Qin Feng <qingfeng@espressif.com>

* feat: use new display backlight API

* feat: use MCP protocol

* remove yuying lcd

* add echoear README.md

---------

Co-authored-by: NingYuxiang <ningyuxiang@espressif.com>
Co-authored-by: Qin Feng <qingfeng@espressif.com>
2025-06-30 23:01:17 +08:00
virgil 8a0ec8b657 fix: fixed the issue of slow startup for devices without cameras (#866) 2025-06-30 22:41:42 +08:00
Terrence d1c586239c fix CPU usage of esp32c3 with ml307 2025-06-29 06:01:41 +08:00
Hangon66 f2f54ba1fd 添加 jiuchuan-s3 开发板支持 (#775)
* 添加 jiuchuang-s3 开发板支持

* 增加编译指南

* 优开发板支持包文件目录,更新README.md

删除了多余板载文件
[* ]README.md -> 更新了编译指南和烧录指南

* 修改板级支持包名

* 使用乐鑫提供的电源监测

* 修复部分代码格式问题

* 解决合并冲突

* 解决部分合并内容

* 完善合并内容

* 修复电量映射表错误

---------

Co-authored-by: unknown <jake12355>
2025-06-29 05:41:42 +08:00
virgil f1277934d1 feat: Support choosing different config.json (#848) 2025-06-26 02:55:45 +08:00
Terrence c17bd15baa Bump to 1.7.6 2025-06-24 10:19:06 +08:00
Terrence b3ab3d0920 在S3芯片上使用更多的PSRAM,解决立创开发板拍照时可能出现内存不足的问题 2025-06-24 04:59:00 +08:00
Terrence 2b0362a812 Fix: misconfigured target of atommatrix-echo-base 2025-06-19 14:52:53 +08:00
Terrence d3367d6b92 Update esp-ml307 to 2.2.1 2025-06-18 05:24:51 +08:00
Terrence 116234a147 Bump to 1.7.5 2025-06-16 20:55:57 +08:00
Xiaoxia f29c1a11d9 ml307: Add sleep mode (#826) 2025-06-16 19:05:31 +08:00
laride f98ffdbb5c fix: optimize MCP commands for ESP-Hi (#825) 2025-06-16 16:03:21 +08:00
Xiaoxia 89f10365b1 xmini-c3: 休眠时关闭es8311可减少20mA电流 (#822)
* Correct class member name

* xmini-c3: 休眠时关闭es8311可减少20mA电流
2025-06-16 12:51:27 +08:00
ZhouKe e9f23ea231 -增加带面包板的摄像头功能 (#815)
* -增加带面包板的摄像头功能

* rename board

---------

Co-authored-by: zk <982145@qq.com>
2025-06-13 21:03:13 +08:00
小鹏 7435c98609 1.增加robot舵机初始位置校准 2.fix(mcp_sever) 超出范围异常捕获类型 bug (#817)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug

* 1.增加robot舵机初始位置校准
2.fix(mcp_sever) 超出范围异常捕获类型  bug
2025-06-13 21:02:03 +08:00
Terrence bf125446b3 feat: Use BOOT button to enter audio testing state when Wi-Fi configuring 2025-06-13 19:57:07 +08:00
flying1425 dfad6a5b2c 添加微雪电子esp32-c6-lcd-1.69、esp32-c6-Touch-lcd-1.69的支持 (#816)
* 添加了摄像头和触控支持

* 添加微雪电子esp32-c6-lcd-1.69、esp32-c6-Touch-lcd-1.69的支持

---------

Co-authored-by: flyingtjy <flyingtjy@gmail.com>
2025-06-13 18:20:22 +08:00
YeezB d460af8426 feat: Add df-k10 MCP control on board RGB LED (#810)
* feat: Add dfk10 MCP blink

* fix: delete iot protocol related part
2025-06-13 18:08:08 +08:00
小鹏 7bb17f7539 fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug (#812)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug
2025-06-13 13:46:14 +08:00
Terrence f8c9126442 Bump to 1.7.4 2025-06-12 21:53:26 +08:00
Lucinhu a118e8f786 feat: es8311添加功放使能引脚的反向控制 (#808) 2025-06-12 20:37:15 +08:00
Terrence 85f3f1ba9f 修复model分区未初始化导致重启 2025-06-12 15:06:31 +08:00
Terrence e2777cc16b esp-hi special app partition 2025-06-12 15:06:31 +08:00
wuxingzhong 5bb7c6deb8 fix: 修复修改vad模型为:vadnet1 medium时, 不生效问题. (#802) 2025-06-12 15:02:48 +08:00
netseye 895a3cfa72 fix: 修复tab5 esp-hosted 升级带来的crash问题 (#795)
Co-authored-by: Jeakin <Jeakin@botu.cc>
2025-06-11 12:14:22 +08:00
laride c9dec29d73 fix: delay WebServer startup to mitigate stack overflow (#797) 2025-06-11 12:12:39 +08:00
Terrence 968ed1fae3 v1.7.3: 参考ESP-HI,为所有C3板子增加10多KB可用SRAM 2025-06-10 01:33:20 +08:00
Terrence f8cd0d30cd fix idf_component.yml 2025-06-09 12:11:51 +08:00
laride 01215d77ed fix: 修复 ESP-Hi 在联网时 crash 的问题 (#790)
* fix: resolve crash issue during network connection on ESP-Hi

* fix: adjust dependency rules for some components
2025-06-09 11:48:20 +08:00
wdmomoxx 3df2f3970a 添加esp32支持唤醒词 (#782)
* Update README.md

* Update config.h

增加MCP控制方式

* Update esp32_cgc_board.cc

增加MCP控制方式

* Update CMakeLists.txt

增加ESP32 CGC 144开发板

* Update Kconfig.projbuild

增加ESP32 CGC 144开发板

* Create README.md

增加ESP32 CGC 144开发板

* Add files via upload

* Update config.h

修改注释

* Update Kconfig.projbuild

增加ESP32语言唤醒支持(目前需要开启PSRAM)

* Add files via upload

Add wake word to esp32

* Update sdkconfig.defaults.esp32

增加看门狗超时
2025-06-09 04:43:46 +08:00
Terrence 386e58a224 Bump to 1.7.2 2025-06-08 12:01:24 +08:00
Terrence 504e694caa 先在lichuang-dev上测试NSNet降噪 2025-06-08 02:52:23 +08:00
Terrence d58037eecd fix p4 compiling errors 2025-06-08 02:39:53 +08:00
Terrence 218d0318fe fix audio debugger compiling errors 2025-06-06 21:39:22 +08:00
Terrence 7bc5f7bb0c Add audio debugger 2025-06-06 20:24:00 +08:00
Terrence 24ede22197 wechat ui支持摄像头预览 2025-06-06 16:54:53 +08:00
flying1425 dc4e82abaf 添加了摄像头和触控支持 (#772)
Co-authored-by: flyingtjy <flyingtjy@gmail.com>
2025-06-06 14:27:26 +08:00
virgil 5c51fbc2f8 Feat sscma camera (#770)
* feat: add sscma camera

* fix: 修复sscma camera 无法使用等问题

* feat: update README.md

* style: optimize styles

* style: fix styles

* Update sscma_camera.h

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-06-06 14:22:39 +08:00
Xiaoxia 8729fad9a8 v1.7.1: fix send audio (#771)
* screen -> display

* Add AUDIO_CODEC_DEFAULT_MIC_GAIN

* WebRTC -> NSNet

* fix: send audio priority
2025-06-06 14:03:46 +08:00
yusuhua b18dda3f2f 增加LilyGo T-CameraPlus-S3的摄像头红外过滤功能 (#766)
* set camera HMirror to true

* change key1 to camera button

* change key1 to camera button

* change key1 to camera button

* add ir filter controller

* add ir filter controller

* add ir filter controller
2025-06-06 11:18:02 +08:00
小鹏 7bb12f31f0 增加ottoRobot和electronBot的支持 (#757)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug
2025-06-05 23:51:49 +08:00
Terrence 6d02b7724a Update related projects 2025-06-05 20:42:45 +08:00
Terrence 5621fa5a65 fix: 长按切换到点按后,无法唤醒的问题 2025-06-05 18:41:23 +08:00
LILYGO_L 2f1229f09f 修复T-CameraPlus-S3_V1.2板子摄像头不能正常使用问题 (#758)
* Resolve the issue where the camera on the T-CameraPlus-S3_V1.2 board cannot be used normally.
2025-06-05 17:24:43 +08:00
Li Junru 54ff46788b fix(esp-hi): fix can not wake up (#754) 2025-06-05 15:52:11 +08:00
Terrence f5d6cd2d36 Bump to 1.7.0 2025-06-04 20:32:41 +08:00
Spotpear d4ae55a4e3 修复屏幕条纹 (#748) 2025-06-04 14:44:33 +08:00
Terrence abba768e90 Add tools/call stack size for HTTPS upload 2025-06-04 14:17:43 +08:00
Terrence f41210577b v1.6.8: Move partition CSV files into a folder 2025-06-04 12:11:55 +08:00
Xiaoxia 16ec95f6d5 Update documentation (An MCP-based Chatbot) 2025-06-04 04:17:49 +08:00
Li Junru 336eff728d feat(esp-hi): update adc mic version (#741) 2025-06-04 01:32:57 +08:00
laride bfc695b1ee feat: ESP-Hi 改用 MCP 协议 (#740)
* feat(esp-hi): use MCP protocol

* docs(esp-hi): Add README

* feat(esp-hi): remove redundant checks and add option to disable WebUI
2025-06-03 16:45:03 +08:00
laride 9122664f0f feat: 添加 ESP-Hi WebUI (#739)
* feat(esp-hi): Skip download if file already exists locally

* feat(esp-hi): add WebUI
2025-06-03 15:24:11 +08:00
Terrence e52703df24 feat: Add Serial-Number to OTA header 2025-06-03 14:15:13 +08:00
wdmomoxx 02abd71588 更新ESP32 CGC MCP控制方式,添加一个ESP32 CGC 144的开发板 (#736)
* Update README.md

* Update config.h

增加MCP控制方式

* Update esp32_cgc_board.cc

增加MCP控制方式

* Update CMakeLists.txt

增加ESP32 CGC 144开发板

* Update Kconfig.projbuild

增加ESP32 CGC 144开发板

* Create README.md

增加ESP32 CGC 144开发板

* Add files via upload

* Update config.h

修改注释
2025-06-03 12:20:57 +08:00
zhouchunyuan 32c5b3e6d4 正点原子DNESP32S3开发板新增相机(ov2640) (#733)
* 正点原子DNESP32S3开发板新增相机(ov2640)

* 增加了相机预初始化,如无相机则camera_ = nullptr;并修正了语法分号

利用了 esp32_camera.h 的 esp_camera_init()/esp_camera_deinit() 函数
2025-06-02 13:51:54 +08:00
Terrence 67c44403a3 Update ESP-IDF version to 5.4 2025-06-01 21:44:12 +08:00
Terrence e4ced2a62e sdkconfig: fix default value 2025-06-01 16:02:22 +08:00
Xiaoxia ae57131c15 Add wake word to xmini-c3 (#730)
* esp-hi: MCP protocol is not ready yet

* Add wake word to xmini-c3
2025-05-31 22:21:03 +08:00
yusuhua 6cb025859f LilyGo T-CameraPlus-S3低版本发布及增加拍照键 (#720)
* set camera HMirror to true

* change key1 to camera button

* change key1 to camera button

* change key1 to camera button
2025-05-30 10:13:18 +08:00
liyuaxue 47bdfa2c77 hide low_battery (#721) 2025-05-30 01:10:28 +08:00
Terrence 1a695a203b fix compiling errors 2025-05-30 01:09:51 +08:00
Terrence 1858da4973 Avoid tool call blocking main thread (dropping packets) 2025-05-30 00:53:11 +08:00
espressif2022 f5c1c30c5e feat: add new board esp-hi (#666)
* feat: add new board esp-hi

* feat(esp-hi): update servo_dog_ctrl

---------

Co-authored-by: Li Junru <lijunru@espressif.com>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-05-29 23:29:33 +08:00
Liam 565c54e7d4 MCP协议文档 (#717)
* MCP协议文档

* Update mcp_protocol.md

---------

Co-authored-by: loadingxv <loadingvx@gmail.com>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-05-29 20:12:21 +08:00
Spotpear 34a77f75df 增加sp-esp32-s3-1.28-box开发板 (#714) 2025-05-29 20:04:03 +08:00
laride e74fd34bf1 feat(Sparkbot): add camera flip control via MCP (#716) 2025-05-29 20:01:08 +08:00
Terrence 89fbf89d0f fix exception 2025-05-29 13:46:19 +08:00
yusuhua 0e6375e347 set camera HMirror to true (#707) 2025-05-29 09:39:25 +08:00
wcc-zf 0902ced1c4 修复param.required()==false时可能触发未定义的问题 (#705) 2025-05-29 09:37:54 +08:00
yusuhua aef527f7af LilyGo T-CameraPlus-S3 add camera function (#704)
* add camera function

* add camera function
2025-05-28 23:35:42 +08:00
Y1hsiaochunnn 245be0ea1b Three new Waveshare ESP32-P4 development boards have been added (#691)
* Added third-party hardware support

Waveshare-ESP32-P4-WIFI6-Touch-LCD-3.4C,
Waveshare-ESP32-P4-WIFI6-Touch-LCD-4C,
Waveshare-ESP32-P4-WIFI6-Touch-LCD-4B

* Remove the README

* Merge ESP32-P4-WIFI6-Touch-LCD-3.4C and ESP32-P4-WIFI6-Touch-LCD-4C into one board

* Add readme files
2025-05-28 23:20:14 +08:00
HonestQiao 7f7f24e5ad 调整摄像头拍照方向 (#693) 2025-05-28 06:47:30 +08:00
YeezB 030a6b9da2 feature: Add dfrobot-k10 vision recognition (#688) 2025-05-27 21:44:03 +08:00
HonestQiao 12cf213351 增加DFRobot ESP32-S3 AI智能摄像头模块,适配视觉识别功能 (#692)
* 增加 DFRobot ESP32-S3 AI智能摄像头模块

* 适配视觉识别功能

* 修改dfrobot-esp32-s3-ai-cam为df-s3-ai-cam
2025-05-27 21:43:01 +08:00
LILYGO_L da62523765 Added support for the T-CameraPlus-S3_V1.2 board (#680)
* Adapt for LilyGO-T-Circle-S3 device

* Adapt for LilyGO-T-Circle-S3 device

* Remove comments and modify the size of the lilygo-t-circle-s3 image

* Modify the code style and format to Google C++

* Modify the code style and format to Google C++

* Fixed bugs in the LILYGO T-Circle-S3 board and added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Merge branch 'main' of https://github.com/Llgok/xiaozhi-esp32

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Fix the color display issue for T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Update T-CameraPlus-S3_V1.2 Version Xiaozhi Example
2025-05-27 21:39:48 +08:00
Xiaoxia d80f94387a v1.6.6: Set MCP as default IoT Protocol (#690) 2025-05-27 14:58:49 +08:00
Create123 0c83263762 Atoms3r cam m12 echo base (#689)
* main/boards: Add camera support for M5Stack CoreS3.

* main/boards: Add camera support for M5Stack AtomS3R-CAM/M12 + EchoBase.
2025-05-27 12:45:09 +08:00
laride 2b553ce6ff feat: add camera functions (ESP-SparkBot) (#687)
Co-authored-by: lvhaiyu <lvhaiyu@espressif.com>
2025-05-27 11:48:31 +08:00
Create123 391aa74abe main/boards: Add camera support for M5Stack CoreS3. (#686) 2025-05-27 09:55:29 +08:00
Terrence 3a2e6875b6 Add audio_send_queue to synchronize timestamp 2025-05-27 05:44:46 +08:00
Terrence d17bfccb35 fix: compile errors 2025-05-27 04:50:21 +08:00
Kevincoooool 0e42bd2b18 Add camera support board(sp v3/v4 korvo) (#682)
* Add camera support board

* Update esp32_camera.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-05-26 18:28:51 +08:00
hanhanlili 8555b89692 fix power manager error (#681) 2025-05-26 18:24:33 +08:00
Terrence 0c57df1cd8 v1.6.5: Improve performance and memory usage 2025-05-26 14:30:44 +08:00
Terrence 277f87ae5f revert gpio level (#627) 2025-05-26 14:17:54 +08:00
Terrence 9f90c7dd6a remove preview_thread_, cost more time but less memory usage 2025-05-26 07:04:25 +08:00
Terrence f890220ce3 remove unused ota class members 2025-05-26 06:11:47 +08:00
Terrence ce1211c86d update esp32 camera code 2025-05-26 06:10:53 +08:00
Terrence 249d12ac25 feat: Add camera functions (lichuang-dev) 2025-05-25 17:07:07 +08:00
Terrence ecfebc4a29 Add preview image to lcd display 2025-05-25 07:02:44 +08:00
Terrence 0204b8800b update status bar immediately after network started 2025-05-24 07:25:34 +08:00
Terrence 6d5331dddd [MCP] extend tools/list payload size to 8000 2025-05-24 03:06:01 +08:00
Terrence 0b98392286 Remove update display timer 2025-05-24 03:03:33 +08:00
Terrence c39f6cfb02 Bump to 1.6.3 2025-05-23 04:59:29 +08:00
Terrence 55a1032779 do not allocate memory if old IoT protocol is not used 2025-05-23 04:26:47 +08:00
Terrence 5da66773d5 Add MCP server 2025-05-22 19:19:48 +08:00
Terrence f142c5469c Adjust mqtt variables 2025-05-22 19:19:48 +08:00
Spotpear 8eecdd1ffc '增加sp-esp32-s3-1.54-muma开发板' (#655) 2025-05-22 14:30:44 +08:00
hanhanlili 319d3332be 增加敏思开发板 (#649)
* 增加敏思开发板

* 去除不需要的代码

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-05-22 14:29:38 +08:00
MakerM0 9874a1b009 增加4G扩展 (#653)
在不影响wifi原版功能的基础上,方便想增加4G功能的朋友通过内置的fpc座子连接4G模块;
默认开机是wifi模式,在联网成功前,双击主按钮,可以进行WIFI和4G网络切换;
若在wifi模式,在成功连接前,可单击主按钮可以进行重新配网;
2025-05-21 22:19:25 +08:00
liyuaxue 0183830915 add zhengchen_ml307 board(征辰科技) (#641)
* add zhengchen_ml307 board

* add boards_http
2025-05-21 22:09:12 +08:00
Y1hsiaochunnn 61bf5754db Add some register configuration for 1.75 amoled screen to adapt to the new screen (#646) 2025-05-21 15:56:07 +08:00
WDF-king 180ca89bd3 初次提交亘具科技s3 1.54小智代码 (#576)
* 初次提交亘具科技s3 1.54小智代码

* 第一次修改命名

* 修改名字,移除GennJu文件夹

* 提交修改了名字的genju文件夹

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-05-20 21:17:02 +08:00
Y1hsiaochunnn b49ad1755d Add board support for Waveshare ESP32-S3-Touch-AMOLED-1.75 (#643)
* Add board support for Waveshare ESP32-S3-Touch-AMOLED-1.75

* Fix component excess strings

* Fix the ui

* Update Kconfig.projbuild

Correction board for USB_DEVICE_AEC requirements
2025-05-20 20:59:09 +08:00
Terrence d2f42527f4 fix: iot screen invalid iot descriptor 2025-05-20 09:23:14 +08:00
liyuaxue b0b471e27e add zhengchen_boards_wifi(征辰科技) (#635)
* add zhengchen_boards_wifi

* add zhengchen_boards_wifi1
2025-05-19 15:37:06 +08:00
Y1hsiaochunnn 538e07aa70 Add a description of supported hardware chips (#637)
LGTM!
2025-05-19 14:59:42 +08:00
Terrence c3e488e744 Iot: Use English description 2025-05-19 10:06:05 +08:00
Terrence 425f46df4b Fix: esp_lcd_ili9881c only for p4 2025-05-19 10:04:34 +08:00
Create123 f7ea248845 main/boards: Add support for M5Stack Tab5. (#632) 2025-05-19 01:43:49 +08:00
Terrence 7925f77739 Fix: 切换状态后一段时间内无法录音问题 2025-05-19 01:29:39 +08:00
HonestQiao beffb362dc 将gpio_led的FadeCallback放到IRAM (#629)
* 添加四博智联AI陪伴盒子适配,典型pdm麦克风设备

* doit_s3_aibox LED切换到GPIO LED

* doit_s3_aibox 添加说明文件

* doit_s3_aibox 音量最大值设置到100

* 将gpio_led的FadeCallback放到IRAM
2025-05-16 22:26:17 +08:00
Ky1eYang 27d85356e4 修改send packet时直接获取时间戳为队列获取时间戳 (#628)
* 修改实时aec传输时间戳改队列方式

* 删/注释化一下log代码, pr

---------

Co-authored-by: yangkaiyue <yangkaiyue1@tenclass.com>
2025-05-16 18:46:20 +08:00
Y1hsiaochunnn 7ceeffc157 Adjust dependency components for ESP32-P4 (#623)
* Adjust dependency components for ESP32-P4

* Add backlight control and touch control to Waveshare ESP32-P4-NANO

* Increase the amount of saved information for Waveshare ESP32-P4-NANO
2025-05-16 18:36:43 +08:00
Y1hsiaochunnn 1c63934756 Adjust ESP32-P4 chip compatibility Add Waveshare ESP32-P4-NANO board support (#589)
* Added ESP32-P4 chip support

* Add Waveshare ESP32-P4-NANO board support

* Add Waveshare ESP32-P4-NANO board support

* Add prefix "Waveshare" to waveshare products

* Adjust the ESP32-P4-NANO README and fix the index link.

* Update code style

* Optimize code styles

* Adjust to naming requirements

* Adjust to naming requirements
2025-05-16 02:41:35 +08:00
Terrence 45c62f5a53 Add session_id to websocket message 2025-05-13 17:16:24 +08:00
Zhihui Zheng 8e9f59efae chore: 更新 .gitignore 文件 (#591)
- 添加 .cache 目录到忽略列表
- 保持 .DS_Store 在忽略列表中
2025-05-12 14:43:10 +08:00
Terrence fcc35d132c fix unused variable warning 2025-05-12 04:43:45 +08:00
Terrence 3047ac4556 Fix Initialize() 2025-05-11 21:14:09 +08:00
yusuhua 7abcd30def Lilygo T-CameraPlus-S3 关闭延时关机以及削平电池百分比 (#598)
* lilygo-t-cameraplus-s3 add pmic

* set lilygo-t-cameraplus-s3 seconds_to_shutdown to -1
2025-05-10 19:18:37 +08:00
Xiaoxia be18c1aa04 Add server AEC option 2025-05-09 14:00:26 +08:00
yusuhua 7ea67146d5 lilygo-t-cameraplus-s3 add pmic (#586) 2025-05-09 04:24:58 +08:00
Terrence 724f440fab fixbug: button driver cannot be in stack memory 2025-05-09 03:56:51 +08:00
Terrence a0ad3e6dc3 Default realtime chat for esp-box-3, lichuang-dev 2025-05-08 02:32:24 +08:00
Terrence b6489a3456 Double click BOOT to switch 4G/Wi-Fi 2025-05-07 17:11:26 +08:00
Terrence ee0df3470c Default press time to 0 2025-05-07 16:42:23 +08:00
Terrence c0acf30b25 Bump to 1.6.2 2025-05-07 15:27:51 +08:00
Terrence 5cb31a5e91 Add CEREG to board JSON for 4G LBS to fix weather location 2025-05-07 15:26:53 +08:00
Terrence 696786ad4c Upgrade component versions 2025-05-07 15:26:53 +08:00
Terrence 7c6b9d8fa7 Use English output log 2025-05-07 15:26:53 +08:00
flying1425 0beae83143 解决部分esp32-s3-touch-lcd-3.5开机黑屏不显示的问题 (#581)
* 解决部分开机黑屏的问题

* Update esp32-s3-touch-lcd-3.5.cc

---------

Co-authored-by: flyingtjy <flyingtjy@gmail.com>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-05-07 15:26:08 +08:00
Terrence fd6235750d Upgrade components 2025-05-07 04:55:51 +08:00
Terrence b00c5b50c3 Adjust LCD display 2025-05-07 04:49:21 +08:00
Terrence 4be2464fbc Remove warnings 2025-05-07 04:40:17 +08:00
Haibo Gu d505b3b1ae 【需求】双网络类型通过长按boot切换网络 (#520)
* 【需求】双网络类型通过长按boot切换网络

* Update Kconfig.projbuild

---------

Co-authored-by: guhaibo <guhaibo@boe.com.cn>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-05-07 02:33:38 +08:00
Liam 8e638e3884 OTA checkversion增加了一些log, 便于三方开发调试自己的OTA接口 (#568)
* feat(ota): add logging for missing sections in Ota::CheckVersion

Add detailed logging to inform when specific sections (activation, mqtt, websocket, server_time, firmware) are not found during the OTA version check. This improves debugging and visibility into the OTA process.

* 恢复提示词

---------

Co-authored-by: loadingxv <loadingvx@gmail.com>
2025-05-04 19:25:50 +09:00
ourkix f590e49f2d 添加乐鑫开发板esp32-s3-lcd-ev-board支持 (#543)
* 添加乐鑫开发版esp32-s3-lcd-ev-board支持

* 新增乐鑫开发版esp32-s3-lcd-ev-board支持

* 新增乐鑫开发板esp32-s3-lcd-ev-board支持,修复led和背光bug

* Delete main/boards/ESP32-S3-LCD-EV-Board directory

* 新增乐鑫开发板esp32-s3-lcd-ev-board支持,修复led和背光bug

* 去除冗余代码

* 添加esp-s3-lcd-ev-board的硬件版本选择配置

* Delete main/boards/esp-s3-lcd-ev-board-1.4 directory

* 添加esp-s3-lcd-ev-board的硬件版本选择配置

* 新增不同版本的名称标识,使ota更新时能识别
2025-04-30 18:21:35 +08:00
LILYGO_L b5595c0ab4 Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY. (#537)
* Adapt for LilyGO-T-Circle-S3 device

* Adapt for LilyGO-T-Circle-S3 device

* Remove comments and modify the size of the lilygo-t-circle-s3 image

* Modify the code style and format to Google C++

* Modify the code style and format to Google C++

* Fixed bugs in the LILYGO T-Circle-S3 board and added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Merge branch 'main' of https://github.com/Llgok/xiaozhi-esp32

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Added support for two new boards: LILYGO T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.

* Fix the color display issue for T-Display-S3-Pro-MVSRLora and LILYGO T-Display-S3-Pro-MVSRLora_NO_BATTERY.
2025-04-29 20:42:50 +08:00
Terrence 4caffd31ed Remove No serial message 2025-04-29 20:42:31 +08:00
Terrence c94e82e865 Add timestamp to MQTT UDP packet 2025-04-29 20:04:17 +08:00
Terrence f6334246ca Add dummy audio processor 2025-04-29 18:17:08 +08:00
Terrence c201e5955f Revert gc9a01 version 2025-04-29 18:15:45 +08:00
Xiaoxia b804343d30 Audio stream packet with timestamp 2025-04-28 23:10:24 +08:00
Xiaoxia 7fdf78408e Add v2.0 to versions.py 2025-04-28 17:05:56 +08:00
Terrence 5f8389c135 Add binary protocol v2 & v3 to websocket 2025-04-28 16:29:33 +08:00
Terrence 1f03d770cc update ml307 version 2025-04-28 16:28:53 +08:00
Terrence 6fbf272613 Allow 10 audio packets in recv queue 2025-04-28 11:19:28 +08:00
matu666 a8ba7e75fe add lcd touch for esp32-s3-touch-amoled-1.8 (#550) 2025-04-26 20:45:02 +08:00
Wiking_Xu 6fabcaabba 新增正点原子三款开发板 (#538) 2025-04-25 07:19:58 +08:00
ZhouKe 7d5237a604 add lcd touch for lichuang_dev (#531)
* add lcd touch for lichuang_dev

* Update lichuang_dev_board.cc

---------

Co-authored-by: zk <982145@qq.com>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-04-23 15:00:17 +08:00
Terrence 738e170d54 Update esp-wifi-connect to 2.4.2 2025-04-23 07:24:55 +08:00
JackHuang021 abb594bddd atk_dnesp32s3: fix set xl9555 port1 output state (#525)
Signed-off-by: Jack Huang <jackhuang021@gmail.com>
2025-04-22 10:28:26 +08:00
Terrence 3404180a77 更新Wi-Fi组件版本,从OTA接口读取Websocket服务器 2025-04-21 15:13:11 +08:00
Terrence c380617cca Support MQTT endpoint port 2025-04-21 15:13:11 +08:00
大汉子民 a6619dcdb9 更新支持 元控·青春板卡 (#486)
* 更新支持 元控·青春板卡

* 更新README.md,修改多灯库使用问题
2025-04-17 08:36:25 +08:00
Terrence dff8f9cb5b Bump to 1.6.0 2025-04-14 23:17:06 +08:00
Terrence 68a3f7d2f7 Allow force OTA upgrade to a previous version 2025-04-14 22:05:29 +08:00
Terrence 6e73a11ac9 Add two types, system and alert. 2025-04-14 16:02:41 +08:00
Terrence d5d8b34b2b Add activation version 2 2025-04-14 15:44:06 +08:00
Xiaoxia f76f31aa12 Prevent too many opus packets in queue 2025-04-13 23:12:44 +08:00
Terrence eac5830439 remove duplicated header files 2025-04-13 15:35:36 +08:00
Terrence 78d7b40914 将项目版本更新至1.5.9,优化内存使用,增加主任务栈大小至8192,优化固件升级流程,重构主循环为MainEventLoop,添加新版本检查功能,更新音频编解码器的DMA配置常量。 2025-04-13 11:47:15 +08:00
HonestQiao 4ef6ef3552 增加四博智联AI陪伴盒子 (#309)
* 添加四博智联AI陪伴盒子适配,典型pdm麦克风设备

* doit_s3_aibox LED切换到GPIO LED

* doit_s3_aibox 添加说明文件

* doit_s3_aibox 音量最大值设置到100
2025-04-13 07:04:46 +08:00
tangyumei3535 f141a6bf32 Add board: ESP-Spot (#460)
* feat: add ESP-Spot S3

Co-authored-by: Tang Yumei <tangyumei@espressif.com>

* feat: add button and power control

long press KEY to shut down.

* feat: change for s3 adc

* fix: adc cali fail

* add ESP-Spot S3 Readme

* fix ES8311 config

---------

Co-authored-by: Liu Ruichao <liuruichao@espressif.com>
2025-04-13 06:45:05 +08:00
Almost-LoverY 4787eb41ab The atk-dnesp32s3-box is compatible with ES8311 devices and non-ES8311 devices (#477)
* The atk-dnesp32s3-box is compatible with ES8311 devices and non-ES8311 devices

* Update atk_dnesp32s3_box.cc

format code

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-04-12 17:17:27 +08:00
mtdxc a3a833b19d add ci build.yml (#475) 2025-04-12 09:34:33 +08:00
virgil 076d907abf sensecap watcher manufacture (#469)
* feat: add shutdown and battery cmd.

* fix: fixed the issue that the LCD does not light up when some devices are turned on.

* fix:  fix task sys_evt  stack overflow.

* feat: Optimize UI display for circles; add Added factory reset function.

* feat:  "low_battery_label_" obj  configurable

* feat: add read_mac cmd

* fix: fix "low_battery_label_" obj  redefine

* style: modify Google C++ Style.

* Update sensecap_watcher.cc

Remove extra spaces

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-04-12 09:33:07 +08:00
Xiaoxia 04c0da059f Fix missing display 2025-04-11 03:11:32 +08:00
Terrence a5dfe67504 move ota headers to ota.cc 2025-04-10 18:56:17 +08:00
mtdxc f1ad29be3b Boxlite aec (#465)
* 允许espbox-lite打开aec
微信模式使用小字体

* 软件回声消除

* 支持双麦采集

---------

Co-authored-by: cqm <cqm@97kid.com>
2025-04-10 17:06:15 +08:00
Terrence 18e44ec775 Fix i2c header files 2025-04-10 01:57:18 +08:00
Xiaoxia 81aa8a43ce Bump to 1.5.8 2025-04-09 23:58:32 +08:00
Terrence dc28f0d9c2 use smaller emoji in wechat message style 2025-04-09 23:30:41 +08:00
Terrence a6ce728386 Fix ML307 FIFO Overflow 2025-04-09 10:41:12 +08:00
Terrence 652e5cbcdd avoid double error alerts 2025-04-09 09:13:18 +08:00
Terrence 69540c6551 fix nullptr error 2025-04-09 08:24:02 +08:00
MOV 9e0de3b302 fix:Cuican Running Error for v1.5.6 (#456)
* fix:Modify the README and add Moji images

* fix: Moji LCD initialization configuration.

* fix: DISPLAY_MIRROR_X false >> true

* fix: Moji GPIO conflict

* fix: Moji GPIO conflict

* fix: Cuican Build config
2025-04-09 00:48:46 +08:00
繁花君1号 27a14c249a 修复 bug (#454)
Co-authored-by: geng_MAX <geng_MAX@hotmail.com>
2025-04-08 23:13:26 +08:00
Xiaoxia c0e702ff47 Bump to 1.5.6 2025-04-05 06:39:59 +08:00
Xiaoxia 91f98a49d9 magiclick 2p4/2p5: add click to reconfigure wifi 2025-04-05 03:27:53 +08:00
Xiaoxia 976ad2eac6 atk box build with wechat message style 2025-04-04 15:58:23 +08:00
Xiaoxia fcd886c217 移除长按对话,改为单击多轮对话 2025-04-04 15:53:50 +08:00
MakerM0 eae0ca9315 增加电量显示和睡眠 (#444) 2025-04-04 15:37:40 +08:00
virgil 464633e7a1 Fix lcd bug (#443)
* fix: fixed the issue that the LCD does not light up when some devices are turned on.

* fix:  fix task sys_evt  stack overflow.
2025-04-04 15:33:17 +08:00
Xiaoxia 70883058e8 fix startup sound 2025-04-04 15:29:44 +08:00
HonestQiao 0ac2f09bb0 GPIO LED更新,可以设置LEDC定时器和控制通道 (#439)
* 添加普通LED支持,支持不同状态亮度设置和呼吸灯效果

* GPIO LED更新,可以设置LEDC定时器和控制通道
2025-04-03 02:25:03 +08:00
Xiaoxia c9dfcb7c93 更新开发者文档(自定义开发板、IoT设备) 2025-04-02 09:11:41 +08:00
香草味的纳西妲 7c6b39e65d add: LVGL Image Converter Script 增加LVGL图片转换工具脚本,可以自定义小智的表情文件。 (#423)
* add: LVGL Image Converter

* add: README

* Rename README.MD to README.md

* remove readme image

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-04-01 06:51:11 +08:00
Kevincoooool 31c1f07481 Korvo开发板支持AEC (#431) 2025-03-31 00:07:12 +08:00
Terrence 488dfa5bf9 Bump to 1.5.5 2025-03-30 16:14:10 +08:00
Terrence 45012e38d4 Fix upgrade failure (main task stack overflow) 2025-03-30 16:13:49 +08:00
Xiaoxia fa899a310e ESP-BOX-3 / LichuangDev enable AEC to support realtime chat (#429)
* read frame duration from server

* fit wechat style emoji size

* Make Wechat UI look better

* Add Realtime Chat to ESP-BOX-3/LichuangDev

* disable debug log

* Fix Sh1106 Compile Error Bug. IDF 5.3.2 Not supporting sh1106-esp-idf. (#424)

* Fix ESP32 Board Led No Light Bug (#427)

* add board esp32-s3-touch-lcd-3.5 (#415)

* add board esp32-s3-touch-lcd-3.5

* add axp2101

---------

Co-authored-by: flyingtjy <flyingtjy@gmail.com>

---------

Co-authored-by: ooxxU <71391474@qq.com>
Co-authored-by: flying1425 <79792003+flying1425@users.noreply.github.com>
Co-authored-by: flyingtjy <flyingtjy@gmail.com>
2025-03-30 09:07:08 +08:00
flying1425 e4c76eaa46 add board esp32-s3-touch-lcd-3.5 (#415)
* add board esp32-s3-touch-lcd-3.5

* add axp2101

---------

Co-authored-by: flyingtjy <flyingtjy@gmail.com>
2025-03-29 20:15:29 +08:00
ooxxU 69f736ac64 Fix ESP32 Board Led No Light Bug (#427) 2025-03-29 20:14:40 +08:00
ooxxU 2e9ce37321 Fix Sh1106 Compile Error Bug. IDF 5.3.2 Not supporting sh1106-esp-idf. (#424) 2025-03-29 12:01:09 +08:00
Lucinhu 8a0bb68c33 fix: 修复微信ui在消息数量超过上限后,气泡位置向上偏移的问题 (#418) 2025-03-27 20:02:45 +08:00
Eason 7ac252637d SH1106 Supported (#416)
* SH1106 Supported

* OLED_SSD1306_128X64_SH1106 -> OLED_SH1106_128X64
2025-03-26 23:11:08 +08:00
Terrence 4c7e00630b fix sensecap watcher partition alignment 2025-03-26 23:07:58 +08:00
Lucinhu f05b46a0d9 typo: 删除sense-watcher显示修复的重复以及改掉错误的注释描述 (#417) 2025-03-26 22:15:12 +08:00
MOV e486d8e91e Add feature cuican (#407)
* fix:Modify the README and add Moji images

* fix: Moji LCD initialization configuration.

* fix: DISPLAY_MIRROR_X false >> true

* fix: Moji GPIO conflict

* fix: Moji GPIO conflict

* add-feature-cuican

* update cuican image

* update config.h
2025-03-26 02:20:30 +08:00
ZhouKe 1f29fa44c2 change SPI mode for 7pin LCD (#405)
Co-authored-by: FanCheng <598592060@qq.com>
2025-03-26 00:39:48 +08:00
WMnologo ae8aec1879 新增了0.85tft屏幕版本的星智开发板 (#397)
* 新增了0.85tft屏幕版本的星智开发板

* 对调了0.85寸屏幕版本的星智连接ml307模块的TX、RX引脚
2025-03-25 20:28:32 +08:00
Chinsyo 50c49023a7 Support adjust volume with knob in SenseCAP Watcher (#399)
* fix typo, add missing prefix `CONFIG` to `ESP_TASK_WDT_TIMEOUT_S`

* add KNOB gpio spec to sensecap config

* create new knob component

* implement ajust output volume with knob

* modify function name to UpperCamelCase

* Tidy up comments and logs
2025-03-25 02:37:43 +08:00
Terrence af879d7806 Bump to 1.5.2 2025-03-22 23:12:04 +08:00
Xiaoxia e1e5387a78 Add missing ja-JP/upgrade.p3 2025-03-22 06:54:37 +08:00
Terrence dfd3069ee9 reduce audio processing stack size from 8192 to 4096 2025-03-22 06:45:46 +08:00
Terrence 1619217bd9 Upgrade esp-sr to 2.0.2, improve performance 2025-03-22 06:09:12 +08:00
Terrence 023dd7fb27 Add lower limit to audio 2025-03-22 06:03:22 +08:00
Terrence 3efef0cf20 fixbug: display spi error when setting brightness 2025-03-22 06:00:22 +08:00
Terrence 80e02d7c70 Add PMIC init to waveshare 1.8 2025-03-22 05:10:38 +08:00
Kevincoooool 8e2cf90d86 Update esp32s3_korvo2_v3_board.cc (#382) 2025-03-21 12:54:52 +08:00
Kevincoooool 34ab004c38 开机检查背光是否为0,如果为0则调为10 (#379)
* Update backlight.cc

* Update backlight.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-03-21 12:16:26 +08:00
Terrence 11c79bf086 fix release 2025-03-20 14:07:44 +08:00
ZhouKe e440aa725a -修复 st7796 参数 (#375)
-增加非IPS的ST7796屏
2025-03-20 13:50:28 +08:00
Terrence 26e47427b9 Bump to 1.5.0 2025-03-20 03:13:14 +08:00
Terrence f76502cb59 Add screen theme switch to atk boards and atoms3 2025-03-20 03:13:04 +08:00
Terrence 6bb1ab7583 Add theme switch to all LCD boards 2025-03-20 03:00:07 +08:00
Terrence 71799ed85c Bump to 1.4.8 2025-03-20 02:03:55 +08:00
Terrence f553459121 fix atk-dnesp32s3 backlight output invert 2025-03-20 01:26:39 +08:00
Chinsyo 39e9d49288 Add single-led support for SenseCAP Watcher (#373)
* add single-led support for SenseCAP Watcher

* Rename blaklight.cc to backlight.cc
2025-03-20 00:45:09 +08:00
ZhouKe d84e27aae7 微调微信界面 (#370)
* 微调微信界面

* 调整气泡框左边距
2025-03-20 00:42:52 +08:00
mtdxc 4884122cc1 cherry-pick #357, fix: 解决esp32-box-lite麦克风收音太小的问题 (#372)
Co-authored-by: cqm <cqm@97kid.com>
2025-03-20 00:41:13 +08:00
Xiaoxia d0ae468fac add ja-JP sounds 2025-03-18 21:21:30 +08:00
ZhouKe 61cc1a236b add iot command for theme switch (#364) 2025-03-18 21:00:54 +08:00
SunnyBoy-y 13fd170a89 Update atk_dnesp32s3_box.cc (#362)
atk_dnesp32s3_box适配微信界面
2025-03-18 20:55:36 +08:00
SunnyBoy-y b2bcb96942 修复部分开发版在config中DISPLAY_BACKLIGHT_OUTPUT_INVERT调整失效问题并适配类微信界面 (#361)
* Update atk_dnesp32s3.cc

修复在config中DISPLAY_BACKLIGHT_OUTPUT_INVERT调整失效问题

* Update atk_dnesp32s3_box.cc

修复在config中调整DISPLAY_BACKLIGHT_OUTPUT_INVERT失效的问题

* Update df_k10_board.cc

修复config中DISPLAY_BACKLIGHT_OUTPUT_INVERT调整失效问题

* Update esp_box_board.cc

修复更改config中DISPLAY_BACKLIGHT_OUTPUT_INVERT失效问题

* Update esp_box3_board.cc

修复在config中DISPLAY_BACKLIGHT_OUTPUT_INVERT调整失效问题

* Update atk_dnesp32s3.cc

dnesp32s3适配微信界面
2025-03-18 20:55:03 +08:00
ZhouKe 2c8f2f7d42 add dark mode (#363) 2025-03-18 10:33:22 +08:00
Paul Xu 349267ef23 fix: 解决行空板df-k10麦克风收音太小的问题 (#357)
Fixes 78/xiaozhi-esp32#350
2025-03-18 00:51:23 +08:00
ZhouKe 423ddcb287 在LCD面板使用微信聊天样式。 (#356)
* 在LCD面板使用微信聊天样式。

* 调整换行
2025-03-18 00:47:35 +08:00
Kevincoooool 0e28cd8a54 降低pclk频率/增大背光PWM频率防止电感啸叫 (#355) 2025-03-17 09:45:03 +08:00
Lucinhu c165d6f7e1 fix: 解决sensecap-watcher显示异常 (#348) 2025-03-14 23:40:13 +08:00
ooxxU a7ed9fd0cf fix ESP32 IOT Pin Bug, Pin35 are used for input and cannot be used for output. changed to Pin12. (#349) 2025-03-14 23:31:54 +08:00
bruceOrange22 4a7ef0b995 feat:解决第一次编译,报错,找不到release路径的问题 (#342)
* 解决第一次编译,报错,找不到release路径的问题

* Update release.py

---------

Co-authored-by: guoxianwei <xianwei.guo@orioniot.cn>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-03-14 11:12:59 +08:00
Xiaoxia a1d150a0b4 fix play_p3 time 2025-03-14 03:06:53 +08:00
dujianmin e777287463 重新整理了代码规范。去掉了一部分多余代码。 (#340)
* 添加嘟嘟开发板CHATX电池检测功能

* 从新整理了代码的书写规范。去掉一部分多余的代码

* Update du-chatx-wifi.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-03-14 03:00:29 +08:00
ooxxU e29fde6fa3 fix esp32 lcd show bug: Pin conflict (#339) 2025-03-14 02:53:52 +08:00
香草味的纳西妲 d235ac4f52 add: 音频/P3批量转换工具 (#336)
Co-authored-by: NyaOH-Nahida <3051979160@qq.com>
2025-03-13 14:21:04 +08:00
香草味的纳西妲 0ef913635d fix: bug修复 (#335) 2025-03-13 13:11:45 +08:00
laride ff7f396f9d feat: Audio loudness normalization for assets files (#332) 2025-03-13 12:14:17 +08:00
香草味的纳西妲 7eb710d404 add: GUI版P3文件简易播放器 (#334) 2025-03-13 08:11:58 +08:00
Xiaoxia 5a2e9ac87f add play_p3 and README 2025-03-12 23:28:20 +08:00
laride 45fa2ca389 feat: add AtomS3R CAM/M12 + Echo Base (#330)
* feat: add AtomS3R CAM/M12 + Echo Base

* Update README.md

fix typing

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-03-12 21:56:47 +08:00
ooxxU d60446bc53 新增 ESP32 系列开发板 LCD 屏幕显示的支持 (#313)
1. 支持 ESP32 系列开发板: DevKitC / NodeMcu-32S / GoouuuESP32 / ESP32 DoIt / ESP-32S
2. 注意: 非ESP32-C3 / 非ESP32-S3

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-03-12 02:30:45 +08:00
wdmomoxx e23f6cf6d8 增加设备ESP32-CGC (#201)
* Update Kconfig.projbuild

增加设备ESP32-CGC

* Update CMakeLists.txt

新增设备EPS32-CGC

* Update idf_component.yml

添加ST7735显示驱动

* Update lamp.cc

与ESP32的屏幕GPIO引脚冲突修改

* Add files via upload

新增一个引脚控制风扇

* Update wifi_board.cc

编译提示错误没有这个函数,暂时注释掉
//wifi_ap.SetLanguage(Lang::CODE);

* Create README.md

创建新设备ESP32-CGC

* Add files via upload

创建新设备ESP32-CGC

* Add files via upload

ESP32-CGC设备引脚图

* Update esp32_cgc_board.cc

* Update idf_component.yml

* Delete main/iot/things/newfan.cc

* Update lamp.cc

* Update wifi_board.cc

* Update idf_component.yml

* Delete main/boards/esp32-cgc/esp32_cgc_board.cc

* Delete main/boards/esp32-cgc/config.h

* Delete main/boards/esp32-cgc/README.md

* Add files via upload

添加设备ESP32-CGC

* Update Kconfig.projbuild

添加ESP32-CGC多屏选择支持,增加一个ST7735-128x128分辨率

* Update config.json

* Delete docs/ESP32-CGC-PINMAP.png

* Update README.md

* Update README.md

* Update esp32_cgc_board.cc

* Update config.h

* Update esp32_cgc_board.cc

跟随主线修改

* Create README.md

加入了ESP32 CGC 144开发板

* Add files via upload

加入ESP32 CGC 144开发板

* Update esp32_cgc_144_board.cc

* Update config.h

* Update Kconfig.projbuild

增加ESP32 CGC 144

* Update CMakeLists.txt

增加ESP32 CGC 144

* Update config.json

* Update config.h

* Update esp32_cgc_144_board.cc

修改屏幕控制参数

* Add files via upload

* Update Kconfig.projbuild

删除重复定义

* Update esp32_cgc_144_board.cc

修改音量控制,增加语音配网指令

* Add files via upload

* Delete main/boards/esp32-cgc-144/esp32_cgc_144_lcd_display.h

* Delete main/boards/esp32-cgc-144/esp32_cgc_144_lcd_display.cc

* Update board_control.cc

修改背光控制逻辑

* Update esp32_cgc_144_board.cc

跟随主代码更新

* Update config.h

删除不使用的引脚定义

* Update esp32_cgc_board.cc

跟随主代码更新,去除多余引脚

* Update esp32_cgc_board.cc

* Update board_control.cc

* Update config.h

* Update esp32_cgc_144_board.cc

* Update Kconfig.projbuild

* Update CMakeLists.txt

* Update CMakeLists.txt

先移除144开发板

* Update Kconfig.projbuild

先移除144开发板

* Delete main/boards/esp32-cgc-144 directory

先移除144开发板

* Update esp32_cgc_board.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-03-12 02:15:53 +08:00
Xiaoxia 2fdcda30ea fix esp-box-lite compiling error 2025-03-11 03:58:33 +08:00
hbs2001 4b46e4890d 添加了ESP32S3_KORVO2_V3官方lcd屏幕的支持 (#323)
* ESP32S3_KORVO2_V3添加官方开发板屏幕支持

* 修正笔误

* Update esp32s3_korvo2_v3_board.cc

---------

Co-authored-by: hbs2001 <wangyuchong@yuchong.wang>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-03-11 01:43:16 +08:00
virgil 236e21ffc2 Fix sensecap-watcher board bug (#322)
* fix: fixed the issue that the device enters re-network configuration mode by mistake when long pressing to start the device.

* fix: Do not shut down when connected to type-c.

* fix: fixed the issue that firmware verification failed during OTA for 32M flash.

* doc: update readme.

* fix: Solve the problem that the partition table configuration is not effective.
2025-03-11 01:38:42 +08:00
Terrence 9bc8be2f25 add IoT led control to kevin c3 2025-03-10 20:50:02 +08:00
Xiaoxia dd1139b169 Add discharging status 2025-03-09 19:18:10 +08:00
Terrence ad0c5312f8 Bump to 1.4.6 2025-03-09 00:52:28 +08:00
Terrence a66760348f fix esp32 compile error 2025-03-08 22:59:11 +08:00
HonestQiao 849b1a5ddc df-k10 update (#308)
* 添加DF设备ESP32-S3-K10

添加DFS3设备板子K10

* 完善DFRobot 行空板 K10适配

* Enable K10 RGB LED

* Enable K10 SetOutputVolume

* 优化K10按键处理

* 添加K10编译配置文件

* DF-K10 去掉多余PSRAM参数,修正README中PSRAM类型说明

---------

Co-authored-by: vonweller <154695311+vonweller@users.noreply.github.com>
2025-03-08 22:50:41 +08:00
Terrence 5568c70cb4 fix no oled display error 2025-03-08 19:56:56 +08:00
kautism e1b84e824c Add new language (#303)
* Add language

* Add ja-JP

* rollback fonts change

* fix cn's language file

* fix cn's font name not rollback

* Update esp32-s3-touch-lcd-1.46.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-03-08 16:21:55 +08:00
Terrence 0842b8f3c3 fix compiling error 2025-03-08 15:58:15 +08:00
香草味的纳西妲 9ead806dc1 feat: use python's zipfile to resolve packaging failure due to missing zip command (#305) 2025-03-08 15:18:18 +08:00
Xiaoxia 5c3e1a87d6 fixbug: bread-compact-wifi-lcd no backlight 2025-03-08 05:51:05 +08:00
Xiaoxia 4bf6fa8324 oled12832: move emotion to the left 2025-03-08 05:31:55 +08:00
Xiaoxia 8267f59a6a sending part of IoT states 2025-03-08 04:04:40 +08:00
Terrence b8bf6bea2e add update param to SendIotDescriptors 2025-03-08 03:26:15 +08:00
Terrence 968bf0e2eb move cores3_audio_codec.cc to boards 2025-03-08 02:58:02 +08:00
HonestQiao 1f803dec16 新增 DFRobot 行空板 K10 (#299)
* 添加DF设备ESP32-S3-K10

添加DFS3设备板子K10

* 完善DFRobot 行空板 K10适配

* Enable K10 RGB LED

* Enable K10 SetOutputVolume

* 优化K10按键处理

* 添加K10编译配置文件

---------

Co-authored-by: vonweller <154695311+vonweller@users.noreply.github.com>
2025-03-08 02:22:44 +08:00
yusuhua a1bade4e0f 增加LilyGo T-Circle-S3和T-CameraPlus-S3的屏幕背光和低功耗模式 (#304)
* 增加LilyGo T-Circle-S3和T-CameraPlus-S3的屏幕背光和低功耗模式

* 增加LilyGo T-Circle-S3和T-CameraPlus-S3的屏幕背光和低功耗模式
2025-03-08 02:21:05 +08:00
WMnologo febcfefd19 修改了protocol.cc文件中的SendIotDescriptors方法,实现将待发送的消息拆分后发送,以解决4g模块在mqtt发布消息过长时导致的网络异常的问题 (#302) 2025-03-08 02:10:00 +08:00
mtdxc 9335a41220 支持乐鑫的esp32-box-lite开发板 (#288)
* add esp-box-lite

* 增加adc按钮支持,响应esp32box-lite的音量上下键

* 注释改进

* 只对esp-box-lite启用CONFIG_SOC_ADC_SUPPORTED

---------

Co-authored-by: cqm <cqm@97kid.com>
2025-03-07 21:53:29 +08:00
Terrence 11c146f6ad fix led highlight when listening 2025-03-07 18:07:40 +08:00
Kevincoooool 55e000f922 增加Kevin SP V4开发板,以代替不能OTA的SP V3 (#293) 2025-03-07 17:57:48 +08:00
二九 bdc4da0650 Adds battery power to the current board (#249)
* Add files via upload

Added board description

* Add files via upload

New battery control

* Add files via upload

New battery control

* Add files via upload

Update format

* Add files via upload

Added screen version compatibility

* Add files via upload

Added screen version compatibility

* Add files via upload

修改程序风格

* Add files via upload

修改程序风格

* Add files via upload

更新背光

* Add files via upload

Update the backlight control program

* Add files via upload

Update the backlight control program

* Add files via upload

Update the backlight control program

* Add files via upload

Update function function implementation

* Add files via upload

Update function function implementation

* Add files via upload

Remove excess space

* Add files via upload

添加注释

* Add files via upload

添加程序注释
2025-03-07 17:55:52 +08:00
Terrence 0533bee83e fix board name empty 2025-03-07 04:10:52 +08:00
Xiaoxia b171ae17b2 Update CMakeLists.txt
1.4.5
2025-03-07 00:13:46 +08:00
HonestQiao 1b338fa71b 修复麦克风PDM数据位宽读取bug,唤醒也能正常使用 (#284)
* 修复麦克风PDM数据位宽读取bug,唤醒也能正常使用

* 重载NoAudioCodecSimplexPdm::Read()
2025-03-07 00:12:30 +08:00
HonestQiao d822fc7512 添加普通LED支持,支持不同状态亮度设置和呼吸灯效果 (#283) 2025-03-06 23:41:18 +08:00
Forairaaaaa 8147746bfa add atoms3r backlight iot support (#279)
* add atoms3r backlight iot support

* fix no backlight on error page
2025-03-06 21:45:16 +08:00
Terrence f1de536110 Don't feed wake word if listening 2025-03-06 07:13:17 +08:00
Terrence 70cb3410b0 set i2c freq to 400000 2025-03-06 06:27:36 +08:00
Terrence 20696b37f9 1.4.3: Low power popup & replace OledDisplay with Ssd1306Display 2025-03-06 05:22:06 +08:00
netseye 40be60ff9b Add M5CoreS3 IoT support (#277)
Co-authored-by: Jeakin <Jeakin@botu.cc>
2025-03-05 23:18:48 +08:00
Terrence f5008af2d1 add powersave to sensecap watcher 2025-03-05 20:04:13 +08:00
Terrence cead024698 Add Backlight and PowerSaveTimer 2025-03-05 09:37:13 +08:00
Terrence 3609aaa412 use original brightness 2025-03-05 09:27:43 +08:00
MakerM0 b587e45562 给magiclick-c3系列板子增加低功耗模式 (#273)
* 给magiclick-c3系列板子增加低功耗模式

light-sleep

* Update magiclick_c3_board.cc
2025-03-05 01:16:13 +08:00
Terrence df252e9049 Add missing DISPLAY_SPI_MODE 2025-03-04 23:59:29 +08:00
Terrence b18784bd8e sensecap_watcher: format code 2025-03-04 23:35:03 +08:00
Arx ed46a94d27 增加 乐鑫科技的ESP32-S3-BOX 开发板 (#266)
Co-authored-by: ZengDerong <derong.zeng@nvc-lighting.com>
2025-03-04 22:51:48 +08:00
Jiao Haoyang 8c826a81de Update config.h ST7789缺少一个宏定义 (#268) 2025-03-04 20:39:41 +08:00
virgil 2eb8cac140 Add SenseCAP Watcher (#241)
* feat: add sensecap watcher board.

* feat(sensecap): Add button function.

* fix: fix compilation error.

* style:Modify code style.

* fix: fix wake bug

* fix: fix compilation error & Enable click to toggle state.

* style:  move sensecap_audio_codec files to sensecap board

* fix: Optimize shutdown.
2025-03-04 20:38:53 +08:00
Terrence bdda575383 fix pm not enable 2025-03-04 08:16:16 +08:00
Terrence 6318dd1793 IoT电池状态读取 2025-03-04 07:56:07 +08:00
Terrence 1a808962e2 display优先级调为最低,避免滚动字幕消耗过多CPU 2025-03-04 07:33:49 +08:00
Terrence 5997ff2ac4 没有唤醒词的板子可以开启Auto Light Sleep,待机40~50mA 2025-03-04 06:27:11 +08:00
Terrence 5a71e1bdd6 MQTT会话超时与网络错误处理 2025-03-04 05:32:11 +08:00
Terrence c60f134093 支持分别关闭降噪和唤醒功能 2025-03-04 05:30:35 +08:00
Terrence 778e4f433f set User-Agent 2025-03-04 00:28:58 +08:00
Terrence 0f95444d62 Bump to 1.4.0 2025-03-03 21:41:41 +08:00
Terrence 01aab961ca set 20px font size 2025-03-03 15:25:55 +08:00
Terrence 7945da0c84 1.3.1 Updates
- Add startup and network failure sound effects
- 12864 OLED scroll text
- Internalization of volume actions
2025-03-03 07:29:22 +08:00
Terrence 36d98ce1a4 reboot => recheck 2025-03-03 07:17:32 +08:00
yusuhua a872ca1bff 增加LilyGo T-CameraPlus-S3的支持及修复LilyGo T-Circle-S3编译i2s_std_clk_config_t报'i2s_std_clk_config_t::ext_clk_freq_hz' does not match declaration (#239)
* 增加LILYGO T-CameraPlus-S3支持

* 增加LILYGO T-CameraPlus-S3支持

* Remove .DS_Store files

* Remove .DS_Store files

* 将T-Circle-S3与T-CamerPlus-S3的codec放入boards下

* 移除T-CameraPlus-S的README3图片展示

* revert README files

* delete lilygo-t-cameraplus-s3.jpg

---------

Co-authored-by: yusuhua <yusuhua@baidu.com>
2025-03-01 22:06:53 +08:00
ZhouKe 7c2a64cc86 add support for GC9A01_240X240 ST7735 _128X128 ST7789_240X240_7PIN (#244)
* add GC9A01 240*240
add ST7735  128*128
add ST7789   240*240 7pin

* fix config for ILI9341

---------

Co-authored-by: zk <982145@qq.com>
2025-03-01 02:38:11 +08:00
WMnologo cbf479f636 为星智开发板四个板级配置分别集成新的display文件,将oled的聊天信息显示改为滚动显示,加入了电量显示和睡眠功能 (#236) 2025-02-26 22:09:57 +08:00
Y1hsiaochunnn e55166b3b3 Add backlight control logic code to Waveshare ESP32-S3-Touch-AMOLED-1.8 (#235)
* Add backlight control logic code to Waveshare ESP32-S3-Touch-AMOLED-1.8

* Update esp32-s3-touch-amoled-1.8.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-02-26 21:59:33 +08:00
Terrence 9116dd6c07 Update QQ group number 2025-02-25 03:01:30 +08:00
Terrence 77db38ca4c lichuang c3 use smaller font to fit in partition 2025-02-25 02:32:40 +08:00
Terrence 80fd7736d5 fix sparkbot emotion color 2025-02-25 02:32:09 +08:00
Y1hsiaochunnn 799302e1e6 Added functionality to Waveshare ESP32-S3-Touch-AMOLED-1.8 (#228)
* Added functionality to Waveshare ESP32-S3-Touch-AMOLED-1.8

* Update board_control.cc

不要提交没有使用的功能到main分支

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-02-24 18:25:11 +08:00
Terrence ffe0b21d18 Fix yuying compiling 2025-02-24 17:55:11 +08:00
Terrence de783b7c57 Modify error messages 2025-02-24 15:47:44 +08:00
Terrence 6b855eae53 Fix SpiLcdDisplay 2025-02-24 15:46:29 +08:00
Terrence a23a88cc5d Bump to 1.3.0 2025-02-24 14:41:34 +08:00
Terrence c08a1a5310 fix compile warnings 2025-02-24 14:15:49 +08:00
Kevincoooool b0f0f4d4db 增加LCD屏幕类型\RGB屏参考\增加鱼鹰3.13寸LCD开发板 (#191)
* 增加LCD屏幕类型\RGB屏参考\增加鱼鹰3.13寸LCD开发板

1、增加LCD屏幕类型判断,lvgl port对不同屏幕初始化不一样
2、增加RGB屏使用参考
3、增加鱼鹰3.13寸LCD开发板

* Update lcd_display.h

* 修改xingzhi两个board为SpiLcdDisplay
2025-02-24 11:07:28 +08:00
MakerM0 20d52def0b add 神奇按钮2.5和c3-v2 (#206)
* add 神奇按钮2.5

* add 神奇按钮 c3-v2
2025-02-22 03:12:39 +08:00
WMnologo dc118d2f24 在README.md中加入了星智开发板。 修改了星智开发板的分支,对0.96oled、1.54tft屏幕细分了wifi和4g两个版本 (#210)
* Update README.md

* Add files via upload

* Update README.md

* Update README.md

* Update README.md

* 修改了星智的版级配置,对0.96oled、1.54tft屏幕细分了wifi和4g两个版本

* 修改了星知开发板支持,对0.96oled、1.54tft屏幕都细分了4g和wifi两个版本

---------

Co-authored-by: WMnologo <200~limaohui2016@icloud.com>
2025-02-22 02:55:26 +08:00
MakerM0 63d8b30c02 修改神奇按钮2.4板子的LED和按键功能 (#203)
* 修改LED和按键功能

* Update magiclick_2p4_board.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-02-21 04:32:09 +08:00
Kevincoooool add225ba56 改korvo板lcd cs引脚为NC,使用TCA9554扩展的IO3来拉低控制LCD CS (#199)
* 改korvo板lcd cs引脚为NC,使用TCA9554扩展的IO3来拉低控制LCD CS

* Update esp32s3_korvo2_v3_board.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-02-21 02:15:13 +08:00
Terrence 216ebc16bf fix compiling error on windows 2025-02-20 18:38:24 +08:00
飞雪无情 e123e37f7d add issue template 2025-02-20 15:22:29 +08:00
Terrence cd2fbf2a25 增加唤醒词播放添加设备验证码 2025-02-20 14:47:03 +08:00
Terrence 8659087f5d fix oled not displaying text 2025-02-20 14:21:41 +08:00
Terrence 455c71167e 给 xmini-c3 增加按键模式的控制 2025-02-20 05:04:35 +08:00
Terrence 01e82ba32e update restriction to release.py 2025-02-20 04:28:39 +08:00
Terrence d0e3426d9f Update docs 2025-02-20 04:15:56 +08:00
Terrence 1d1fe3dd2e Sync language option to wifi config page 2025-02-20 00:26:24 +08:00
Terrence 939564b175 Add English system sounds 2025-02-19 23:54:59 +08:00
VinJay d5594d01a3 添加多国语言支持 2025-02-18 19:33:07 +08:00
Kevincoooool 140aab8999 Update kevin-sp-v3_board.cc (#179)
* Update kevin-sp-v3_board.cc

* Update kevin-sp-v3_board.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-02-18 13:54:48 +08:00
Terrence 898109b348 add default role to system 2025-02-18 13:40:56 +08:00
Terrence 10a05db4a1 Bump to 1.2.1 2025-02-18 05:31:30 +08:00
Terrence 35940f8bda fix network error 2025-02-18 05:14:53 +08:00
Terrence db712fa078 remove unused code 2025-02-18 04:42:55 +08:00
Terrence ade1e3193d 优化c3上的内存使用 2025-02-18 03:05:00 +08:00
Terrence 93915cd624 add config.json to boards for auto building 2025-02-18 00:52:37 +08:00
Terrence ff18da5a29 fix display abort 2025-02-18 00:52:37 +08:00
Terrence 53cf361b58 remove unused code 2025-02-18 00:52:37 +08:00
zhou bbdbbc4f28 rename main/boards/xingzhi-cube-tft/compact_wifi_board_lcd.cc to main/boards/xingzhi-cube-tft/xingzhi-cube-tft.cc (#175)
* Update CMakeLists.txt

* Update Kconfig.projbuild

* Add files via upload

* Update CMakeLists.txt

* Update Kconfig.projbuild

* update

* update

* update

* update xingzhi-cube-tft

* add xingzhi-cube-tft backlight control

* rename main/boards/xingzhi-cube-tft/compact_wifi_board_lcd.cc to main/boards/xingzhi-cube-tft/xingzhi-cube-tft.cc
2025-02-17 20:33:00 +08:00
ooxxU 6b2752a498 外接唤醒模组的支持,可以有多种自定义唤醒词,进行唤醒小智,ESP32(非C3,非S3) 面包板上已支持 (#172)
* 外接唤醒模组的支持,可以有多种自定义唤醒词,进行唤醒小智
ESP32(非C3,非S3) 面包板上已支持

* Update application.cc

外接唤醒模组的支持,好处是可以有多种自定义唤醒词,进行唤醒小智
唤醒模组需要一个GPIO Pin,设置成输出模式+高电平
对该Pin进行唤醒设置,1秒内的低电平脉冲,也就是小智的一个Click
可以参考 ESP32 面包板中的 asr_button_ 按钮的功能函数调用
本人测试采用ASR-ProV1.0版本的唤醒模组,测试内容包括:自定义唤醒词,唤醒词打断,唤醒词回应
此代码兼容其他型号的唤醒模组,并没做限制模组型号,方便大家使用
Modify By MarsBear

* Update esp32_bread_board.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-02-17 18:47:21 +08:00
Xiaoxia da2168ea73 Update README.md 2025-02-17 01:11:11 +08:00
Terrence 9ec5f2f908 shorter message to display on small LCD 2025-02-17 00:56:40 +08:00
Terrence 3a71c1e895 Enhance device activation and OTA update process
- Add support for device activation with audio feedback
- Refactor OTA update flow to include activation code handling
- Update asset management for localized sound resources
- Improve error handling and device state management
- Reorganize binary asset includes and CMake configuration
2025-02-16 06:59:19 +08:00
Terrence 14a89cae33 update ml307 version 2025-02-15 02:09:26 +08:00
dujianmin 3a2f6acc9a 修改代码语音控制LCD屏幕的亮度 (#165)
* 添加了嘟嘟电路板chatx

* 多写了一个空格。修改了一下

* 修改了屏幕的右边和下边有条纹的问题

* 修改屏幕亮度可以语言控制
2025-02-15 00:30:36 +08:00
二九 5bce5c3f70 Added several boards for Waveshare (#159)
* Added SPD2010 display adaptation

Added SPD2010 display adaptation

* Added other channel configurations

Added functions for other channel applications

* Add new boards

Add new boards

* Add new boards

Add new boards

* Update display compatibility

Update display compatibility

* The lcd display.cc changes are restored

The lcd display.cc changes are restored

* Modify the SPD2010 adaptation to the board file

Modify the SPD2010 adaptation to the board file

* The lcd display.cc changes are restored

The lcd display.cc changes are restored

* New backlight control

New backlight control

* New backlight control

New backlight control

* Add backlight controls

Add backlight controls

* Delete main/boards/esp32-s3-touch-lcd-1.85c/esp32-s3-touch-lcd-1.85c directory

Add path error

* Add backlight controls

Add backlight controls

* Update variable name

Update variable name

* Eliminate unnecessary programs

Eliminate unnecessary programs

* Update esp32-s3-touch-lcd-1.46.cc

* Update esp32-s3-touch-lcd-1.85.cc

Eliminate unnecessary programs

* Update esp32-s3-touch-lcd-1.85c.cc

Eliminate unnecessary programs

* Update no_audio_codec.cc

* Update esp32-s3-touch-lcd-1.46.cc

* Update esp32-s3-touch-lcd-1.85.cc

* Update esp32-s3-touch-lcd-1.85c.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-02-14 17:53:22 +08:00
Kevincoooool 730275e4a7 增加Kevin SP V3开发板 (#160)
* 增加Kevin SP V3开发板

* Update config.h

* Update kevin-sp-v3_board.cc

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-02-14 17:37:30 +08:00
Forairaaaaa f183b881b7 fix display rgb order (#158) 2025-02-14 14:00:42 +08:00
zhou af79b70fb5 add xingzhi-cube-tft backlight control (#157)
* Update CMakeLists.txt

* Update Kconfig.projbuild

* Add files via upload

* Update CMakeLists.txt

* Update Kconfig.projbuild

* update

* update

* update

* update xingzhi-cube-tft

* add xingzhi-cube-tft backlight control
2025-02-14 13:56:04 +08:00
Terrence 1d1a0c43ba fix xmini-c3 toggle state 2025-02-14 05:20:59 +08:00
Terrence 8f6691859c remove unused code 2025-02-14 02:12:54 +08:00
MOV 4114ff213e fix; Moji GPIO conflict (#156)
* fix:Modify the README and add Moji images

* fix: Moji LCD initialization configuration.

* fix: DISPLAY_MIRROR_X false >> true

* fix: Moji GPIO conflict

* fix: Moji GPIO conflict
2025-02-14 01:49:18 +08:00
zhou 83d6fa9d26 删除无名科技ESP32S3星智开发板未使用的TOUCH_BUTTON;同时添加星智的TFT版本 (#155)
* Update CMakeLists.txt

* Update Kconfig.projbuild

* Add files via upload

* Update CMakeLists.txt

* Update Kconfig.projbuild

* update

* update

* update

* update xingzhi-cube-tft
2025-02-14 01:45:56 +08:00
Forairaaaaa d7f41b4b4d add atoms3 + atomic echo base support (#154) 2025-02-14 01:36:08 +08:00
Li Junru fed8cb4d86 feat: Add ESP SparkBot tracked chassis Support (#144)
* feat: Add ESP SparkBot tracked chassis Support

* feat: remove chassis.cc file to esp-sparkbot

---------

Co-authored-by: Liu Ruichao <liuruichao@espressif.com>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-02-14 01:30:00 +08:00
Forairaaaaa bafc9def1a add no echo base check (#152) 2025-02-14 01:19:48 +08:00
Terrence 8ace1095e9 使用定时器调节屏幕亮度 2025-02-14 01:15:10 +08:00
Kevincoooool 9b8db4a551 iot增加屏幕背光亮度调节 (#150) 2025-02-14 00:21:46 +08:00
Terrence b889355d8d 修复唤醒后亮红灯不说话的bug 2025-02-12 05:37:34 +08:00
ooxxU 5e406b481c 新增 ESP32 系列开发板 对 OLED-0.96 SSD1306 屏幕显示的支持 (#143)
1. 支持 ESP32 系列开发板: DevKitC / NodeMcu-32S / GoouuuESP32 / ESP32 DoIt / ESP-32S
2. 注意: 非ESP32-C3 / 非ESP32-S3
2025-02-12 02:41:23 +08:00
zhou e19604b21e 增加无名科技的ESP32S3星智开发板 (#142)
* Update CMakeLists.txt

* Update Kconfig.projbuild

* Add files via upload

* Update CMakeLists.txt

* Update Kconfig.projbuild

* update

* update
2025-02-12 02:40:02 +08:00
Terrence ac93e88d17 add uuid to board 2025-02-11 16:56:23 +08:00
Terrence 2d718a0cbc graceful code 2025-02-09 01:32:26 +08:00
Wang Yihua 24c10a607c feat: support JC3636W518 of taiji-pi-s3 board. (#131) 2025-02-09 00:55:30 +08:00
dujianmin 380f702637 修复了LCD屏幕底部条纹 (#132)
* 添加了嘟嘟电路板chatx

* 多写了一个空格。修改了一下

* 修改了屏幕的右边和下边有条纹的问题
2025-02-08 14:03:33 +08:00
Terrence 4aef3d2a4e update version to 1.1.2 2025-02-08 13:56:36 +08:00
dujianmin bc800921cf 添加了嘟嘟电路板chatx (#128)
* 添加了嘟嘟电路板chatx

* 多写了一个空格。修改了一下
2025-02-06 23:24:39 +08:00
Terrence 256a16e2fe remove the lvgl draw thread to save 8kb sram 2025-02-05 14:57:34 +08:00
Terrence 554152cd00 fix es8388 input/output volume 2025-02-04 23:49:58 +08:00
SunnyBoy-y 503c7d8a2a 正点原子esp32s3开发板音量问题修正 (#125)
* Update config.h

添加音量增益设置

* Update config.h

音量增益设置

* Update atk_dnesp32s3.cc

音量增益设置

* Update es8388_audio_codec.h

音量增益设置

* Update es8388_audio_codec.cc

音量增益设置
2025-02-04 23:10:49 +08:00
Terrence 84c932da4a CPU usage depending on boards 2025-02-04 14:37:11 +08:00
Terrence a0adbfd774 fix display issues 2025-02-04 14:37:11 +08:00
MOV 252755f615 Moji LCD configuration (#122)
* fix:Modify the README and add Moji images

* fix: Moji LCD initialization configuration.

* fix: DISPLAY_MIRROR_X false >> true
2025-02-04 12:33:06 +08:00
Terrence 564680da92 lichuang c3 use 20px fonts 2025-02-04 00:32:37 +08:00
Terrence c36e25ce3f upgrade to LVGL 9 2025-02-03 23:43:07 +08:00
Terrence e434cd1aed improve wifi experience 2025-02-02 19:06:54 +08:00
Terrence e49c520349 fix websocket mode not responding after close conn 2025-02-02 18:13:34 +08:00
Terrence 5be81638aa edit version upload 2025-02-01 23:09:40 +08:00
Terrence d840699bbf edit signal display 2025-02-01 23:08:41 +08:00
Terrence c34cf27ccb fix surprised emotion 2025-02-01 11:06:17 +08:00
ooxxU d44c01a5a3 支持 ESP32 系列开发板 (#116)
* 1. 支持 ESP32系列开发板: DevKitC / NodeMcu-32S / GoouuuESP32 / ESP32 DoIt / ESP-32S
2. 注意:非ESP32-C3 / 非ESP32-S3

* 补图片: M5Stack  Atom Matrix + ES8311 + NS4150B

* 修订 ESP32 系列开发板 面包板 成品图

* 修订: ESP32系列开发板 README.md

* 修订: 移除对首页修改的这部分内容,跳转链接添加至《百科全书》的目录里。
2025-02-01 11:03:49 +08:00
Terrence 3d3f2ad96d fix tudouzi board compile 2025-01-28 12:58:36 +08:00
Terrence ce26b8d3a1 toggle and hold mode cannot work together 2025-01-28 09:31:13 +08:00
Kevincoooool 3816f7eb57 add tudouzi board (#85)
* add tudouzi board

* Update Kconfig.projbuild

fix spaces

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-01-28 09:23:52 +08:00
MOV f0a683578a fix: Moji LCD initialization configuration (#114)
* fix:Modify the README and add Moji images

* fix: Moji LCD initialization configuration.
2025-01-28 01:41:30 +08:00
Xiaoxia c564d24cf1 Fix UI condition racing (#110)
* move display init code to board

* fix ui condition race
2025-01-25 15:35:00 +08:00
Xiaoxia d2cc2e0090 move display init code to board (#109) 2025-01-25 15:17:37 +08:00
Wiking_Xu e48370ffcd 增加正点原子两款ESP32S3板子 (#107)
* ESP32S3-BOX
* ESP32S3开发板
2025-01-25 15:11:50 +08:00
Terrence 046ca3e0c9 fix upgrade icon 2025-01-25 12:44:31 +08:00
Terrence e4d80060a2 fix lcd font error 2025-01-25 00:41:49 +08:00
MOV fbf90d1b17 fix:Modify the README and add Moji images (#106) 2025-01-24 12:17:49 +08:00
Terrence e2ef952bcf fix image title 2025-01-24 04:26:52 +08:00
Terrence 10353d7b9f update v1 docs 2025-01-24 04:24:50 +08:00
Terrence 8992c24afb fix atommatrix 2025-01-24 03:09:19 +08:00
Terrence ef69840907 move fonts configuration to boards 2025-01-24 03:00:56 +08:00
ooxxU 2e40ad0e8a 1. 支持 M5Stack Atom Matrix + ES8311 + NS4150B (#105)
2. 支持 ESP32 4M 的设备,修订 NoAudioCodec 兼容 ESP32
2025-01-24 02:55:03 +08:00
Terrence 7335362bc1 fix magiclick color 2025-01-24 00:21:42 +08:00
Terrence d75b01984c fixbug: add virtual 2025-01-23 23:50:43 +08:00
Terrence 633b52238d remove extra calls 2025-01-23 23:42:34 +08:00
MOV 7a40c084ba Add Moji board (#103)
* Boards add Moji adaptation

* add README
2025-01-23 23:42:00 +08:00
MakerM0 64058e4093 update magiclick 2.4 (#102)
* update magiclick 2.4

* Update magiclick_2p4_board.cc
2025-01-23 23:35:45 +08:00
Terrence cfea65a18e fix lilygo fonts 2025-01-23 23:21:24 +08:00
Terrence 1ac5f20f2a remove system resets 2025-01-23 23:12:48 +08:00
Terrence eefee4f834 fix lichuang c3 font size 2025-01-23 23:12:36 +08:00
Terrence c2dd384ed1 add scripts folder 2025-01-23 22:45:26 +08:00
Terrence c46052958f fix c3 compile 2025-01-23 22:44:44 +08:00
Terrence 2026472d48 fix font declare 2025-01-23 21:52:27 +08:00
Terrence ea605a8e44 ajust code style 2025-01-23 21:51:59 +08:00
LILYGO_L e1ff22e4d6 Adapt for LilyGO-T-Circle-S3 device (#89)
* Adapt for LilyGO-T-Circle-S3 device

* Adapt for LilyGO-T-Circle-S3 device

* Remove comments and modify the size of the lilygo-t-circle-s3 image

* Modify the code style and format to Google C++

* Modify the code style and format to Google C++

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-01-23 20:58:14 +08:00
MakerM0 6c67c99197 add board magiclick-c3 (#99) 2025-01-23 20:51:02 +08:00
HonestQiao 87425b821c Fix: Prevent death restart caused by setting button pin to GPIO_NUM_NC (#98) 2025-01-23 20:49:50 +08:00
Terrence 84f5674359 add more fonts for version 1.0.0 2025-01-23 13:50:22 +08:00
Terrence a5d8db6bbb add pa_pin check 2025-01-23 08:18:01 +08:00
Terrence 27b8221808 fix rgb endian 2025-01-23 08:15:30 +08:00
Kevincoooool 3afe6cb725 fix:es8311 share i2s wake bug (#95) 2025-01-23 08:12:38 +08:00
Terrence a4a06cf76d add toggle mode to lichuang dev boards 2025-01-20 10:48:07 +08:00
ZhouKe 3c719d5c91 使用imgfont在LCD显示器显示彩色表情图标 (#77)
* 使用imgfont在LCD显示器显示彩色表情图标

* fix one emotion

---------

Co-authored-by: zk <982145@qq.com>
2025-01-19 04:29:23 +08:00
ZhouKe 48229607d2 增加对使用LCD的面包板的支持 (#79)
* 增加对使用LCD的面包板的支持

* Update compact_wifi_board_lcd.cc

remove #if 0

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-01-19 04:07:46 +08:00
Terrence b19f6498b8 remove default sound volume 2025-01-19 03:57:07 +08:00
Terrence e2c5578ede fixbug: getting empty value 2025-01-19 03:53:48 +08:00
小黄同学 ea0333c0ce 增加 虾哥mini-c3单击按钮触发连续对话 (#74)
Signed-off-by: xiaohuangtx <hys578084@126.com>
2025-01-17 16:39:18 +08:00
Terrence d1d38df397 upgrade component versions 2025-01-17 14:41:18 +08:00
EMORobots 958517b931 Add esp sparkbot support (#70)
* audio interrupt

* support esp launchpad online download

* Update config.toml

config url

* Update README.md

新窗口打开

* Update config.toml

* Update config.toml

* Update config.toml

* Update README.md

* Update config.toml

* Update config.toml

* Update config.toml

* fix config file and bin name error

fix config file and bin name error

* add Esp Launchpad in readme

* Update config.toml

* update readme

* fit all board online download

* Update config.toml

firmware url to releases

* Update README.md

* Update README_en.md

* Revert "Update config.toml"

This reverts commit 1fe349d5b407fb33033490308372bdfcb621e5d7.

* Revert "Update README.md"

This reverts commit 8fc7dc8e68a47f0318c154eafd3b1d36c6f4f1f7.

* Revert "Update README_en.md"

This reverts commit 346ab09b90dafdaa6112bca50d8925634a87b052.

* 增加esp SparkBot

* sparkbot work ok

* Update config.h

* delete esp launchpad

* Update application.cc

* esp-sparkbot picture

* Resolve display io and PA io conflicts on Esp Sparkbot board

* Update CMakeLists.txt

Keep the board type consistent with the folder name.

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-01-16 15:09:37 +08:00
Terrence d0081cfb43 add atoms3r echo base 2025-01-16 05:57:53 +08:00
Terrence 7731f5f1ac add upgrade alert message 2025-01-16 05:43:07 +08:00
Terrence e98c80df44 fix idf 5.4 compile error 2025-01-16 05:11:55 +08:00
Y1hsiaochunnn bdbbff302d Added ESP32-S3-Touch-AMOLED-1.8 support (#63)
* Added ESP32-S3-Touch-AMOLED-1.8 support

* Add ESP32-S3-Touch-AMOLED-1.8 support README

* Change the default image format

---------

Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-01-14 23:49:51 +08:00
Xiaoxia a9244470ef Merge pull request #65 from Forairaaaaa/add-menuconfig-guide
添加 sdkconfig 配置指导
2025-01-14 23:44:15 +08:00
Forairaaaaa 7e6a3d9785 add cores3 guide 2025-01-14 16:27:21 +08:00
Forairaaaaa fe042050e5 add atom s3r build guide 2025-01-14 16:17:55 +08:00
Xiaoxia 9ad4cd0367 Merge pull request #62 from m5stack/atoms3r-echo-base
添加 M5Stack AtomS3R + AtomicEchoBase 支持
2025-01-14 15:32:34 +08:00
Forairaaaaa 24298bfb7d Add M5Stack AtomS3R + AtomicEchoBase support 2025-01-13 17:53:17 +08:00
Terrence b00bfaf181 delete background task before upgrade 2025-01-13 06:49:01 +08:00
Terrence 03020d8e2e oled display 400k 2025-01-13 05:33:04 +08:00
Terrence 1928a662de static buffer 2025-01-13 05:32:24 +08:00
Terrence 58c1cd81c6 reduce memory usage of ota 2025-01-13 05:00:14 +08:00
Terrence 7049522fc9 add 8M partition table 2025-01-13 03:20:07 +08:00
Terrence 81582dff65 ignore VERSIONS_CONFIG_PATH 2025-01-13 03:19:39 +08:00
Terrence 678147a9bd add open source url to xmini c3 2025-01-12 17:43:42 +08:00
Terrence 679130c0ae remove the special code for box3 lcd 2025-01-12 17:31:34 +08:00
Terrence bfdee9b721 fix cores3 header 2025-01-12 17:11:08 +08:00
Terrence 3655fc89d2 wifi connect version 2 2025-01-12 10:25:43 +08:00
Terrence a868d7e5d1 fix esp box3 headers 2025-01-11 01:53:18 +08:00
Terrence b3e39b6a22 fixbug: audio input stutters 2025-01-11 01:52:33 +08:00
Xiaoxia 6bb9ee3441 Merge pull request #45 from HeyGoda/main
适配立创·实战派ESP32-C3开发板硬件:boot按键、麦克风、喇叭、音频编解码芯片、显示屏等
2025-01-09 03:07:00 +08:00
Xiaoxia 02079a35ab Merge pull request #46 from eltociear/add-japanese-readme
docs: add Japanese README
2025-01-09 03:04:37 +08:00
Ikko Eltociear Ashimine 3832337b78 docs: add Japanese README
I created Japanese translated README.
2025-01-08 22:56:30 +09:00
xieyaze ddf8738c00 适配立创·实战派ESP32-C3开发板硬件:boot按键、麦克风、喇叭、音频编解码芯片、显示屏等 2025-01-08 17:47:58 +08:00
Xiaoxia c177ae176b Merge pull request #44 from Kevincoooool/add_korvo_board
add korvo board
2025-01-08 00:06:57 +08:00
Xiaoxia 7de0fc7d54 Update Kconfig.projbuild
remove spaces
2025-01-08 00:06:25 +08:00
Xiaoxia 1d1bec1320 Update config.h
remove unused code
2025-01-08 00:05:47 +08:00
Xiaoxia bf483d0768 Update esp32s3_korvo2_v3_board.cc
remove unused code
2025-01-08 00:04:19 +08:00
Kevincoooool e7ec0ed30e add korvo board 2025-01-07 23:36:36 +08:00
Terrence a8bceee3c7 add reset wifi to boot button 2025-01-07 22:52:52 +08:00
Terrence b3dd2461d2 add language switch 2025-01-07 05:21:10 +08:00
Terrence 9a4deeb78f add English readme 2025-01-07 05:19:09 +08:00
Terrence 9adb9f66a2 rename to xmini c3 2025-01-07 05:18:55 +08:00
Xiaoxia 7cca1d80c1 Merge pull request #39 from 78/terrence_board
add terrence c3 board
2025-01-06 16:40:41 +08:00
Andy 6be4cdc559 add terrence c3 board 2025-01-06 16:14:07 +08:00
Xiaoxia 2f1c133d72 Update README.md
resize images to 240
2025-01-06 04:29:59 +08:00
Xiaoxia ece58cdf21 Update README.md
resize images
2025-01-06 04:29:22 +08:00
Terrence fd00ba9bc0 add opensource boards to README 2025-01-06 04:25:36 +08:00
Xiaoxia 0033349eba Merge pull request #31 from 78/led_strip
feat: add led strip class
2025-01-06 01:30:55 +08:00
Terrence b3cef41d77 fix display for magicclick 2025-01-06 01:26:39 +08:00
Terrence b94c8a6e8b rename St7789 to LCD 2025-01-05 21:20:30 +08:00
Terrence c7c5b74d37 reconstruct led control 2025-01-05 19:36:00 +08:00
Andy 495b949d77 fix boot button gpio 2025-01-05 19:35:38 +08:00
Andy 2e6a278b0d feat: add led strip class 2025-01-05 19:35:38 +08:00
Terrence 1820a83256 use espressif component 2025-01-05 03:34:28 +08:00
Xiaoxia 7ed076ee83 Merge pull request #37 from MakerM0/main
add 神奇按钮 MagiClick_2.4 board support
2025-01-05 01:41:37 +08:00
MakerM0 90069f0f72 add 神奇按钮Magiclick_2.4 2025-01-04 15:24:40 +08:00
MakerM0 22ad538eb7 Merge branch 'main' of https://github.com/MakerM0/xiaozhi-esp32 2025-01-03 17:03:41 +08:00
Xiaoxia ad5f687734 Update README.md
Add star history
2025-01-03 01:02:58 +08:00
Xiaoxia 7128182cf3 Merge pull request #35 from whble/main
The repair screen displays ESP_BOX3
2025-01-03 00:51:22 +08:00
Xiaoxia ded4f40e34 Update esp_box3_board.cc
fix spacing
2025-01-03 00:50:58 +08:00
EMORobots 78a89be4e6 Merge pull request #1 from 78/main
Update README.md
2025-01-02 19:37:41 +08:00
Xiaoxia 498fd08cc8 Update README.md
更新 QQ 群号码
2025-01-02 17:42:07 +08:00
whble f98be27000 fix display for esp32 box3 2025-01-01 22:43:20 +08:00
whble 11a3bb3f35 The repair screen displays ESP_BOX3 2024-12-30 02:57:34 +08:00
Xiaoxia 5675d5eca9 Merge pull request #33 from m5stack/m5cores3
Add M5Stack CoreS3 board support
2024-12-28 21:55:35 +08:00
imliubo 76990c8c0e cleanup code
Signed-off-by: imliubo <imliubo@makingfun.xyz>
2024-12-26 13:38:01 +08:00
Xiaoxia 6654d6348e Update README.md
更新群号
2024-12-26 13:28:32 +08:00
Forairaaaaa 9626b0b71b add m5stack cores3 support 2024-12-26 12:24:53 +08:00
MakerM0 e4ebcb0b4a add board magiclick v2.4 2024-12-21 11:13:32 +08:00
Xiaoxia 8ae4f03417 Merge pull request #28 from Kevincoooool/fix_c3_bug
Add esp32c3 efuse setting & fix components version
2024-12-16 23:01:27 +08:00
Xiaoxia 9f0ee369ad Update idf_component.yml
do not use old version
2024-12-16 23:00:40 +08:00
Xiaoxia 548e1d9890 Update kevin_box_board.cc
format code
2024-12-16 22:57:36 +08:00
Xiaoxia e1e14e45c5 Update sdkconfig.defaults
Fix i2c runtiime error
2024-12-16 22:54:42 +08:00
Kevincoooool 894e872cfd Add esp32c3 efuse setting & fix components version 2024-12-13 09:35:40 +08:00
Terrence 051a0ba483 add iot speaker for boards 2024-12-07 06:19:59 +08:00
Terrence d31901e9e5 add iot framework 2024-12-06 11:09:17 +08:00
Xiaoxia 43b1046df5 Merge pull request #24 from MakerM0/main
add pdm mic
2024-12-06 05:43:08 +08:00
MakerM0 cf3dcfa1fd add pdm mic 2024-12-05 15:40:41 +08:00
MakerM0 c88f5eb473 Update no_audio_codec.h
add pdm mic
2024-12-05 15:39:35 +08:00
Terrence 4042897857 use gpio47 and active low as touch button 2024-12-05 02:55:24 +08:00
Terrence bcfd120b00 新的opus封装以及优化const会导致的内存拷贝 2024-12-04 02:12:20 +08:00
Terrence 9c1f8a1d06 bump to 0.9.5 2024-12-03 22:03:22 +08:00
Terrence 313dd712e3 fix boot button 2024-12-03 22:02:47 +08:00
Terrence 37773c9c15 fix compile warnings 2024-12-03 12:33:33 +08:00
Terrence cabd1faaea bump to 0.9.4 2024-12-03 11:21:43 +08:00
Xiaoxia 4c222acd46 Merge pull request #22 from Kevincoooool/fix_lvgl_offset
Add configurable offset to SPI screen
2024-12-03 09:48:14 +08:00
Xiaoxia 60052d80fb Merge pull request #23 from 78/ui
面包板增加触摸对话按钮,使用GPIO45
2024-12-03 09:44:50 +08:00
Terrence 064341c5ef 面包板增加触摸对话按钮,使用GPIO45 2024-12-03 09:43:41 +08:00
Kevincoooool 43a0cbeebc Add configurable offset to SPI screen 2024-11-30 19:00:05 +08:00
Xiaoxia 5e7c5da337 Merge pull request #21 from 78/ui
fit the memory usage for esp32c3
2024-11-29 11:09:01 +08:00
Terrence 436ff2b906 fit the memory usage for esp32c3 2024-11-29 11:06:05 +08:00
Xiaoxia e9de52647c Merge pull request #20 from 78/ui
v0.9.2
2024-11-25 04:48:43 +08:00
Terrence ff28586c35 add hold to talk test 2024-11-25 04:44:27 +08:00
Terrence e4382faee3 charger current set to 400mA 2024-11-25 04:33:06 +08:00
Terrence b07ec1a148 连接wifi时按下boot重置wifi 2024-11-25 02:27:21 +08:00
Terrence 472219d5bf update protocol to support manual response mode 2024-11-25 00:59:03 +08:00
Terrence aa806f676e fix duplex bug 2024-11-23 16:14:24 +08:00
Xiaoxia 2d7a127c27 Merge pull request #18 from 78/ui
add network error callback
2024-11-20 03:29:43 +08:00
Terrence c79d6cf4d8 add network error callback 2024-11-20 03:28:52 +08:00
Xiaoxia bb43cf5876 Merge pull request #17 from 78/ui
add power save timer
2024-11-19 08:56:22 +08:00
Terrence 874adc80b8 add power save timer 2024-11-19 08:50:47 +08:00
Xiaoxia 6dcc64459f Merge pull request #16 from 78/ui
加入中文UI
2024-11-18 20:41:27 +08:00
Terrence 6bfe2719a8 加入中文UI 2024-11-18 06:17:39 +08:00
Terrence 794e6f4bef add websocket protocol 2024-11-16 05:49:35 +08:00
Xiaoxia cabb29a1bb Merge pull request #15 from 78/mqtt
adjust board structure
2024-11-16 03:27:11 +08:00
Terrence a494c41367 adjust board structure 2024-11-16 03:25:55 +08:00
Xiaoxia 384426e03a Merge pull request #14 from 78/mqtt
set power safe mode
2024-11-15 23:18:57 +08:00
Terrence 15891f5840 set power safe mode 2024-11-15 23:07:20 +08:00
Xiaoxia 1deb477e0e Merge pull request #13 from 78/mqtt
add settings
2024-11-15 05:31:23 +08:00
Terrence 58de3852c5 add settings 2024-11-15 04:44:53 +08:00
Xiaoxia 01fe53c4c7 Merge pull request #12 from 78/mqtt
bump to 0.8.0
2024-11-14 23:23:51 +08:00
Terrence ec918748f1 bump to 0.8.0 2024-11-14 23:15:43 +08:00
Xiaoxia ddb375173e Merge pull request #10 from Justin-sky/main
Delete useless code.
2024-11-07 01:53:25 +08:00
Terrence 35cd80feb7 fixbug: internal memory not enough 2024-11-06 22:48:21 +08:00
Justin 77044b410f Delete useless code. 2024-11-06 15:55:20 +08:00
Terrence 20deb2b777 add st7789 2024-11-06 10:06:05 +08:00
Terrence 3575448373 move all hardware init to boards 2024-11-06 06:18:56 +08:00
Terrence 55ff4e1f74 move wifi/ml307 to boards folder 2024-11-06 03:40:49 +08:00
Terrence 82030d003d rename CreateAudioDevice to GetAudioDevice 2024-11-05 21:17:56 +08:00
Terrence 458ac2c999 rename files 2024-11-05 20:15:00 +08:00
Terrence bc4b0a0bb1 move audio enable/disable in ws connect/discconect 2024-11-05 16:50:29 +08:00
Terrence 8fccef2c52 remove unnecessary mutex (use Schedule) 2024-11-05 13:55:42 +08:00
Terrence 92efdc9b64 add Board::GetJson 2024-11-03 05:54:15 +08:00
Terrence 5006e5bda1 add ref resampler 2024-11-03 01:34:18 +08:00
Terrence 91c7774117 bump to 0.6.2 2024-11-01 15:19:37 +08:00
Terrence b0bc81b921 add new boards 2024-11-01 14:26:02 +08:00
Terrence a701d5918e add abort command 2024-10-31 05:57:13 +08:00
Terrence 6f5f5a0642 use protocol 3 2024-10-30 06:58:29 +08:00
Terrence 3e1e576272 update ml307 component version 2024-10-29 00:26:05 +08:00
Terrence 33518dca2b add config files for known boards 2024-10-29 00:22:29 +08:00
Terrence fe05a039a2 fix v0.4.x board name 2024-10-25 12:46:33 +08:00
Terrence 32a5977fcc update to 0.4.1 2024-10-25 12:29:23 +08:00
Terrence 357cd95693 fix audio data overflow 2024-10-25 12:25:22 +08:00
Terrence 2833142870 update docs 2024-10-25 10:05:01 +08:00
Terrence a2487f46c8 ES8311 + ES7210 2024-10-24 09:53:08 +08:00
Terrence 4c6da771ec add versions.py for ota upgrade 2024-10-17 18:34:51 +08:00
Terrence ad8033fb47 bump to 0.3.3 2024-10-15 04:02:41 +08:00
Terrence caae7cb930 add volume up gpio button 2024-10-15 03:56:35 +08:00
Terrence 548b854777 bump to 0.3.2 2024-10-11 00:59:03 +08:00
Terrence 56560685b1 add tcp transport support 2024-10-10 21:41:20 +08:00
Terrence 073fd4046e fix frame size calculation 2024-10-04 04:26:08 +08:00
Terrence 2be6217b1f v0.3.1 2024-10-03 06:41:16 +08:00
Terrence 879f1cc21e reconstruct application 2024-10-03 06:39:22 +08:00
Terrence e59be04394 update to 4MB partition 2024-10-01 15:58:03 +08:00
Terrence d26e8d25ff support ML307, new version 0.3.0 2024-10-01 14:16:12 +08:00
Terrence 8e9be5abc7 add websocket protocol 2024-09-26 16:19:54 +08:00
Terrence 7fd72aa8e2 add more wake word packets 2024-09-26 16:19:06 +08:00
Terrence 0396b4a91c fix bugs 2024-09-25 03:44:28 +08:00
Terrence 53b08843d4 add vad to detection and communication 2024-09-17 11:26:07 +08:00
Terrence 797f9c2515 start AP if WiFi station fails to connect 2024-09-15 14:03:11 +08:00
Terrence cebe41c2d0 update opus encoder version 2024-09-14 15:00:48 +08:00
Terrence e46016b3fc add testing 2024-09-14 14:58:03 +08:00
Terrence 140ed56ee9 增加 RGB 灯亮的注意事项 2024-09-12 21:48:47 +08:00
Terrence 1093bce089 add usage to readme 2024-09-12 19:53:14 +08:00
1428 changed files with 104416 additions and 1256 deletions
+126
View File
@@ -0,0 +1,126 @@
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: ExceptShortType
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- cJSON_ArrayForEach
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<esp_.*\.h>'
Priority: 1
- Regex: '^<driver/.*\.h>'
Priority: 1
- Regex: '^<.*\.h>'
Priority: 2
- Regex: '^<.*'
Priority: 3
- Regex: '.*'
Priority: 4
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseTab: Never
@@ -0,0 +1,103 @@
name: Installation or build bug report
description: Report installation or build bugs
labels: ['bug']
body:
- type: checkboxes
id: checklist
attributes:
label: Answers checklist.
description: Before submitting a new issue, please follow the checklist and try to find the answer.
options:
- label: I have read the documentation [XiaoZhi AI Programming Guide](https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb) and the issue is not addressed there.
required: true
- label: I have updated my branch (master or release) to the latest version and checked that the issue is present there.
required: true
- label: I have searched the issue tracker for a similar issue and not found a similar issue.
required: true
- type: input
id: xiaozhi_ai_version
attributes:
label: XiaoZhi AI version.
description: On which XiaoZhi AI version does this issue occur on? Run `git describe --tags` to find it.
placeholder: ex. v1.1.0-44-g140aab8
validations:
required: true
- type: dropdown
id: operating_system
attributes:
label: Operating System used.
multiple: false
options:
- Windows
- Linux
- macOS
validations:
required: true
- type: dropdown
id: build
attributes:
label: How did you build your project?
multiple: false
options:
- Command line with CMake
- Command line with idf.py
- CLion IDE
- VS Code IDE/Cursor
- Other (please specify in More Information)
validations:
required: true
- type: dropdown
id: windows_comand_line
attributes:
label: If you are using Windows, please specify command line type.
multiple: false
options:
- PowerShell
- CMD
validations:
required: false
- type: textarea
id: expected
attributes:
label: What is the expected behavior?
description: Please provide a clear and concise description of the expected behavior.
placeholder: I expected it to...
validations:
required: true
- type: textarea
id: actual
attributes:
label: What is the actual behavior?
description: Please describe actual behavior.
placeholder: Instead it...
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce.
description: 'How do you trigger this bug? Please walk us through it step by step. If this is build bug, please attach sdkconfig file (from your project folder). Please attach your code here.'
value: |
1. Step
2. Step
3. Step
...
validations:
required: true
- type: textarea
id: debug_logs
attributes:
label: Build or installation Logs.
description: Build or installation log goes here, should contain the backtrace, as well as the reset source if it is a crash.
placeholder: Your log goes here.
render: plain
validations:
required: false
- type: textarea
id: more-info
attributes:
label: More Information.
description: Do you have any other information from investigating this?
placeholder: ex. Any more.
validations:
required: false
+115
View File
@@ -0,0 +1,115 @@
name: Runtime bug report
description: Report runtime bugs
labels: ['bug']
body:
- type: checkboxes
id: checklist
attributes:
label: Answers checklist.
description: Before submitting a new issue, please follow the checklist and try to find the answer.
options:
- label: I have read the documentation [XiaoZhi AI Programming Guide](https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb) and the issue is not addressed there.
required: true
- label: I have updated my firmware to the latest version and checked that the issue is present there.
required: true
- label: I have searched the issue tracker for a similar issue and not found a similar issue.
required: true
- type: input
id: xiaozhi_ai_firmware_version
attributes:
label: XiaoZhi AI firmware version.
description: On which firmware version does this issue occur on?
placeholder: ex. v1.2.1_bread-compact-wifi
validations:
required: true
- type: dropdown
id: operating_system
attributes:
label: Operating System used.
multiple: false
options:
- Windows
- Linux
- macOS
validations:
required: true
- type: dropdown
id: build
attributes:
label: How did you build your project?
multiple: false
options:
- Command line with CMake
- Command line with idf.py
- CLion IDE
- VS Code IDE/Cursor
- Other (please specify in More Information)
validations:
required: true
- type: dropdown
id: windows_comand_line
attributes:
label: If you are using Windows, please specify command line type.
multiple: false
options:
- PowerShell
- CMD
validations:
required: false
- type: dropdown
id: power_supply
attributes:
label: Power Supply used.
multiple: false
options:
- USB
- External 5V
- External 3.3V
- Battery
validations:
required: true
- type: textarea
id: expected
attributes:
label: What is the expected behavior?
description: Please provide a clear and concise description of the expected behavior.
placeholder: I expected it to...
validations:
required: true
- type: textarea
id: actual
attributes:
label: What is the actual behavior?
description: Please describe actual behavior.
placeholder: Instead it...
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce.
description: 'How do you trigger this bug? Please walk us through it step by step. Please attach your code here.'
value: |
1. Step
2. Step
3. Step
...
validations:
required: true
- type: textarea
id: debug_logs
attributes:
label: Debug Logs.
description: Debug log goes here, should contain the backtrace, as well as the reset source if it is a crash.
placeholder: Your log goes here.
render: plain
validations:
required: false
- type: textarea
id: more-info
attributes:
label: More Information.
description: Do you have any other information from investigating this?
placeholder: ex. Any more.
validations:
required: false
@@ -0,0 +1,34 @@
name: Feature request
description: Suggest an idea for this project.
labels: ['enhancement']
body:
- type: markdown
attributes:
value: |
* We welcome any ideas or feature requests! Its helpful if you can explain exactly why the feature would be useful.
* There are usually some outstanding feature requests in the [existing issues list](https://github.com/78/xiaozhi-esp32/labels/enhancement), feel free to add comments to them.
* If you would like to contribute, please read the [contributions guide](https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb).
- type: textarea
id: problem-related
attributes:
label: Is your feature request related to a problem?
description: Please provide a clear and concise description of what the problem is.
placeholder: ex. I'm always frustrated when ...
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like.
description: Please provide a clear and concise description of what you want to happen.
placeholder: ex. When using XiaoZhi ...
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered.
description: Please provide a clear and concise description of any alternative solutions or features you've considered.
placeholder: ex. Choosing other approach wouldn't work, because ...
- type: textarea
id: context
attributes:
label: Additional context.
description: Please add any other context or screenshots about the feature request here.
placeholder: ex. This would work only when ...
+8
View File
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: 小智 AI 官方网站
url: https://xiaozhi.me/
about: 激活设备、配置 AI、声纹识别、声音克隆等应有尽有,DIY 属于你自己的小智
- name: 小智 AI 聊天机器人百科全书
url: https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb
about: 开发文档、硬件制作、烧录教程、FAQ尽在小智百科
+111
View File
@@ -0,0 +1,111 @@
name: Build Boards
on:
push:
branches:
- main
- ci/* # for ci test
pull_request:
branches:
- main
permissions:
contents: read
jobs:
prepare:
name: Determine variants to build
runs-on: ubuntu-latest
outputs:
variants: ${{ steps.select.outputs.variants }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- id: list
name: Get all variant list
run: |
echo "all_variants=$(python scripts/release.py --list-boards --json)" >> $GITHUB_OUTPUT
- id: select
name: Select variants based on changes
env:
ALL_VARIANTS: ${{ steps.list.outputs.all_variants }}
run: |
EVENT_NAME="${{ github.event_name }}"
# push 到 main 分支,编译全部变体
if [[ "$EVENT_NAME" == "push" ]]; then
echo "variants=$ALL_VARIANTS" >> $GITHUB_OUTPUT
exit 0
fi
# pull_request 场景
BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
echo "Base: $BASE_SHA, Head: $HEAD_SHA"
CHANGED=$(git diff --name-only $BASE_SHA $HEAD_SHA || true)
echo -e "Changed files:\n$CHANGED"
NEED_ALL=0
declare -A AFFECTED
while IFS= read -r file; do
if [[ "$file" == main/* && "$file" != main/boards/* ]]; then
NEED_ALL=1
fi
if [[ "$file" == main/boards/common/* ]]; then
NEED_ALL=1
fi
if [[ "$file" == main/boards/* ]]; then
board=$(echo "$file" | cut -d '/' -f3)
AFFECTED[$board]=1
fi
done <<< "$CHANGED"
if [[ "$NEED_ALL" -eq 1 ]]; then
echo "variants=$ALL_VARIANTS" >> $GITHUB_OUTPUT
else
if [[ ${#AFFECTED[@]} -eq 0 ]]; then
echo "variants=[]" >> $GITHUB_OUTPUT
else
BOARDS_JSON=$(printf '%s\n' "${!AFFECTED[@]}" | sort -u | jq -R -s -c 'split("\n")[:-1]')
FILTERED=$(echo "$ALL_VARIANTS" | jq -c --argjson boards "$BOARDS_JSON" 'map(select(.board as $b | $boards | index($b)))')
echo "variants=$FILTERED" >> $GITHUB_OUTPUT
fi
fi
build:
name: Build ${{ matrix.name }}
needs: prepare
if: ${{ needs.prepare.outputs.variants != '[]' }}
strategy:
fail-fast: false # 单个变体失败不影响其它变体
matrix:
include: ${{ fromJson(needs.prepare.outputs.variants) }}
runs-on: ubuntu-latest
container:
image: espressif/idf:v5.5.2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build current variant
shell: bash
run: |
source $IDF_PATH/export.sh
python scripts/release.py ${{ matrix.board }} --name ${{ matrix.name }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: xiaozhi_${{ matrix.name }}_${{ github.sha }}.bin
path: build/merged-binary.bin
if-no-files-found: error
+10
View File
@@ -2,9 +2,19 @@ tmp/
components/
managed_components/
build/
dist/
.vscode/
.devcontainer/
sdkconfig.old
sdkconfig
dependencies.lock
.env
releases/
main/assets/lang_config.h
main/mmap_generate_emoji.h
.DS_Store
.cache
*.pyc
*.bin
mmap_generate_*.h
.clangd
+7 -4
View File
@@ -1,10 +1,13 @@
# For more information about build system see
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
# The following five lines of boilerplate have to be in your project's
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
set(PROJECT_VER "0.2.0")
# Add this line to disable the specific warning
add_compile_options(-Wno-missing-field-initializers)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
idf_build_set_property(MINIMAL_BUILD ON)
set(PROJECT_VER "2.2.2")
project(xiaozhi)
+2 -1
View File
@@ -1,6 +1,7 @@
MIT License
Copyright (c) 2024 Xiaoxia
Copyright (c) 2025 Shenzhen Xinzhi Future Technology Co., Ltd.
Copyright (c) 2025 Project Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Executable → Regular
+170 -3
View File
@@ -1,6 +1,173 @@
# 你好,小智
# An MCP-based Chatbot
【ESP32+SenseVoice+Qwen72B打造你的AI聊天伴侣!】
(English | [中文](README_zh.md) | [日本語](README_ja.md))
https://www.bilibili.com/video/BV11msTenEH3/?share_source=copy_web&vd_source=ee1aafe19d6e60cf22e60a93881faeba
## Introduction
👉 [Human: Give AI a camera vs AI: Instantly finds out the owner hasn't washed hair for three days【bilibili】](https://www.bilibili.com/video/BV1bpjgzKEhd/)
👉 [Handcraft your AI girlfriend, beginner's guide【bilibili】](https://www.bilibili.com/video/BV1XnmFYLEJN/)
As a voice interaction entry, the XiaoZhi AI chatbot leverages the AI capabilities of large models like Qwen / DeepSeek, and achieves multi-terminal control via the MCP protocol.
<img src="docs/mcp-based-graph.jpg" alt="Control everything via MCP" width="320">
## Version Notes
The current v2 version is incompatible with the v1 partition table, so it is not possible to upgrade from v1 to v2 via OTA. For partition table details, see [partitions/v2/README.md](partitions/v2/README.md).
All hardware running v1 can be upgraded to v2 by manually flashing the firmware.
The stable version of v1 is 1.9.2. You can switch to v1 by running `git checkout v1`. The v1 branch will be maintained until February 2026.
### Features Implemented
- Wi-Fi / ML307 Cat.1 4G
- Offline voice wake-up [ESP-SR](https://github.com/espressif/esp-sr)
- Supports two communication protocols ([Websocket](docs/websocket.md) or MQTT+UDP)
- Uses OPUS audio codec
- Voice interaction based on streaming ASR + LLM + TTS architecture
- Speaker recognition, identifies the current speaker [3D Speaker](https://github.com/modelscope/3D-Speaker)
- OLED / LCD display, supports emoji display
- Battery display and power management
- Multi-language support (Chinese, English, Japanese)
- Supports ESP32-C3, ESP32-S3, ESP32-P4 chip platforms
- Device-side MCP for device control (Speaker, LED, Servo, GPIO, etc.)
- Cloud-side MCP to extend large model capabilities (smart home control, PC desktop operation, knowledge search, email, etc.)
- Customizable wake words, fonts, emojis, and chat backgrounds with online web-based editing ([Custom Assets Generator](https://github.com/78/xiaozhi-assets-generator))
## Hardware
### Breadboard DIY Practice
See the Feishu document tutorial:
👉 ["XiaoZhi AI Chatbot Encyclopedia"](https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb?from=from_copylink)
Breadboard demo:
![Breadboard Demo](docs/v1/wiring2.jpg)
### Supports 70+ Open Source Hardware (Partial List)
- <a href="https://oshwhub.com/li-chuang-kai-fa-ban/li-chuang-shi-zhan-pai-esp32-s3-kai-fa-ban" target="_blank" title="LiChuang ESP32-S3 Development Board">LiChuang ESP32-S3 Development Board</a>
- <a href="https://github.com/espressif/esp-box" target="_blank" title="Espressif ESP32-S3-BOX3">Espressif ESP32-S3-BOX3</a>
- <a href="https://docs.m5stack.com/zh_CN/core/CoreS3" target="_blank" title="M5Stack CoreS3">M5Stack CoreS3</a>
- <a href="https://docs.m5stack.com/en/atom/Atomic%20Echo%20Base" target="_blank" title="AtomS3R + Echo Base">M5Stack AtomS3R + Echo Base</a>
- <a href="https://gf.bilibili.com/item/detail/1108782064" target="_blank" title="Magic Button 2.4">Magic Button 2.4</a>
- <a href="https://www.waveshare.net/shop/ESP32-S3-Touch-AMOLED-1.8.htm" target="_blank" title="Waveshare ESP32-S3-Touch-AMOLED-1.8">Waveshare ESP32-S3-Touch-AMOLED-1.8</a>
- <a href="https://github.com/Xinyuan-LilyGO/T-Circle-S3" target="_blank" title="LILYGO T-Circle-S3">LILYGO T-Circle-S3</a>
- <a href="https://oshwhub.com/tenclass01/xmini_c3" target="_blank" title="XiaGe Mini C3">XiaGe Mini C3</a>
- <a href="https://oshwhub.com/movecall/cuican-ai-pendant-lights-up-y" target="_blank" title="Movecall CuiCan ESP32S3">CuiCan AI Pendant</a>
- <a href="https://github.com/WMnologo/xingzhi-ai" target="_blank" title="WMnologo-Xingzhi-1.54">WMnologo-Xingzhi-1.54TFT</a>
- <a href="https://www.seeedstudio.com/SenseCAP-Watcher-W1-A-p-5979.html" target="_blank" title="SenseCAP Watcher">SenseCAP Watcher</a>
- <a href="https://www.bilibili.com/video/BV1BHJtz6E2S/" target="_blank" title="ESP-HI Low Cost Robot Dog">ESP-HI Low Cost Robot Dog</a>
<div style="display: flex; justify-content: space-between;">
<a href="docs/v1/lichuang-s3.jpg" target="_blank" title="LiChuang ESP32-S3 Development Board">
<img src="docs/v1/lichuang-s3.jpg" width="240" />
</a>
<a href="docs/v1/espbox3.jpg" target="_blank" title="Espressif ESP32-S3-BOX3">
<img src="docs/v1/espbox3.jpg" width="240" />
</a>
<a href="docs/v1/m5cores3.jpg" target="_blank" title="M5Stack CoreS3">
<img src="docs/v1/m5cores3.jpg" width="240" />
</a>
<a href="docs/v1/atoms3r.jpg" target="_blank" title="AtomS3R + Echo Base">
<img src="docs/v1/atoms3r.jpg" width="240" />
</a>
<a href="docs/v1/magiclick.jpg" target="_blank" title="Magic Button 2.4">
<img src="docs/v1/magiclick.jpg" width="240" />
</a>
<a href="docs/v1/waveshare.jpg" target="_blank" title="Waveshare ESP32-S3-Touch-AMOLED-1.8">
<img src="docs/v1/waveshare.jpg" width="240" />
</a>
<a href="docs/v1/lilygo-t-circle-s3.jpg" target="_blank" title="LILYGO T-Circle-S3">
<img src="docs/v1/lilygo-t-circle-s3.jpg" width="240" />
</a>
<a href="docs/v1/xmini-c3.jpg" target="_blank" title="XiaGe Mini C3">
<img src="docs/v1/xmini-c3.jpg" width="240" />
</a>
<a href="docs/v1/movecall-cuican-esp32s3.jpg" target="_blank" title="CuiCan">
<img src="docs/v1/movecall-cuican-esp32s3.jpg" width="240" />
</a>
<a href="docs/v1/wmnologo_xingzhi_1.54.jpg" target="_blank" title="WMnologo-Xingzhi-1.54">
<img src="docs/v1/wmnologo_xingzhi_1.54.jpg" width="240" />
</a>
<a href="docs/v1/sensecap_watcher.jpg" target="_blank" title="SenseCAP Watcher">
<img src="docs/v1/sensecap_watcher.jpg" width="240" />
</a>
<a href="docs/v1/esp-hi.jpg" target="_blank" title="ESP-HI Low Cost Robot Dog">
<img src="docs/v1/esp-hi.jpg" width="240" />
</a>
</div>
## Software
### Firmware Flashing
For beginners, it is recommended to use the firmware that can be flashed without setting up a development environment.
The firmware connects to the official [xiaozhi.me](https://xiaozhi.me) server by default. Personal users can register an account to use the Qwen real-time model for free.
👉 [Beginner's Firmware Flashing Guide](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS)
### Development Environment
- Cursor or VSCode
- Install ESP-IDF plugin, select SDK version 5.4 or above
- Linux is better than Windows for faster compilation and fewer driver issues
- This project uses Google C++ code style, please ensure compliance when submitting code
### Developer Documentation
- [Custom Board Guide](docs/custom-board.md) - Learn how to create custom boards for XiaoZhi AI
- [MCP Protocol IoT Control Usage](docs/mcp-usage.md) - Learn how to control IoT devices via MCP protocol
- [MCP Protocol Interaction Flow](docs/mcp-protocol.md) - Device-side MCP protocol implementation
- [MQTT + UDP Hybrid Communication Protocol Document](docs/mqtt-udp.md)
- [A detailed WebSocket communication protocol document](docs/websocket.md)
## Large Model Configuration
If you already have a XiaoZhi AI chatbot device and have connected to the official server, you can log in to the [xiaozhi.me](https://xiaozhi.me) console for configuration.
👉 [Backend Operation Video Tutorial (Old Interface)](https://www.bilibili.com/video/BV1jUCUY2EKM/)
## Related Open Source Projects
For server deployment on personal computers, refer to the following open-source projects:
- [xinnan-tech/xiaozhi-esp32-server](https://github.com/xinnan-tech/xiaozhi-esp32-server) Python server
- [joey-zhou/xiaozhi-esp32-server-java](https://github.com/joey-zhou/xiaozhi-esp32-server-java) Java server
- [AnimeAIChat/xiaozhi-server-go](https://github.com/AnimeAIChat/xiaozhi-server-go) Golang server
- [hackers365/xiaozhi-esp32-server-golang](https://github.com/hackers365/xiaozhi-esp32-server-golang) Golang server
Other client projects using the XiaoZhi communication protocol:
- [huangjunsen0406/py-xiaozhi](https://github.com/huangjunsen0406/py-xiaozhi) Python client
- [TOM88812/xiaozhi-android-client](https://github.com/TOM88812/xiaozhi-android-client) Android client
- [100askTeam/xiaozhi-linux](http://github.com/100askTeam/xiaozhi-linux) Linux client by 100ask
- [78/xiaozhi-sf32](https://github.com/78/xiaozhi-sf32) Bluetooth chip firmware by Sichuan
- [QuecPython/solution-xiaozhiAI](https://github.com/QuecPython/solution-xiaozhiAI) QuecPython firmware by Quectel
Custom Assets Tools:
- [78/xiaozhi-assets-generator](https://github.com/78/xiaozhi-assets-generator) Custom Assets Generator (Wake words, fonts, emojis, backgrounds)
## About the Project
This is an open-source ESP32 project, released under the MIT license, allowing anyone to use it for free, including for commercial purposes.
We hope this project helps everyone understand AI hardware development and apply rapidly evolving large language models to real hardware devices.
If you have any ideas or suggestions, please feel free to raise Issues or join our [Discord](https://discord.gg/bXqgAfRm) or QQ group: 994694848
## Star History
<a href="https://star-history.com/#78/xiaozhi-esp32&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date" />
</picture>
</a>
+169
View File
@@ -0,0 +1,169 @@
# MCP ベースのチャットボット
(日本語 | [中文](README_zh.md) | [English](README.md)
## はじめに
👉 [人間:AIにカメラを装着 vs AI:その場で飼い主が3日間髪を洗っていないことを発見【bilibili】](https://www.bilibili.com/video/BV1bpjgzKEhd/)
👉 [手作りでAIガールフレンドを作る、初心者入門チュートリアル【bilibili】](https://www.bilibili.com/video/BV1XnmFYLEJN/)
シャオジーAIチャットボットは音声インタラクションの入口として、Qwen / DeepSeekなどの大規模モデルのAI能力を活用し、MCPプロトコルを通じてマルチエンド制御を実現します。
<img src="docs/mcp-based-graph.jpg" alt="MCPであらゆるものを制御" width="320">
## バージョンノート
現在のv2バージョンはv1パーティションテーブルと互換性がないため、v1からv2へOTAでアップグレードすることはできません。パーティションテーブルの詳細については、[partitions/v2/README.md](partitions/v2/README.md)をご参照ください。
v1を実行しているすべてのハードウェアは、ファームウェアを手動で書き込むことでv2にアップグレードできます。
v1の安定版は1.9.2です。`git checkout v1`でv1に切り替えることができます。v1ブランチは2026年2月まで継続的にメンテナンスされます。
### 実装済み機能
- Wi-Fi / ML307 Cat.1 4G
- オフライン音声ウェイクアップ [ESP-SR](https://github.com/espressif/esp-sr)
- 2種類の通信プロトコルに対応([Websocket](docs/websocket.md) または MQTT+UDP
- OPUSオーディオコーデックを採用
- ストリーミングASR + LLM + TTSアーキテクチャに基づく音声インタラクション
- 話者認識、現在話している人を識別 [3D Speaker](https://github.com/modelscope/3D-Speaker)
- OLED / LCDディスプレイ、表情表示対応
- バッテリー表示と電源管理
- 多言語対応(中国語、英語、日本語)
- ESP32-C3、ESP32-S3、ESP32-P4チッププラットフォーム対応
- デバイス側MCPによるデバイス制御(音量・明るさ調整、アクション制御など)
- クラウド側MCPで大規模モデル能力を拡張(スマートホーム制御、PCデスクトップ操作、知識検索、メール送受信など)
- カスタマイズ可能なウェイクワード、フォント、絵文字、チャット背景、オンラインWeb編集に対応 ([カスタムアセットジェネレーター](https://github.com/78/xiaozhi-assets-generator))
## ハードウェア
### ブレッドボード手作り実践
Feishuドキュメントチュートリアルをご覧ください:
👉 [「シャオジーAIチャットボット百科事典」](https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb?from=from_copylink)
ブレッドボードのデモ:
![ブレッドボードデモ](docs/v1/wiring2.jpg)
### 70種類以上のオープンソースハードウェアに対応(一部のみ表示)
- <a href="https://oshwhub.com/li-chuang-kai-fa-ban/li-chuang-shi-zhan-pai-esp32-s3-kai-fa-ban" target="_blank" title="立創・実戦派 ESP32-S3 開発ボード">立創・実戦派 ESP32-S3 開発ボード</a>
- <a href="https://github.com/espressif/esp-box" target="_blank" title="楽鑫 ESP32-S3-BOX3">楽鑫 ESP32-S3-BOX3</a>
- <a href="https://docs.m5stack.com/zh_CN/core/CoreS3" target="_blank" title="M5Stack CoreS3">M5Stack CoreS3</a>
- <a href="https://docs.m5stack.com/en/atom/Atomic%20Echo%20Base" target="_blank" title="AtomS3R + Echo Base">M5Stack AtomS3R + Echo Base</a>
- <a href="https://gf.bilibili.com/item/detail/1108782064" target="_blank" title="マジックボタン2.4">マジックボタン2.4</a>
- <a href="https://www.waveshare.net/shop/ESP32-S3-Touch-AMOLED-1.8.htm" target="_blank" title="微雪電子 ESP32-S3-Touch-AMOLED-1.8">微雪電子 ESP32-S3-Touch-AMOLED-1.8</a>
- <a href="https://github.com/Xinyuan-LilyGO/T-Circle-S3" target="_blank" title="LILYGO T-Circle-S3">LILYGO T-Circle-S3</a>
- <a href="https://oshwhub.com/tenclass01/xmini_c3" target="_blank" title="エビ兄さん Mini C3">エビ兄さん Mini C3</a>
- <a href="https://oshwhub.com/movecall/cuican-ai-pendant-lights-up-y" target="_blank" title="Movecall CuiCan ESP32S3">CuiCan AIペンダント</a>
- <a href="https://github.com/WMnologo/xingzhi-ai" target="_blank" title="無名科技Nologo-星智-1.54">無名科技Nologo-星智-1.54TFT</a>
- <a href="https://www.seeedstudio.com/SenseCAP-Watcher-W1-A-p-5979.html" target="_blank" title="SenseCAP Watcher">SenseCAP Watcher</a>
- <a href="https://www.bilibili.com/video/BV1BHJtz6E2S/" target="_blank" title="ESP-HI 超低コストロボット犬">ESP-HI 超低コストロボット犬</a>
<div style="display: flex; justify-content: space-between;">
<a href="docs/v1/lichuang-s3.jpg" target="_blank" title="立創・実戦派 ESP32-S3 開発ボード">
<img src="docs/v1/lichuang-s3.jpg" width="240" />
</a>
<a href="docs/v1/espbox3.jpg" target="_blank" title="楽鑫 ESP32-S3-BOX3">
<img src="docs/v1/espbox3.jpg" width="240" />
</a>
<a href="docs/v1/m5cores3.jpg" target="_blank" title="M5Stack CoreS3">
<img src="docs/v1/m5cores3.jpg" width="240" />
</a>
<a href="docs/v1/atoms3r.jpg" target="_blank" title="AtomS3R + Echo Base">
<img src="docs/v1/atoms3r.jpg" width="240" />
</a>
<a href="docs/v1/magiclick.jpg" target="_blank" title="マジックボタン2.4">
<img src="docs/v1/magiclick.jpg" width="240" />
</a>
<a href="docs/v1/waveshare.jpg" target="_blank" title="微雪電子 ESP32-S3-Touch-AMOLED-1.8">
<img src="docs/v1/waveshare.jpg" width="240" />
</a>
<a href="docs/v1/lilygo-t-circle-s3.jpg" target="_blank" title="LILYGO T-Circle-S3">
<img src="docs/v1/lilygo-t-circle-s3.jpg" width="240" />
</a>
<a href="docs/v1/xmini-c3.jpg" target="_blank" title="エビ兄さん Mini C3">
<img src="docs/v1/xmini-c3.jpg" width="240" />
</a>
<a href="docs/v1/movecall-cuican-esp32s3.jpg" target="_blank" title="CuiCan">
<img src="docs/v1/movecall-cuican-esp32s3.jpg" width="240" />
</a>
<a href="docs/v1/wmnologo_xingzhi_1.54.jpg" target="_blank" title="無名科技Nologo-星智-1.54">
<img src="docs/v1/wmnologo_xingzhi_1.54.jpg" width="240" />
</a>
<a href="docs/v1/sensecap_watcher.jpg" target="_blank" title="SenseCAP Watcher">
<img src="docs/v1/sensecap_watcher.jpg" width="240" />
</a>
<a href="docs/v1/esp-hi.jpg" target="_blank" title="ESP-HI 超低コストロボット犬">
<img src="docs/v1/esp-hi.jpg" width="240" />
</a>
</div>
## ソフトウェア
### ファームウェア書き込み
初心者の方は、まず開発環境を構築せずに書き込み可能なファームウェアを使用することをおすすめします。
ファームウェアはデフォルトで公式 [xiaozhi.me](https://xiaozhi.me) サーバーに接続します。個人ユーザーはアカウント登録でQwenリアルタイムモデルを無料で利用できます。
👉 [初心者向けファームウェア書き込みガイド](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS)
### 開発環境
- Cursor または VSCode
- ESP-IDFプラグインをインストールし、SDKバージョン5.4以上を選択
- LinuxはWindowsよりも優れており、コンパイルが速く、ドライバの問題も少ない
- 本プロジェクトはGoogle C++コードスタイルを採用、コード提出時は準拠を確認してください
### 開発者ドキュメント
- [カスタム開発ボードガイド](docs/custom-board.md) - シャオジーAI用のカスタム開発ボード作成方法
- [MCPプロトコルIoT制御使用法](docs/mcp-usage.md) - MCPプロトコルでIoTデバイスを制御する方法
- [MCPプロトコルインタラクションフロー](docs/mcp-protocol.md) - デバイス側MCPプロトコルの実装方法
- [MQTT + UDP ハイブリッド通信プロトコルドキュメント](docs/mqtt-udp.md)
- [詳細なWebSocket通信プロトコルドキュメント](docs/websocket.md)
## 大規模モデル設定
すでにシャオジーAIチャットボットデバイスをお持ちで、公式サーバーに接続済みの場合は、[xiaozhi.me](https://xiaozhi.me) コンソールで設定できます。
👉 [バックエンド操作ビデオチュートリアル(旧インターフェース)](https://www.bilibili.com/video/BV1jUCUY2EKM/)
## 関連オープンソースプロジェクト
個人PCでサーバーをデプロイする場合は、以下のオープンソースプロジェクトを参照してください:
- [xinnan-tech/xiaozhi-esp32-server](https://github.com/xinnan-tech/xiaozhi-esp32-server) Pythonサーバー
- [joey-zhou/xiaozhi-esp32-server-java](https://github.com/joey-zhou/xiaozhi-esp32-server-java) Javaサーバー
- [AnimeAIChat/xiaozhi-server-go](https://github.com/AnimeAIChat/xiaozhi-server-go) Golangサーバー
- [hackers365/xiaozhi-esp32-server-golang](https://github.com/hackers365/xiaozhi-esp32-server-golang) Golangサーバー
シャオジー通信プロトコルを利用した他のクライアントプロジェクト:
- [huangjunsen0406/py-xiaozhi](https://github.com/huangjunsen0406/py-xiaozhi) Pythonクライアント
- [TOM88812/xiaozhi-android-client](https://github.com/TOM88812/xiaozhi-android-client) Androidクライアント
- [100askTeam/xiaozhi-linux](http://github.com/100askTeam/xiaozhi-linux) 百問科技提供のLinuxクライアント
- [78/xiaozhi-sf32](https://github.com/78/xiaozhi-sf32) 思澈科技のBluetoothチップファームウェア
- [QuecPython/solution-xiaozhiAI](https://github.com/QuecPython/solution-xiaozhiAI) 移遠提供のQuecPythonファームウェア
## プロジェクトについて
これはエビ兄さんがオープンソースで公開しているESP32プロジェクトで、MITライセンスのもと、誰でも無料で、商用利用も可能です。
このプロジェクトを通じて、AIハードウェア開発を理解し、急速に進化する大規模言語モデルを実際のハードウェアデバイスに応用できるようになることを目指しています。
ご意見やご提案があれば、いつでもIssueを提出するか、[Discord](https://discord.gg/bXqgAfRm) または QQグループ:1011329060 にご参加ください。
## スター履歴
<a href="https://star-history.com/#78/xiaozhi-esp32&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date" />
</picture>
</a>
+169
View File
@@ -0,0 +1,169 @@
# An MCP-based Chatbot
(中文 | [English](README.md) | [日本語](README_ja.md)
## 介绍
👉 [人类:给 AI 装摄像头 vs AI:当场发现主人三天没洗头【bilibili】](https://www.bilibili.com/video/BV1bpjgzKEhd/)
👉 [手工打造你的 AI 女友,新手入门教程【bilibili】](https://www.bilibili.com/video/BV1XnmFYLEJN/)
小智 AI 聊天机器人作为一个语音交互入口,利用 Qwen / DeepSeek 等大模型的 AI 能力,通过 MCP 协议实现多端控制。
<img src="docs/mcp-based-graph.jpg" alt="通过MCP控制万物" width="320">
### 版本说明
当前 v2 版本与 v1 版本分区表不兼容,所以无法从 v1 版本通过 OTA 升级到 v2 版本。分区表说明参见 [partitions/v2/README.md](partitions/v2/README.md)。
使用 v1 版本的所有硬件,可以通过手动烧录固件来升级到 v2 版本。
v1 的稳定版本为 1.9.2,可以通过 `git checkout v1` 来切换到 v1 版本,该分支会持续维护到 2026 年 2 月。
### 已实现功能
- Wi-Fi / ML307 Cat.1 4G
- 离线语音唤醒 [ESP-SR](https://github.com/espressif/esp-sr)
- 支持两种通信协议([Websocket](docs/websocket.md) 或 MQTT+UDP
- 采用 OPUS 音频编解码
- 基于流式 ASR + LLM + TTS 架构的语音交互
- 声纹识别,识别当前说话人的身份 [3D Speaker](https://github.com/modelscope/3D-Speaker)
- OLED / LCD 显示屏,支持表情显示
- 电量显示与电源管理
- 支持多语言(中文、英文、日文)
- 支持 ESP32-C3、ESP32-S3、ESP32-P4 芯片平台
- 通过设备端 MCP 实现设备控制(音量、灯光、电机、GPIO 等)
- 通过云端 MCP 扩展大模型能力(智能家居控制、PC桌面操作、知识搜索、邮件收发等)
- 自定义唤醒词、字体、表情与聊天背景,支持网页端在线修改 ([自定义Assets生成器](https://github.com/78/xiaozhi-assets-generator))
## 硬件
### 面包板手工制作实践
详见飞书文档教程:
👉 [《小智 AI 聊天机器人百科全书》](https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb?from=from_copylink)
面包板效果图如下:
![面包板效果图](docs/v1/wiring2.jpg)
### 支持 70 多个开源硬件(仅展示部分)
- <a href="https://oshwhub.com/li-chuang-kai-fa-ban/li-chuang-shi-zhan-pai-esp32-s3-kai-fa-ban" target="_blank" title="立创·实战派 ESP32-S3 开发板">立创·实战派 ESP32-S3 开发板</a>
- <a href="https://github.com/espressif/esp-box" target="_blank" title="乐鑫 ESP32-S3-BOX3">乐鑫 ESP32-S3-BOX3</a>
- <a href="https://docs.m5stack.com/zh_CN/core/CoreS3" target="_blank" title="M5Stack CoreS3">M5Stack CoreS3</a>
- <a href="https://docs.m5stack.com/en/atom/Atomic%20Echo%20Base" target="_blank" title="AtomS3R + Echo Base">M5Stack AtomS3R + Echo Base</a>
- <a href="https://gf.bilibili.com/item/detail/1108782064" target="_blank" title="神奇按钮 2.4">神奇按钮 2.4</a>
- <a href="https://www.waveshare.net/shop/ESP32-S3-Touch-AMOLED-1.8.htm" target="_blank" title="微雪电子 ESP32-S3-Touch-AMOLED-1.8">微雪电子 ESP32-S3-Touch-AMOLED-1.8</a>
- <a href="https://github.com/Xinyuan-LilyGO/T-Circle-S3" target="_blank" title="LILYGO T-Circle-S3">LILYGO T-Circle-S3</a>
- <a href="https://oshwhub.com/tenclass01/xmini_c3" target="_blank" title="虾哥 Mini C3">虾哥 Mini C3</a>
- <a href="https://oshwhub.com/movecall/cuican-ai-pendant-lights-up-y" target="_blank" title="Movecall CuiCan ESP32S3">璀璨·AI 吊坠</a>
- <a href="https://github.com/WMnologo/xingzhi-ai" target="_blank" title="无名科技Nologo-星智-1.54">无名科技 Nologo-星智-1.54TFT</a>
- <a href="https://www.seeedstudio.com/SenseCAP-Watcher-W1-A-p-5979.html" target="_blank" title="SenseCAP Watcher">SenseCAP Watcher</a>
- <a href="https://www.bilibili.com/video/BV1BHJtz6E2S/" target="_blank" title="ESP-HI 超低成本机器狗">ESP-HI 超低成本机器狗</a>
<div style="display: flex; justify-content: space-between;">
<a href="docs/v1/lichuang-s3.jpg" target="_blank" title="立创·实战派 ESP32-S3 开发板">
<img src="docs/v1/lichuang-s3.jpg" width="240" />
</a>
<a href="docs/v1/espbox3.jpg" target="_blank" title="乐鑫 ESP32-S3-BOX3">
<img src="docs/v1/espbox3.jpg" width="240" />
</a>
<a href="docs/v1/m5cores3.jpg" target="_blank" title="M5Stack CoreS3">
<img src="docs/v1/m5cores3.jpg" width="240" />
</a>
<a href="docs/v1/atoms3r.jpg" target="_blank" title="AtomS3R + Echo Base">
<img src="docs/v1/atoms3r.jpg" width="240" />
</a>
<a href="docs/v1/magiclick.jpg" target="_blank" title="神奇按钮 2.4">
<img src="docs/v1/magiclick.jpg" width="240" />
</a>
<a href="docs/v1/waveshare.jpg" target="_blank" title="微雪电子 ESP32-S3-Touch-AMOLED-1.8">
<img src="docs/v1/waveshare.jpg" width="240" />
</a>
<a href="docs/v1/lilygo-t-circle-s3.jpg" target="_blank" title="LILYGO T-Circle-S3">
<img src="docs/v1/lilygo-t-circle-s3.jpg" width="240" />
</a>
<a href="docs/v1/xmini-c3.jpg" target="_blank" title="虾哥 Mini C3">
<img src="docs/v1/xmini-c3.jpg" width="240" />
</a>
<a href="docs/v1/movecall-cuican-esp32s3.jpg" target="_blank" title="CuiCan">
<img src="docs/v1/movecall-cuican-esp32s3.jpg" width="240" />
</a>
<a href="docs/v1/wmnologo_xingzhi_1.54.jpg" target="_blank" title="无名科技Nologo-星智-1.54">
<img src="docs/v1/wmnologo_xingzhi_1.54.jpg" width="240" />
</a>
<a href="docs/v1/sensecap_watcher.jpg" target="_blank" title="SenseCAP Watcher">
<img src="docs/v1/sensecap_watcher.jpg" width="240" />
</a>
<a href="docs/v1/esp-hi.jpg" target="_blank" title="ESP-HI 超低成本机器狗">
<img src="docs/v1/esp-hi.jpg" width="240" />
</a>
</div>
## 软件
### 固件烧录
新手第一次操作建议先不要搭建开发环境,直接使用免开发环境烧录的固件。
固件默认接入 [xiaozhi.me](https://xiaozhi.me) 官方服务器,个人用户注册账号可以免费使用 Qwen 实时模型。
👉 [新手烧录固件教程](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS)
### 开发环境
- Cursor 或 VSCode
- 安装 ESP-IDF 插件,选择 SDK 版本 5.4 或以上
- Linux 比 Windows 更好,编译速度快,也免去驱动问题的困扰
- 本项目使用 Google C++ 代码风格,提交代码时请确保符合规范
### 开发者文档
- [自定义开发板指南](docs/custom-board.md) - 学习如何为小智 AI 创建自定义开发板
- [MCP 协议物联网控制用法说明](docs/mcp-usage.md) - 了解如何通过 MCP 协议控制物联网设备
- [MCP 协议交互流程](docs/mcp-protocol.md) - 设备端 MCP 协议的实现方式
- [MQTT + UDP 混合通信协议文档](docs/mqtt-udp.md)
- [一份详细的 WebSocket 通信协议文档](docs/websocket.md)
## 大模型配置
如果你已经拥有一个小智 AI 聊天机器人设备,并且已接入官方服务器,可以登录 [xiaozhi.me](https://xiaozhi.me) 控制台进行配置。
👉 [后台操作视频教程(旧版界面)](https://www.bilibili.com/video/BV1jUCUY2EKM/)
## 相关开源项目
在个人电脑上部署服务器,可以参考以下第三方开源的项目:
- [xinnan-tech/xiaozhi-esp32-server](https://github.com/xinnan-tech/xiaozhi-esp32-server) Python 服务器
- [joey-zhou/xiaozhi-esp32-server-java](https://github.com/joey-zhou/xiaozhi-esp32-server-java) Java 服务器
- [AnimeAIChat/xiaozhi-server-go](https://github.com/AnimeAIChat/xiaozhi-server-go) Golang 服务器
- [hackers365/xiaozhi-esp32-server-golang](https://github.com/hackers365/xiaozhi-esp32-server-golang) Golang 服务器
使用小智通信协议的第三方客户端项目:
- [huangjunsen0406/py-xiaozhi](https://github.com/huangjunsen0406/py-xiaozhi) Python 客户端
- [TOM88812/xiaozhi-android-client](https://github.com/TOM88812/xiaozhi-android-client) Android 客户端
- [100askTeam/xiaozhi-linux](http://github.com/100askTeam/xiaozhi-linux) 百问科技提供的 Linux 客户端
- [78/xiaozhi-sf32](https://github.com/78/xiaozhi-sf32) 思澈科技的蓝牙芯片固件
- [QuecPython/solution-xiaozhiAI](https://github.com/QuecPython/solution-xiaozhiAI) 移远提供的 QuecPython 固件
## 关于项目
这是一个由虾哥开源的 ESP32 项目,以 MIT 许可证发布,允许任何人免费使用,修改或用于商业用途。
我们希望通过这个项目,能够帮助大家了解 AI 硬件开发,将当下飞速发展的大语言模型应用到实际的硬件设备中。
如果你有任何想法或建议,请随时提出 Issues 或加入 [Discord](https://discord.gg/bXqgAfRm) 或 QQ 群:1011329060
## Star History
<a href="https://star-history.com/#78/xiaozhi-esp32&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date" />
</picture>
</a>
+1
View File
@@ -0,0 +1 @@
.
+37
View File
@@ -0,0 +1,37 @@
# BluFi 配网(集成 esp-wifi-connect
本文档说明如何在小智固件中启用和使用 BluFi(BLE Wi‑Fi 配网),并结合项目内置的 `esp-wifi-connect` 组件完成 Wi‑Fi 连接与存储。官方
BluFi
协议说明请参考 [Espressif 文档](https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32/api-guides/ble/blufi.html)。
## 前置条件
- 需要支持 BLE 的芯片与固件配置。
-`idf.py menuconfig` 中启用 `WiFi Configuration Method -> Esp Blufi``CONFIG_USE_ESP_BLUFI_WIFI_PROVISIONING=y`
)。如果想使用 BluFi,必须关闭同一菜单下的 Hotspot 选项,否则默认使用 Hotspot 配网模式。
- 保持默认的 NVS 与事件循环初始化(项目的 `app_main` 已处理)。
- CONFIG_BT_BLUEDROID_ENABLED、CONFIG_BT_NIMBLE_ENABLED这两个宏应二选一,不能同时启用。
## 工作流程
1) 手机端通过 BluFi(如官方 EspBlufi App 或自研客户端)连接设备,发送 Wi‑Fi SSID/密码,手机端可以通过blufi协议获取设备端扫描到的WiFi列表。
2) 设备侧在 `ESP_BLUFI_EVENT_REQ_CONNECT_TO_AP` 中将凭据写入 `SsidManager`(存储到 NVS,属于 `esp-wifi-connect` 组件)。
3) 随后启动 `WifiStation` 扫描并连接;状态通过 BluFi 返回。
4) 配网成功后设备会自动连接新 Wi‑Fi;失败则返回失败状态。
## 使用步骤
1. 配置:在 menuconfig 开启 `Esp Blufi`。编译并烧录固件。
2. 触发配网:设备首次启动且没有已保存的 Wi‑Fi 时会自动进入配网。
3. 手机端操作:打开 EspBlufi App(或其他 BluFi 客户端),搜索并连接设备,可以选择是否加密,按提示输入 Wi‑Fi SSID/密码并发送。
4. 观察结果:
- 成功:BluFi 报告连接成功,设备自动连接 Wi‑Fi。
- 失败:BluFi 返回失败状态,可重新发送或检查路由器。
## 注意事项
- BluFi 配网不支持与热点配网同时开启。如果热点配网已经启动,则默认使用热点配网。请在 menuconfig 中只保留一种配网方式。
- 若多次测试,建议清除或覆盖存储的 SSID(`wifi` 命名空间),避免旧配置干扰。
- 如果使用自定义 BluFi 客户端,需遵循官方协议帧格式,参考上文官方文档链接。
- 官方文档中已提供EspBlufi APP下载地址
- 由于IDF5.5.2的blufi接口发生变化,5.5.2版本编译后蓝牙名称为"Xiaozhi-Blufi",5.5.1版本中蓝牙名称为"BLUFI_DEVICE"
+91
View File
@@ -0,0 +1,91 @@
# 代码风格指南
## 代码格式化工具
本项目使用 clang-format 工具来统一代码风格。我们已经在项目根目录下提供了 `.clang-format` 配置文件,该配置基于 Google C++ 风格指南,并做了一些自定义调整。
### 安装 clang-format
在使用之前,请确保你已经安装了 clang-format 工具:
- **Windows**
```powershell
winget install LLVM
# 或者使用 Chocolatey
choco install llvm
```
- **Linux**
```bash
sudo apt install clang-format # Ubuntu/Debian
sudo dnf install clang-tools-extra # Fedora
```
- **macOS**
```bash
brew install clang-format
```
### 使用方法
1. **格式化单个文件**
```bash
clang-format -i path/to/your/file.cpp
```
2. **格式化整个项目**
```bash
# 在项目根目录下执行
find main -iname *.h -o -iname *.cc | xargs clang-format -i
```
3. **在提交代码前检查格式**
```bash
# 检查文件格式是否符合规范(不修改文件)
clang-format --dry-run -Werror path/to/your/file.cpp
```
### IDE 集成
- **Visual Studio Code**
1. 安装 C/C++ 扩展
2. 在设置中启用 `C_Cpp.formatting` 为 `clang-format`
3. 可以设置保存时自动格式化:`editor.formatOnSave: true`
- **CLion**
1. 在设置中选择 `Editor > Code Style > C/C++`
2. 将 `Formatter` 设置为 `clang-format`
3. 选择使用项目中的 `.clang-format` 配置文件
### 主要格式规则
- 缩进使用 4 个空格
- 行宽限制为 100 字符
- 大括号采用 Attach 风格(与控制语句在同一行)
- 指针和引用符号靠左对齐
- 自动排序头文件包含
- 类访问修饰符缩进为 -4 空格
### 注意事项
1. 提交代码前请确保代码已经过格式化
2. 不要手动调整已格式化的代码对齐
3. 如果某段代码不希望被格式化,可以使用以下注释包围:
```cpp
// clang-format off
// 你的代码
// clang-format on
```
### 常见问题
1. **格式化失败**
- 检查 clang-format 版本是否过低
- 确认文件编码为 UTF-8
- 验证 .clang-format 文件语法是否正确
2. **与期望格式不符**
- 检查是否使用了项目根目录下的 .clang-format 配置
- 确认没有其他位置的 .clang-format 文件被优先使用
如有任何问题或建议,欢迎提出 issue 或 pull request。
+453
View File
@@ -0,0 +1,453 @@
# 自定义开发板指南
本指南介绍如何为小智AI语音聊天机器人项目定制一个新的开发板初始化程序。小智AI支持70多种ESP32系列开发板,每个开发板的初始化代码都放在对应的目录下。
## 重要提示
> **警告**: 对于自定义开发板,当IO配置与原有开发板不同时,切勿直接覆盖原有开发板的配置编译固件。必须创建新的开发板类型,或者通过config.json文件中的builds配置不同的name和sdkconfig宏定义来区分。使用 `python scripts/release.py [开发板目录名字]` 来编译打包固件。
>
> 如果直接覆盖原有配置,将来OTA升级时,您的自定义固件可能会被原有开发板的标准固件覆盖,导致您的设备无法正常工作。每个开发板有唯一的标识和对应的固件升级通道,保持开发板标识的唯一性非常重要。
## 目录结构
每个开发板的目录结构通常包含以下文件:
- `xxx_board.cc` - 主要的板级初始化代码,实现了板子相关的初始化和功能
- `config.h` - 板级配置文件,定义了硬件管脚映射和其他配置项
- `config.json` - 编译配置,指定目标芯片和特殊的编译选项
- `README.md` - 开发板相关的说明文档
## 定制开发板步骤
### 1. 创建新的开发板目录
首先在`boards/`目录下创建一个新的目录,命名方式应使用 `[品牌名]-[开发板类型]` 的形式,例如 `m5stack-tab5`
```bash
mkdir main/boards/my-custom-board
```
### 2. 创建配置文件
#### config.h
`config.h`中定义所有的硬件配置,包括:
- 音频采样率和I2S引脚配置
- 音频编解码芯片地址和I2C引脚配置
- 按钮和LED引脚配置
- 显示屏参数和引脚配置
参考示例(来自lichuang-c3-dev):
```c
#ifndef _BOARD_CONFIG_H_
#define _BOARD_CONFIG_H_
#include <driver/gpio.h>
// 音频配置
#define AUDIO_INPUT_SAMPLE_RATE 24000
#define AUDIO_OUTPUT_SAMPLE_RATE 24000
#define AUDIO_I2S_GPIO_MCLK GPIO_NUM_10
#define AUDIO_I2S_GPIO_WS GPIO_NUM_12
#define AUDIO_I2S_GPIO_BCLK GPIO_NUM_8
#define AUDIO_I2S_GPIO_DIN GPIO_NUM_7
#define AUDIO_I2S_GPIO_DOUT GPIO_NUM_11
#define AUDIO_CODEC_PA_PIN GPIO_NUM_13
#define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_0
#define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_1
#define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR
// 按钮配置
#define BOOT_BUTTON_GPIO GPIO_NUM_9
// 显示屏配置
#define DISPLAY_SPI_SCK_PIN GPIO_NUM_3
#define DISPLAY_SPI_MOSI_PIN GPIO_NUM_5
#define DISPLAY_DC_PIN GPIO_NUM_6
#define DISPLAY_SPI_CS_PIN GPIO_NUM_4
#define DISPLAY_WIDTH 320
#define DISPLAY_HEIGHT 240
#define DISPLAY_MIRROR_X true
#define DISPLAY_MIRROR_Y false
#define DISPLAY_SWAP_XY true
#define DISPLAY_OFFSET_X 0
#define DISPLAY_OFFSET_Y 0
#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_2
#define DISPLAY_BACKLIGHT_OUTPUT_INVERT true
#endif // _BOARD_CONFIG_H_
```
#### config.json
`config.json`中定义编译配置,这个文件用于 `scripts/release.py` 脚本自动化编译:
```json
{
"target": "esp32s3", // 目标芯片型号: esp32, esp32s3, esp32c3, esp32c6, esp32p4等
"builds": [
{
"name": "my-custom-board", // 开发板名称,用于生成固件包
"sdkconfig_append": [
// 特别 Flash 大小配置
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
// 特别分区表配置
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/8m.csv\""
]
}
]
}
```
**配置项说明:**
- `target`: 目标芯片型号,必须与硬件匹配
- `name`: 编译输出的固件包名称,建议与目录名一致
- `sdkconfig_append`: 额外的 sdkconfig 配置项数组,会追加到默认配置中
**常用的 sdkconfig_append 配置:**
```json
// Flash 大小
"CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y" // 4MB Flash
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y" // 8MB Flash
"CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y" // 16MB Flash
// 分区表
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/4m.csv\"" // 4MB 分区表
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/8m.csv\"" // 8MB 分区表
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/16m.csv\"" // 16MB 分区表
// 语言配置
"CONFIG_LANGUAGE_EN_US=y" // 英语
"CONFIG_LANGUAGE_ZH_CN=y" // 简体中文
// 唤醒词配置
"CONFIG_USE_DEVICE_AEC=y" // 启用设备端 AEC
"CONFIG_WAKE_WORD_DISABLED=y" // 禁用唤醒词
```
### 3. 编写板级初始化代码
创建一个`my_custom_board.cc`文件,实现开发板的所有初始化逻辑。
一个基本的开发板类定义包含以下几个部分:
1. **类定义**:继承自`WifiBoard``Ml307Board`
2. **初始化函数**:包括I2C、显示屏、按钮、IoT等组件的初始化
3. **虚函数重写**:如`GetAudioCodec()``GetDisplay()``GetBacklight()`
4. **注册开发板**:使用`DECLARE_BOARD`宏注册开发板
```cpp
#include "wifi_board.h"
#include "codecs/es8311_audio_codec.h"
#include "display/lcd_display.h"
#include "application.h"
#include "button.h"
#include "config.h"
#include "mcp_server.h"
#include <esp_log.h>
#include <driver/i2c_master.h>
#include <driver/spi_common.h>
#define TAG "MyCustomBoard"
class MyCustomBoard : public WifiBoard {
private:
i2c_master_bus_handle_t codec_i2c_bus_;
Button boot_button_;
LcdDisplay* display_;
// I2C初始化
void InitializeI2c() {
i2c_master_bus_config_t i2c_bus_cfg = {
.i2c_port = I2C_NUM_0,
.sda_io_num = AUDIO_CODEC_I2C_SDA_PIN,
.scl_io_num = AUDIO_CODEC_I2C_SCL_PIN,
.clk_source = I2C_CLK_SRC_DEFAULT,
.glitch_ignore_cnt = 7,
.intr_priority = 0,
.trans_queue_depth = 0,
.flags = {
.enable_internal_pullup = 1,
},
};
ESP_ERROR_CHECK(i2c_new_master_bus(&i2c_bus_cfg, &codec_i2c_bus_));
}
// SPI初始化(用于显示屏)
void InitializeSpi() {
spi_bus_config_t buscfg = {};
buscfg.mosi_io_num = DISPLAY_SPI_MOSI_PIN;
buscfg.miso_io_num = GPIO_NUM_NC;
buscfg.sclk_io_num = DISPLAY_SPI_SCK_PIN;
buscfg.quadwp_io_num = GPIO_NUM_NC;
buscfg.quadhd_io_num = GPIO_NUM_NC;
buscfg.max_transfer_sz = DISPLAY_WIDTH * DISPLAY_HEIGHT * sizeof(uint16_t);
ESP_ERROR_CHECK(spi_bus_initialize(SPI2_HOST, &buscfg, SPI_DMA_CH_AUTO));
}
// 按钮初始化
void InitializeButtons() {
boot_button_.OnClick([this]() {
auto& app = Application::GetInstance();
if (app.GetDeviceState() == kDeviceStateStarting) {
EnterWifiConfigMode();
return;
}
app.ToggleChatState();
});
}
// 显示屏初始化(以ST7789为例)
void InitializeDisplay() {
esp_lcd_panel_io_handle_t panel_io = nullptr;
esp_lcd_panel_handle_t panel = nullptr;
esp_lcd_panel_io_spi_config_t io_config = {};
io_config.cs_gpio_num = DISPLAY_SPI_CS_PIN;
io_config.dc_gpio_num = DISPLAY_DC_PIN;
io_config.spi_mode = 2;
io_config.pclk_hz = 80 * 1000 * 1000;
io_config.trans_queue_depth = 10;
io_config.lcd_cmd_bits = 8;
io_config.lcd_param_bits = 8;
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_config, &panel_io));
esp_lcd_panel_dev_config_t panel_config = {};
panel_config.reset_gpio_num = GPIO_NUM_NC;
panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB;
panel_config.bits_per_pixel = 16;
ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(panel_io, &panel_config, &panel));
esp_lcd_panel_reset(panel);
esp_lcd_panel_init(panel);
esp_lcd_panel_invert_color(panel, true);
esp_lcd_panel_swap_xy(panel, DISPLAY_SWAP_XY);
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
// 创建显示屏对象
display_ = new SpiLcdDisplay(panel_io, panel,
DISPLAY_WIDTH, DISPLAY_HEIGHT,
DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y,
DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}
// MCP Tools 初始化
void InitializeTools() {
// 参考 MCP 文档
}
public:
// 构造函数
MyCustomBoard() : boot_button_(BOOT_BUTTON_GPIO) {
InitializeI2c();
InitializeSpi();
InitializeDisplay();
InitializeButtons();
InitializeTools();
GetBacklight()->SetBrightness(100);
}
// 获取音频编解码器
virtual AudioCodec* GetAudioCodec() override {
static Es8311AudioCodec audio_codec(
codec_i2c_bus_,
I2C_NUM_0,
AUDIO_INPUT_SAMPLE_RATE,
AUDIO_OUTPUT_SAMPLE_RATE,
AUDIO_I2S_GPIO_MCLK,
AUDIO_I2S_GPIO_BCLK,
AUDIO_I2S_GPIO_WS,
AUDIO_I2S_GPIO_DOUT,
AUDIO_I2S_GPIO_DIN,
AUDIO_CODEC_PA_PIN,
AUDIO_CODEC_ES8311_ADDR);
return &audio_codec;
}
// 获取显示屏
virtual Display* GetDisplay() override {
return display_;
}
// 获取背光控制
virtual Backlight* GetBacklight() override {
static PwmBacklight backlight(DISPLAY_BACKLIGHT_PIN, DISPLAY_BACKLIGHT_OUTPUT_INVERT);
return &backlight;
}
};
// 注册开发板
DECLARE_BOARD(MyCustomBoard);
```
### 4. 添加构建系统配置
#### 在 Kconfig.projbuild 中添加开发板选项
打开 `main/Kconfig.projbuild` 文件,在 `choice BOARD_TYPE` 部分添加新的开发板配置项:
```kconfig
choice BOARD_TYPE
prompt "Board Type"
default BOARD_TYPE_BREAD_COMPACT_WIFI
help
Board type. 开发板类型
# ... 其他开发板选项 ...
config BOARD_TYPE_MY_CUSTOM_BOARD
bool "My Custom Board (我的自定义开发板)"
depends on IDF_TARGET_ESP32S3 # 根据你的目标芯片修改
endchoice
```
**注意事项:**
- `BOARD_TYPE_MY_CUSTOM_BOARD` 是配置项名称,需要全大写,使用下划线分隔
- `depends on` 指定了目标芯片类型(如 `IDF_TARGET_ESP32S3``IDF_TARGET_ESP32C3` 等)
- 描述文字可以使用中英文
#### 在 CMakeLists.txt 中添加开发板配置
打开 `main/CMakeLists.txt` 文件,在开发板类型判断部分添加新的配置:
```cmake
# 在 elseif 链中添加你的开发板配置
elseif(CONFIG_BOARD_TYPE_MY_CUSTOM_BOARD)
set(BOARD_TYPE "my-custom-board") # 与目录名一致
set(BUILTIN_TEXT_FONT font_puhui_basic_20_4) # 根据屏幕大小选择合适的字体
set(BUILTIN_ICON_FONT font_awesome_20_4)
set(DEFAULT_EMOJI_COLLECTION twemoji_64) # 可选,如果需要表情显示
endif()
```
**字体和表情配置说明:**
根据屏幕分辨率选择合适的字体大小:
- 小屏幕(128x64 OLED):`font_puhui_basic_14_1` / `font_awesome_14_1`
- 中小屏幕(240x240):`font_puhui_basic_16_4` / `font_awesome_16_4`
- 中等屏幕(240x320):`font_puhui_basic_20_4` / `font_awesome_20_4`
- 大屏幕(480x320+):`font_puhui_basic_30_4` / `font_awesome_30_4`
表情集合选项:
- `twemoji_32` - 32x32 像素表情(小屏幕)
- `twemoji_64` - 64x64 像素表情(大屏幕)
### 5. 配置和编译
#### 方法一:使用 idf.py 手动配置
1. **设置目标芯片**(首次配置或更换芯片时):
```bash
# 对于 ESP32-S3
idf.py set-target esp32s3
# 对于 ESP32-C3
idf.py set-target esp32c3
# 对于 ESP32
idf.py set-target esp32
```
2. **清理旧配置**
```bash
idf.py fullclean
```
3. **进入配置菜单**
```bash
idf.py menuconfig
```
在菜单中导航到:`Xiaozhi Assistant` -> `Board Type`,选择你的自定义开发板。
4. **编译和烧录**
```bash
idf.py build
idf.py flash monitor
```
#### 方法二:使用 release.py 脚本(推荐)
如果你的开发板目录下有 `config.json` 文件,可以使用此脚本自动完成配置和编译:
```bash
python scripts/release.py my-custom-board
```
此脚本会自动:
- 读取 `config.json` 中的 `target` 配置并设置目标芯片
- 应用 `sdkconfig_append` 中的编译选项
- 完成编译并打包固件
### 6. 创建README.md
在README.md中说明开发板的特性、硬件要求、编译和烧录步骤:
## 常见开发板组件
### 1. 显示屏
项目支持多种显示屏驱动,包括:
- ST7789 (SPI)
- ILI9341 (SPI)
- SH8601 (QSPI)
- 等...
### 2. 音频编解码器
支持的编解码器包括:
- ES8311 (常用)
- ES7210 (麦克风阵列)
- AW88298 (功放)
- 等...
### 3. 电源管理
一些开发板使用电源管理芯片:
- AXP2101
- 其他可用的PMIC
### 4. MCP设备控制
可以添加各种MCP工具,让AI能够使用:
- Speaker (扬声器控制)
- Screen (屏幕亮度调节)
- Battery (电池电量读取)
- Light (灯光控制)
- 等...
## 开发板类继承关系
- `Board` - 基础板级类
- `WifiBoard` - Wi-Fi连接的开发板
- `Ml307Board` - 使用4G模块的开发板
- `DualNetworkBoard` - 支持Wi-Fi与4G网络切换的开发板
## 开发技巧
1. **参考相似的开发板**:如果您的新开发板与现有开发板有相似之处,可以参考现有实现
2. **分步调试**:先实现基础功能(如显示),再添加更复杂的功能(如音频)
3. **管脚映射**:确保在config.h中正确配置所有管脚映射
4. **检查硬件兼容性**:确认所有芯片和驱动程序的兼容性
## 可能遇到的问题
1. **显示屏不正常**:检查SPI配置、镜像设置和颜色反转设置
2. **音频无输出**:检查I2S配置、PA使能引脚和编解码器地址
3. **无法连接网络**:检查Wi-Fi凭据和网络配置
4. **无法与服务器通信**:检查MQTT或WebSocket配置
## 参考资料
- ESP-IDF 文档: https://docs.espressif.com/projects/esp-idf/
- LVGL 文档: https://docs.lvgl.io/
- ESP-SR 文档: https://github.com/espressif/esp-sr
Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

+269
View File
@@ -0,0 +1,269 @@
# MCP (Model Context Protocol) 交互流程
NOTICE: AI 辅助生成, 在实现后台服务时, 请参照代码确认细节!!
本项目中的 MCP 协议用于后台 API(MCP 客户端)与 ESP32 设备(MCP 服务器)之间的通信,以便后台能够发现和调用设备提供的功能(工具)。
## 协议格式
根据代码 (`main/protocols/protocol.cc`, `main/mcp_server.cc`),MCP 消息是封装在基础通信协议(如 WebSocket 或 MQTT)的消息体中的。其内部结构遵循 [JSON-RPC 2.0](https://www.jsonrpc.org/specification) 规范。
整体消息结构示例:
```json
{
"session_id": "...", // 会话 ID
"type": "mcp", // 消息类型,固定为 "mcp"
"payload": { // JSON-RPC 2.0 负载
"jsonrpc": "2.0",
"method": "...", // 方法名 (如 "initialize", "tools/list", "tools/call")
"params": { ... }, // 方法参数 (对于 request)
"id": ..., // 请求 ID (对于 request 和 response)
"result": { ... }, // 方法执行结果 (对于 success response)
"error": { ... } // 错误信息 (对于 error response)
}
}
```
其中,`payload` 部分是标准的 JSON-RPC 2.0 消息:
- `jsonrpc`: 固定的字符串 "2.0"。
- `method`: 要调用的方法名称 (对于 Request)。
- `params`: 方法的参数,一个结构化值,通常为对象 (对于 Request)。
- `id`: 请求的标识符,客户端发送请求时提供,服务器响应时原样返回。用于匹配请求和响应。
- `result`: 方法成功执行时的结果 (对于 Success Response)。
- `error`: 方法执行失败时的错误信息 (对于 Error Response)。
## 交互流程及发送时机
MCP 的交互主要围绕客户端(后台 API)发现和调用设备上的“工具”(Tool)进行。
1. **连接建立与能力通告**
- **时机:** 设备启动并成功连接到后台 API 后。
- **发送方:** 设备。
- **消息:** 设备发送基础协议的 "hello" 消息给后台 API,消息中包含设备支持的能力列表,例如通过支持 MCP 协议 (`"mcp": true`)。
- **示例 (非 MCP 负载,而是基础协议消息):**
```json
{
"type": "hello",
"version": ...,
"features": {
"mcp": true,
...
},
"transport": "websocket", // 或 "mqtt"
"audio_params": { ... },
"session_id": "..." // 设备收到服务器hello后可能设置
}
```
2. **初始化 MCP 会话**
- **时机:** 后台 API 收到设备 "hello" 消息,确认设备支持 MCP 后,通常作为 MCP 会话的第一个请求发送。
- **发送方:** 后台 API (客户端)。
- **方法:** `initialize`
- **消息 (MCP payload):**
```json
{
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"capabilities": {
// 客户端能力,可选
// 摄像头视觉相关
"vision": {
"url": "...", //摄像头: 图片处理地址(必须是http地址, 不是websocket地址)
"token": "..." // url token
}
// ... 其他客户端能力
}
},
"id": 1 // 请求 ID
}
```
- **设备响应时机:** 设备收到 `initialize` 请求并处理后。
- **设备响应消息 (MCP payload):**
```json
{
"jsonrpc": "2.0",
"id": 1, // 匹配请求 ID
"result": {
"protocolVersion": "2024-11-05",
"capabilities": {
"tools": {} // 这里的 tools 似乎不列出详细信息,需要 tools/list
},
"serverInfo": {
"name": "...", // 设备名称 (BOARD_NAME)
"version": "..." // 设备固件版本
}
}
}
```
3. **发现设备工具列表**
- **时机:** 后台 API 需要获取设备当前支持的具体功能(工具)列表及其调用方式时。
- **发送方:** 后台 API (客户端)。
- **方法:** `tools/list`
- **消息 (MCP payload):**
```json
{
"jsonrpc": "2.0",
"method": "tools/list",
"params": {
"cursor": "" // 用于分页,首次请求为空字符串
},
"id": 2 // 请求 ID
}
```
- **设备响应时机:** 设备收到 `tools/list` 请求并生成工具列表后。
- **设备响应消息 (MCP payload):**
```json
{
"jsonrpc": "2.0",
"id": 2, // 匹配请求 ID
"result": {
"tools": [ // 工具对象列表
{
"name": "self.get_device_status",
"description": "...",
"inputSchema": { ... } // 参数 schema
},
{
"name": "self.audio_speaker.set_volume",
"description": "...",
"inputSchema": { ... } // 参数 schema
}
// ... 更多工具
],
"nextCursor": "..." // 如果列表很大需要分页,这里会包含下一个请求的 cursor 值
}
}
```
- **分页处理:** 如果 `nextCursor` 字段非空,客户端需要再次发送 `tools/list` 请求,并在 `params` 中带上这个 `cursor` 值以获取下一页工具。
4. **调用设备工具**
- **时机:** 后台 API 需要执行设备上的某个具体功能时。
- **发送方:** 后台 API (客户端)。
- **方法:** `tools/call`
- **消息 (MCP payload):**
```json
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "self.audio_speaker.set_volume", // 要调用的工具名称
"arguments": {
// 工具参数,对象格式
"volume": 50 // 参数名及其值
}
},
"id": 3 // 请求 ID
}
```
- **设备响应时机:** 设备收到 `tools/call` 请求,执行相应的工具函数后。
- **设备成功响应消息 (MCP payload):**
```json
{
"jsonrpc": "2.0",
"id": 3, // 匹配请求 ID
"result": {
"content": [
// 工具执行结果内容
{ "type": "text", "text": "true" } // 示例:set_volume 返回 bool
],
"isError": false // 表示成功
}
}
```
- **设备失败响应消息 (MCP payload):**
```json
{
"jsonrpc": "2.0",
"id": 3, // 匹配请求 ID
"error": {
"code": -32601, // JSON-RPC 错误码,例如 Method not found (-32601)
"message": "Unknown tool: self.non_existent_tool" // 错误描述
}
}
```
5. **设备主动发送消息 (Notifications)**
- **时机:** 设备内部发生需要通知后台 API 的事件时(例如,状态变化,虽然代码示例中没有明确的工具发送此类消息,但 `Application::SendMcpMessage` 的存在暗示了设备可能主动发送 MCP 消息)。
- **发送方:** 设备 (服务器)。
- **方法:** 可能是以 `notifications/` 开头的方法名,或者其他自定义方法。
- **消息 (MCP payload):** 遵循 JSON-RPC Notification 格式,没有 `id` 字段。
```json
{
"jsonrpc": "2.0",
"method": "notifications/state_changed", // 示例方法名
"params": {
"newState": "idle",
"oldState": "connecting"
}
// 没有 id 字段
}
```
- **后台 API 处理:** 接收到 Notification 后,后台 API 进行相应的处理,但不回复。
## 交互图
下面是一个简化的交互序列图,展示了主要的 MCP 消息流程:
```mermaid
sequenceDiagram
participant Device as ESP32 Device
participant BackendAPI as 后台 API (Client)
Note over Device, BackendAPI: 建立 WebSocket / MQTT 连接
Device->>BackendAPI: Hello Message (包含 "mcp": true)
BackendAPI->>Device: MCP Initialize Request
Note over BackendAPI: method: initialize
Note over BackendAPI: params: { capabilities: ... }
Device->>BackendAPI: MCP Initialize Response
Note over Device: result: { protocolVersion: ..., serverInfo: ... }
BackendAPI->>Device: MCP Get Tools List Request
Note over BackendAPI: method: tools/list
Note over BackendAPI: params: { cursor: "" }
Device->>BackendAPI: MCP Get Tools List Response
Note over Device: result: { tools: [...], nextCursor: ... }
loop Optional Pagination
BackendAPI->>Device: MCP Get Tools List Request
Note over BackendAPI: method: tools/list
Note over BackendAPI: params: { cursor: "..." }
Device->>BackendAPI: MCP Get Tools List Response
Note over Device: result: { tools: [...], nextCursor: "" }
end
BackendAPI->>Device: MCP Call Tool Request
Note over BackendAPI: method: tools/call
Note over BackendAPI: params: { name: "...", arguments: { ... } }
alt Tool Call Successful
Device->>BackendAPI: MCP Tool Call Success Response
Note over Device: result: { content: [...], isError: false }
else Tool Call Failed
Device->>BackendAPI: MCP Tool Call Error Response
Note over Device: error: { code: ..., message: ... }
end
opt Device Notification
Device->>BackendAPI: MCP Notification
Note over Device: method: notifications/...
Note over Device: params: { ... }
end
```
这份文档概述了该项目中 MCP 协议的主要交互流程。具体的参数细节和工具功能需要参考 `main/mcp_server.cc` 中 `McpServer::AddCommonTools` 以及各个工具的实现。
+115
View File
@@ -0,0 +1,115 @@
# MCP 协议物联网控制用法说明
> 本文档介绍如何基于 MCP 协议实现 ESP32 设备的物联网控制。详细协议流程请参考 [`mcp-protocol.md`](./mcp-protocol.md)。
## 简介
MCPModel Context Protocol)是新一代推荐用于物联网控制的协议,通过标准 JSON-RPC 2.0 格式在后台与设备间发现和调用"工具"(Tool),实现灵活的设备控制。
## 典型使用流程
1. 设备启动后通过基础协议(如 WebSocket/MQTT)与后台建立连接。
2. 后台通过 MCP 协议的 `initialize` 方法初始化会话。
3. 后台通过 `tools/list` 获取设备支持的所有工具(功能)及参数说明。
4. 后台通过 `tools/call` 调用具体工具,实现对设备的控制。
详细协议格式与交互请见 [`mcp-protocol.md`](./mcp-protocol.md)。
## 设备端工具注册方法说明
设备通过 `McpServer::AddTool` 方法注册可被后台调用的"工具"。其常用函数签名如下:
```cpp
void AddTool(
const std::string& name, // 工具名称,建议唯一且有层次感,如 self.dog.forward
const std::string& description, // 工具描述,简明说明功能,便于大模型理解
const PropertyList& properties, // 输入参数列表(可为空),支持类型:布尔、整数、字符串
std::function<ReturnValue(const PropertyList&)> callback // 工具被调用时的回调实现
);
```
- name:工具唯一标识,建议用"模块.功能"命名风格。
- description:自然语言描述,便于 AI/用户理解。
- properties:参数列表,支持类型有布尔、整数、字符串,可指定范围和默认值。
- callback:收到调用请求时的实际执行逻辑,返回值可为 bool/int/string。
## 典型注册示例(以 ESP-Hi 为例)
```cpp
void InitializeTools() {
auto& mcp_server = McpServer::GetInstance();
// 例1:无参数,控制机器人前进
mcp_server.AddTool("self.dog.forward", "机器人向前移动", PropertyList(), [this](const PropertyList&) -> ReturnValue {
servo_dog_ctrl_send(DOG_STATE_FORWARD, NULL);
return true;
});
// 例2:带参数,设置灯光 RGB 颜色
mcp_server.AddTool("self.light.set_rgb", "设置RGB颜色", PropertyList({
Property("r", kPropertyTypeInteger, 0, 255),
Property("g", kPropertyTypeInteger, 0, 255),
Property("b", kPropertyTypeInteger, 0, 255)
}), [this](const PropertyList& properties) -> ReturnValue {
int r = properties["r"].value<int>();
int g = properties["g"].value<int>();
int b = properties["b"].value<int>();
led_on_ = true;
SetLedColor(r, g, b);
return true;
});
}
```
## 常见工具调用 JSON-RPC 示例
### 1. 获取工具列表
```json
{
"jsonrpc": "2.0",
"method": "tools/list",
"params": { "cursor": "" },
"id": 1
}
```
### 2. 控制底盘前进
```json
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "self.chassis.go_forward",
"arguments": {}
},
"id": 2
}
```
### 3. 切换灯光模式
```json
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "self.chassis.switch_light_mode",
"arguments": { "light_mode": 3 }
},
"id": 3
}
```
### 4. 摄像头翻转
```json
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "self.camera.set_camera_flipped",
"arguments": {}
},
"id": 4
}
```
## 备注
- 工具名称、参数及返回值请以设备端 `AddTool` 注册为准。
- 推荐所有新项目统一采用 MCP 协议进行物联网控制。
- 详细协议与进阶用法请查阅 [`mcp-protocol.md`](./mcp-protocol.md)。
+393
View File
@@ -0,0 +1,393 @@
# MQTT + UDP 混合通信协议文档
基于代码实现整理的 MQTT + UDP 混合通信协议文档,概述设备端与服务器之间如何通过 MQTT 进行控制消息传输,通过 UDP 进行音频数据传输的交互方式。
---
## 1. 协议概览
本协议采用混合传输方式:
- **MQTT**:用于控制消息、状态同步、JSON 数据交换
- **UDP**:用于实时音频数据传输,支持加密
### 1.1 协议特点
- **双通道设计**:控制与数据分离,确保实时性
- **加密传输**UDP 音频数据使用 AES-CTR 加密
- **序列号保护**:防止数据包重放和乱序
- **自动重连**:MQTT 连接断开时自动重连
---
## 2. 总体流程概览
```mermaid
sequenceDiagram
participant Device as ESP32 设备
participant MQTT as MQTT 服务器
participant UDP as UDP 服务器
Note over Device, UDP: 1. 建立 MQTT 连接
Device->>MQTT: MQTT Connect
MQTT->>Device: Connected
Note over Device, UDP: 2. 请求音频通道
Device->>MQTT: Hello Message (type: "hello", transport: "udp")
MQTT->>Device: Hello Response (UDP 连接信息 + 加密密钥)
Note over Device, UDP: 3. 建立 UDP 连接
Device->>UDP: UDP Connect
UDP->>Device: Connected
Note over Device, UDP: 4. 音频数据传输
loop 音频流传输
Device->>UDP: 加密音频数据 (Opus)
UDP->>Device: 加密音频数据 (Opus)
end
Note over Device, UDP: 5. 控制消息交换
par 控制消息
Device->>MQTT: Listen/TTS/MCP 消息
MQTT->>Device: STT/TTS/MCP 响应
end
Note over Device, UDP: 6. 关闭连接
Device->>MQTT: Goodbye Message
Device->>UDP: Disconnect
```
---
## 3. MQTT 控制通道
### 3.1 连接建立
设备通过 MQTT 连接到服务器,连接参数包括:
- **Endpoint**MQTT 服务器地址和端口
- **Client ID**:设备唯一标识符
- **Username/Password**:认证凭据
- **Keep Alive**:心跳间隔(默认240秒)
### 3.2 Hello 消息交换
#### 3.2.1 设备端发送 Hello
```json
{
"type": "hello",
"version": 3,
"transport": "udp",
"features": {
"mcp": true
},
"audio_params": {
"format": "opus",
"sample_rate": 16000,
"channels": 1,
"frame_duration": 60
}
}
```
#### 3.2.2 服务器响应 Hello
```json
{
"type": "hello",
"transport": "udp",
"session_id": "xxx",
"audio_params": {
"format": "opus",
"sample_rate": 24000,
"channels": 1,
"frame_duration": 60
},
"udp": {
"server": "192.168.1.100",
"port": 8888,
"key": "0123456789ABCDEF0123456789ABCDEF",
"nonce": "0123456789ABCDEF0123456789ABCDEF"
}
}
```
**字段说明:**
- `udp.server`UDP 服务器地址
- `udp.port`UDP 服务器端口
- `udp.key`AES 加密密钥(十六进制字符串)
- `udp.nonce`:AES 加密随机数(十六进制字符串)
### 3.3 JSON 消息类型
#### 3.3.1 设备端→服务器
1. **Listen 消息**
```json
{
"session_id": "xxx",
"type": "listen",
"state": "start",
"mode": "manual"
}
```
2. **Abort 消息**
```json
{
"session_id": "xxx",
"type": "abort",
"reason": "wake_word_detected"
}
```
3. **MCP 消息**
```json
{
"session_id": "xxx",
"type": "mcp",
"payload": {
"jsonrpc": "2.0",
"id": 1,
"result": {...}
}
}
```
4. **Goodbye 消息**
```json
{
"session_id": "xxx",
"type": "goodbye"
}
```
#### 3.3.2 服务器→设备端
支持的消息类型与 WebSocket 协议一致,包括:
- **STT**:语音识别结果
- **TTS**:语音合成控制
- **LLM**:情感表达控制
- **MCP**:物联网控制
- **System**:系统控制
- **Custom**:自定义消息(可选)
---
## 4. UDP 音频通道
### 4.1 连接建立
设备收到 MQTT Hello 响应后,使用其中的 UDP 连接信息建立音频通道:
1. 解析 UDP 服务器地址和端口
2. 解析加密密钥和随机数
3. 初始化 AES-CTR 加密上下文
4. 建立 UDP 连接
### 4.2 音频数据格式
#### 4.2.1 加密音频包结构
```
|type 1byte|flags 1byte|payload_len 2bytes|ssrc 4bytes|timestamp 4bytes|sequence 4bytes|
|payload payload_len bytes|
```
**字段说明:**
- `type`:数据包类型,固定为 0x01
- `flags`:标志位,当前未使用
- `payload_len`:负载长度(网络字节序)
- `ssrc`:同步源标识符
- `timestamp`:时间戳(网络字节序)
- `sequence`:序列号(网络字节序)
- `payload`:加密的 Opus 音频数据
#### 4.2.2 加密算法
使用 **AES-CTR** 模式加密:
- **密钥**:128位,由服务器提供
- **随机数**:128位,由服务器提供
- **计数器**:包含时间戳和序列号信息
### 4.3 序列号管理
- **发送端**`local_sequence_` 单调递增
- **接收端**`remote_sequence_` 验证连续性
- **防重放**:拒绝序列号小于期望值的数据包
- **容错处理**:允许轻微的序列号跳跃,记录警告
### 4.4 错误处理
1. **解密失败**:记录错误,丢弃数据包
2. **序列号异常**:记录警告,但仍处理数据包
3. **数据包格式错误**:记录错误,丢弃数据包
---
## 5. 状态管理
### 5.1 连接状态
```mermaid
stateDiagram
direction TB
[*] --> Disconnected
Disconnected --> MqttConnecting: StartMqttClient()
MqttConnecting --> MqttConnected: MQTT Connected
MqttConnecting --> Disconnected: Connect Failed
MqttConnected --> RequestingChannel: OpenAudioChannel()
RequestingChannel --> ChannelOpened: Hello Exchange Success
RequestingChannel --> MqttConnected: Hello Timeout/Failed
ChannelOpened --> UdpConnected: UDP Connect Success
UdpConnected --> AudioStreaming: Start Audio Transfer
AudioStreaming --> UdpConnected: Stop Audio Transfer
UdpConnected --> ChannelOpened: UDP Disconnect
ChannelOpened --> MqttConnected: CloseAudioChannel()
MqttConnected --> Disconnected: MQTT Disconnect
```
### 5.2 状态检查
设备通过以下条件判断音频通道是否可用:
```cpp
bool IsAudioChannelOpened() const {
return udp_ != nullptr && !error_occurred_ && !IsTimeout();
}
```
---
## 6. 配置参数
### 6.1 MQTT 配置
从设置中读取的配置项:
- `endpoint`MQTT 服务器地址
- `client_id`:客户端标识符
- `username`:用户名
- `password`:密码
- `keepalive`:心跳间隔(默认240秒)
- `publish_topic`:发布主题
### 6.2 音频参数
- **格式**Opus
- **采样率**16000 Hz(设备端)/ 24000 Hz(服务器端)
- **声道数**1(单声道)
- **帧时长**60ms
---
## 7. 错误处理与重连
### 7.1 MQTT 重连机制
- 连接失败时自动重试
- 支持错误上报控制
- 断线时触发清理流程
### 7.2 UDP 连接管理
- 连接失败时不自动重试
- 依赖 MQTT 通道重新协商
- 支持连接状态查询
### 7.3 超时处理
基类 `Protocol` 提供超时检测:
- 默认超时时间:120 秒
- 基于最后接收时间计算
- 超时时自动标记为不可用
---
## 8. 安全考虑
### 8.1 传输加密
- **MQTT**:支持 TLS/SSL 加密(端口8883
- **UDP**:使用 AES-CTR 加密音频数据
### 8.2 认证机制
- **MQTT**:用户名/密码认证
- **UDP**:通过 MQTT 通道分发密钥
### 8.3 防重放攻击
- 序列号单调递增
- 拒绝过期数据包
- 时间戳验证
---
## 9. 性能优化
### 9.1 并发控制
使用互斥锁保护 UDP 连接:
```cpp
std::lock_guard<std::mutex> lock(channel_mutex_);
```
### 9.2 内存管理
- 动态创建/销毁网络对象
- 智能指针管理音频数据包
- 及时释放加密上下文
### 9.3 网络优化
- UDP 连接复用
- 数据包大小优化
- 序列号连续性检查
---
## 10. 与 WebSocket 协议的比较
| 特性 | MQTT + UDP | WebSocket |
|------|------------|-----------|
| 控制通道 | MQTT | WebSocket |
| 音频通道 | UDP (加密) | WebSocket (二进制) |
| 实时性 | 高 (UDP) | 中等 |
| 可靠性 | 中等 | 高 |
| 复杂度 | 高 | 低 |
| 加密 | AES-CTR | TLS |
| 防火墙友好度 | 低 | 高 |
---
## 11. 部署建议
### 11.1 网络环境
- 确保 UDP 端口可达
- 配置防火墙规则
- 考虑 NAT 穿透
### 11.2 服务器配置
- MQTT Broker 配置
- UDP 服务器部署
- 密钥管理系统
### 11.3 监控指标
- 连接成功率
- 音频传输延迟
- 数据包丢失率
- 解密失败率
---
## 12. 总结
MQTT + UDP 混合协议通过以下设计实现高效的音视频通信:
- **分离式架构**:控制与数据通道分离,各司其职
- **加密保护**:AES-CTR 确保音频数据安全传输
- **序列化管理**:防止重放攻击和数据乱序
- **自动恢复**:支持连接断开后的自动重连
- **性能优化**:UDP 传输保证音频数据的实时性
该协议适用于对实时性要求较高的语音交互场景,但需要在网络复杂度和传输性能之间做出权衡。
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

+495
View File
@@ -0,0 +1,495 @@
以下是一份基于代码实现整理的 WebSocket 通信协议文档,概述设备端与服务器之间如何通过 WebSocket 进行交互。
该文档仅基于所提供的代码推断,实际部署时可能需要结合服务器端实现进行进一步确认或补充。
---
## 1. 总体流程概览
1. **设备端初始化**
- 设备上电、初始化 `Application`
- 初始化音频编解码器、显示屏、LED 等
- 连接网络
- 创建并初始化实现 `Protocol` 接口的 WebSocket 协议实例(`WebsocketProtocol`
- 进入主循环等待事件(音频输入、音频输出、调度任务等)。
2. **建立 WebSocket 连接**
- 当设备需要开始语音会话时(例如用户唤醒、手动按键触发等),调用 `OpenAudioChannel()`
- 根据配置获取 WebSocket URL
- 设置若干请求头(`Authorization`, `Protocol-Version`, `Device-Id`, `Client-Id`
- 调用 `Connect()` 与服务器建立 WebSocket 连接
3. **设备端发送 "hello" 消息**
- 连接成功后,设备会发送一条 JSON 消息,示例结构如下:
```json
{
"type": "hello",
"version": 1,
"features": {
"mcp": true
},
"transport": "websocket",
"audio_params": {
"format": "opus",
"sample_rate": 16000,
"channels": 1,
"frame_duration": 60
}
}
```
- 其中 `features` 字段为可选,内容根据设备编译配置自动生成。例如:`"mcp": true` 表示支持 MCP 协议。
- `frame_duration` 的值对应 `OPUS_FRAME_DURATION_MS`(例如 60ms)。
4. **服务器回复 "hello"**
- 设备等待服务器返回一条包含 `"type": "hello"` 的 JSON 消息,并检查 `"transport": "websocket"` 是否匹配。
- 服务器可选下发 `session_id` 字段,设备端收到后会自动记录。
- 示例:
```json
{
"type": "hello",
"transport": "websocket",
"session_id": "xxx",
"audio_params": {
"format": "opus",
"sample_rate": 24000,
"channels": 1,
"frame_duration": 60
}
}
```
- 如果匹配,则认为服务器已就绪,标记音频通道打开成功。
- 如果在超时时间(默认 10 秒)内未收到正确回复,认为连接失败并触发网络错误回调。
5. **后续消息交互**
- 设备端和服务器端之间可发送两种主要类型的数据:
1. **二进制音频数据**(Opus 编码)
2. **文本 JSON 消息**(用于传输聊天状态、TTS/STT 事件、MCP 协议消息等)
- 在代码里,接收回调主要分为:
- `OnData(...)`:
- 当 `binary` 为 `true` 时,认为是音频帧;设备会将其当作 Opus 数据进行解码。
- 当 `binary` 为 `false` 时,认为是 JSON 文本,需要在设备端用 cJSON 进行解析并做相应业务逻辑处理(如聊天、TTS、MCP 协议消息等)。
- 当服务器或网络出现断连,回调 `OnDisconnected()` 被触发:
- 设备会调用 `on_audio_channel_closed_()`,并最终回到空闲状态。
6. **关闭 WebSocket 连接**
- 设备在需要结束语音会话时,会调用 `CloseAudioChannel()` 主动断开连接,并回到空闲状态。
- 或者如果服务器端主动断开,也会引发同样的回调流程。
---
## 2. 通用请求头
在建立 WebSocket 连接时,代码示例中设置了以下请求头:
- `Authorization`: 用于存放访问令牌,形如 `"Bearer <token>"`
- `Protocol-Version`: 协议版本号,与 hello 消息体内的 `version` 字段保持一致
- `Device-Id`: 设备物理网卡 MAC 地址
- `Client-Id`: 软件生成的 UUID(擦除 NVS 或重新烧录完整固件会重置)
这些头会随着 WebSocket 握手一起发送到服务器,服务器可根据需求进行校验、认证等。
---
## 3. 二进制协议版本
设备支持多种二进制协议版本,通过配置中的 `version` 字段指定:
### 3.1 版本1(默认)
直接发送 Opus 音频数据,无额外元数据。Websocket 协议会区分 text 与 binary。
### 3.2 版本2
使用 `BinaryProtocol2` 结构:
```c
struct BinaryProtocol2 {
uint16_t version; // 协议版本
uint16_t type; // 消息类型 (0: OPUS, 1: JSON)
uint32_t reserved; // 保留字段
uint32_t timestamp; // 时间戳(毫秒,用于服务器端AEC)
uint32_t payload_size; // 负载大小(字节)
uint8_t payload[]; // 负载数据
} __attribute__((packed));
```
### 3.3 版本3
使用 `BinaryProtocol3` 结构:
```c
struct BinaryProtocol3 {
uint8_t type; // 消息类型
uint8_t reserved; // 保留字段
uint16_t payload_size; // 负载大小
uint8_t payload[]; // 负载数据
} __attribute__((packed));
```
---
## 4. JSON 消息结构
WebSocket 文本帧以 JSON 方式传输,以下为常见的 `"type"` 字段及其对应业务逻辑。若消息里包含未列出的字段,可能为可选或特定实现细节。
### 4.1 设备端→服务器
1. **Hello**
- 连接成功后,由设备端发送,告知服务器基本参数。
- 例:
```json
{
"type": "hello",
"version": 1,
"features": {
"mcp": true
},
"transport": "websocket",
"audio_params": {
"format": "opus",
"sample_rate": 16000,
"channels": 1,
"frame_duration": 60
}
}
```
2. **Listen**
- 表示设备端开始或停止录音监听。
- 常见字段:
- `"session_id"`:会话标识
- `"type": "listen"`
- `"state"``"start"`, `"stop"`, `"detect"`(唤醒检测已触发)
- `"mode"``"auto"`, `"manual"` 或 `"realtime"`,表示识别模式。
- 例:开始监听
```json
{
"session_id": "xxx",
"type": "listen",
"state": "start",
"mode": "manual"
}
```
3. **Abort**
- 终止当前说话(TTS 播放)或语音通道。
- 例:
```json
{
"session_id": "xxx",
"type": "abort",
"reason": "wake_word_detected"
}
```
- `reason` 值可为 `"wake_word_detected"` 或其他。
4. **Wake Word Detected**
- 用于设备端向服务器告知检测到唤醒词。
- 在发送该消息之前,可提前发送唤醒词的 Opus 音频数据,用于服务器进行声纹检测。
- 例:
```json
{
"session_id": "xxx",
"type": "listen",
"state": "detect",
"text": "你好小明"
}
```
5. **MCP**
- 推荐用于物联网控制的新一代协议。所有设备能力发现、工具调用等均通过 type: "mcp" 的消息进行,payload 内部为标准 JSON-RPC 2.0(详见 [MCP 协议文档](./mcp-protocol.md))。
- **设备端到服务器发送 result 的例子:**
```json
{
"session_id": "xxx",
"type": "mcp",
"payload": {
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{ "type": "text", "text": "true" }
],
"isError": false
}
}
}
```
---
### 4.2 服务器→设备端
1. **Hello**
- 服务器端返回的握手确认消息。
- 必须包含 `"type": "hello"` 和 `"transport": "websocket"`。
- 可能会带有 `audio_params`,表示服务器期望的音频参数,或与设备端对齐的配置。
- 服务器可选下发 `session_id` 字段,设备端收到后会自动记录。
- 成功接收后设备端会设置事件标志,表示 WebSocket 通道就绪。
2. **STT**
- `{"session_id": "xxx", "type": "stt", "text": "..."}`
- 表示服务器端识别到了用户语音。(例如语音转文本结果)
- 设备可能将此文本显示到屏幕上,后续再进入回答等流程。
3. **LLM**
- `{"session_id": "xxx", "type": "llm", "emotion": "happy", "text": "😀"}`
- 服务器指示设备调整表情动画 / UI 表达。
4. **TTS**
- `{"session_id": "xxx", "type": "tts", "state": "start"}`:服务器准备下发 TTS 音频,设备端进入 "speaking" 播放状态。
- `{"session_id": "xxx", "type": "tts", "state": "stop"}`:表示本次 TTS 结束。
- `{"session_id": "xxx", "type": "tts", "state": "sentence_start", "text": "..."}`
- 让设备在界面上显示当前要播放或朗读的文本片段(例如用于显示给用户)。
5. **MCP**
- 服务器通过 type: "mcp" 的消息下发物联网相关的控制指令或返回调用结果,payload 结构同上。
- **服务器到设备端发送 tools/call 的例子:**
```json
{
"session_id": "xxx",
"type": "mcp",
"payload": {
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "self.light.set_rgb",
"arguments": { "r": 255, "g": 0, "b": 0 }
},
"id": 1
}
}
```
6. **System**
- 系统控制命令,常用于远程升级更新。
- 例:
```json
{
"session_id": "xxx",
"type": "system",
"command": "reboot"
}
```
- 支持的命令:
- `"reboot"`:重启设备
7. **Custom**(可选)
- 自定义消息,当 `CONFIG_RECEIVE_CUSTOM_MESSAGE` 启用时支持。
- 例:
```json
{
"session_id": "xxx",
"type": "custom",
"payload": {
"message": "自定义内容"
}
}
```
8. **音频数据:二进制帧**
- 当服务器发送音频二进制帧(Opus 编码)时,设备端解码并播放。
- 若设备端正在处于 "listening" (录音)状态,收到的音频帧会被忽略或清空以防冲突。
---
## 5. 音频编解码
1. **设备端发送录音数据**
- 音频输入经过可能的回声消除、降噪或音量增益后,通过 Opus 编码打包为二进制帧发送给服务器。
- 根据协议版本,可能直接发送 Opus 数据(版本1)或使用带元数据的二进制协议(版本2/3)。
2. **设备端播放收到的音频**
- 收到服务器的二进制帧时,同样认定是 Opus 数据。
- 设备端会进行解码,然后交由音频输出接口播放。
- 如果服务器的音频采样率与设备不一致,会在解码后再进行重采样。
---
## 6. 常见状态流转
以下为常见设备端关键状态流转,与 WebSocket 消息对应:
1. **Idle** → **Connecting**
- 用户触发或唤醒后,设备调用 `OpenAudioChannel()` → 建立 WebSocket 连接 → 发送 `"type":"hello"`。
2. **Connecting** → **Listening**
- 成功建立连接后,若继续执行 `SendStartListening(...)`,则进入录音状态。此时设备会持续编码麦克风数据并发送到服务器。
3. **Listening** → **Speaking**
- 收到服务器 TTS Start 消息 (`{"type":"tts","state":"start"}`) → 停止录音并播放接收到的音频。
4. **Speaking** → **Idle**
- 服务器 TTS Stop (`{"type":"tts","state":"stop"}`) → 音频播放结束。若未继续进入自动监听,则返回 Idle;如果配置了自动循环,则再度进入 Listening。
5. **Listening** / **Speaking** → **Idle**(遇到异常或主动中断)
- 调用 `SendAbortSpeaking(...)` 或 `CloseAudioChannel()` → 中断会话 → 关闭 WebSocket → 状态回到 Idle。
### 自动模式状态流转图
```mermaid
stateDiagram
direction TB
[*] --> kDeviceStateUnknown
kDeviceStateUnknown --> kDeviceStateStarting:初始化
kDeviceStateStarting --> kDeviceStateWifiConfiguring:配置WiFi
kDeviceStateStarting --> kDeviceStateActivating:激活设备
kDeviceStateActivating --> kDeviceStateUpgrading:检测到新版本
kDeviceStateActivating --> kDeviceStateIdle:激活完成
kDeviceStateIdle --> kDeviceStateConnecting:开始连接
kDeviceStateConnecting --> kDeviceStateIdle:连接失败
kDeviceStateConnecting --> kDeviceStateListening:连接成功
kDeviceStateListening --> kDeviceStateSpeaking:开始说话
kDeviceStateSpeaking --> kDeviceStateListening:结束说话
kDeviceStateListening --> kDeviceStateIdle:手动终止
kDeviceStateSpeaking --> kDeviceStateIdle:自动终止
```
### 手动模式状态流转图
```mermaid
stateDiagram
direction TB
[*] --> kDeviceStateUnknown
kDeviceStateUnknown --> kDeviceStateStarting:初始化
kDeviceStateStarting --> kDeviceStateWifiConfiguring:配置WiFi
kDeviceStateStarting --> kDeviceStateActivating:激活设备
kDeviceStateActivating --> kDeviceStateUpgrading:检测到新版本
kDeviceStateActivating --> kDeviceStateIdle:激活完成
kDeviceStateIdle --> kDeviceStateConnecting:开始连接
kDeviceStateConnecting --> kDeviceStateIdle:连接失败
kDeviceStateConnecting --> kDeviceStateListening:连接成功
kDeviceStateIdle --> kDeviceStateListening:开始监听
kDeviceStateListening --> kDeviceStateIdle:停止监听
kDeviceStateIdle --> kDeviceStateSpeaking:开始说话
kDeviceStateSpeaking --> kDeviceStateIdle:结束说话
```
---
## 7. 错误处理
1. **连接失败**
- 如果 `Connect(url)` 返回失败或在等待服务器 "hello" 消息时超时,触发 `on_network_error_()` 回调。设备会提示"无法连接到服务"或类似错误信息。
2. **服务器断开**
- 如果 WebSocket 异常断开,回调 `OnDisconnected()`
- 设备回调 `on_audio_channel_closed_()`
- 切换到 Idle 或其他重试逻辑。
---
## 8. 其它注意事项
1. **鉴权**
- 设备通过设置 `Authorization: Bearer <token>` 提供鉴权,服务器端需验证是否有效。
- 如果令牌过期或无效,服务器可拒绝握手或在后续断开。
2. **会话控制**
- 代码中部分消息包含 `session_id`,用于区分独立的对话或操作。服务端可根据需要对不同会话做分离处理。
3. **音频负载**
- 代码里默认使用 Opus 格式,并设置 `sample_rate = 16000`,单声道。帧时长由 `OPUS_FRAME_DURATION_MS` 控制,一般为 60ms。可根据带宽或性能做适当调整。为了获得更好的音乐播放效果,服务器下行音频可能使用 24000 采样率。
4. **协议版本配置**
- 通过设置中的 `version` 字段配置二进制协议版本(1、2 或 3)
- 版本1:直接发送 Opus 数据
- 版本2:使用带时间戳的二进制协议,适用于服务器端 AEC
- 版本3:使用简化的二进制协议
5. **物联网控制推荐 MCP 协议**
- 设备与服务器之间的物联网能力发现、状态同步、控制指令等,建议全部通过 MCP 协议(type: "mcp")实现。原有的 type: "iot" 方案已废弃。
- MCP 协议可在 WebSocket、MQTT 等多种底层协议上传输,具备更好的扩展性和标准化能力。
- 详细用法请参考 [MCP 协议文档](./mcp-protocol.md) 及 [MCP 物联网控制用法](./mcp-usage.md)。
6. **错误或异常 JSON**
- 当 JSON 中缺少必要字段,例如 `{"type": ...}`,设备端会记录错误日志(`ESP_LOGE(TAG, "Missing message type, data: %s", data);`),不会执行任何业务。
---
## 9. 消息示例
下面给出一个典型的双向消息示例(流程简化示意):
1. **设备端 → 服务器**(握手)
```json
{
"type": "hello",
"version": 1,
"features": {
"mcp": true
},
"transport": "websocket",
"audio_params": {
"format": "opus",
"sample_rate": 16000,
"channels": 1,
"frame_duration": 60
}
}
```
2. **服务器 → 设备端**(握手应答)
```json
{
"type": "hello",
"transport": "websocket",
"session_id": "xxx",
"audio_params": {
"format": "opus",
"sample_rate": 16000
}
}
```
3. **设备端 → 服务器**(开始监听)
```json
{
"session_id": "xxx",
"type": "listen",
"state": "start",
"mode": "auto"
}
```
同时设备端开始发送二进制帧(Opus 数据)。
4. **服务器 → 设备端**(ASR 结果)
```json
{
"session_id": "xxx",
"type": "stt",
"text": "用户说的话"
}
```
5. **服务器 → 设备端**(TTS开始)
```json
{
"session_id": "xxx",
"type": "tts",
"state": "start"
}
```
接着服务器发送二进制音频帧给设备端播放。
6. **服务器 → 设备端**(TTS结束)
```json
{
"session_id": "xxx",
"type": "tts",
"state": "stop"
}
```
设备端停止播放音频,若无更多指令,则回到空闲状态。
---
## 10. 总结
本协议通过在 WebSocket 上层传输 JSON 文本与二进制音频帧,完成功能包括音频流上传、TTS 音频播放、语音识别与状态管理、MCP 指令下发等。其核心特征:
- **握手阶段**:发送 `"type":"hello"`,等待服务器返回。
- **音频通道**:采用 Opus 编码的二进制帧双向传输语音流,支持多种协议版本。
- **JSON 消息**:使用 `"type"` 为核心字段标识不同业务逻辑,包括 TTS、STT、MCP、WakeWord、System、Custom 等。
- **扩展性**:可根据实际需求在 JSON 消息中添加字段,或在 headers 里进行额外鉴权。
服务器与设备端需提前约定各类消息的字段含义、时序逻辑以及错误处理规则,方能保证通信顺畅。上述信息可作为基础文档,便于后续对接、开发或扩展。
-559
View File
@@ -1,559 +0,0 @@
#include "Application.h"
#include "BuiltinLed.h"
#include "WifiStation.h"
#include <cstring>
#include "esp_log.h"
#include "model_path.h"
#include "SystemInfo.h"
#include "cJSON.h"
#define TAG "Application"
Application::Application() {
event_group_ = xEventGroupCreate();
audio_encode_queue_ = xQueueCreate(100, sizeof(iovec));
audio_decode_queue_ = xQueueCreate(100, sizeof(AudioPacket*));
srmodel_list_t *models = esp_srmodel_init("model");
for (int i = 0; i < models->num; i++) {
ESP_LOGI(TAG, "Model %d: %s", i, models->model_name[i]);
if (strstr(models->model_name[i], ESP_WN_PREFIX) != NULL) {
wakenet_model_ = models->model_name[i];
} else if (strstr(models->model_name[i], ESP_NSNET_PREFIX) != NULL) {
nsnet_model_ = models->model_name[i];
}
}
opus_encoder_.Configure(CONFIG_AUDIO_INPUT_SAMPLE_RATE, 1);
opus_decoder_ = opus_decoder_create(opus_decode_sample_rate_, 1, NULL);
if (opus_decode_sample_rate_ != CONFIG_AUDIO_OUTPUT_SAMPLE_RATE) {
opus_resampler_.Configure(opus_decode_sample_rate_, CONFIG_AUDIO_OUTPUT_SAMPLE_RATE);
}
}
Application::~Application() {
if (afe_detection_data_ != nullptr) {
esp_afe_sr_v1.destroy(afe_detection_data_);
}
if (afe_communication_data_ != nullptr) {
esp_afe_vc_v1.destroy(afe_communication_data_);
}
if (wake_word_encode_task_stack_ != nullptr) {
free(wake_word_encode_task_stack_);
}
for (auto& pcm : wake_word_pcm_) {
free(pcm.iov_base);
}
for (auto& opus : wake_word_opus_) {
free(opus.iov_base);
}
if (opus_decoder_ != nullptr) {
opus_decoder_destroy(opus_decoder_);
}
if (audio_encode_task_stack_ != nullptr) {
free(audio_encode_task_stack_);
}
if (audio_decode_task_stack_ != nullptr) {
free(audio_decode_task_stack_);
}
vQueueDelete(audio_decode_queue_);
vQueueDelete(audio_encode_queue_);
vEventGroupDelete(event_group_);
}
void Application::Start() {
// Initialize the audio device
audio_device_.Start(CONFIG_AUDIO_INPUT_SAMPLE_RATE, CONFIG_AUDIO_OUTPUT_SAMPLE_RATE);
audio_device_.OnStateChanged([this]() {
if (audio_device_.playing()) {
SetChatState(kChatStateSpeaking);
} else {
// Check if communication is still running
if (xEventGroupGetBits(event_group_) & COMMUNICATION_RUNNING) {
SetChatState(kChatStateListening);
} else {
SetChatState(kChatStateIdle);
}
}
});
// OPUS encoder / decoder use a lot of stack memory
const size_t opus_stack_size = 4096 * 8;
audio_encode_task_stack_ = (StackType_t*)malloc(opus_stack_size);
xTaskCreateStatic([](void* arg) {
Application* app = (Application*)arg;
app->AudioEncodeTask();
}, "opus_encode", opus_stack_size, this, 1, audio_encode_task_stack_, &audio_encode_task_buffer_);
audio_decode_task_stack_ = (StackType_t*)malloc(opus_stack_size);
xTaskCreateStatic([](void* arg) {
Application* app = (Application*)arg;
app->AudioDecodeTask();
}, "opus_decode", opus_stack_size, this, 1, audio_decode_task_stack_, &audio_decode_task_buffer_);
auto& builtin_led = BuiltinLed::GetInstance();
// Blink the LED to indicate the device is connecting
builtin_led.SetBlue();
builtin_led.BlinkOnce();
WifiStation::GetInstance().Start();
// Check if there is a new firmware version available
firmware_upgrade_.CheckVersion();
if (firmware_upgrade_.HasNewVersion()) {
builtin_led.TurnOn();
firmware_upgrade_.StartUpgrade();
// If upgrade success, the device will reboot and never reach here
ESP_LOGI(TAG, "Firmware upgrade failed...");
builtin_led.TurnOff();
} else {
firmware_upgrade_.MarkValid();
}
StartCommunication();
StartDetection();
// Blink the LED to indicate the device is running
builtin_led.SetGreen();
builtin_led.BlinkOnce();
xEventGroupSetBits(event_group_, DETECTION_RUNNING);
}
void Application::SetChatState(ChatState state) {
auto& builtin_led = BuiltinLed::GetInstance();
chat_state_ = state;
switch (chat_state_) {
case kChatStateIdle:
ESP_LOGI(TAG, "Chat state: idle");
builtin_led.TurnOff();
break;
case kChatStateConnecting:
ESP_LOGI(TAG, "Chat state: connecting");
builtin_led.SetBlue();
builtin_led.TurnOn();
break;
case kChatStateListening:
ESP_LOGI(TAG, "Chat state: listening");
builtin_led.SetRed();
builtin_led.TurnOn();
break;
case kChatStateSpeaking:
ESP_LOGI(TAG, "Chat state: speaking");
builtin_led.SetGreen();
builtin_led.TurnOn();
break;
case kChatStateWakeWordDetected:
ESP_LOGI(TAG, "Chat state: wake word detected");
builtin_led.SetBlue();
builtin_led.TurnOn();
break;
}
const char* state_str[] = { "idle", "connecting", "listening", "speaking", "wake_word_detected", "unknown" };
std::lock_guard<std::recursive_mutex> lock(mutex_);
if (ws_client_ && ws_client_->IsConnected()) {
cJSON* root = cJSON_CreateObject();
cJSON_AddStringToObject(root, "type", "state");
cJSON_AddStringToObject(root, "state", state_str[chat_state_]);
char* json = cJSON_PrintUnformatted(root);
ws_client_->Send(json);
cJSON_Delete(root);
free(json);
}
}
void Application::StartCommunication() {
afe_config_t afe_config = {
.aec_init = false,
.se_init = true,
.vad_init = false,
.wakenet_init = false,
.voice_communication_init = true,
.voice_communication_agc_init = true,
.voice_communication_agc_gain = 10,
.vad_mode = VAD_MODE_3,
.wakenet_model_name = NULL,
.wakenet_model_name_2 = NULL,
.wakenet_mode = DET_MODE_90,
.afe_mode = SR_MODE_HIGH_PERF,
.afe_perferred_core = 0,
.afe_perferred_priority = 5,
.afe_ringbuf_size = 50,
.memory_alloc_mode = AFE_MEMORY_ALLOC_MORE_PSRAM,
.afe_linear_gain = 1.0,
.agc_mode = AFE_MN_PEAK_AGC_MODE_2,
.pcm_config = {
.total_ch_num = 1,
.mic_num = 1,
.ref_num = 0,
.sample_rate = CONFIG_AUDIO_INPUT_SAMPLE_RATE,
},
.debug_init = false,
.debug_hook = {{ AFE_DEBUG_HOOK_MASE_TASK_IN, NULL }, { AFE_DEBUG_HOOK_FETCH_TASK_IN, NULL }},
.afe_ns_mode = NS_MODE_SSP,
.afe_ns_model_name = NULL,
.fixed_first_channel = true,
};
afe_communication_data_ = esp_afe_vc_v1.create_from_config(&afe_config);
xTaskCreate([](void* arg) {
Application* app = (Application*)arg;
app->AudioCommunicationTask();
}, "audio_communication", 4096 * 2, this, 5, NULL);
}
void Application::StartDetection() {
afe_config_t afe_config = {
.aec_init = false,
.se_init = true,
.vad_init = false,
.wakenet_init = true,
.voice_communication_init = false,
.voice_communication_agc_init = false,
.voice_communication_agc_gain = 10,
.vad_mode = VAD_MODE_3,
.wakenet_model_name = wakenet_model_,
.wakenet_model_name_2 = NULL,
.wakenet_mode = DET_MODE_90,
.afe_mode = SR_MODE_HIGH_PERF,
.afe_perferred_core = 0,
.afe_perferred_priority = 5,
.afe_ringbuf_size = 50,
.memory_alloc_mode = AFE_MEMORY_ALLOC_MORE_PSRAM,
.afe_linear_gain = 1.0,
.agc_mode = AFE_MN_PEAK_AGC_MODE_2,
.pcm_config = {
.total_ch_num = 1,
.mic_num = 1,
.ref_num = 0,
.sample_rate = CONFIG_AUDIO_INPUT_SAMPLE_RATE
},
.debug_init = false,
.debug_hook = {{ AFE_DEBUG_HOOK_MASE_TASK_IN, NULL }, { AFE_DEBUG_HOOK_FETCH_TASK_IN, NULL }},
.afe_ns_mode = NS_MODE_SSP,
.afe_ns_model_name = NULL,
.fixed_first_channel = true,
};
afe_detection_data_ = esp_afe_sr_v1.create_from_config(&afe_config);
xTaskCreate([](void* arg) {
Application* app = (Application*)arg;
app->AudioFeedTask();
}, "audio_feed", 4096 * 2, this, 5, NULL);
xTaskCreate([](void* arg) {
Application* app = (Application*)arg;
app->AudioDetectionTask();
}, "audio_detection", 4096 * 2, this, 5, NULL);
}
void Application::AudioFeedTask() {
int chunk_size = esp_afe_vc_v1.get_feed_chunksize(afe_detection_data_);
int16_t buffer[chunk_size];
ESP_LOGI(TAG, "Audio feed task started, chunk size: %d", chunk_size);
while (true) {
audio_device_.Read(buffer, chunk_size);
auto event_bits = xEventGroupGetBits(event_group_);
if (event_bits & DETECTION_RUNNING) {
esp_afe_sr_v1.feed(afe_detection_data_, buffer);
} else if (event_bits & COMMUNICATION_RUNNING) {
esp_afe_vc_v1.feed(afe_communication_data_, buffer);
}
}
vTaskDelete(NULL);
}
void Application::StoreWakeWordData(uint8_t* data, size_t size) {
// store audio data to detect_packets_
auto iov = (iovec){
.iov_base = heap_caps_malloc(size, MALLOC_CAP_SPIRAM),
.iov_len = size
};
memcpy(iov.iov_base, data, size);
wake_word_pcm_.push_back(iov);
// remove the oldest packet if the size is larger than 50, about 2 seconds
if (wake_word_pcm_.size() > 50) {
heap_caps_free(wake_word_pcm_.front().iov_base);
wake_word_pcm_.pop_front();
}
}
void Application::EncodeWakeWordData() {
wake_word_opus_.clear();
if (wake_word_encode_task_stack_ == nullptr) {
wake_word_encode_task_stack_ = (StackType_t*)malloc(4096 * 8);
}
wake_word_encode_task_ = xTaskCreateStatic([](void* arg) {
Application* app = (Application*)arg;
auto start_time = esp_timer_get_time();
// encode detect packets
OpusEncoder* encoder = new OpusEncoder();
encoder->Configure(CONFIG_AUDIO_INPUT_SAMPLE_RATE, 1, 60);
encoder->SetComplexity(2);
for (auto& pcm: app->wake_word_pcm_) {
encoder->Encode(pcm, [app](const iovec opus) {
iovec iov = {
.iov_base = heap_caps_malloc(opus.iov_len, MALLOC_CAP_SPIRAM),
.iov_len = opus.iov_len
};
memcpy(iov.iov_base, opus.iov_base, opus.iov_len);
app->wake_word_opus_.push_back(iov);
});
heap_caps_free(pcm.iov_base);
}
app->wake_word_pcm_.clear();
auto end_time = esp_timer_get_time();
ESP_LOGI(TAG, "Encode wake word data opus packets: %d in %lld ms", app->wake_word_opus_.size(), (end_time - start_time) / 1000);
xEventGroupSetBits(app->event_group_, DETECT_PACKETS_ENCODED);
delete encoder;
vTaskDelete(NULL);
}, "encode_detect_packets", 4096 * 8, this, 1, wake_word_encode_task_stack_, &wake_word_encode_task_buffer_);
}
void Application::SendWakeWordData() {
for (auto& opus: wake_word_opus_) {
ws_client_->Send(opus.iov_base, opus.iov_len, true);
heap_caps_free(opus.iov_base);
}
wake_word_opus_.clear();
}
void Application::AudioDetectionTask() {
auto chunk_size = esp_afe_sr_v1.get_fetch_chunksize(afe_detection_data_);
ESP_LOGI(TAG, "Audio detection task started, chunk size: %d", chunk_size);
while (true) {
xEventGroupWaitBits(event_group_, DETECTION_RUNNING, pdFALSE, pdTRUE, portMAX_DELAY);
auto res = esp_afe_sr_v1.fetch(afe_detection_data_);
if (res == nullptr || res->ret_value == ESP_FAIL) {
ESP_LOGE(TAG, "Error in fetch");
if (res != nullptr) {
ESP_LOGI(TAG, "Error code: %d", res->ret_value);
}
continue;;
}
// Store the wake word data for voice recognition, like who is speaking
StoreWakeWordData((uint8_t*)res->data, res->data_size);
if (res->wakeup_state == WAKENET_DETECTED) {
xEventGroupClearBits(event_group_, DETECTION_RUNNING);
SetChatState(kChatStateConnecting);
// Encode the wake word data and start websocket client at the same time
// They both consume a lot of time (700ms), so we can do them in parallel
EncodeWakeWordData();
StartWebSocketClient();
// Here the websocket is done, and we also wait for the wake word data to be encoded
xEventGroupWaitBits(event_group_, DETECT_PACKETS_ENCODED, pdTRUE, pdTRUE, portMAX_DELAY);
std::lock_guard<std::recursive_mutex> lock(mutex_);
if (ws_client_ && ws_client_->IsConnected()) {
// Send the wake word data to the server
SendWakeWordData();
// Send a ready message to indicate the server that the wake word data is sent
SetChatState(kChatStateWakeWordDetected);
opus_encoder_.ResetState();
// If connected, the hello message is already sent, so we can start communication
xEventGroupSetBits(event_group_, COMMUNICATION_RUNNING);
ESP_LOGI(TAG, "Start communication after wake word detected");
} else {
SetChatState(kChatStateIdle);
xEventGroupSetBits(event_group_, DETECTION_RUNNING);
}
}
}
}
void Application::AudioCommunicationTask() {
int chunk_size = esp_afe_vc_v1.get_fetch_chunksize(afe_communication_data_);
ESP_LOGI(TAG, "Audio communication task started, chunk size: %d", chunk_size);
while (true) {
xEventGroupWaitBits(event_group_, COMMUNICATION_RUNNING, pdFALSE, pdTRUE, portMAX_DELAY);
auto res = esp_afe_vc_v1.fetch(afe_communication_data_);
if (res == nullptr || res->ret_value == ESP_FAIL) {
ESP_LOGE(TAG, "Error in fetch");
if (res != nullptr) {
ESP_LOGI(TAG, "Error code: %d", res->ret_value);
}
continue;
}
// Check if the websocket client is disconnected by the server
{
std::lock_guard<std::recursive_mutex> lock(mutex_);
if (ws_client_ == nullptr || !ws_client_->IsConnected()) {
if (ws_client_ != nullptr) {
delete ws_client_;
ws_client_ = nullptr;
}
if (audio_device_.playing()) {
audio_device_.Break();
}
SetChatState(kChatStateIdle);
xEventGroupSetBits(event_group_, DETECTION_RUNNING);
xEventGroupClearBits(event_group_, COMMUNICATION_RUNNING);
continue;
}
}
if (chat_state_ == kChatStateListening) {
// Send audio data to server
iovec data = {
.iov_base = malloc(res->data_size),
.iov_len = (size_t)res->data_size
};
memcpy(data.iov_base, res->data, res->data_size);
xQueueSend(audio_encode_queue_, &data, portMAX_DELAY);
}
}
}
void Application::AudioEncodeTask() {
ESP_LOGI(TAG, "Audio encode task started");
while (true) {
iovec pcm;
xQueueReceive(audio_encode_queue_, &pcm, portMAX_DELAY);
// Encode audio data
opus_encoder_.Encode(pcm, [this](const iovec opus) {
std::lock_guard<std::recursive_mutex> lock(mutex_);
if (ws_client_ && ws_client_->IsConnected()) {
ws_client_->Send(opus.iov_base, opus.iov_len, true);
}
});
free(pcm.iov_base);
}
}
void Application::AudioDecodeTask() {
while (true) {
AudioPacket* packet;
xQueueReceive(audio_decode_queue_, &packet, portMAX_DELAY);
if (packet->type == kAudioPacketTypeData) {
int frame_size = opus_decode_sample_rate_ / 1000 * opus_duration_ms_;
packet->pcm.resize(frame_size);
int ret = opus_decode(opus_decoder_, packet->opus.data(), packet->opus.size(), packet->pcm.data(), frame_size, 0);
if (ret < 0) {
ESP_LOGE(TAG, "Failed to decode audio, error code: %d", ret);
delete packet;
continue;
}
if (opus_decode_sample_rate_ != CONFIG_AUDIO_OUTPUT_SAMPLE_RATE) {
int target_size = frame_size * CONFIG_AUDIO_OUTPUT_SAMPLE_RATE / opus_decode_sample_rate_;
std::vector<int16_t> resampled(target_size);
opus_resampler_.Process(packet->pcm.data(), frame_size, resampled.data(), target_size);
packet->pcm = std::move(resampled);
}
}
audio_device_.QueueAudioPacket(packet);
}
}
void Application::SetDecodeSampleRate(int sample_rate) {
if (opus_decode_sample_rate_ == sample_rate) {
return;
}
opus_decoder_destroy(opus_decoder_);
opus_decode_sample_rate_ = sample_rate;
opus_decoder_ = opus_decoder_create(opus_decode_sample_rate_, 1, NULL);
if (opus_decode_sample_rate_ != CONFIG_AUDIO_OUTPUT_SAMPLE_RATE) {
opus_resampler_.Configure(opus_decode_sample_rate_, CONFIG_AUDIO_OUTPUT_SAMPLE_RATE);
}
}
void Application::StartWebSocketClient() {
if (ws_client_ != nullptr) {
delete ws_client_;
}
std::string token = "Bearer " + std::string(CONFIG_WEBSOCKET_ACCESS_TOKEN);
ws_client_ = new WebSocketClient();
ws_client_->SetHeader("Authorization", token.c_str());
ws_client_->SetHeader("Device-Id", SystemInfo::GetMacAddress().c_str());
ws_client_->OnConnected([this]() {
ESP_LOGI(TAG, "Websocket connected");
// Send hello message to describe the client
// keys: message type, version, wakeup_model, audio_params (format, sample_rate, channels)
std::string message = "{";
message += "\"type\":\"hello\", \"version\":\"1.0\",";
message += "\"wakeup_model\":\"" + std::string(wakenet_model_) + "\",";
message += "\"audio_params\":{";
message += "\"format\":\"opus\", \"sample_rate\":" + std::to_string(CONFIG_AUDIO_INPUT_SAMPLE_RATE) + ", \"channels\":1";
message += "}}";
ws_client_->Send(message);
});
ws_client_->OnData([this](const char* data, size_t len, bool binary) {
auto packet = new AudioPacket();
if (binary) {
auto header = (AudioDataHeader*)data;
packet->type = kAudioPacketTypeData;
packet->timestamp = ntohl(header->timestamp);
auto payload_size = ntohl(header->payload_size);
packet->opus.resize(payload_size);
memcpy(packet->opus.data(), data + sizeof(AudioDataHeader), payload_size);
} else {
// Parse JSON data
auto root = cJSON_Parse(data);
auto type = cJSON_GetObjectItem(root, "type");
if (type != NULL) {
if (strcmp(type->valuestring, "tts") == 0) {
auto state = cJSON_GetObjectItem(root, "state");
if (strcmp(state->valuestring, "start") == 0) {
packet->type = kAudioPacketTypeStart;
auto sample_rate = cJSON_GetObjectItem(root, "sample_rate");
if (sample_rate != NULL) {
SetDecodeSampleRate(sample_rate->valueint);
}
} else if (strcmp(state->valuestring, "stop") == 0) {
packet->type = kAudioPacketTypeStop;
} else if (strcmp(state->valuestring, "sentence_end") == 0) {
packet->type = kAudioPacketTypeSentenceEnd;
} else if (strcmp(state->valuestring, "sentence_start") == 0) {
packet->type = kAudioPacketTypeSentenceStart;
packet->text = cJSON_GetObjectItem(root, "text")->valuestring;
}
}
}
cJSON_Delete(root);
}
xQueueSend(audio_decode_queue_, &packet, portMAX_DELAY);
});
ws_client_->OnError([this](int error) {
ESP_LOGE(TAG, "Websocket error: %d", error);
});
ws_client_->OnClosed([this]() {
ESP_LOGI(TAG, "Websocket closed");
});
if (!ws_client_->Connect(CONFIG_WEBSOCKET_URL)) {
ESP_LOGE(TAG, "Failed to connect to websocket server");
return;
}
}
-102
View File
@@ -1,102 +0,0 @@
#ifndef _APPLICATION_H_
#define _APPLICATION_H_
#include "AudioDevice.h"
#include "OpusEncoder.h"
#include "OpusResampler.h"
#include "WebSocketClient.h"
#include "FirmwareUpgrade.h"
#include "opus.h"
#include "resampler_structs.h"
#include "freertos/event_groups.h"
#include "freertos/queue.h"
#include "freertos/task.h"
#include "esp_afe_sr_models.h"
#include "esp_nsn_models.h"
#include <mutex>
#include <list>
#define DETECTION_RUNNING 1
#define COMMUNICATION_RUNNING 2
#define DETECT_PACKETS_ENCODED 4
enum ChatState {
kChatStateIdle,
kChatStateConnecting,
kChatStateListening,
kChatStateSpeaking,
kChatStateWakeWordDetected
};
class Application {
public:
static Application& GetInstance() {
static Application instance;
return instance;
}
void Start();
// 删除拷贝构造函数和赋值运算符
Application(const Application&) = delete;
Application& operator=(const Application&) = delete;
private:
Application();
~Application();
AudioDevice audio_device_;
FirmwareUpgrade firmware_upgrade_;
std::recursive_mutex mutex_;
WebSocketClient* ws_client_ = nullptr;
esp_afe_sr_data_t* afe_detection_data_ = nullptr;
esp_afe_sr_data_t* afe_communication_data_ = nullptr;
EventGroupHandle_t event_group_;
char* wakenet_model_ = NULL;
char* nsnet_model_ = NULL;
volatile ChatState chat_state_ = kChatStateIdle;
// Audio encode / decode
TaskHandle_t audio_feed_task_ = nullptr;
StaticTask_t audio_encode_task_buffer_;
StackType_t* audio_encode_task_stack_ = nullptr;
QueueHandle_t audio_encode_queue_ = nullptr;
TaskHandle_t audio_decode_task_ = nullptr;
StaticTask_t audio_decode_task_buffer_;
StackType_t* audio_decode_task_stack_ = nullptr;
QueueHandle_t audio_decode_queue_ = nullptr;
OpusEncoder opus_encoder_;
OpusDecoder* opus_decoder_ = nullptr;
int opus_duration_ms_ = 60;
int opus_decode_sample_rate_ = CONFIG_AUDIO_OUTPUT_SAMPLE_RATE;
OpusResampler opus_resampler_;
TaskHandle_t wake_word_encode_task_ = nullptr;
StaticTask_t wake_word_encode_task_buffer_;
StackType_t* wake_word_encode_task_stack_ = nullptr;
std::list<iovec> wake_word_pcm_;
std::vector<iovec> wake_word_opus_;
void SetDecodeSampleRate(int sample_rate);
void SetChatState(ChatState state);
void StartDetection();
void StartCommunication();
void StartWebSocketClient();
void StoreWakeWordData(uint8_t* data, size_t size);
void EncodeWakeWordData();
void SendWakeWordData();
void AudioFeedTask();
void AudioDetectionTask();
void AudioCommunicationTask();
void AudioEncodeTask();
void AudioDecodeTask();
};
#endif // _APPLICATION_H_
-236
View File
@@ -1,236 +0,0 @@
#include "AudioDevice.h"
#include "esp_log.h"
#include <cstring>
#define TAG "AudioDevice"
AudioDevice::AudioDevice() {
audio_play_queue_ = xQueueCreate(100, sizeof(AudioPacket*));
}
AudioDevice::~AudioDevice() {
vQueueDelete(audio_play_queue_);
if (audio_play_task_ != nullptr) {
vTaskDelete(audio_play_task_);
}
if (rx_handle_ != nullptr) {
ESP_ERROR_CHECK(i2s_channel_disable(rx_handle_));
}
if (tx_handle_ != nullptr) {
ESP_ERROR_CHECK(i2s_channel_disable(tx_handle_));
}
}
void AudioDevice::Start(int input_sample_rate, int output_sample_rate) {
input_sample_rate_ = input_sample_rate;
output_sample_rate_ = output_sample_rate;
#ifdef CONFIG_AUDIO_DEVICE_I2S_SIMPLEX
CreateSimplexChannels();
#else
CreateDuplexChannels();
#endif
ESP_ERROR_CHECK(i2s_channel_enable(tx_handle_));
ESP_ERROR_CHECK(i2s_channel_enable(rx_handle_));
xTaskCreate([](void* arg) {
auto audio_device = (AudioDevice*)arg;
audio_device->AudioPlayTask();
}, "audio_play", 4096 * 4, this, 5, &audio_play_task_);
}
void AudioDevice::CreateDuplexChannels() {
duplex_ = true;
i2s_chan_config_t chan_cfg = {
.id = I2S_NUM_0,
.role = I2S_ROLE_MASTER,
.dma_desc_num = 6,
.dma_frame_num = 240,
.auto_clear_after_cb = false,
.auto_clear_before_cb = false,
.intr_priority = 0,
};
ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &tx_handle_, &rx_handle_));
i2s_std_config_t std_cfg = {
.clk_cfg = {
.sample_rate_hz = (uint32_t)output_sample_rate_,
.clk_src = I2S_CLK_SRC_DEFAULT,
.ext_clk_freq_hz = 0,
.mclk_multiple = I2S_MCLK_MULTIPLE_256
},
.slot_cfg = {
.data_bit_width = I2S_DATA_BIT_WIDTH_32BIT,
.slot_bit_width = I2S_SLOT_BIT_WIDTH_AUTO,
.slot_mode = I2S_SLOT_MODE_MONO,
.slot_mask = I2S_STD_SLOT_LEFT,
.ws_width = I2S_DATA_BIT_WIDTH_32BIT,
.ws_pol = false,
.bit_shift = true,
.left_align = true,
.big_endian = false,
.bit_order_lsb = false
},
.gpio_cfg = {
.mclk = I2S_GPIO_UNUSED,
.bclk = (gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_GPIO_BCLK,
.ws = (gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_GPIO_WS,
.dout = (gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_GPIO_DOUT,
.din = (gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_GPIO_DIN,
.invert_flags = {
.mclk_inv = false,
.bclk_inv = false,
.ws_inv = false
}
}
};
ESP_ERROR_CHECK(i2s_channel_init_std_mode(tx_handle_, &std_cfg));
ESP_ERROR_CHECK(i2s_channel_init_std_mode(rx_handle_, &std_cfg));
ESP_LOGI(TAG, "Duplex channels created");
}
#ifdef CONFIG_AUDIO_DEVICE_I2S_SIMPLEX
void AudioDevice::CreateSimplexChannels() {
// Create a new channel for speaker
i2s_chan_config_t chan_cfg = {
.id = I2S_NUM_0,
.role = I2S_ROLE_MASTER,
.dma_desc_num = 6,
.dma_frame_num = 240,
.auto_clear_after_cb = false,
.auto_clear_before_cb = false,
.intr_priority = 0,
};
ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &tx_handle_, nullptr));
i2s_std_config_t std_cfg = {
.clk_cfg = {
.sample_rate_hz = (uint32_t)output_sample_rate_,
.clk_src = I2S_CLK_SRC_DEFAULT,
.ext_clk_freq_hz = 0,
.mclk_multiple = I2S_MCLK_MULTIPLE_256
},
.slot_cfg = {
.data_bit_width = I2S_DATA_BIT_WIDTH_32BIT,
.slot_bit_width = I2S_SLOT_BIT_WIDTH_AUTO,
.slot_mode = I2S_SLOT_MODE_MONO,
.slot_mask = I2S_STD_SLOT_LEFT,
.ws_width = I2S_DATA_BIT_WIDTH_32BIT,
.ws_pol = false,
.bit_shift = true,
.left_align = true,
.big_endian = false,
.bit_order_lsb = false
},
.gpio_cfg = {
.mclk = I2S_GPIO_UNUSED,
.bclk = (gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_GPIO_BCLK,
.ws = (gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_GPIO_WS,
.dout = (gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_GPIO_DOUT,
.din = I2S_GPIO_UNUSED,
.invert_flags = {
.mclk_inv = false,
.bclk_inv = false,
.ws_inv = false
}
}
};
ESP_ERROR_CHECK(i2s_channel_init_std_mode(tx_handle_, &std_cfg));
// Create a new channel for MIC
chan_cfg.id = I2S_NUM_1;
ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, nullptr, &rx_handle_));
std_cfg.clk_cfg.sample_rate_hz = (uint32_t)input_sample_rate_;
std_cfg.gpio_cfg.bclk = (gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_MIC_GPIO_BCLK;
std_cfg.gpio_cfg.ws = (gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_MIC_GPIO_WS;
std_cfg.gpio_cfg.dout = I2S_GPIO_UNUSED;
std_cfg.gpio_cfg.din = (gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_GPIO_DIN;
ESP_ERROR_CHECK(i2s_channel_init_std_mode(rx_handle_, &std_cfg));
ESP_LOGI(TAG, "Simplex channels created");
}
#endif
void AudioDevice::Write(const int16_t* data, int samples) {
int32_t buffer[samples];
for (int i = 0; i < samples; i++) {
buffer[i] = int32_t(data[i]) << 15;
}
size_t bytes_written;
ESP_ERROR_CHECK(i2s_channel_write(tx_handle_, buffer, samples * sizeof(int32_t), &bytes_written, portMAX_DELAY));
}
int AudioDevice::Read(int16_t* dest, int samples) {
size_t bytes_read;
int32_t bit32_buffer_[samples];
if (i2s_channel_read(rx_handle_, bit32_buffer_, samples * sizeof(int32_t), &bytes_read, portMAX_DELAY) != ESP_OK) {
ESP_LOGE(TAG, "Read Failed!");
return 0;
}
samples = bytes_read / sizeof(int32_t);
for (int i = 0; i < samples; i++) {
int32_t value = bit32_buffer_[i] >> 12;
dest[i] = (value > INT16_MAX) ? INT16_MAX : (value < -INT16_MAX) ? -INT16_MAX : (int16_t)value;
}
return samples;
}
void AudioDevice::QueueAudioPacket(AudioPacket* packet) {
xQueueSend(audio_play_queue_, &packet, portMAX_DELAY);
}
void AudioDevice::AudioPlayTask() {
while (true) {
AudioPacket* packet;
xQueueReceive(audio_play_queue_, &packet, portMAX_DELAY);
switch (packet->type)
{
case kAudioPacketTypeStart:
playing_ = true;
breaked_ = false;
if (on_state_changed_) {
on_state_changed_();
}
break;
case kAudioPacketTypeStop:
playing_ = false;
if (on_state_changed_) {
on_state_changed_();
}
break;
case kAudioPacketTypeSentenceStart:
ESP_LOGI(TAG, "Playing sentence: %s", packet->text.c_str());
break;
case kAudioPacketTypeSentenceEnd:
if (breaked_) { // Clear the queue
AudioPacket* p;
while (xQueueReceive(audio_play_queue_, &p, 0) == pdTRUE) {
delete p;
}
breaked_ = false;
playing_ = false;
}
break;
case kAudioPacketTypeData:
Write(packet->pcm.data(), packet->pcm.size());
break;
default:
ESP_LOGE(TAG, "Unknown audio packet type: %d", packet->type);
}
delete packet;
}
}
void AudioDevice::OnStateChanged(std::function<void()> callback) {
on_state_changed_ = callback;
}
void AudioDevice::Break() {
breaked_ = true;
}
-76
View File
@@ -1,76 +0,0 @@
#ifndef _AUDIO_DEVICE_H
#define _AUDIO_DEVICE_H
#include "opus.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
#include "freertos/event_groups.h"
#include "driver/i2s_std.h"
#include <vector>
#include <string>
#include <functional>
enum AudioPacketType {
kAudioPacketTypeUnkonwn = 0,
kAudioPacketTypeStart,
kAudioPacketTypeStop,
kAudioPacketTypeData,
kAudioPacketTypeSentenceStart,
kAudioPacketTypeSentenceEnd
};
struct AudioPacket {
AudioPacketType type = kAudioPacketTypeUnkonwn;
std::string text;
std::vector<uint8_t> opus;
std::vector<int16_t> pcm;
uint32_t timestamp;
};
struct AudioDataHeader {
uint32_t version;
uint32_t reserved;
uint32_t timestamp;
uint32_t payload_size;
} __attribute__((packed));
class AudioDevice {
public:
AudioDevice();
~AudioDevice();
void Start(int input_sample_rate, int output_sample_rate);
int Read(int16_t* dest, int samples);
void Write(const int16_t* data, int samples);
void QueueAudioPacket(AudioPacket* packet);
void OnStateChanged(std::function<void()> callback);
void Break();
int input_sample_rate() const { return input_sample_rate_; }
int output_sample_rate() const { return output_sample_rate_; }
bool duplex() const { return duplex_; }
bool playing() const { return playing_; }
private:
bool playing_ = false;
bool breaked_ = false;
bool duplex_ = false;
int input_sample_rate_ = 0;
int output_sample_rate_ = 0;
i2s_chan_handle_t tx_handle_ = nullptr;
i2s_chan_handle_t rx_handle_ = nullptr;
QueueHandle_t audio_play_queue_ = nullptr;
TaskHandle_t audio_play_task_ = nullptr;
EventGroupHandle_t event_group_;
std::function<void()> on_state_changed_;
void CreateDuplexChannels();
void CreateSimplexChannels();
void AudioPlayTask();
};
#endif // _AUDIO_DEVICE_H
Executable → Regular
+1034 -4
View File
File diff suppressed because it is too large Load Diff
+830 -52
View File
@@ -1,71 +1,849 @@
menu "Xiaozhi Assistant"
config WEBSOCKET_URL
string "Websocket URL"
default "wss://"
config OTA_URL
string "Default OTA URL"
default "https://api.tenclass.net/xiaozhi/ota/"
help
Communication with the server through websocket after wake up.
The application will access this URL to check for new firmwares and server address.
config WEBSOCKET_ACCESS_TOKEN
string "Websocket Access Token"
default ""
choice
prompt "Flash Assets"
default FLASH_DEFAULT_ASSETS if !USE_EMOTE_MESSAGE_STYLE
default FLASH_EXPRESSION_ASSETS if USE_EMOTE_MESSAGE_STYLE
help
Access token for websocket communication.
Select the assets to flash.
config AUDIO_INPUT_SAMPLE_RATE
int "Audio Input Sample Rate"
default 16000
help
Audio input sample rate.
config FLASH_NONE_ASSETS
bool "Do not flash assets"
config FLASH_DEFAULT_ASSETS
bool "Flash Default Assets"
depends on !USE_EMOTE_MESSAGE_STYLE
config FLASH_CUSTOM_ASSETS
bool "Flash Custom Assets"
config FLASH_EXPRESSION_ASSETS
bool "Flash Emote Assets"
depends on USE_EMOTE_MESSAGE_STYLE
endchoice
config AUDIO_OUTPUT_SAMPLE_RATE
int "Audio Output Sample Rate"
default 24000
config CUSTOM_ASSETS_FILE
depends on FLASH_CUSTOM_ASSETS
string "Custom Assets File"
default "assets.bin"
help
Audio output sample rate.
The custom assets file to flash.
It can be a local file relative to the project directory or a remote url.
config AUDIO_DEVICE_I2S_GPIO_BCLK
int "I2S GPIO BCLK"
default 5
choice
prompt "Default Language"
default LANGUAGE_ZH_CN
help
GPIO number of the I2S BCLK.
Select device display language
config AUDIO_DEVICE_I2S_GPIO_WS
int "I2S GPIO WS"
default 4
help
GPIO number of the I2S WS.
config LANGUAGE_ZH_CN
bool "Chinese"
config LANGUAGE_ZH_TW
bool "Chinese Traditional"
config LANGUAGE_EN_US
bool "English"
config LANGUAGE_JA_JP
bool "Japanese"
config LANGUAGE_KO_KR
bool "Korean"
config LANGUAGE_VI_VN
bool "Vietnamese"
config LANGUAGE_TH_TH
bool "Thai"
config LANGUAGE_DE_DE
bool "German"
config LANGUAGE_FR_FR
bool "French"
config LANGUAGE_ES_ES
bool "Spanish"
config LANGUAGE_IT_IT
bool "Italian"
config LANGUAGE_RU_RU
bool "Russian"
config LANGUAGE_AR_SA
bool "Arabic"
config LANGUAGE_HI_IN
bool "Hindi"
config LANGUAGE_PT_PT
bool "Portuguese"
config LANGUAGE_PL_PL
bool "Polish"
config LANGUAGE_CS_CZ
bool "Czech"
config LANGUAGE_FI_FI
bool "Finnish"
config LANGUAGE_TR_TR
bool "Turkish"
config LANGUAGE_ID_ID
bool "Indonesian"
config LANGUAGE_UK_UA
bool "Ukrainian"
config LANGUAGE_RO_RO
bool "Romanian"
config LANGUAGE_BG_BG
bool "Bulgarian"
config LANGUAGE_CA_ES
bool "Catalan"
config LANGUAGE_DA_DK
bool "Danish"
config LANGUAGE_EL_GR
bool "Greek"
config LANGUAGE_FA_IR
bool "Persian"
config LANGUAGE_FIL_PH
bool "Filipino"
config LANGUAGE_HE_IL
bool "Hebrew"
config LANGUAGE_HR_HR
bool "Croatian"
config LANGUAGE_HU_HU
bool "Hungarian"
config LANGUAGE_MS_MY
bool "Malay"
config LANGUAGE_NB_NO
bool "Norwegian"
config LANGUAGE_NL_NL
bool "Dutch"
config LANGUAGE_SK_SK
bool "Slovak"
config LANGUAGE_SL_SI
bool "Slovenian"
config LANGUAGE_SV_SE
bool "Swedish"
config LANGUAGE_SR_RS
bool "Serbian"
endchoice
config AUDIO_DEVICE_I2S_GPIO_DOUT
int "I2S GPIO DOUT"
default 6
choice BOARD_TYPE
prompt "Board Type"
default BOARD_TYPE_BREAD_COMPACT_WIFI
help
GPIO number of the I2S DOUT.
Board type. 开发板类型
config BOARD_TYPE_BREAD_COMPACT_WIFI
bool "Bread Compact WiFi (面包板)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_BREAD_COMPACT_WIFI_LCD
bool "Bread Compact WiFi + LCD (面包板)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_BREAD_COMPACT_WIFI_CAM
bool "Bread Compact WiFi + LCD + Camera (面包板)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_BREAD_COMPACT_ML307
bool "Bread Compact ML307/EC801E (面包板 4G)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_BREAD_COMPACT_NT26
bool "Bread Compact NT26 (面包板 4G)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_BREAD_COMPACT_ESP32
bool "Bread Compact ESP32 DevKit (面包板)"
depends on IDF_TARGET_ESP32
config BOARD_TYPE_BREAD_COMPACT_ESP32_LCD
bool "Bread Compact ESP32 DevKit + LCD (面包板)"
depends on IDF_TARGET_ESP32
config BOARD_TYPE_XMINI_C3_V3
bool "Xmini C3 V3"
depends on IDF_TARGET_ESP32C3
config BOARD_TYPE_XMINI_C3_4G
bool "Xmini C3 4G"
depends on IDF_TARGET_ESP32C3
config BOARD_TYPE_XMINI_C3
bool "Xmini C3"
depends on IDF_TARGET_ESP32C3
config BOARD_TYPE_ESP_KORVO2_V3
bool "Espressif Korvo2 V3"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ESP_KORVO2_V3_RNDIS
bool "Espressif Korvo2 V3 RNDIS"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ESP_SPARKBOT
bool "Espressif SparkBot"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ESP_SENSAIRSHUTTLE
bool "Espressif ESP-SensairShuttle"
depends on IDF_TARGET_ESP32C5
config BOARD_TYPE_ESP_SPOT_S3
bool "Espressif Spot-S3"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ESP_SPOT_C5
bool "Espressif Spot-C5"
depends on IDF_TARGET_ESP32C5
config BOARD_TYPE_ESP_HI
bool "Espressif ESP-HI"
depends on IDF_TARGET_ESP32C3
config BOARD_TYPE_ESP_BOX_3
bool "Espressif ESP-BOX-3"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ESP_BOX
bool "Espressif ESP-BOX"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ESP_BOX_LITE
bool "Espressif ESP-BOX-Lite"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ESP_P4_FUNCTION_EV_BOARD
bool "Espressif ESP-P4-Function-EV-Board"
depends on IDF_TARGET_ESP32P4
config BOARD_TYPE_ECHOEAR
bool "EchoEar"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_KEVIN_BOX_2
bool "Kevin Box 2"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_KEVIN_C3
bool "Kevin C3"
depends on IDF_TARGET_ESP32C3
config BOARD_TYPE_KEVIN_SP_V3_DEV
bool "Kevin SP V3"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_KEVIN_SP_V4_DEV
bool "Kevin SP V4"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_KEVIN_YUYING_313LCD
bool "鱼鹰科技 3.13LCD"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_CGC
bool "CGC"
depends on IDF_TARGET_ESP32
config BOARD_TYPE_CGC_144
bool "CGC 144"
depends on IDF_TARGET_ESP32
config BOARD_TYPE_LICHUANG_DEV_S3
bool "立创·实战派 ESP32-S3"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_LICHUANG_DEV_C3
bool "立创·实战派 ESP32-C3"
depends on IDF_TARGET_ESP32C3
config BOARD_TYPE_DF_K10
bool "DFRobot 行空板 k10"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_DF_S3_AI_CAM
bool "DFRobot ESP32-S3 AI智能摄像头模块"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_MAGICLICK_S3_2P4
bool "神奇按钮 Magiclick_2.4"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_MAGICLICK_S3_2P5
bool "神奇按钮 Magiclick_2.5"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_MAGICLICK_C3
bool "神奇按钮 Magiclick_C3"
depends on IDF_TARGET_ESP32C3
config BOARD_TYPE_MAGICLICK_C3_V2
bool "神奇按钮 Magiclick_C3_v2"
depends on IDF_TARGET_ESP32C3
config BOARD_TYPE_M5STACK_CORE_S3
bool "M5Stack CoreS3"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_M5STACK_CORE_TAB5
bool "M5Stack Tab5"
depends on IDF_TARGET_ESP32P4
config BOARD_TYPE_M5STACK_ATOM_S3_ECHO_BASE
bool "M5Stack AtomS3 + Echo Base"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_M5STACK_ATOM_S3R_ECHO_BASE
bool "M5Stack AtomS3R + Echo Base"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_M5STACK_ATOM_S3R_CAM_M12_ECHO_BASE
bool "M5Stack AtomS3R CAM/M12 + Echo Base"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_M5STACK_ATOM_ECHOS3R
bool "M5Stack AtomEchoS3R"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_M5STACK_CARDPUTER_ADV
bool "M5Stack Cardputer Adv"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_M5STACK_ATOM_MATRIX_ECHO_BASE
bool "M5Stack AtomMatrix + Echo Base"
depends on IDF_TARGET_ESP32
config BOARD_TYPE_WAVESHARE_S3_AUDIO_BOARD
bool "Waveshare ESP32-S3-Audio-Board"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_AMOLED_1_8
bool "Waveshare ESP32-S3-Touch-AMOLED-1.8"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_AMOLED_2_06
bool "Waveshare ESP32-S3-Touch-AMOLED-2.06"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_C6_TOUCH_AMOLED_2_06
bool "Waveshare ESP32-C6-Touch-AMOLED-2.06"
depends on IDF_TARGET_ESP32C6
config BOARD_TYPE_WAVESHARE_S3_TOUCH_AMOLED_1_75
bool "Waveshare ESP32-S3-Touch-AMOLED-1.75"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_1_83
bool "Waveshare ESP32-S3-Touch-LCD-1.83"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_4B
bool "Waveshare ESP32-S3-Touch-LCD-4B"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_4_3C
bool "Waveshare ESP32-S3-Touch-LCD-4.3C"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_1_85C
bool "Waveshare ESP32-S3-Touch-LCD-1.85C"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_1_85
bool "Waveshare ESP32-S3-Touch-LCD-1.85"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_1_46
bool "Waveshare ESP32-S3-Touch-LCD-1.46"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_C6_LCD_1_69
bool "Waveshare ESP32-C6-LCD-1.69"
depends on IDF_TARGET_ESP32C6
config BOARD_TYPE_WAVESHARE_C6_TOUCH_LCD_1_83
bool "Waveshare ESP32-C6-Touch-LCD-1.83"
depends on IDF_TARGET_ESP32C6
config BOARD_TYPE_WAVESHARE_C6_TOUCH_AMOLED_1_43
bool "Waveshare ESP32-C6-Touch-AMOLOED-1.43"
depends on IDF_TARGET_ESP32C6
config BOARD_TYPE_WAVESHARE_C6_TOUCH_AMOLED_1_32
bool "Waveshare ESP32-C6-Touch-AMOLOED-1.32"
depends on IDF_TARGET_ESP32C6
config BOARD_TYPE_WAVESHARE_C6_TOUCH_AMOLED_1_8
bool "Waveshare ESP32-C6-Touch-AMOLED-1.8"
depends on IDF_TARGET_ESP32C6
config BOARD_TYPE_WAVESHARE_S3_TOUCH_AMOLED_1_32
bool "Waveshare ESP32-S3-Touch-AMOLOED-1.32"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_3_49
bool "Waveshare ESP32-S3-Touch-LCD-3.49"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_3_5
bool "Waveshare ESP32-S3-Touch-LCD-3.5"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_ePaper_1_54
bool "Waveshare ESP32-S3-ePaper-1.54"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_RLCD_4_2
bool "Waveshare ESP32-S3-RLCD-4.2"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_3_5B
bool "Waveshare ESP32-S3-Touch-LCD-3.5B"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WAVESHARE_P4_NANO
bool "Waveshare ESP32-P4-NANO"
depends on IDF_TARGET_ESP32P4
config BOARD_TYPE_WAVESHARE_P4_WIFI6_TOUCH_LCD_4B
bool "Waveshare ESP32-P4-WIFI6-Touch-LCD-4B"
depends on IDF_TARGET_ESP32P4
config BOARD_TYPE_WAVESHARE_P4_WIFI6_TOUCH_LCD_7B
bool "Waveshare ESP32-P4-WIFI6-Touch-LCD-7B"
depends on IDF_TARGET_ESP32P4
config BOARD_TYPE_WAVESHARE_P4_WIFI6_TOUCH_LCD_XC
bool "Waveshare ESP32-P4-WIFI6-Touch-LCD-3.4C or ESP32-P4-WIFI6-Touch-LCD-4C"
depends on IDF_TARGET_ESP32P4
config BOARD_TYPE_TUDOUZI
bool "土豆子"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_LILYGO_T_CIRCLE_S3
bool "LILYGO T-Circle-S3"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_LILYGO_T_CAMERAPLUS_S3_V1_0_V1_1
bool "LILYGO T-CameraPlus-S3_V1_0_V1_1"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_LILYGO_T_CAMERAPLUS_S3_V1_2
bool "LILYGO T-CameraPlus-S3_V1_2"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_LILYGO_T_DISPLAY_S3_PRO_MVSRLORA
bool "LILYGO T-Display-S3-Pro-MVSRLora"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_LILYGO_T_DISPLAY_S3_PRO_MVSRLORA_NO_BATTERY
bool "LILYGO T-Display-S3-Pro-MVSRLora_No_Battery"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_LILYGO_T_DISPLAY_P4
bool "LILYGO T-Display-P4"
depends on IDF_TARGET_ESP32P4
config BOARD_TYPE_MOVECALL_MOJI_ESP32S3
bool "Movecall Moji 小智AI衍生版"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_MOVECALL_MOJI2_ESP32C5
bool "Movecall Moji2.0 小智AI衍生版"
depends on IDF_TARGET_ESP32C5
config BOARD_TYPE_MOVECALL_CUICAN_ESP32S3
bool "Movecall CuiCan 璀璨·AI吊坠"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ATK_DNESP32S3
bool "正点原子DNESP32S3开发板"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ATK_DNESP32S3_BOX
bool "正点原子DNESP32S3-BOX"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ATK_DNESP32S3_BOX0
bool "正点原子DNESP32S3-BOX0"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ATK_DNESP32S3_BOX2_WIFI
bool "正点原子DNESP32S3-BOX2-WIFI"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ATK_DNESP32S3_BOX2_4G
bool "正点原子DNESP32S3-BOX2-4G"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ATK_DNESP32S3M_WIFI
bool "正点原子DNESP32S3M-WIFI"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ATK_DNESP32S3M_4G
bool "正点原子DNESP32S3M-4G"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_DU_CHATX
bool "嘟嘟开发板CHATX(wifi)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_TAIJI_PI_S3
bool "太极小派esp32s3"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_XINGZHI_CUBE_0_85TFT_WIFI
bool "无名科技星智0.85(WIFI)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_XINGZHI_CUBE_0_85TFT_ML307
bool "无名科技星智0.85(ML307)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_XINGZHI_CUBE_0_96OLED_WIFI
bool "无名科技星智0.96(WIFI)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_XINGZHI_CUBE_0_96OLED_ML307
bool "无名科技星智0.96(ML307)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_XINGZHI_CUBE_1_54TFT_WIFI
bool "无名科技星智1.54(WIFI)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_XINGZHI_CUBE_1_54TFT_ML307
bool "无名科技星智1.54(ML307)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_XINGZHI_METAL_1_54_WIFI
bool "无名科技星智1.54 METAL(wifi)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_SEEED_STUDIO_SENSECAP_WATCHER
bool "Seeed Studio SenseCAP Watcher"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_DOIT_S3_AIBOX
bool "四博智联AI陪伴盒子"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_MIXGO_NOVA
bool "元控·青春"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_GENJUTECH_S3_1_54TFT
bool "亘具科技1.54(s3)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ESP_S3_LCD_EV_Board
bool "乐鑫ESP S3 LCD EV Board开发板"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ESP_S3_LCD_EV_Board_2
bool "乐鑫ESP S3 LCD EV Board 2开发板"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ZHENGCHEN_1_54TFT_WIFI
bool "征辰科技1.54(WIFI)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ZHENGCHEN_1_54TFT_ML307
bool "征辰科技1.54(ML307)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ZHENGCHEN_CAM
bool "征辰科技AI Camera"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ZHENGCHEN_CAM_ML307
bool "征辰科技AI Camera(ML307)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_MINSI_K08_DUAL
bool "敏思科技K08(DUAL)"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_SPOTPEAR_ESP32_S3_1_54_MUMA
bool "Spotpear ESP32-S3-1.54-MUMA"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_SPOTPEAR_ESP32_S3_1_28_BOX
bool "Spotpear ESP32-S3-1.28-BOX"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_OTTO_ROBOT
bool "ottoRobot"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_ELECTRON_BOT
bool "electronBot"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_JIUCHUAN
bool "九川智能"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_LABPLUS_MPYTHON_V3
bool "labplus mpython_v3 board"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_LABPLUS_LEDONG_V2
bool "labplus ledong_v2 board"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_SURFER_C3_1_14TFT
bool "Surfer-C3-1.14TFT"
depends on IDF_TARGET_ESP32C3
config BOARD_TYPE_YUNLIAO_S3
bool "小智云聊-S3"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_WIRELESS_TAG_WTP4C5MP07S
bool "Wireless-Tag WTP4C5MP07S"
depends on IDF_TARGET_ESP32P4
config BOARD_TYPE_AIPI_LITE
bool "AIPI-Lite"
depends on IDF_TARGET_ESP32S3
config BOARD_TYPE_HU_087
bool "HU-087"
depends on IDF_TARGET_ESP32S3
endchoice
config AUDIO_DEVICE_I2S_GPIO_DIN
int "I2S GPIO DIN"
default 3
choice
depends on BOARD_TYPE_LILYGO_T_DISPLAY_P4
prompt "Select the screen type"
default SCREEN_TYPE_HI8561
config SCREEN_TYPE_HI8561
bool "HI8561"
config SCREEN_TYPE_RM69A10
bool "RM69A10"
endchoice
choice
depends on BOARD_TYPE_LILYGO_T_DISPLAY_P4
prompt "Select the color format of the screen"
default SCREEN_PIXEL_FORMAT_RGB565
config SCREEN_PIXEL_FORMAT_RGB565
bool "RGB565"
config SCREEN_PIXEL_FORMAT_RGB888
bool "RGB888"
endchoice
choice ESP_S3_LCD_EV_Board_Version_TYPE
depends on BOARD_TYPE_ESP_S3_LCD_EV_Board
prompt "EV_BOARD Type"
default ESP_S3_LCD_EV_Board_1p4
config ESP_S3_LCD_EV_Board_1p4
bool "乐鑫ESP32_S3_LCD_EV_Board-MB_V1.4"
config ESP_S3_LCD_EV_Board_1p5
bool "乐鑫ESP32_S3_LCD_EV_Board-MB_V1.5"
endchoice
choice DISPLAY_OLED_TYPE
depends on BOARD_TYPE_BREAD_COMPACT_WIFI || BOARD_TYPE_BREAD_COMPACT_ML307 || BOARD_TYPE_BREAD_COMPACT_NT26 || BOARD_TYPE_BREAD_COMPACT_ESP32 || BOARD_TYPE_HU_087
prompt "OLED Type"
default OLED_SSD1306_128X32
help
GPIO number of the I2S DIN.
config AUDIO_DEVICE_I2S_SIMPLEX
bool "I2S Simplex"
OLED Monochrome Display Type
config OLED_SSD1306_128X32
bool "SSD1306 128*32"
config OLED_SSD1306_128X64
bool "SSD1306 128*64"
config OLED_SH1106_128X64
bool "SH1106 128*64"
endchoice
choice DISPLAY_LCD_TYPE
depends on BOARD_TYPE_BREAD_COMPACT_WIFI_LCD || BOARD_TYPE_BREAD_COMPACT_ESP32_LCD || BOARD_TYPE_CGC || BOARD_TYPE_WAVESHARE_P4_NANO || BOARD_TYPE_WAVESHARE_P4_WIFI6_TOUCH_LCD_XC || BOARD_TYPE_BREAD_COMPACT_WIFI_CAM
prompt "LCD Type"
default LCD_ST7789_240X320
help
LCD Display Type
config LCD_ST7789_240X320
bool "ST7789 240*320, IPS"
config LCD_ST7789_240X320_NO_IPS
bool "ST7789 240*320, Non-IPS"
config LCD_ST7789_170X320
bool "ST7789 170*320"
config LCD_ST7789_172X320
bool "ST7789 172*320"
config LCD_ST7789_240X280
bool "ST7789 240*280"
config LCD_ST7789_240X240
bool "ST7789 240*240"
config LCD_ST7789_240X240_7PIN
bool "ST7789 240*240, 7PIN"
config LCD_ST7789_240X135
bool "ST7789 240*135"
config LCD_ST7735_128X160
bool "ST7735 128*160"
config LCD_ST7735_128X128
bool "ST7735 128*128"
config LCD_ST7796_320X480
bool "ST7796 320*480 IPS"
config LCD_ST7796_320X480_NO_IPS
bool "ST7796 320*480, Non-IPS"
config LCD_ILI9341_240X320
bool "ILI9341 240*320"
config LCD_ILI9341_240X320_NO_IPS
bool "ILI9341 240*320, Non-IPS"
config LCD_GC9A01_240X240
bool "GC9A01 240*240 Circle"
config LCD_TYPE_800_1280_10_1_INCH
bool "Waveshare 101M-8001280-IPS-CT-K Display"
config LCD_TYPE_800_1280_10_1_INCH_A
bool "Waveshare 10.1-DSI-TOUCH-A Display"
config LCD_TYPE_800_800_3_4_INCH
bool "Waveshare ESP32-P4-WIFI6-Touch-LCD-3.4C with 800*800 3.4inch round display"
config LCD_TYPE_720_720_4_INCH
bool "Waveshare ESP32-P4-WIFI6-Touch-LCD-4C with 720*720 4inch round display"
config LCD_CUSTOM
bool "Custom LCD (自定义屏幕参数)"
endchoice
choice DISPLAY_ESP32S3_KORVO2_V3
depends on BOARD_TYPE_ESP_KORVO2_V3 || BOARD_TYPE_ESP_KORVO2_V3_RNDIS
prompt "ESP32S3_KORVO2_V3 LCD Type"
default ESP32S3_KORVO2_V3_LCD_ST7789
help
LCD Display Type
config ESP32S3_KORVO2_V3_LCD_ST7789
bool "ST7789 240*280"
config ESP32S3_KORVO2_V3_LCD_ILI9341
bool "ILI9341 240*320"
endchoice
choice DISPLAY_ESP32S3_AUDIO_BOARD
depends on BOARD_TYPE_WAVESHARE_S3_AUDIO_BOARD
prompt "ESP32S3_AUDIO_BOARD LCD Type"
default AUDIO_BOARD_LCD_JD9853
help
LCD Display Type
config AUDIO_BOARD_LCD_JD9853
bool "JD9853 320*172"
config AUDIO_BOARD_LCD_ST7789
bool "ST7789 240*320"
endchoice
choice DISPLAY_STYLE
prompt "Select display style"
default USE_DEFAULT_MESSAGE_STYLE
help
Select display style for Xiaozhi device
config USE_DEFAULT_MESSAGE_STYLE
bool "Enable default message style"
config USE_WECHAT_MESSAGE_STYLE
bool "Enable WeChat Message Style"
config USE_EMOTE_MESSAGE_STYLE
bool "Emote animation style"
depends on BOARD_TYPE_ESP_BOX || BOARD_TYPE_ESP_BOX_3 \
|| BOARD_TYPE_ECHOEAR || BOARD_TYPE_LICHUANG_DEV_S3 \
|| BOARD_TYPE_ESP_SENSAIRSHUTTLE
endchoice
choice WAKE_WORD_TYPE
prompt "Wake Word Implementation Type"
default USE_AFE_WAKE_WORD if (IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4) && SPIRAM
default WAKE_WORD_DISABLED
help
Choose the type of wake word implementation to use
config WAKE_WORD_DISABLED
bool "Disabled"
help
Disable wake word detection
config USE_ESP_WAKE_WORD
bool "Wakenet model without AFE"
depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C6 || (IDF_TARGET_ESP32 && SPIRAM)
help
Support ESP32 C3、ESP32 C5 与 ESP32 C6, and (ESP32 with PSRAM)
config USE_AFE_WAKE_WORD
bool "Wakenet model with AFE"
depends on (IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4) && SPIRAM
help
Support AEC if available, requires ESP32 S3 and PSRAM
config USE_CUSTOM_WAKE_WORD
bool "Multinet model (Custom Wake Word)"
depends on (IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4) && SPIRAM
help
Requires ESP32 S3 and PSRAM
endchoice
config CUSTOM_WAKE_WORD
string "Custom Wake Word"
default "xiao tu dou"
depends on USE_CUSTOM_WAKE_WORD
help
Custom Wake Word, use pinyin for Chinese, separated by spaces
config CUSTOM_WAKE_WORD_DISPLAY
string "Custom Wake Word Display"
default "小土豆"
depends on USE_CUSTOM_WAKE_WORD
help
Greeting sent to the server after wake word detection
config CUSTOM_WAKE_WORD_THRESHOLD
int "Custom Wake Word Threshold (%)"
default 20
range 1 99
depends on USE_CUSTOM_WAKE_WORD
help
Custom Wake Word Threshold, range 1-99, the smaller the more sensitive, default 20
config SEND_WAKE_WORD_DATA
bool "Send Wake Word Data"
default y
depends on USE_AFE_WAKE_WORD || USE_CUSTOM_WAKE_WORD
help
Send wake word data to the server as the first message of the conversation and wait for response
config USE_AUDIO_PROCESSOR
bool "Enable Audio Noise Reduction"
default y
depends on (IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4) && SPIRAM
help
Requires ESP32 S3 and PSRAM
config USE_DEVICE_AEC
bool "Enable Device-Side AEC"
default n
depends on USE_AUDIO_PROCESSOR && (BOARD_TYPE_ESP_BOX_3 || BOARD_TYPE_ESP_BOX || BOARD_TYPE_ESP_BOX_LITE \
|| BOARD_TYPE_LICHUANG_DEV_S3 || BOARD_TYPE_ESP_KORVO2_V3 || BOARD_TYPE_WAVESHARE_S3_TOUCH_AMOLED_1_75 || BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_1_83\
|| BOARD_TYPE_WAVESHARE_S3_TOUCH_AMOLED_2_06 || BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_4B || BOARD_TYPE_WAVESHARE_P4_WIFI6_TOUCH_LCD_4B || BOARD_TYPE_WAVESHARE_P4_WIFI6_TOUCH_LCD_7B \
|| BOARD_TYPE_WAVESHARE_P4_WIFI6_TOUCH_LCD_XC || BOARD_TYPE_ESP_S3_LCD_EV_Board_2 || BOARD_TYPE_YUNLIAO_S3 \
|| BOARD_TYPE_ECHOEAR || BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_3_49 || BOARD_TYPE_WAVESHARE_S3_RLCD_4_2 || BOARD_TYPE_ZHENGCHEN_CAM || BOARD_TYPE_ZHENGCHEN_CAM_ML307 \
|| BOARD_TYPE_WAVESHARE_S3_TOUCH_LCD_4_3C)
help
To work properly, device-side AEC requires a clean output reference path from the speaker signal and physical acoustic isolation between the microphone and speaker.
config USE_SERVER_AEC
bool "Enable Server-Side AEC (Unstable)"
default n
depends on USE_AUDIO_PROCESSOR
help
To work perperly, server-side AEC requires server support
config USE_AUDIO_DEBUGGER
bool "Enable Audio Debugger"
default n
help
Enable audio debugger, send audio data through UDP to the host machine
menu "WiFi Configuration Method"
help
WiFi Configuration Method Selection
config USE_HOTSPOT_WIFI_PROVISIONING
bool "Hotspot"
default y
help
Use WiFi Hotspot to transmit WiFi configuration data
config USE_ACOUSTIC_WIFI_PROVISIONING
bool "Acoustic"
help
Use audio signal to transmit WiFi configuration data
config USE_ESP_BLUFI_WIFI_PROVISIONING
bool "Esp Blufi"
help
Use esp blufi protocol to transmit WiFi configuration data
select BT_ENABLED
select BT_BLE_42_FEATURES_SUPPORTED
select BT_BLE_BLUFI_ENABLE
select MBEDTLS_DHM_C
endmenu
config AUDIO_DEBUG_UDP_SERVER
string "Audio Debug UDP Server Address"
default "192.168.2.100:8000"
depends on USE_AUDIO_DEBUGGER
help
UDP server address, format: IP:PORT, used to receive audio debugging data
config RECEIVE_CUSTOM_MESSAGE
bool "Enable Custom Message Reception"
default n
help
Enable custom message reception, allow the device to receive custom messages from the server (preferably through the MQTT protocol)
menu "Camera Configuration"
depends on !IDF_TARGET_ESP32
comment "Warning: Please read the help text before modifying these settings."
config XIAOZHI_CAMERA_ALLOW_JPEG_INPUT
bool "Allow JPEG Input"
default n
help
Allow JPEG Input format for the camera.
This option may need to be enabled when using a USB camera.
Not currently supported when used simultaneously with XIAOZHI_ENABLE_ROTATE_CAMERA_IMAGE.
config XIAOZHI_ENABLE_HARDWARE_JPEG_ENCODER
bool "Enable Hardware JPEG Encoder"
default y
depends on SOC_JPEG_ENCODE_SUPPORTED
help
Use hardware JPEG encoder on ESP32-P4 to encode image to JPEG.
See https://docs.espressif.com/projects/esp-idf/en/stable/esp32p4/api-reference/peripherals/jpeg.html for more details.
config XIAOZHI_ENABLE_HARDWARE_JPEG_DECODER
bool "Enable Hardware JPEG Decoder"
default n
depends on SOC_JPEG_DECODE_SUPPORTED && XIAOZHI_CAMERA_ALLOW_JPEG_INPUT
help
Use hardware JPEG decoder on ESP32-P4 to decode JPEG to image.
See https://docs.espressif.com/projects/esp-idf/en/stable/esp32p4/api-reference/peripherals/jpeg.html for more details.
config XIAOZHI_ENABLE_CAMERA_DEBUG_MODE
bool "Enable Camera Debug Mode"
default n
help
Enable camera debug mode, print camera debug information to the console.
Only works on boards that support camera.
config XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP
bool "Enable software camera buffer endianness swapping"
default n
depends on !CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER
help
This option treats the camera buffer as a uint16_t[] array and performs byte-swapping (endianness conversion) on each element.
Should only be modified by development board integration engineers.
**Incorrect usage may result in incorrect image colors!**
ATTENTION: If the option CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER is available for your sensor, please use that instead.
menuconfig XIAOZHI_ENABLE_ROTATE_CAMERA_IMAGE
bool "Enable Camera Image Rotation"
default n
depends on !XIAOZHI_CAMERA_ALLOW_JPEG_INPUT
help
Enable camera image rotation, rotate the camera image to the correct orientation.
- On ESP32-P4, rotation is handled by PPA hardware.
- On other chips, rotation is done in software with performance cost.
- For 180° rotation, use HFlip + VFlip instead of this option.
Not currently supported when used simultaneously with XIAOZHI_CAMERA_ALLOW_JPEG_INPUT.
if XIAOZHI_ENABLE_ROTATE_CAMERA_IMAGE
choice XIAOZHI_CAMERA_IMAGE_ROTATION_ANGLE
prompt "Camera Image Rotation Angle (clockwise)"
default XIAOZHI_CAMERA_IMAGE_ROTATION_ANGLE_90
help
Camera image rotation angle.
config XIAOZHI_CAMERA_IMAGE_ROTATION_ANGLE_90
bool "90°"
config XIAOZHI_CAMERA_IMAGE_ROTATION_ANGLE_270
bool "270°"
comment "For 180° rotation, use HFlip + VFlip instead of this option"
endchoice
endif
endmenu
menu "TAIJIPAI_S3_CONFIG"
depends on BOARD_TYPE_TAIJI_PI_S3
choice I2S_TYPE_TAIJIPI_S3
prompt "taiji-pi-S3 I2S Type"
default TAIJIPAI_I2S_TYPE_STD
help
I2S 类型选择
config TAIJIPAI_I2S_TYPE_STD
bool "I2S Type STD"
config TAIJIPAI_I2S_TYPE_PDM
bool "I2S Type PDM"
endchoice
config I2S_USE_2SLOT
bool "Enable I2S 2 Slot"
default y
help
Enable I2S Simplex mode.
config AUDIO_DEVICE_I2S_MIC_GPIO_BCLK
int "I2S MIC GPIO BCLK"
default 11
depends on AUDIO_DEVICE_I2S_SIMPLEX
help
GPIO number of the I2S MIC BCLK.
config AUDIO_DEVICE_I2S_MIC_GPIO_WS
int "I2S MIC GPIO WS"
default 10
depends on AUDIO_DEVICE_I2S_SIMPLEX
help
GPIO number of the I2S MIC WS.
启动双声道
endmenu
endmenu
+1087
View File
File diff suppressed because it is too large Load Diff
+188
View File
@@ -0,0 +1,188 @@
#ifndef _APPLICATION_H_
#define _APPLICATION_H_
#include <freertos/FreeRTOS.h>
#include <freertos/event_groups.h>
#include <freertos/task.h>
#include <esp_timer.h>
#include <string>
#include <mutex>
#include <deque>
#include <memory>
#include "protocol.h"
#include "ota.h"
#include "audio_service.h"
#include "device_state.h"
#include "device_state_machine.h"
// Main event bits
#define MAIN_EVENT_SCHEDULE (1 << 0)
#define MAIN_EVENT_SEND_AUDIO (1 << 1)
#define MAIN_EVENT_WAKE_WORD_DETECTED (1 << 2)
#define MAIN_EVENT_VAD_CHANGE (1 << 3)
#define MAIN_EVENT_ERROR (1 << 4)
#define MAIN_EVENT_ACTIVATION_DONE (1 << 5)
#define MAIN_EVENT_CLOCK_TICK (1 << 6)
#define MAIN_EVENT_NETWORK_CONNECTED (1 << 7)
#define MAIN_EVENT_NETWORK_DISCONNECTED (1 << 8)
#define MAIN_EVENT_TOGGLE_CHAT (1 << 9)
#define MAIN_EVENT_START_LISTENING (1 << 10)
#define MAIN_EVENT_STOP_LISTENING (1 << 11)
#define MAIN_EVENT_STATE_CHANGED (1 << 12)
enum AecMode {
kAecOff,
kAecOnDeviceSide,
kAecOnServerSide,
};
class Application {
public:
static Application& GetInstance() {
static Application instance;
return instance;
}
// Delete copy constructor and assignment operator
Application(const Application&) = delete;
Application& operator=(const Application&) = delete;
/**
* Initialize the application
* This sets up display, audio, network callbacks, etc.
* Network connection starts asynchronously.
*/
void Initialize();
/**
* Run the main event loop
* This function runs in the main task and never returns.
* It handles all events including network, state changes, and user interactions.
*/
void Run();
DeviceState GetDeviceState() const { return state_machine_.GetState(); }
bool IsVoiceDetected() const { return audio_service_.IsVoiceDetected(); }
/**
* Request state transition
* Returns true if transition was successful
*/
bool SetDeviceState(DeviceState state);
/**
* Schedule a callback to be executed in the main task
*/
void Schedule(std::function<void()>&& callback);
/**
* Alert with status, message, emotion and optional sound
*/
void Alert(const char* status, const char* message, const char* emotion = "", const std::string_view& sound = "");
void DismissAlert();
void AbortSpeaking(AbortReason reason);
/**
* Toggle chat state (event-based, thread-safe)
* Sends MAIN_EVENT_TOGGLE_CHAT to be handled in Run()
*/
void ToggleChatState();
/**
* Start listening (event-based, thread-safe)
* Sends MAIN_EVENT_START_LISTENING to be handled in Run()
*/
void StartListening();
/**
* Stop listening (event-based, thread-safe)
* Sends MAIN_EVENT_STOP_LISTENING to be handled in Run()
*/
void StopListening();
void Reboot();
void WakeWordInvoke(const std::string& wake_word);
bool UpgradeFirmware(const std::string& url, const std::string& version = "");
bool CanEnterSleepMode();
void SendMcpMessage(const std::string& payload);
void SetAecMode(AecMode mode);
AecMode GetAecMode() const { return aec_mode_; }
void PlaySound(const std::string_view& sound);
AudioService& GetAudioService() { return audio_service_; }
/**
* Reset protocol resources (thread-safe)
* Can be called from any task to release resources allocated after network connected
* This includes closing audio channel, resetting protocol and ota objects
*/
void ResetProtocol();
private:
Application();
~Application();
std::mutex mutex_;
std::deque<std::function<void()>> main_tasks_;
std::unique_ptr<Protocol> protocol_;
EventGroupHandle_t event_group_ = nullptr;
esp_timer_handle_t clock_timer_handle_ = nullptr;
DeviceStateMachine state_machine_;
ListeningMode listening_mode_ = kListeningModeAutoStop;
AecMode aec_mode_ = kAecOff;
std::string last_error_message_;
AudioService audio_service_;
std::unique_ptr<Ota> ota_;
bool has_server_time_ = false;
bool aborted_ = false;
bool assets_version_checked_ = false;
bool play_popup_on_listening_ = false; // Flag to play popup sound after state changes to listening
int clock_ticks_ = 0;
TaskHandle_t activation_task_handle_ = nullptr;
// Event handlers
void HandleStateChangedEvent();
void HandleToggleChatEvent();
void HandleStartListeningEvent();
void HandleStopListeningEvent();
void HandleNetworkConnectedEvent();
void HandleNetworkDisconnectedEvent();
void HandleActivationDoneEvent();
void HandleWakeWordDetectedEvent();
void ContinueOpenAudioChannel(ListeningMode mode);
void ContinueWakeWordInvoke(const std::string& wake_word);
// Activation task (runs in background)
void ActivationTask();
// Helper methods
void CheckAssetsVersion();
void CheckNewVersion();
void InitializeProtocol();
void ShowActivationCode(const std::string& code, const std::string& message);
void SetListeningMode(ListeningMode mode);
// State change handler called by state machine
void OnStateChanged(DeviceState old_state, DeviceState new_state);
};
class TaskPriorityReset {
public:
TaskPriorityReset(BaseType_t priority) {
original_priority_ = uxTaskPriorityGet(NULL);
vTaskPrioritySet(NULL, priority);
}
~TaskPriorityReset() {
vTaskPrioritySet(NULL, original_priority_);
}
private:
BaseType_t original_priority_;
};
#endif // _APPLICATION_H_
+560
View File
@@ -0,0 +1,560 @@
#include "assets.h"
#include "board.h"
#include "display.h"
#include "application.h"
#include "lvgl_theme.h"
#include "emote_display.h"
#include "expression_emote.h"
#if HAVE_LVGL
#include "display/lcd_display.h"
#include <spi_flash_mmap.h>
#endif
#include <esp_log.h>
#include <esp_timer.h>
#include <esp_heap_caps.h>
#include <cbin_font.h>
#define TAG "Assets"
#define PARTITION_LABEL "assets"
struct mmap_assets_table {
char asset_name[32]; /*!< Name of the asset */
uint32_t asset_size; /*!< Size of the asset */
uint32_t asset_offset; /*!< Offset of the asset */
uint16_t asset_width; /*!< Width of the asset */
uint16_t asset_height; /*!< Height of the asset */
};
Assets::Assets() {
#if HAVE_LVGL
strategy_ = std::make_unique<Assets::LvglStrategy>();
#else
strategy_ = std::make_unique<Assets::EmoteStrategy>();
#endif
// Initialize the partition
InitializePartition();
}
Assets::~Assets() {
UnApplyPartition();
}
bool Assets::FindPartition(Assets* assets) {
assets->partition_ = esp_partition_find_first(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, PARTITION_LABEL);
if (assets->partition_ == nullptr) {
ESP_LOGI(TAG, "No assets partition found");
return false;
}
return true;
}
bool Assets::Apply() {
return strategy_ ? strategy_->Apply(this) : false;
}
bool Assets::InitializePartition() {
return strategy_ ? strategy_->InitializePartition(this) : false;
}
void Assets::UnApplyPartition() {
if (strategy_) {
strategy_->UnApplyPartition(this);
}
}
bool Assets::GetAssetData(const std::string& name, void*& ptr, size_t& size) {
return strategy_ ? strategy_->GetAssetData(this, name, ptr, size) : false;
}
bool Assets::LoadSrmodelsFromIndex(Assets* assets, cJSON* root) {
void* ptr = nullptr;
size_t size = 0;
bool need_delete_root = false;
// If root is not provided, parse index.json
if (root == nullptr) {
if (!assets->GetAssetData("index.json", ptr, size)) {
ESP_LOGE(TAG, "The index.json file is not found");
return false;
}
root = cJSON_ParseWithLength(static_cast<char*>(ptr), size);
if (root == nullptr) {
ESP_LOGE(TAG, "The index.json file is not valid");
return false;
}
need_delete_root = true;
}
cJSON* srmodels = cJSON_GetObjectItem(root, "srmodels");
if (cJSON_IsString(srmodels)) {
std::string srmodels_file = srmodels->valuestring;
if (assets->GetAssetData(srmodels_file, ptr, size)) {
if (assets->models_list_ != nullptr) {
esp_srmodel_deinit(assets->models_list_);
assets->models_list_ = nullptr;
}
assets->models_list_ = srmodel_load(static_cast<uint8_t*>(ptr));
if (assets->models_list_ != nullptr) {
auto& app = Application::GetInstance();
app.GetAudioService().SetModelsList(assets->models_list_);
if (need_delete_root) {
cJSON_Delete(root);
}
return true;
} else {
ESP_LOGE(TAG, "Failed to load srmodels.bin");
}
} else {
ESP_LOGE(TAG, "The srmodels file %s is not found", srmodels_file.c_str());
}
}
if (need_delete_root) {
cJSON_Delete(root);
}
return false;
}
#if HAVE_LVGL
uint32_t Assets::LvglStrategy::CalculateChecksum(const char* data, uint32_t length) {
uint32_t checksum = 0;
for (uint32_t i = 0; i < length; i++) {
checksum += data[i];
}
return checksum & 0xFFFF;
}
bool Assets::LvglStrategy::InitializePartition(Assets* assets) {
assets->partition_valid_ = false;
assets_.clear();
if (!Assets::FindPartition(assets)) {
return false;
}
int free_pages = spi_flash_mmap_get_free_pages(SPI_FLASH_MMAP_DATA);
uint32_t storage_size = free_pages * 64 * 1024;
ESP_LOGI(TAG, "The storage free size is %ld KB", storage_size / 1024);
ESP_LOGI(TAG, "The partition size is %ld KB", assets->partition_->size / 1024);
if (storage_size < assets->partition_->size) {
ESP_LOGE(TAG, "The free size %ld KB is less than assets partition required %ld KB", storage_size / 1024, assets->partition_->size / 1024);
return false;
}
esp_err_t err = esp_partition_mmap(assets->partition_, 0, assets->partition_->size, ESP_PARTITION_MMAP_DATA, (const void**)&mmap_root_, &mmap_handle_);
if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to mmap assets partition: %s", esp_err_to_name(err));
return false;
}
assets->partition_valid_ = true;
uint32_t stored_files = *(uint32_t*)(mmap_root_ + 0);
uint32_t stored_chksum = *(uint32_t*)(mmap_root_ + 4);
uint32_t stored_len = *(uint32_t*)(mmap_root_ + 8);
if (stored_len > assets->partition_->size - 12) {
ESP_LOGD(TAG, "The stored_len (0x%lx) is greater than the partition size (0x%lx) - 12", stored_len, assets->partition_->size);
return false;
}
auto start_time = esp_timer_get_time();
uint32_t calculated_checksum = CalculateChecksum(mmap_root_ + 12, stored_len);
auto end_time = esp_timer_get_time();
ESP_LOGI(TAG, "The checksum calculation time is %d ms", int((end_time - start_time) / 1000));
if (calculated_checksum != stored_chksum) {
ESP_LOGE(TAG, "The calculated checksum (0x%lx) does not match the stored checksum (0x%lx)", calculated_checksum, stored_chksum);
return false;
}
checksum_valid_ = true;
for (uint32_t i = 0; i < stored_files; i++) {
auto item = (const mmap_assets_table*)(mmap_root_ + 12 + i * sizeof(mmap_assets_table));
auto asset = Asset{
.size = static_cast<size_t>(item->asset_size),
.offset = static_cast<size_t>(12 + sizeof(mmap_assets_table) * stored_files + item->asset_offset)
};
assets_[item->asset_name] = asset;
}
return checksum_valid_;
}
void Assets::LvglStrategy::UnApplyPartition(Assets* assets) {
if (mmap_handle_ != 0) {
esp_partition_munmap(mmap_handle_);
mmap_handle_ = 0;
mmap_root_ = nullptr;
}
checksum_valid_ = false;
assets_.clear();
(void)assets; // Unused parameter
}
bool Assets::LvglStrategy::GetAssetData(Assets* assets, const std::string& name, void*& ptr, size_t& size) {
auto asset = assets_.find(name);
if (asset == assets_.end()) {
return false;
}
auto data = (const char*)(mmap_root_ + asset->second.offset);
if (data[0] != 'Z' || data[1] != 'Z') {
ESP_LOGE(TAG, "The asset %s is not valid with magic %02x%02x", name.c_str(), data[0], data[1]);
return false;
}
ptr = static_cast<void*>(const_cast<char*>(data + 2));
size = asset->second.size;
return true;
}
bool Assets::LvglStrategy::Apply(Assets* assets) {
void* ptr = nullptr;
size_t size = 0;
if (!assets->GetAssetData("index.json", ptr, size)) {
ESP_LOGE(TAG, "The index.json file is not found");
return false;
}
cJSON* root = cJSON_ParseWithLength(static_cast<char*>(ptr), size);
if (root == nullptr) {
ESP_LOGE(TAG, "The index.json file is not valid");
return false;
}
cJSON* version = cJSON_GetObjectItem(root, "version");
if (cJSON_IsNumber(version)) {
if (version->valuedouble > 1) {
ESP_LOGE(TAG, "The assets version %d is not supported, please upgrade the firmware", version->valueint);
return false;
}
}
Assets::LoadSrmodelsFromIndex(assets, root);
auto& theme_manager = LvglThemeManager::GetInstance();
auto light_theme = theme_manager.GetTheme("light");
auto dark_theme = theme_manager.GetTheme("dark");
cJSON* font = cJSON_GetObjectItem(root, "text_font");
if (cJSON_IsString(font)) {
std::string fonts_text_file = font->valuestring;
if (assets->GetAssetData(fonts_text_file, ptr, size)) {
auto text_font = std::make_shared<LvglCBinFont>(ptr);
if (text_font->font() == nullptr) {
ESP_LOGE(TAG, "Failed to load fonts.bin");
return false;
}
if (light_theme != nullptr) {
light_theme->set_text_font(text_font);
}
if (dark_theme != nullptr) {
dark_theme->set_text_font(text_font);
}
} else {
ESP_LOGE(TAG, "The font file %s is not found", fonts_text_file.c_str());
}
}
cJSON* emoji_collection = cJSON_GetObjectItem(root, "emoji_collection");
if (cJSON_IsArray(emoji_collection)) {
auto custom_emoji_collection = std::make_shared<EmojiCollection>();
int emoji_count = cJSON_GetArraySize(emoji_collection);
for (int i = 0; i < emoji_count; i++) {
cJSON* emoji = cJSON_GetArrayItem(emoji_collection, i);
if (cJSON_IsObject(emoji)) {
cJSON* name = cJSON_GetObjectItem(emoji, "name");
cJSON* file = cJSON_GetObjectItem(emoji, "file");
cJSON* eaf = cJSON_GetObjectItem(emoji, "eaf");
if (cJSON_IsString(name) && cJSON_IsString(file) && (NULL== eaf)) {
if (!assets->GetAssetData(file->valuestring, ptr, size)) {
ESP_LOGE(TAG, "Emoji %s image file %s is not found", name->valuestring, file->valuestring);
continue;
}
custom_emoji_collection->AddEmoji(name->valuestring, new LvglRawImage(ptr, size));
}
}
}
if (light_theme != nullptr) {
light_theme->set_emoji_collection(custom_emoji_collection);
}
if (dark_theme != nullptr) {
dark_theme->set_emoji_collection(custom_emoji_collection);
}
}
cJSON* skin = cJSON_GetObjectItem(root, "skin");
if (cJSON_IsObject(skin)) {
cJSON* light_skin = cJSON_GetObjectItem(skin, "light");
if (cJSON_IsObject(light_skin) && light_theme != nullptr) {
cJSON* text_color = cJSON_GetObjectItem(light_skin, "text_color");
cJSON* background_color = cJSON_GetObjectItem(light_skin, "background_color");
cJSON* background_image = cJSON_GetObjectItem(light_skin, "background_image");
if (cJSON_IsString(text_color)) {
light_theme->set_text_color(LvglTheme::ParseColor(text_color->valuestring));
}
if (cJSON_IsString(background_color)) {
light_theme->set_background_color(LvglTheme::ParseColor(background_color->valuestring));
light_theme->set_chat_background_color(LvglTheme::ParseColor(background_color->valuestring));
}
if (cJSON_IsString(background_image)) {
if (!assets->GetAssetData(background_image->valuestring, ptr, size)) {
ESP_LOGE(TAG, "The background image file %s is not found", background_image->valuestring);
return false;
}
auto background_image = std::make_shared<LvglCBinImage>(ptr);
light_theme->set_background_image(background_image);
}
}
cJSON* dark_skin = cJSON_GetObjectItem(skin, "dark");
if (cJSON_IsObject(dark_skin) && dark_theme != nullptr) {
cJSON* text_color = cJSON_GetObjectItem(dark_skin, "text_color");
cJSON* background_color = cJSON_GetObjectItem(dark_skin, "background_color");
cJSON* background_image = cJSON_GetObjectItem(dark_skin, "background_image");
if (cJSON_IsString(text_color)) {
dark_theme->set_text_color(LvglTheme::ParseColor(text_color->valuestring));
}
if (cJSON_IsString(background_color)) {
dark_theme->set_background_color(LvglTheme::ParseColor(background_color->valuestring));
dark_theme->set_chat_background_color(LvglTheme::ParseColor(background_color->valuestring));
}
if (cJSON_IsString(background_image)) {
if (!assets->GetAssetData(background_image->valuestring, ptr, size)) {
ESP_LOGE(TAG, "The background image file %s is not found", background_image->valuestring);
return false;
}
auto background_image = std::make_shared<LvglCBinImage>(ptr);
dark_theme->set_background_image(background_image);
}
}
}
auto display = Board::GetInstance().GetDisplay();
ESP_LOGI(TAG, "Refreshing display theme...");
auto current_theme = display->GetTheme();
if (current_theme != nullptr) {
display->SetTheme(current_theme);
}
// Parse hide_subtitle configuration
cJSON* hide_subtitle = cJSON_GetObjectItem(root, "hide_subtitle");
if (cJSON_IsBool(hide_subtitle)) {
bool hide = cJSON_IsTrue(hide_subtitle);
auto lcd_display = dynamic_cast<LcdDisplay*>(display);
if (lcd_display != nullptr) {
lcd_display->SetHideSubtitle(hide);
ESP_LOGI(TAG, "Set hide_subtitle to %s", hide ? "true" : "false");
}
}
cJSON_Delete(root);
return true;
}
#endif // HAVE_LVGL
bool Assets::EmoteStrategy::InitializePartition(Assets* assets) {
assets->partition_valid_ = false;
if (!Assets::FindPartition(assets)) {
return false;
}
esp_err_t ret = ESP_ERR_INVALID_STATE;
auto display = Board::GetInstance().GetDisplay();
auto* emote_display = dynamic_cast<emote::EmoteDisplay*>(display);
if (emote_display && emote_display->GetEmoteHandle() != nullptr) {
const emote_data_t data = {
.type = EMOTE_SOURCE_PARTITION,
.source = {
.partition_label = PARTITION_LABEL,
},
.flags = {
.mmap_enable = true, //must be true here!!!
},
};
ret = emote_mount_assets(emote_display->GetEmoteHandle(), &data);
} else {
ESP_LOGE(TAG, "Emote display is not initialized");
}
assets->partition_valid_ = ((ret == ESP_OK) ? true : false);
return assets->partition_valid_;
}
void Assets::EmoteStrategy::UnApplyPartition(Assets* assets) {
auto display = Board::GetInstance().GetDisplay();
auto* emote_display = dynamic_cast<emote::EmoteDisplay*>(display);
if (emote_display && emote_display->GetEmoteHandle() != nullptr) {
emote_unmount_assets(emote_display->GetEmoteHandle());
}
(void)assets; // Unused parameter
}
bool Assets::EmoteStrategy::GetAssetData(Assets* assets, const std::string& name, void*& ptr, size_t& size) {
auto display = Board::GetInstance().GetDisplay();
auto* emote_display = dynamic_cast<emote::EmoteDisplay*>(display);
if (emote_display && emote_display->GetEmoteHandle() != nullptr) {
const uint8_t* data = nullptr;
size_t data_size = 0;
if (ESP_OK == emote_get_asset_data_by_name(emote_display->GetEmoteHandle(), name.c_str(), &data, &data_size)) {
ptr = const_cast<void*>(static_cast<const void*>(data));
size = data_size;
return true;
}
ESP_LOGE(TAG, "Failed to get asset data by name: %s", name.c_str());
return false;
}
(void)assets; // Unused parameter
return false;
}
bool Assets::EmoteStrategy::Apply(Assets* assets) {
Assets::LoadSrmodelsFromIndex(assets);
auto display = Board::GetInstance().GetDisplay();
auto* emote_display = dynamic_cast<emote::EmoteDisplay*>(display);
if (emote_display && emote_display->GetEmoteHandle() != nullptr) {
emote_load_assets(emote_display->GetEmoteHandle());
}
return true;
}
bool Assets::Download(std::string url, std::function<void(int progress, size_t speed)> progress_callback) {
ESP_LOGI(TAG, "Downloading new version of assets from %s", url.c_str());
// 取消当前资源分区的内存映射
UnApplyPartition();
// 下载新的资源文件
auto network = Board::GetInstance().GetNetwork();
auto http = network->CreateHttp(0);
if (!http->Open("GET", url)) {
ESP_LOGE(TAG, "Failed to open HTTP connection");
return false;
}
if (http->GetStatusCode() != 200) {
ESP_LOGE(TAG, "Failed to get assets, status code: %d", http->GetStatusCode());
return false;
}
size_t content_length = http->GetBodyLength();
if (content_length == 0) {
ESP_LOGE(TAG, "Failed to get content length");
return false;
}
if (content_length > partition_->size) {
ESP_LOGE(TAG, "Assets file size (%u) is larger than partition size (%lu)", content_length, partition_->size);
return false;
}
// 定义扇区大小为4KB(ESP32的标准扇区大小)
const size_t SECTOR_SIZE = esp_partition_get_main_flash_sector_size();
// 计算需要擦除的扇区数量
size_t sectors_to_erase = (content_length + SECTOR_SIZE - 1) / SECTOR_SIZE; // 向上取整
size_t total_erase_size = sectors_to_erase * SECTOR_SIZE;
ESP_LOGI(TAG, "Sector size: %u, content length: %u, sectors to erase: %u, total erase size: %u",
SECTOR_SIZE, content_length, sectors_to_erase, total_erase_size);
// 写入新的资源文件到分区,一边erase一边写入
char* buffer = (char*)heap_caps_malloc(SECTOR_SIZE, MALLOC_CAP_INTERNAL);
if (buffer == nullptr) {
ESP_LOGE(TAG, "Failed to allocate buffer");
return false;
}
size_t total_written = 0;
size_t recent_written = 0;
size_t current_sector = 0;
auto last_calc_time = esp_timer_get_time();
while (true) {
int ret = http->Read(buffer, SECTOR_SIZE);
if (ret < 0) {
ESP_LOGE(TAG, "Failed to read HTTP data: %s", esp_err_to_name(ret));
heap_caps_free(buffer);
return false;
}
if (ret == 0) {
break;
}
// 检查是否需要擦除新的扇区
size_t write_end_offset = total_written + ret;
size_t needed_sectors = (write_end_offset + SECTOR_SIZE - 1) / SECTOR_SIZE;
// 擦除需要的新扇区
while (current_sector < needed_sectors) {
size_t sector_start = current_sector * SECTOR_SIZE;
size_t sector_end = (current_sector + 1) * SECTOR_SIZE;
// 确保擦除范围不超过分区大小
if (sector_end > partition_->size) {
ESP_LOGE(TAG, "Sector end (%u) exceeds partition size (%lu)", sector_end, partition_->size);
heap_caps_free(buffer);
return false;
}
ESP_LOGD(TAG, "Erasing sector %u (offset: %u, size: %u)", current_sector, sector_start, SECTOR_SIZE);
esp_err_t err = esp_partition_erase_range(partition_, sector_start, SECTOR_SIZE);
if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to erase sector %u at offset %u: %s", current_sector, sector_start, esp_err_to_name(err));
heap_caps_free(buffer);
return false;
}
current_sector++;
}
// 写入数据到分区
esp_err_t err = esp_partition_write(partition_, total_written, buffer, ret);
if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to write to assets partition at offset %u: %s", total_written, esp_err_to_name(err));
heap_caps_free(buffer);
return false;
}
total_written += ret;
recent_written += ret;
// 计算进度和速度
if (esp_timer_get_time() - last_calc_time >= 1000000 || total_written == content_length || ret == 0) {
size_t progress = total_written * 100 / content_length;
size_t speed = recent_written; // 每秒的字节数
ESP_LOGI(TAG, "Progress: %u%% (%u/%u), Speed: %u B/s, Sectors erased: %u",
progress, total_written, content_length, speed, current_sector);
if (progress_callback) {
progress_callback(progress, speed);
}
last_calc_time = esp_timer_get_time();
recent_written = 0; // 重置最近写入的字节数
}
}
http->Close();
heap_caps_free(buffer);
if (total_written != content_length) {
ESP_LOGE(TAG, "Downloaded size (%u) does not match expected size (%u)", total_written, content_length);
return false;
}
ESP_LOGI(TAG, "Assets download completed, total written: %u bytes, total sectors erased: %u",
total_written, current_sector);
// 重新初始化资源分区
if (!InitializePartition()) {
ESP_LOGE(TAG, "Failed to re-initialize assets partition");
return false;
}
return true;
}
+89
View File
@@ -0,0 +1,89 @@
#ifndef ASSETS_H
#define ASSETS_H
#include <string>
#include <functional>
#include <memory>
#include <cJSON.h>
#include <esp_partition.h>
#include <model_path.h>
#include <map>
#include <string>
#if HAVE_LVGL
#include <spi_flash_mmap.h>
#endif
struct Asset {
size_t size;
size_t offset;
};
class Assets {
public:
static Assets& GetInstance() {
static Assets instance;
return instance;
}
~Assets();
bool Download(std::string url, std::function<void(int progress, size_t speed)> progress_callback);
bool Apply();
bool GetAssetData(const std::string& name, void*& ptr, size_t& size);
inline bool partition_valid() const { return partition_valid_; }
inline std::string default_assets_url() const { return default_assets_url_; }
private:
Assets();
Assets(const Assets&) = delete;
Assets& operator=(const Assets&) = delete;
bool InitializePartition();
void UnApplyPartition();
static bool FindPartition(Assets* assets);
static bool LoadSrmodelsFromIndex(Assets* assets, cJSON* root = nullptr);
class AssetStrategy {
public:
virtual ~AssetStrategy() = default;
virtual bool Apply(Assets* assets) = 0;
virtual bool InitializePartition(Assets* assets) = 0;
virtual void UnApplyPartition(Assets* assets) = 0;
virtual bool GetAssetData(Assets* assets, const std::string& name, void*& ptr, size_t& size) = 0;
};
class LvglStrategy : public AssetStrategy {
public:
bool Apply(Assets* assets) override;
bool InitializePartition(Assets* assets) override;
void UnApplyPartition(Assets* assets) override;
bool GetAssetData(Assets* assets, const std::string& name, void*& ptr, size_t& size) override;
private:
static uint32_t CalculateChecksum(const char* data, uint32_t length);
std::map<std::string, Asset> assets_;
esp_partition_mmap_handle_t mmap_handle_ = 0;
const char* mmap_root_ = nullptr;
bool checksum_valid_ = false;
};
class EmoteStrategy : public AssetStrategy {
public:
bool Apply(Assets* assets) override;
bool InitializePartition(Assets* assets) override;
void UnApplyPartition(Assets* assets) override;
bool GetAssetData(Assets* assets, const std::string& name, void*& ptr, size_t& size) override;
};
// Strategy instance
std::unique_ptr<AssetStrategy> strategy_;
protected:
const esp_partition_t* partition_ = nullptr;
bool partition_valid_ = false;
std::string default_assets_url_;
srmodel_list_t* models_list_ = nullptr;
};
#endif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+59
View File
@@ -0,0 +1,59 @@
{
"language": {
"type": "ar-SA"
},
"strings": {
"WARNING": "تحذير",
"INFO": "معلومات",
"ERROR": "خطأ",
"VERSION": "الإصدار ",
"LOADING_PROTOCOL": "الاتصال بالخادم...",
"INITIALIZING": "التهيئة...",
"PIN_ERROR": "يرجى إدخال بطاقة SIM",
"REG_ERROR": "لا يمكن الوصول إلى الشبكة، يرجى التحقق من حالة بطاقة البيانات",
"DETECTING_MODULE": "اكتشاف الوحدة...",
"REGISTERING_NETWORK": "انتظار الشبكة...",
"CHECKING_NEW_VERSION": "فحص الإصدار الجديد...",
"CHECK_NEW_VERSION_FAILED": "فشل فحص الإصدار الجديد، سيتم المحاولة خلال %d ثانية: %s",
"SWITCH_TO_WIFI_NETWORK": "التبديل إلى Wi-Fi...",
"SWITCH_TO_4G_NETWORK": "التبديل إلى 4G...",
"STANDBY": "في الانتظار",
"CONNECT_TO": "الاتصال بـ ",
"CONNECTING": "جاري الاتصال...",
"CONNECTED_TO": "متصل بـ ",
"LISTENING": "الاستماع...",
"SPEAKING": "التحدث...",
"SERVER_NOT_FOUND": "البحث عن خدمة متاحة",
"SERVER_NOT_CONNECTED": "لا يمكن الاتصال بالخدمة، يرجى المحاولة لاحقاً",
"SERVER_TIMEOUT": "انتهت مهلة الاستجابة",
"SERVER_ERROR": "فشل الإرسال، يرجى التحقق من الشبكة",
"CONNECT_TO_HOTSPOT": "اتصل الهاتف بنقطة الاتصال ",
"ACCESS_VIA_BROWSER": "،الوصول عبر المتصفح ",
"WIFI_CONFIG_MODE": "وضع تكوين الشبكة",
"ENTERING_WIFI_CONFIG_MODE": "الدخول في وضع تكوين الشبكة...",
"SCANNING_WIFI": "فحص Wi-Fi...",
"NEW_VERSION": "إصدار جديد ",
"OTA_UPGRADE": "تحديث OTA",
"UPGRADING": "تحديث النظام...",
"UPGRADE_FAILED": "فشل التحديث",
"ACTIVATION": "تفعيل الجهاز",
"BATTERY_LOW": "البطارية منخفضة",
"BATTERY_CHARGING": "جاري الشحن",
"BATTERY_FULL": "البطارية ممتلئة",
"BATTERY_NEED_CHARGE": "البطارية منخفضة، يرجى الشحن",
"VOLUME": "الصوت ",
"MUTED": "صامت",
"MAX_VOLUME": "أقصى صوت",
"RTC_MODE_OFF": "AEC مُوقف",
"RTC_MODE_ON": "AEC مُشغل",
"DOWNLOAD_ASSETS_FAILED": "فشل في تنزيل الموارد",
"LOADING_ASSETS": "جاري تحميل الموارد...",
"PLEASE_WAIT": "يرجى الانتظار...",
"FOUND_NEW_ASSETS": "تم العثور على موارد جديدة: %s",
"HELLO_MY_FRIEND": "مرحباً، صديقي!",
"CONNECTION_SUCCESSFUL": "تم الاتصال بنجاح",
"FLIGHT_MODE_OFF": "وضع الطيران معطل",
"FLIGHT_MODE_ON": "وضع الطيران قيد التشغيل",
"MODEM_INIT_ERROR": "فشل تهيئة المودم"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+59
View File
@@ -0,0 +1,59 @@
{
"language": {
"type": "bg-BG"
},
"strings": {
"WARNING": "Предупреждение",
"INFO": "Информация",
"ERROR": "Грешка",
"VERSION": "Версия ",
"LOADING_PROTOCOL": "Влизане в системата...",
"INITIALIZING": "Инициализация...",
"PIN_ERROR": "Моля, поставете SIM карта",
"REG_ERROR": "Не може да се осъществи достъп до мрежата, моля проверете статуса на SIM картата",
"DETECTING_MODULE": "Откриване на модул...",
"REGISTERING_NETWORK": "Изчакване на мрежата...",
"CHECKING_NEW_VERSION": "Проверка за нова версия...",
"CHECK_NEW_VERSION_FAILED": "Проверката за нова версия е неуспешна, ще се опита отново след %d секунди: %s",
"SWITCH_TO_WIFI_NETWORK": "Превключване към Wi-Fi...",
"SWITCH_TO_4G_NETWORK": "Превключване към 4G...",
"STANDBY": "Режим на готовност",
"CONNECT_TO": "Свързване към ",
"CONNECTING": "Свързване...",
"CONNECTION_SUCCESSFUL": "Успешно свързване",
"CONNECTED_TO": "Свързан към ",
"LISTENING": "Слушане...",
"SPEAKING": "Говорене...",
"SERVER_NOT_FOUND": "Търсене на налична услуга",
"SERVER_NOT_CONNECTED": "Не може да се свърже с услугата, моля опитайте по-късно",
"SERVER_TIMEOUT": "Времето за изчакване на отговор изтече",
"SERVER_ERROR": "Неуспешно изпращане, моля проверете мрежата",
"CONNECT_TO_HOTSPOT": "Горещa точка: ",
"ACCESS_VIA_BROWSER": " Конфигурационен URL: ",
"WIFI_CONFIG_MODE": "Режим на конфигуриране на Wi-Fi",
"ENTERING_WIFI_CONFIG_MODE": "Влизане в режим на конфигуриране на Wi-Fi...",
"SCANNING_WIFI": "Сканиране на Wi-Fi...",
"NEW_VERSION": "Нова версия ",
"OTA_UPGRADE": "OTA надстройка",
"UPGRADING": "Системата се надстройва...",
"UPGRADE_FAILED": "Надстройката е неуспешна",
"ACTIVATION": "Активация",
"BATTERY_LOW": "Слаба батерия",
"BATTERY_CHARGING": "Зарядна",
"BATTERY_FULL": "Батерията е пълна",
"BATTERY_NEED_CHARGE": "Слаба батерия, моля заредете",
"VOLUME": "Сила на звука ",
"MUTED": "Заглушено",
"MAX_VOLUME": "Максимална сила на звука",
"RTC_MODE_OFF": "AEC изключен",
"RTC_MODE_ON": "AEC включен",
"PLEASE_WAIT": "Моля, изчакайте...",
"FOUND_NEW_ASSETS": "Намерени нови ресурси: %s",
"DOWNLOAD_ASSETS_FAILED": "Неуспешно изтегляне на ресурси",
"LOADING_ASSETS": "Зареждане на ресурси...",
"HELLO_MY_FRIEND": "Здравей, мой приятел!",
"FLIGHT_MODE_OFF": "Режим на самолет е изключен",
"FLIGHT_MODE_ON": "Режим на самолет е включен",
"MODEM_INIT_ERROR": "Неуспешна инициализация на модема"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More