Compare commits

...

255 Commits

Author SHA1 Message Date
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 1fe349d5b4.

* Revert "Update README.md"

This reverts commit 8fc7dc8e68.

* Revert "Update README_en.md"

This reverts commit 346ab09b90.

* 增加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
394 changed files with 25576 additions and 60372 deletions

View File

@@ -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

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

View File

@@ -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
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
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尽在小智百科

4
.gitignore vendored
View File

@@ -8,4 +8,6 @@ sdkconfig.old
sdkconfig
dependencies.lock
.env
releases/
releases/
main/assets/lang_config.h
.DS_Store

View File

@@ -4,7 +4,11 @@
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
set(PROJECT_VER "0.9.9")
set(PROJECT_VER "1.5.5")
# Add this line to disable the specific warning
add_compile_options(-Wno-missing-field-initializers)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(xiaozhi)

View File

@@ -2,21 +2,23 @@
(中文 | [English](README_en.md) | [日本語](README_ja.md)
这是虾哥的第一个硬件作品。
## 视频介绍
👉 [ESP32+SenseVoice+Qwen72B打造你的AI聊天伴侣【bilibili】](https://www.bilibili.com/video/BV11msTenEH3/?share_source=copy_web&vd_source=ee1aafe19d6e60cf22e60a93881faeba)
👉 [ESP32+SenseVoice+Qwen72B打造你的AI聊天伴侣【bilibili】](https://www.bilibili.com/video/BV11msTenEH3/)
👉 [给小智装上 DeepSeek 的聪明大脑【bilibili】](https://www.bilibili.com/video/BV1GQP6eNEFG/)
👉 [手工打造你的 AI 女友新手入门教程【bilibili】](https://www.bilibili.com/video/BV1XnmFYLEJN/)
## 项目目的
本项目基于乐鑫的 ESP-IDF 进行开发
本项目是由虾哥开源的一个开源项目,以 MIT 许可证发布,允许任何人免费使用,并可以用于商业用途
本项目是一个开源项目,主要用于教学目的。我们希望通过这个项目,能够帮助更多人入门 AI 硬件开发,了解如何将当下飞速发展的大语言模型应用到实际的硬件设备中。无论你是对 AI 感兴趣的学生,还是想要探索新技术的开发者,都可以通过这个项目获得宝贵的学习经验。
我们希望通过这个项目,能够帮助更多人入门 AI 硬件开发,了解如何将当下飞速发展的大语言模型应用到实际的硬件设备中。无论你是对 AI 感兴趣的学生,还是想要探索新技术的开发者,都可以通过这个项目获得宝贵的学习经验。
欢迎所有人参与到项目的开发和改进中来。如果你有任何想法或建议,请随时提出 Issue 或加入群聊。
学习交流 QQ 群:946599635
学习交流 QQ 群:376893254
## 已实现功能
@@ -27,10 +29,12 @@
- 支持国语、粤语、英语、日语、韩语 5 种语言识别 [SenseVoice](https://github.com/FunAudioLLM/SenseVoice)
- 声纹识别,识别是谁在喊 AI 的名字 [3D Speaker](https://github.com/modelscope/3D-Speaker)
- 大模型 TTS火山引擎 或 CosyVoice
- 大模型 LLMQwen2.5 72B 或 豆包 API
- 大模型 LLMQwen, DeepSeek, Doubao
- 可配置的提示词和音色(自定义角色)
- 短期记忆,每轮对话后自我总结
- OLED / LCD 显示屏,显示信号强弱或对话内容
- 支持 LCD 显示图片表情
- 支持多语言(中文、英文)
## 硬件部分
@@ -49,32 +53,62 @@
- <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>
- 神奇按钮 2.4
- <a href="https://docs.m5stack.com/en/atom/Atomic%20Echo%20Base" target="_blank" title="AtomS3R + Echo Base">AtomS3R + Echo Base</a>
- <a href="https://docs.m5stack.com/en/core/ATOM%20Matrix" target="_blank" title="AtomMatrix + Echo Base">AtomMatrix + 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/moji-xiaozhi-ai-derivative-editi" target="_blank" title="Movecall Moji ESP32S3">Moji 小智AI衍生版</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>
<div style="display: flex; justify-content: space-between;">
<a href="docs/lichuang-s3.jpg" target="_blank" title="立创·实战派 ESP32-S3 开发板">
<img src="docs/lichuang-s3.jpg" width="240" />
<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/esp32s3-box3.jpg" target="_blank" title="乐鑫 ESP32-S3-BOX3">
<img src="docs/esp32s3-box3.jpg" width="240" />
<a href="docs/v1/espbox3.jpg" target="_blank" title="乐鑫 ESP32-S3-BOX3">
<img src="docs/v1/espbox3.jpg" width="240" />
</a>
<a href="docs/m5stack-cores3.jpg" target="_blank" title="M5Stack CoreS3">
<img src="docs/m5stack-cores3.jpg" width="240" />
<a href="docs/v1/m5cores3.jpg" target="_blank" title="M5Stack CoreS3">
<img src="docs/v1/m5cores3.jpg" width="240" />
</a>
<a href="docs/magiclick-2p4.jpg" target="_blank" title="神奇按钮 2.4">
<img src="docs/magiclick-2p4.jpg" width="240" />
<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/lilygo-t-circle-s3.jpg" target="_blank" title="LILYGO T-Circle-S3">
<img src="docs/lilygo-t-circle-s3.jpg" width="240" />
</a>
<a href="docs/xmini-c3.jpg" target="_blank" title="虾哥 Mini C3">
<img src="docs/xmini-c3.jpg" width="240" />
</a>
<a href="docs/v1/movecall-moji-esp32s3.jpg" target="_blank" title="Movecall Moji 小智AI衍生版">
<img src="docs/v1/movecall-moji-esp32s3.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>
</div>
## 固件部分
### 免开发环境烧录
新手第一次操作建议先不要搭建开发环境,直接使用免开发环境烧录的固件。固件使用的是作者友情提供的测试服,目前开放免费使用,请勿用于商业用途。
新手第一次操作建议先不要搭建开发环境,直接使用免开发环境烧录的固件。
固件默认接入 [xiaozhi.me](https://xiaozhi.me) 官方服务器,目前个人用户注册账号可以免费使用 Qwen 实时模型。
👉 [Flash烧录固件无IDF开发环境](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS)
@@ -84,13 +118,25 @@
- Cursor 或 VSCode
- 安装 ESP-IDF 插件,选择 SDK 版本 5.3 或以上
- Linux 比 Windows 更好,编译速度快,也免去驱动问题的困扰
- 使用 Google C++ 代码风格,提交代码时请确保符合规范
### 开发者文档
- [开发板定制指南](main/boards/README.md) - 学习如何为小智创建自定义开发板适配
- [物联网控制模块](main/iot/README.md) - 了解如何通过AI语音控制物联网设备
## AI 角色配置
## 智能体配置
如果你已经拥有一个小智 AI 聊天机器人,可以参考 👉 [后台操作视频教程](https://www.bilibili.com/video/BV1jUCUY2EKM/)
如果你已经拥有一个小智 AI 聊天机器人设备,可以登录 [xiaozhi.me](https://xiaozhi.me) 控制台进行配置。
详细的使用说明以及测试服的注意事项,请参考 👉 [小智测试服的帮助说明](https://xiaozhi.me/help)
👉 [后台操作视频教程(旧版界面)](https://www.bilibili.com/video/BV1jUCUY2EKM/)
## 技术原理与私有化部署
👉 [一份详细的 WebSocket 通信协议文档](docs/websocket.md)
在个人电脑上部署服务器,可以参考另一位作者同样以 MIT 许可证开源的项目 [xiaozhi-esp32-server](https://github.com/xinnan-tech/xiaozhi-esp32-server)
## Star History

View File

@@ -1,72 +1,108 @@
# XiaoZhi AI Chatbot
[中文](README.md) | English | [日本語](README_ja.md)
([中文](README.md) | English | [日本語](README_ja.md))
This is Terrence's first hardware project.
## Introduction
👉 [Build your AI chat companion with ESP32+SenseVoice+Qwen72B! [bilibili]](https://www.bilibili.com/video/BV11msTenEH3/?share_source=copy_web&vd_source=ee1aafe19d6e60cf22e60a93881faeba)
👉 [Build your AI chat companion with ESP32+SenseVoice+Qwen72B!bilibili](https://www.bilibili.com/video/BV11msTenEH3/)
👉 [DIY Your AI Companion - Beginner's Tutorial [bilibili]](https://www.bilibili.com/video/BV1XnmFYLEJN/)
👉 [Equipping XiaoZhi with DeepSeek's smart brain【bilibili](https://www.bilibili.com/video/BV1GQP6eNEFG/)
👉 [Build your own AI companion, a beginner's guide【bilibili】](https://www.bilibili.com/video/BV1XnmFYLEJN/)
## Project Purpose
This project is developed based on Espressif's ESP-IDF.
This is an open-source project released under the MIT license, allowing anyone to use it freely, including for commercial purposes.
This is an open-source project primarily for educational purposes. Through this project, we aim to help more people get started with AI hardware development and understand how to integrate rapidly evolving large language models into actual hardware devices. Whether you're a student interested in AI or a developer looking to explore new technologies, this project offers valuable learning experiences.
Through this project, we aim to help more people get started with AI hardware development and understand how to implement rapidly evolving large language models in actual hardware devices. Whether you're a student interested in AI or a developer exploring new technologies, this project offers valuable learning experiences.
Everyone is welcome to participate in the project's development and improvement. If you have any ideas or suggestions, please feel free to raise an Issue or join our chat group.
Everyone is welcome to participate in the project's development and improvement. If you have any ideas or suggestions, please feel free to raise an Issue or join the chat group.
Learning & Discussion QQ Group: 946599635
Learning & Discussion QQ Group: 376893254
## Implemented Features
- Wi-Fi / ML307 Cat.1 4G
- BOOT button wake-up and interrupt, supporting both click and long-press triggers
- BOOT button wake-up and interruption, supporting both click and long-press triggers
- Offline voice wake-up [ESP-SR](https://github.com/espressif/esp-sr)
- Streaming voice dialogue (WebSocket or UDP protocol)
- Support for 5 languages: Mandarin, Cantonese, English, Japanese, Korean [SenseVoice](https://github.com/FunAudioLLM/SenseVoice)
- Voice print recognition to identify who's calling AI's name [3D Speaker](https://github.com/modelscope/3D-Speaker)
- Large model TTS (Volcengine or CosyVoice)
- Large Language Model (Qwen2.5 72B or Doubao API)
- Large model TTS (Volcano Engine or CosyVoice)
- Large Language Models (Qwen, DeepSeek, Doubao)
- Configurable prompts and voice tones (custom characters)
- Short-term memory with self-summary after each conversation round
- Short-term memory, self-summarizing after each conversation round
- OLED / LCD display showing signal strength or conversation content
- Support for LCD image expressions
- Multi-language support (Chinese, English)
## Hardware Section
### Breadboard Practice
### Breadboard DIY Practice
For detailed tutorial, see the Feishu document:
See the Feishu document tutorial:
👉 [XiaoZhi AI Chatbot Encyclopedia](https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb?from=from_copylink)
Breadboard setup shown below:
Breadboard demonstration:
![Breadboard Setup](docs/wiring2.jpg)
![Breadboard Demo](docs/wiring2.jpg)
### Supported Open-Source Hardware
### Supported Open Source Hardware
- <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>
- MagiClick 2.4
- <a href="https://oshwhub.com/tenclass01/xmini_c3" target="_blank" title="Xmini C3">Xmini C3</a>
- <a href="https://docs.m5stack.com/en/atom/Atomic%20Echo%20Base" target="_blank" title="AtomS3R + Echo Base">AtomS3R + Echo Base</a>
- <a href="https://docs.m5stack.com/en/core/ATOM%20Matrix" target="_blank" title="AtomMatrix + Echo Base">AtomMatrix + 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/moji-xiaozhi-ai-derivative-editi" target="_blank" title="Movecall Moji ESP32S3">Moji XiaoZhi AI Derivative Version</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>
<div style="display: flex; justify-content: space-between;">
<a href="docs/lichuang-s3.jpg" target="_blank" title="LiChuang ESP32-S3 Development Board">
<img src="docs/lichuang-s3.jpg" />
<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/esp32s3-box3.jpg" target="_blank" title="Espressif ESP32-S3-BOX3">
<img src="docs/esp32s3-box3.jpg" />
<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/m5stack-cores3.jpg" target="_blank" title="M5Stack CoreS3">
<img src="docs/m5stack-cores3.jpg" />
<a href="docs/v1/m5cores3.jpg" target="_blank" title="M5Stack CoreS3">
<img src="docs/v1/m5cores3.jpg" width="240" />
</a>
<a href="docs/magiclick-2p4.jpg" target="_blank" title="MagiClick 2.4">
<img src="docs/magiclick-2p4.jpg" />
<a href="docs/v1/atoms3r.jpg" target="_blank" title="AtomS3R + Echo Base">
<img src="docs/v1/atoms3r.jpg" width="240" />
</a>
<a href="docs/AtomMatrix-echo-base.jpg" target="_blank" title="AtomMatrix-echo-base + Echo Base">
<img src="docs/AtomMatrix-echo-base.jpg" width="240" />
</a>
<a href="docs/v1/magiclick.jpg" target="_blank" title="MagiClick 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/lilygo-t-circle-s3.jpg" target="_blank" title="LILYGO T-Circle-S3">
<img src="docs/lilygo-t-circle-s3.jpg" width="240" />
</a>
<a href="docs/xmini-c3.jpg" target="_blank" title="Xmini C3">
<img src="docs/xmini-c3.jpg" />
<img src="docs/xmini-c3.jpg" width="240" />
</a>
<a href="docs/v1/movecall-moji-esp32s3.jpg" target="_blank" title="Moji">
<img src="docs/v1/movecall-moji-esp32s3.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>
</div>
@@ -74,21 +110,35 @@ Breadboard setup shown below:
### Flashing Without Development Environment
For beginners, it's recommended to first try flashing the firmware without setting up a development environment. The firmware uses a test server provided by the author, currently available for free use (not for commercial purposes).
For beginners, it's recommended to first use the firmware that can be flashed without setting up a development environment.
👉 [Flash Firmware Guide (No IDF Environment Required)](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS)
The firmware connects to the official [xiaozhi.me](https://xiaozhi.me) server by default. Currently, personal users can register an account to use the Qwen real-time model for free.
👉 [Flash Firmware Guide (No IDF Environment)](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS)
### Development Environment
- Cursor or VSCode
- Install ESP-IDF plugin, select SDK version 5.3 or above
- Linux is preferred over Windows for faster compilation and fewer driver issues
- Use Google C++ code style, ensure compliance when submitting code
## AI Character Configuration
### Developer Documentation
If you already have a XiaoZhi AI chatbot, please refer to 👉 [Backend Operation Video Tutorial](https://www.bilibili.com/video/BV1jUCUY2EKM/)
- [Board Customization Guide](main/boards/README.md) - Learn how to create custom board adaptations for XiaoZhi
- [IoT Control Module](main/iot/README.md) - Understand how to control IoT devices through AI voice commands
For detailed usage instructions and test server notes, please refer to 👉 [XiaoZhi Test Server Help Guide](https://xiaozhi.me/help).
## AI Agent Configuration
If you already have a XiaoZhi AI chatbot device, you can configure it through the [xiaozhi.me](https://xiaozhi.me) console.
👉 [Backend Operation Tutorial (Old Interface)](https://www.bilibili.com/video/BV1jUCUY2EKM/)
## Technical Principles and Private Deployment
👉 [Detailed WebSocket Communication Protocol Documentation](docs/websocket.md)
For server deployment on personal computers, refer to another MIT-licensed project [xiaozhi-esp32-server](https://github.com/xinnan-tech/xiaozhi-esp32-server)
## Star History

View File

@@ -1,96 +1,143 @@
# XiaoZhi AI チャットボット
# シャオジー AI チャットボット
[中文](README.md) | [English](README_en.md) | 日本語
([中文](README.md) | [English](README_en.md) | 日本語)
これはテレンスの最初のハードウェアプロジェクトです。
## プロジェクト紹介
👉 [ESP32+SenseVoice+Qwen72BでAIチャットコンパニオンを作ろう【bilibili】](https://www.bilibili.com/video/BV11msTenEH3/?share_source=copy_web&vd_source=ee1aafe19d6e60cf22e60a93881faeba)
👉 [ESP32+SenseVoice+Qwen72Bで AI チャット仲間を作ろう【bilibili】](https://www.bilibili.com/video/BV11msTenEH3/)
👉 [AIコンパニオンをDIYする - 初心者向けチュートリアル【bilibili】](https://www.bilibili.com/video/BV1XnmFYLEJN/)
👉 [シャオジーに DeepSeek のスマートな頭脳を搭載【bilibili】](https://www.bilibili.com/video/BV1GQP6eNEFG/)
👉 [自分だけの AI パートナーを作る、初心者向けガイド【bilibili】](https://www.bilibili.com/video/BV1XnmFYLEJN/)
## プロジェクトの目的
このプロジェクトはEspressifのESP-IDFに基づいて開発されています。
このプロジェクトは MIT ライセンスの下で公開されているオープンソースプロジェクトで、商用利用を含め、誰でも自由に使用することができます。
このプロジェクトは主に教育目的のためのオープンソースプロジェクトです。このプロジェクトを通じて、より多くの人々がAIハードウェア開発を始め、急速に進化る大規模言語モデルを実際のハードウェアデバイスに統合する方法を理解する手助けをすることを目指しています。AIに興味のある学生新しい技術を探求したい開発者にとって、このプロジェクト貴重な学習験を提供します。
このプロジェクトを通じて、より多くの人々が AI ハードウェア開発を始め、急速に進化している大規模言語モデルを実際のハードウェアデバイスに実装する方法を理解できるようになることを目指しています。AI に興味のある学生でも、新しい技術を探求する開発者でも、このプロジェクトから貴重な学習験を得ることができます。
プロジェクトの開発と改善に参加することを歓迎します。アイデアや提案があれば、Issueを提起するかチャットグループに参加してください。
プロジェクトの開発と改善には誰でも参加できます。アイデアや提案がありましたら、Issue を立てるかチャットグループに参加ください。
学習・ディスカッションQQグループ: 946599635
学習・交流 QQ グループ376893254
## 実装された機能
## 実装済みの機能
- Wi-Fi / ML307 Cat.1 4G
- BOOTボタンのウェイクアップと割り込み、クリックと長押しの両方のトリガーをサポート
- オフライン音声ウェイクアップ [ESP-SR](https://github.com/espressif/esp-sr)
- ストリーミング音声対話WebSocketまたはUDPプロトコル
- 5つの言語をサポート:標準中国語、広東語、英語、日本語、韓国語 [SenseVoice](https://github.com/FunAudioLLM/SenseVoice)
- 音声認識AIの名前を呼んでいる人を識別 [3D Speaker](https://github.com/modelscope/3D-Speaker)
- 大規模モデルTTSVolcengineまたはCosyVoice
- 大規模言語モデルQwen2.5 72BまたはDoubao API
- カスタマイズ可能なプロンプトと音声トーン(カスタムキャラクター)
- 短期記憶、各話ラウンド後の自己要約
- 信号強度や対話内容を表示するOLED / LCDディスプレイ
- BOOT ボタンによる起動と中断、クリックと長押しの2種類のトリガーに対応
- オフライン音声起動 [ESP-SR](https://github.com/espressif/esp-sr)
- ストリーミング音声対話WebSocket または UDP プロトコル)
- 5言語対応:標準中国語、広東語、英語、日本語、韓国語 [SenseVoice](https://github.com/FunAudioLLM/SenseVoice)
- 話者認識AI の名前を呼んでいる人を識別 [3D Speaker](https://github.com/modelscope/3D-Speaker)
- 大規模モデル TTSVolcano Engine または CosyVoice
- 大規模言語モデルQwen, DeepSeek, Doubao
- 設定可能なプロンプトと音声トーン(カスタムキャラクター)
- 短期記憶、各話ラウンド後の自己要約
- OLED / LCD ディスプレイ、信号強度や会話内容を表示
- LCD での画像表情表示に対応
- 多言語対応(中国語、英語)
## ハードウェアセクション
## ハードウェア部分
### ブレッドボードの練習
### ブレッドボード DIY 実践
詳細なチュートリアルについては、Feishuドキュメントを参照してください:
Feishu ドキュメントチュートリアルをご覧ください:
👉 [XiaoZhi AI チャットボット百<EFBFBD><EFBFBD>事典](https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb?from=from_copylink)
👉 [シャオジー AI チャットボット百事典](https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb?from=from_copylink)
以下にブレッドボードのセットアップを示します
ブレッドボードのデモ
![ブレッドボードのセットアップ](docs/wiring2.jpg)
![ブレッドボードデモ](docs/wiring2.jpg)
### サポートされているオープンソースハードウェア
- <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 開発ボード">LiChuang ESP32-S3 開発ボード</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>
- MagiClick 2.4
- <a href="https://oshwhub.com/tenclass01/xmini_c3" target="_blank" title="Xmini C3">Xmini C3</a>
- <a href="https://docs.m5stack.com/en/atom/Atomic%20Echo%20Base" target="_blank" title="AtomS3R + Echo Base">AtomS3R + Echo Base</a>
- <a href="https://docs.m5stack.com/en/core/ATOM%20Matrix" target="_blank" title="AtomMatrix + Echo Base">AtomMatrix + 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="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/moji-xiaozhi-ai-derivative-editi" target="_blank" title="Movecall Moji ESP32S3">Moji シャオジー AI 派生版</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>
<div style="display: flex; justify-content: space-between;">
<a href="docs/lichuang-s3.jpg" target="_blank" title="LiChuang ESP32-S3 開発ボード">
<img src="docs/lichuang-s3.jpg" />
<a href="docs/v1/lichuang-s3.jpg" target="_blank" title="LiChuang ESP32-S3 開発ボード">
<img src="docs/v1/lichuang-s3.jpg" width="240" />
</a>
<a href="docs/esp32s3-box3.jpg" target="_blank" title="Espressif ESP32-S3-BOX3">
<img src="docs/esp32s3-box3.jpg" />
<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/m5stack-cores3.jpg" target="_blank" title="M5Stack CoreS3">
<img src="docs/m5stack-cores3.jpg" />
<a href="docs/v1/m5cores3.jpg" target="_blank" title="M5Stack CoreS3">
<img src="docs/v1/m5cores3.jpg" width="240" />
</a>
<a href="docs/magiclick-2p4.jpg" target="_blank" title="MagiClick 2.4">
<img src="docs/magiclick-2p4.jpg" />
<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="MagiClick 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/lilygo-t-circle-s3.jpg" target="_blank" title="LILYGO T-Circle-S3">
<img src="docs/lilygo-t-circle-s3.jpg" width="240" />
</a>
<a href="docs/xmini-c3.jpg" target="_blank" title="Xmini C3">
<img src="docs/xmini-c3.jpg" />
<img src="docs/xmini-c3.jpg" width="240" />
</a>
<a href="docs/v1/movecall-moji-esp32s3.jpg" target="_blank" title="Moji">
<img src="docs/v1/movecall-moji-esp32s3.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>
</div>
## ファームウェアセクション
## ファームウェア部分
### 開発環境なしのフラッシュ
### 開発環境なしのフラッシュ
初心者には、最初に開発環境を設定せずにファームウェアをフラッシュすることをお勧めします。ファームウェアは著者が提供するテストサーバーを使用しており、現在無料で使用できます(商業目的では使用しないでください)
初心者の方は、まず開発環境のセットアップなしでフラッシュできるファームウェアを使用することをお勧めします
👉 [開発環境なしでのフラッシュガイド](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS)
ファームウェアはデフォルトで公式 [xiaozhi.me](https://xiaozhi.me) サーバーに接続します。現在、個人ユーザーはアカウントを登録することで、Qwen リアルタイムモデルを無料で使用できます。
👉 [フラッシュファームウェアガイドIDF環境なし](https://ccnphfhqs21z.feishu.cn/wiki/Zpz4wXBtdimBrLk25WdcXzxcnNS)
### 開発環境
- CursorまたはVSCode
- ESP-IDFプラグインをインストール、SDKバージョン5.3以上を選択
- LinuxWindowsよりも優れており、コンパイルが速く、ドライバの問題も少ない
- Cursor または VSCode
- ESP-IDF プラグインをインストール、SDK バージョン 5.3 以上を選択
- LinuxWindows より好ましい(コンパイルが速く、ドライバの問題も少ない
- Google C++ コードスタイルを使用、コード提出時にはコンプライアンスを確認
## AIキャラクターの設定
### 開発者ドキュメント
すでにXiaoZhi AIチャットボットをお持ちの場合は、👉 [バックエンド操作ビデオチュートリアル](https://www.bilibili.com/video/BV1jUCUY2EKM/)を参照してください。
- [ボードカスタマイズガイド](main/boards/README.md) - シャオジー向けのカスタムボード適応を作成する方法を学ぶ
- [IoT 制御モジュール](main/iot/README.md) - AI 音声コマンドでIoTデバイスを制御する方法を理解する
詳細な使用方法とテストサーバーの注意事項については、👉 [XiaoZhiテストサーバーヘルプガイド](https://xiaozhi.me/help)を参照してください。
## AI エージェント設定
## Star History
シャオジー AI チャットボットデバイスをお持ちの場合は、[xiaozhi.me](https://xiaozhi.me) コンソールで設定できます。
👉 [バックエンド操作チュートリアル(旧インターフェース)](https://www.bilibili.com/video/BV1jUCUY2EKM/)
## 技術原理とプライベートデプロイメント
👉 [詳細な WebSocket 通信プロトコルドキュメント](docs/websocket.md)
個人のコンピュータでのサーバーデプロイメントについては、同じく MIT ライセンスで公開されている別のプロジェクト [xiaozhi-esp32-server](https://github.com/xinnan-tech/xiaozhi-esp32-server) を参照してください。
## スター履歴
<a href="https://star-history.com/#78/xiaozhi-esp32&Date">
<picture>

View File

@@ -1,40 +0,0 @@
# convert audio files to protocol v3 stream
import librosa
import opuslib
import struct
import sys
import tqdm
import numpy as np
def encode_audio_to_opus(input_file, output_file):
# Load audio file using librosa
audio, sample_rate = librosa.load(input_file, sr=None, mono=False, dtype=np.int16)
# Get left channel if stereo
if audio.ndim == 2:
audio = audio[0]
# Initialize Opus encoder
encoder = opuslib.Encoder(sample_rate, 1, opuslib.APPLICATION_VOIP)
# Encode audio data to Opus packets
# Save encoded data to file
with open(output_file, 'wb') as f:
sample_rate = 16000 # 16000Hz
duration = 60 # 60ms every frame
frame_size = int(sample_rate * duration / 1000)
for i in tqdm.tqdm(range(0, len(audio) - frame_size, frame_size)):
frame = audio[i:i + frame_size]
opus_data = encoder.encode(frame.tobytes(), frame_size=frame_size)
# protocol format, [1u type, 1u reserved, 2u len, data]
packet = struct.pack('>BBH', 0, 0, len(opus_data)) + opus_data
f.write(packet)
# Example usage
if len(sys.argv) != 3:
print('Usage: python convert.py <input_file> <output_file>')
sys.exit(1)
input_file = sys.argv[1]
output_file = sys.argv[2]
encode_audio_to_opus(input_file, output_file)

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
docs/ESP32-BreadBoard.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
docs/atoms3r-echo-base.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
docs/esp-sparkbot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
docs/lilygo-t-circle-s3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
docs/v1/atoms3r.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
docs/v1/espbox3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/v1/lichuang-s3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
docs/v1/m5cores3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
docs/v1/magiclick.jpg Normal file

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: 38 KiB

BIN
docs/v1/waveshare.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 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: 46 KiB

338
docs/websocket.md Normal file
View File

@@ -0,0 +1,338 @@
以下是一份基于代码实现整理的 WebSocket 通信协议文档,概述客户端(设备)与服务器之间如何通过 WebSocket 进行交互。该文档仅基于所提供的代码推断,实际部署时可能需要结合服务器端实现进行进一步确认或补充。
---
## 1. 总体流程概览
1. **设备端初始化**
- 设备上电、初始化 `Application`
- 初始化音频编解码器、显示屏、LED 等
- 连接网络
- 创建并初始化实现 `Protocol` 接口的 WebSocket 协议实例(`WebsocketProtocol`
- 进入主循环等待事件(音频输入、音频输出、调度任务等)。
2. **建立 WebSocket 连接**
- 当设备需要开始语音会话时(例如用户唤醒、手动按键触发等),调用 `OpenAudioChannel()`
- 根据编译配置获取 WebSocket URL`CONFIG_WEBSOCKET_URL`
- 设置若干请求头(`Authorization`, `Protocol-Version`, `Device-Id`, `Client-Id`
- 调用 `Connect()` 与服务器建立 WebSocket 连接
3. **发送客户端 “hello” 消息**
- 连接成功后,设备会发送一条 JSON 消息,示例结构如下:
```json
{
"type": "hello",
"version": 1,
"transport": "websocket",
"audio_params": {
"format": "opus",
"sample_rate": 16000,
"channels": 1,
"frame_duration": 60
}
}
```
- 其中 `"frame_duration"` 的值对应 `OPUS_FRAME_DURATION_MS`(例如 60ms
4. **服务器回复 “hello”**
- 设备等待服务器返回一条包含 `"type": "hello"` 的 JSON 消息,并检查 `"transport": "websocket"` 是否匹配。
- 如果匹配,则认为服务器已就绪,标记音频通道打开成功。
- 如果在超时时间(默认 10 秒)内未收到正确回复,认为连接失败并触发网络错误回调。
5. **后续消息交互**
- 设备端和服务器端之间可发送两种主要类型的数据:
1. **二进制音频数据**Opus 编码)
2. **文本 JSON 消息**用于传输聊天状态、TTS/STT 事件、IoT 命令等)
- 在代码里,接收回调主要分为:
- `OnData(...)`:
- 当 `binary` 为 `true` 时,认为是音频帧;设备会将其当作 Opus 数据进行解码。
- 当 `binary` 为 `false` 时,认为是 JSON 文本,需要在设备端用 cJSON 进行解析并做相应业务逻辑处理(见下文消息结构)。
- 当服务器或网络出现断连,回调 `OnDisconnected()` 被触发:
- 设备会调用 `on_audio_channel_closed_()`,并最终回到空闲状态。
6. **关闭 WebSocket 连接**
- 设备在需要结束语音会话时,会调用 `CloseAudioChannel()` 主动断开连接,并回到空闲状态。
- 或者如果服务器端主动断开,也会引发同样的回调流程。
---
## 2. 通用请求头
在建立 WebSocket 连接时,代码示例中设置了以下请求头:
- `Authorization`: 用于存放访问令牌,形如 `"Bearer <token>"`
- `Protocol-Version`: 固定示例中为 `"1"`
- `Device-Id`: 设备物理网卡 MAC 地址
- `Client-Id`: 设备 UUID可在应用中唯一标识设备
这些头会随着 WebSocket 握手一起发送到服务器,服务器可根据需求进行校验、认证等。
---
## 3. JSON 消息结构
WebSocket 文本帧以 JSON 方式传输,以下为常见的 `"type"` 字段及其对应业务逻辑。若消息里包含未列出的字段,可能为可选或特定实现细节。
### 3.1 客户端→服务器
1. **Hello**
- 连接成功后,由客户端发送,告知服务器基本参数。
- 例:
```json
{
"type": "hello",
"version": 1,
"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**
- 用于客户端向服务器告知检测到唤醒词。
- 例:
```json
{
"session_id": "xxx",
"type": "listen",
"state": "detect",
"text": "你好小明"
}
```
5. **IoT**
- 发送当前设备的物联网相关信息:
- **Descriptors**(描述设备功能、属性等)
- **States**(设备状态的实时更新)
- 例:
```json
{
"session_id": "xxx",
"type": "iot",
"descriptors": { ... }
}
```
```json
{
"session_id": "xxx",
"type": "iot",
"states": { ... }
}
```
---
### 3.2 服务器→客户端
1. **Hello**
- 服务器端返回的握手确认消息。
- 必须包含 `"type": "hello"` 和 `"transport": "websocket"`。
- 可能会带有 `audio_params`,表示服务器期望的音频参数,或与客户端对齐的配置。
- 成功接收后客户端会设置事件标志,表示 WebSocket 通道就绪。
2. **STT**
- `{"type": "stt", "text": "..."}`
- 表示服务器端识别到了用户语音。(例如语音转文本结果)
- 设备可能将此文本显示到屏幕上,后续再进入回答等流程。
3. **LLM**
- `{"type": "llm", "emotion": "happy", "text": "😀"}`
- 服务器指示设备调整表情动画 / UI 表达。
4. **TTS**
- `{"type": "tts", "state": "start"}`:服务器准备下发 TTS 音频,客户端进入 “speaking” 播放状态。
- `{"type": "tts", "state": "stop"}`:表示本次 TTS 结束。
- `{"type": "tts", "state": "sentence_start", "text": "..."}`
- 让设备在界面上显示当前要播放或朗读的文本片段(例如用于显示给用户)。
5. **IoT**
- `{"type": "iot", "commands": [ ... ]}`
- 服务器向设备发送物联网的动作指令,设备解析并执行(如打开灯、设置温度等)。
6. **音频数据:二进制帧**
- 当服务器发送音频二进制帧Opus 编码)时,客户端解码并播放。
- 若客户端正在处于 “listening” (录音)状态,收到的音频帧会被忽略或清空以防冲突。
---
## 4. 音频编解码
1. **客户端发送录音数据**
- 音频输入经过可能的回声消除、降噪或音量增益后,通过 Opus 编码打包为二进制帧发送给服务器。
- 如果客户端每次编码生成的二进制帧大小为 N 字节,则会通过 WebSocket 的 **binary** 消息发送这块数据。
2. **客户端播放收到的音频**
- 收到服务器的二进制帧时,同样认定是 Opus 数据。
- 设备端会进行解码,然后交由音频输出接口播放。
- 如果服务器的音频采样率与设备不一致,会在解码后再进行重采样。
---
## 5. 常见状态流转
以下简述设备端关键状态流转,与 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。
---
## 6. 错误处理
1. **连接失败**
- 如果 `Connect(url)` 返回失败或在等待服务器 “hello” 消息时超时,触发 `on_network_error_()` 回调。设备会提示“无法连接到服务”或类似错误信息。
2. **服务器断开**
- 如果 WebSocket 异常断开,回调 `OnDisconnected()`
- 设备回调 `on_audio_channel_closed_()`
- 切换到 Idle 或其他重试逻辑。
---
## 7. 其它注意事项
1. **鉴权**
- 设备通过设置 `Authorization: Bearer <token>` 提供鉴权,服务器端需验证是否有效。
- 如果令牌过期或无效,服务器可拒绝握手或在后续断开。
2. **会话控制**
- 代码中部分消息包含 `session_id`用于区分独立的对话或操作。服务端可根据需要对不同会话做分离处理WebSocket 协议为空。
3. **音频负载**
- 代码里默认使用 Opus 格式,并设置 `sample_rate = 16000`,单声道。帧时长由 `OPUS_FRAME_DURATION_MS` 控制,一般为 60ms。可根据带宽或性能做适当调整。
4. **IoT 指令**
- `"type":"iot"` 的消息用户端代码对接 `thing_manager` 执行具体命令,因设备定制而不同。服务器端需确保下发格式与客户端保持一致。
5. **错误或异常 JSON**
- 当 JSON 中缺少必要字段,例如 `{"type": ...}`,客户端会记录错误日志(`ESP_LOGE(TAG, "Missing message type, data: %s", data);`),不会执行任何业务。
---
## 8. 消息示例
下面给出一个典型的双向消息示例(流程简化示意):
1. **客户端 → 服务器**(握手)
```json
{
"type": "hello",
"version": 1,
"transport": "websocket",
"audio_params": {
"format": "opus",
"sample_rate": 16000,
"channels": 1,
"frame_duration": 60
}
}
```
2. **服务器 → 客户端**(握手应答)
```json
{
"type": "hello",
"transport": "websocket",
"audio_params": {
"sample_rate": 16000
}
}
```
3. **客户端 → 服务器**(开始监听)
```json
{
"session_id": "",
"type": "listen",
"state": "start",
"mode": "auto"
}
```
同时客户端开始发送二进制帧Opus 数据)。
4. **服务器 → 客户端**ASR 结果)
```json
{
"type": "stt",
"text": "用户说的话"
}
```
5. **服务器 → 客户端**TTS开始
```json
{
"type": "tts",
"state": "start"
}
```
接着服务器发送二进制音频帧给客户端播放。
6. **服务器 → 客户端**TTS结束
```json
{
"type": "tts",
"state": "stop"
}
```
客户端停止播放音频,若无更多指令,则回到空闲状态。
---
## 9. 总结
本协议通过在 WebSocket 上层传输 JSON 文本与二进制音频帧完成功能包括音频流上传、TTS 音频播放、语音识别与状态管理、IoT 指令下发等。其核心特征:
- **握手阶段**:发送 `"type":"hello"`,等待服务器返回。
- **音频通道**:采用 Opus 编码的二进制帧双向传输语音流。
- **JSON 消息**:使用 `"type"` 为核心字段标识不同业务逻辑,包括 TTS、STT、IoT、WakeWord 等。
- **扩展性**:可根据实际需求在 JSON 消息中添加字段,或在 headers 里进行额外鉴权。
服务器与客户端需提前约定各类消息的字段含义、时序逻辑以及错误处理规则,方能保证通信顺畅。上述信息可作为基础文档,便于后续对接、开发或扩展。

View File

@@ -1,2 +0,0 @@
#!/bin/sh
esptool.py -p /dev/ttyACM0 -b 2000000 write_flash 0 releases/v0.9.9_bread-compact-wifi/merged-binary.bin

View File

@@ -2,16 +2,14 @@ set(SOURCES "audio_codecs/audio_codec.cc"
"audio_codecs/no_audio_codec.cc"
"audio_codecs/box_audio_codec.cc"
"audio_codecs/es8311_audio_codec.cc"
"audio_codecs/cores3_audio_codec.cc"
"audio_codecs/es8388_audio_codec.cc"
"led/single_led.cc"
"led/circular_strip.cc"
"led/gpio_led.cc"
"display/display.cc"
"display/no_display.cc"
"display/lcd_display.cc"
"display/ssd1306_display.cc"
"display/oled_display.cc"
"protocols/protocol.cc"
"protocols/mqtt_protocol.cc"
"protocols/websocket_protocol.cc"
"iot/thing.cc"
"iot/thing_manager.cc"
"system_info.cc"
@@ -28,11 +26,6 @@ set(INCLUDE_DIRS "." "display" "audio_codecs" "protocols" "audio_processing")
file(GLOB IOT_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/iot/things/*.cc)
list(APPEND SOURCES ${IOT_SOURCES})
# 字体
file(GLOB FONT_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fonts/*.c)
list(APPEND SOURCES ${FONT_SOURCES})
list(APPEND INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/fonts)
# 添加板级公共文件
file(GLOB BOARD_COMMON_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/boards/common/*.cc)
list(APPEND SOURCES ${BOARD_COMMON_SOURCES})
@@ -43,41 +36,177 @@ if(CONFIG_BOARD_TYPE_BREAD_COMPACT_WIFI)
set(BOARD_TYPE "bread-compact-wifi")
elseif(CONFIG_BOARD_TYPE_BREAD_COMPACT_ML307)
set(BOARD_TYPE "bread-compact-ml307")
elseif(CONFIG_BOARD_TYPE_BREAD_COMPACT_ESP32)
set(BOARD_TYPE "bread-compact-esp32")
elseif(CONFIG_BOARD_TYPE_BREAD_COMPACT_ESP32_LCD)
set(BOARD_TYPE "bread-compact-esp32-lcd")
elseif(CONFIG_BOARD_TYPE_DF_K10)
set(BOARD_TYPE "df-k10")
elseif(CONFIG_BOARD_TYPE_ESP_BOX_3)
set(BOARD_TYPE "esp-box-3")
elseif(CONFIG_BOARD_TYPE_ESP_BOX)
set(BOARD_TYPE "esp-box")
elseif(CONFIG_BOARD_TYPE_ESP_BOX_LITE)
set(BOARD_TYPE "esp-box-lite")
elseif(CONFIG_BOARD_TYPE_KEVIN_BOX_1)
set(BOARD_TYPE "kevin-box-1")
elseif(CONFIG_BOARD_TYPE_KEVIN_BOX_2)
set(BOARD_TYPE "kevin-box-2")
elseif(CONFIG_BOARD_TYPE_KEVIN_C3)
set(BOARD_TYPE "kevin-c3")
elseif(CONFIG_BOARD_TYPE_KEVIN_SP_V3_DEV)
set(BOARD_TYPE "kevin-sp-v3-dev")
elseif(CONFIG_BOARD_TYPE_KEVIN_SP_V4_DEV)
set(BOARD_TYPE "kevin-sp-v4-dev")
elseif(CONFIG_BOARD_TYPE_KEVIN_YUYING_313LCD)
set(BOARD_TYPE "kevin-yuying-313lcd")
elseif(CONFIG_BOARD_TYPE_LICHUANG_DEV)
set(BOARD_TYPE "lichuang-dev")
elseif(CONFIG_BOARD_TYPE_LICHUANG_C3_DEV)
elseif(CONFIG_BOARD_TYPE_LICHUANG_C3_DEV)
set(BOARD_TYPE "lichuang-c3-dev")
elseif(CONFIG_BOARD_TYPE_MAGICLICK_2P4)
set(BOARD_TYPE "magiclick-2p4")
elseif(CONFIG_BOARD_TYPE_MAGICLICK_2P5)
set(BOARD_TYPE "magiclick-2p5")
elseif(CONFIG_BOARD_TYPE_MAGICLICK_C3)
set(BOARD_TYPE "magiclick-c3")
elseif(CONFIG_BOARD_TYPE_MAGICLICK_C3_V2)
set(BOARD_TYPE "magiclick-c3-v2")
elseif(CONFIG_BOARD_TYPE_M5STACK_CORE_S3)
set(BOARD_TYPE "m5stack-core-s3")
elseif(CONFIG_BOARD_TYPE_ATOMS3_ECHO_BASE)
set(BOARD_TYPE "atoms3-echo-base")
elseif(CONFIG_BOARD_TYPE_ATOMS3R_ECHO_BASE)
set(BOARD_TYPE "atoms3r-echo-base")
elseif(CONFIG_BOARD_TYPE_ATOMS3R_CAM_M12_ECHO_BASE)
set(BOARD_TYPE "atoms3r-cam-m12-echo-base")
elseif(CONFIG_BOARD_TYPE_ATOMMATRIX_ECHO_BASE)
set(BOARD_TYPE "atommatrix-echo-base")
elseif(CONFIG_BOARD_TYPE_XMINI_C3)
set(BOARD_TYPE "xmini-c3")
elseif(CONFIG_BOARD_TYPE_ESP32S3_KORVO2_V3)
set(BOARD_TYPE "esp32s3-korvo2-v3")
elseif(CONFIG_BOARD_TYPE_ESP_SPARKBOT)
set(BOARD_TYPE "esp-sparkbot")
elseif(CONFIG_BOARD_TYPE_ESP32S3_Touch_AMOLED_1_8)
set(BOARD_TYPE "esp32-s3-touch-amoled-1.8")
elseif(CONFIG_BOARD_TYPE_ESP32S3_Touch_LCD_1_85C)
set(BOARD_TYPE "esp32-s3-touch-lcd-1.85c")
elseif(CONFIG_BOARD_TYPE_ESP32S3_Touch_LCD_1_85)
set(BOARD_TYPE "esp32-s3-touch-lcd-1.85")
elseif(CONFIG_BOARD_TYPE_ESP32S3_Touch_LCD_1_46)
set(BOARD_TYPE "esp32-s3-touch-lcd-1.46")
elseif(CONFIG_BOARD_TYPE_ESP32S3_Touch_LCD_3_5)
set(BOARD_TYPE "esp32-s3-touch-lcd-3.5")
elseif(CONFIG_BOARD_TYPE_BREAD_COMPACT_WIFI_LCD)
set(BOARD_TYPE "bread-compact-wifi-lcd")
elseif(CONFIG_BOARD_TYPE_TUDOUZI)
set(BOARD_TYPE "tudouzi")
elseif(CONFIG_BOARD_TYPE_LILYGO_T_CIRCLE_S3)
set(BOARD_TYPE "lilygo-t-circle-s3")
elseif(CONFIG_BOARD_TYPE_LILYGO_T_CAMERAPLUS_S3)
set(BOARD_TYPE "lilygo-t-cameraplus-s3")
elseif(CONFIG_BOARD_TYPE_MOVECALL_MOJI_ESP32S3)
set(BOARD_TYPE "movecall-moji-esp32s3")
elseif(CONFIG_BOARD_TYPE_MOVECALL_CUICAN_ESP32S3)
set(BOARD_TYPE "movecall-cuican-esp32s3")
elseif(CONFIG_BOARD_TYPE_ATK_DNESP32S3)
set(BOARD_TYPE "atk-dnesp32s3")
elseif(CONFIG_BOARD_TYPE_ATK_DNESP32S3_BOX)
set(BOARD_TYPE "atk-dnesp32s3-box")
elseif(CONFIG_BOARD_TYPE_DU_CHATX)
set(BOARD_TYPE "du-chatx")
elseif(CONFIG_BOARD_TYPE_ESP32S3_Taiji_Pi)
set(BOARD_TYPE "taiji-pi-s3")
elseif(CONFIG_BOARD_TYPE_XINGZHI_Cube_0_85TFT_WIFI)
set(BOARD_TYPE "xingzhi-cube-0.85tft-wifi")
elseif(CONFIG_BOARD_TYPE_XINGZHI_Cube_0_85TFT_ML307)
set(BOARD_TYPE "xingzhi-cube-0.85tft-ml307")
elseif(CONFIG_BOARD_TYPE_XINGZHI_Cube_0_96OLED_WIFI)
set(BOARD_TYPE "xingzhi-cube-0.96oled-wifi")
elseif(CONFIG_BOARD_TYPE_XINGZHI_Cube_0_96OLED_ML307)
set(BOARD_TYPE "xingzhi-cube-0.96oled-ml307")
elseif(CONFIG_BOARD_TYPE_XINGZHI_Cube_1_54TFT_WIFI)
set(BOARD_TYPE "xingzhi-cube-1.54tft-wifi")
elseif(CONFIG_BOARD_TYPE_XINGZHI_Cube_1_54TFT_ML307)
set(BOARD_TYPE "xingzhi-cube-1.54tft-ml307")
elseif(CONFIG_BOARD_TYPE_SENSECAP_WATCHER)
set(BOARD_TYPE "sensecap-watcher")
elseif(CONFIG_BOARD_TYPE_ESP32_CGC)
set(BOARD_TYPE "esp32-cgc")
endif()
file(GLOB BOARD_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE}/*.cc)
file(GLOB BOARD_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE}/*.cc
${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE}/*.c
)
list(APPEND SOURCES ${BOARD_SOURCES})
if(CONFIG_IDF_TARGET_ESP32S3)
list(APPEND SOURCES "audio_processing/audio_processor.cc" "audio_processing/wake_word_detect.cc")
if(CONFIG_CONNECTION_TYPE_MQTT_UDP)
list(APPEND SOURCES "protocols/mqtt_protocol.cc")
elseif(CONFIG_CONNECTION_TYPE_WEBSOCKET)
list(APPEND SOURCES "protocols/websocket_protocol.cc")
endif()
if(CONFIG_USE_AUDIO_PROCESSOR)
list(APPEND SOURCES "audio_processing/audio_processor.cc")
endif()
if(CONFIG_USE_WAKE_WORD_DETECT)
list(APPEND SOURCES "audio_processing/wake_word_detect.cc")
endif()
# 根据Kconfig选择语言目录
if(CONFIG_LANGUAGE_ZH_CN)
set(LANG_DIR "zh-CN")
elseif(CONFIG_LANGUAGE_ZH_TW)
set(LANG_DIR "zh-TW")
elseif(CONFIG_LANGUAGE_EN_US)
set(LANG_DIR "en-US")
elseif(CONFIG_LANGUAGE_JA_JP)
set(LANG_DIR "ja-JP")
endif()
# 定义生成路径
set(LANG_JSON "${CMAKE_CURRENT_SOURCE_DIR}/assets/${LANG_DIR}/language.json")
set(LANG_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/assets/lang_config.h")
file(GLOB LANG_SOUNDS ${CMAKE_CURRENT_SOURCE_DIR}/assets/${LANG_DIR}/*.p3)
file(GLOB COMMON_SOUNDS ${CMAKE_CURRENT_SOURCE_DIR}/assets/common/*.p3)
# 如果目标芯片是 ESP32则排除特定文件
if(CONFIG_IDF_TARGET_ESP32)
list(REMOVE_ITEM SOURCES "audio_codecs/box_audio_codec.cc"
"audio_codecs/es8388_audio_codec.cc"
"led/gpio_led.cc"
)
endif()
idf_component_register(SRCS ${SOURCES}
EMBED_FILES "assets/err_reg.p3" "assets/err_pin.p3" "assets/err_wificonfig.p3"
EMBED_FILES ${LANG_SOUNDS} ${COMMON_SOUNDS}
INCLUDE_DIRS ${INCLUDE_DIRS}
WHOLE_ARCHIVE
)
# 使用 target_compile_definitions 来定义 BOARD_TYPE
# 使用 target_compile_definitions 来定义 BOARD_TYPE, BOARD_NAME
# 如果 BOARD_NAME 为空,则使用 BOARD_TYPE
if(NOT BOARD_NAME)
set(BOARD_NAME ${BOARD_TYPE})
endif()
target_compile_definitions(${COMPONENT_LIB}
PRIVATE BOARD_TYPE=\"${BOARD_TYPE}\"
PRIVATE BOARD_TYPE=\"${BOARD_TYPE}\" BOARD_NAME=\"${BOARD_NAME}\"
)
# 添加生成规则
add_custom_command(
OUTPUT ${LANG_HEADER}
COMMAND python ${PROJECT_DIR}/scripts/gen_lang.py
--input "${LANG_JSON}"
--output "${LANG_HEADER}"
DEPENDS
${LANG_JSON}
${PROJECT_DIR}/scripts/gen_lang.py
COMMENT "Generating ${LANG_DIR} language config"
)
# 强制建立生成依赖
add_custom_target(lang_header ALL
DEPENDS ${LANG_HEADER}
)

View File

@@ -6,6 +6,24 @@ config OTA_VERSION_URL
help
The application will access this URL to check for updates.
choice
prompt "语言选择"
default LANGUAGE_ZH_CN
help
Select device display language
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"
endchoice
choice CONNECTION_TYPE
prompt "Connection Type"
default CONNECTION_TYPE_MQTT_UDP
@@ -38,28 +56,199 @@ choice BOARD_TYPE
Board type. 开发板类型
config BOARD_TYPE_BREAD_COMPACT_WIFI
bool "面包板新版接线WiFi"
config BOARD_TYPE_BREAD_COMPACT_WIFI_LCD
bool "面包板新版接线WiFi+ LCD"
config BOARD_TYPE_BREAD_COMPACT_ML307
bool "面包板新版接线ML307 AT"
config BOARD_TYPE_BREAD_COMPACT_ESP32
bool "面包板WiFi ESP32 DevKit"
config BOARD_TYPE_BREAD_COMPACT_ESP32_LCD
bool "面包板WiFi+ LCD ESP32 DevKit"
config BOARD_TYPE_ESP32_CGC
bool "ESP32 CGC"
config BOARD_TYPE_ESP_BOX_3
bool "ESP BOX 3"
config BOARD_TYPE_ESP_BOX
bool "ESP BOX"
config BOARD_TYPE_ESP_BOX_LITE
bool "ESP BOX Lite"
config BOARD_TYPE_KEVIN_BOX_1
bool "Kevin Box 1"
config BOARD_TYPE_KEVIN_BOX_2
bool "Kevin Box 2"
config BOARD_TYPE_KEVIN_C3
bool "Kevin C3"
config BOARD_TYPE_KEVIN_SP_V3_DEV
bool "Kevin SP V3开发板"
config BOARD_TYPE_KEVIN_SP_V4_DEV
bool "Kevin SP V4开发板"
config BOARD_TYPE_KEVIN_YUYING_313LCD
bool "鱼鹰科技3.13LCD开发板"
config BOARD_TYPE_LICHUANG_DEV
bool "立创·实战派ESP32-S3开发板"
config BOARD_TYPE_LICHUANG_C3_DEV
bool "立创·实战派ESP32-C3开发板"
config BOARD_TYPE_DF_K10
bool "DFRobot 行空板 k10"
config BOARD_TYPE_MAGICLICK_2P4
bool "神奇按钮 Magiclick_2.4"
bool "神奇按钮 Magiclick_2.4"
config BOARD_TYPE_MAGICLICK_2P5
bool "神奇按钮 Magiclick_2.5"
config BOARD_TYPE_MAGICLICK_C3
bool "神奇按钮 Magiclick_C3"
config BOARD_TYPE_MAGICLICK_C3_V2
bool "神奇按钮 Magiclick_C3_v2"
config BOARD_TYPE_M5STACK_CORE_S3
bool "M5Stack CoreS3"
config BOARD_TYPE_ATOMS3_ECHO_BASE
bool "AtomS3 + Echo Base"
config BOARD_TYPE_ATOMS3R_ECHO_BASE
bool "AtomS3R + Echo Base"
config BOARD_TYPE_ATOMS3R_CAM_M12_ECHO_BASE
bool "AtomS3R CAM/M12 + Echo Base"
config BOARD_TYPE_ATOMMATRIX_ECHO_BASE
bool "AtomMatrix + Echo Base"
config BOARD_TYPE_XMINI_C3
bool "虾哥 Mini C3"
config BOARD_TYPE_ESP32S3_KORVO2_V3
bool "ESP32S3_KORVO2_V3开发板"
config BOARD_TYPE_ESP_SPARKBOT
bool "ESP-SparkBot开发板"
config BOARD_TYPE_ESP32S3_Touch_AMOLED_1_8
bool "Waveshare ESP32-S3-Touch-AMOLED-1.8"
config BOARD_TYPE_ESP32S3_Touch_LCD_1_85C
bool "Waveshare ESP32-S3-Touch-LCD-1.85C"
config BOARD_TYPE_ESP32S3_Touch_LCD_1_85
bool "Waveshare ESP32-S3-Touch-LCD-1.85"
config BOARD_TYPE_ESP32S3_Touch_LCD_1_46
bool "Waveshare ESP32-S3-Touch-LCD-1.46"
config BOARD_TYPE_ESP32S3_Touch_LCD_3_5
bool "Waveshare ESP32-S3-Touch-LCD-3.5"
config BOARD_TYPE_TUDOUZI
bool "土豆子"
config BOARD_TYPE_LILYGO_T_CIRCLE_S3
bool "LILYGO T-Circle-S3"
config BOARD_TYPE_LILYGO_T_CAMERAPLUS_S3
bool "LILYGO T-CameraPlus-S3"
config BOARD_TYPE_MOVECALL_MOJI_ESP32S3
bool "Movecall Moji 小智AI衍生版"
config BOARD_TYPE_MOVECALL_CUICAN_ESP32S3
bool "Movecall CuiCan 璀璨·AI吊坠"
config BOARD_TYPE_ATK_DNESP32S3
bool "正点原子DNESP32S3开发板"
config BOARD_TYPE_ATK_DNESP32S3_BOX
bool "正点原子DNESP32S3-BOX"
config BOARD_TYPE_DU_CHATX
bool "嘟嘟开发板CHATX(wifi)"
config BOARD_TYPE_ESP32S3_Taiji_Pi
bool "太极小派esp32s3"
config BOARD_TYPE_XINGZHI_Cube_0_85TFT_WIFI
bool "无名科技星智0.85(WIFI)"
config BOARD_TYPE_XINGZHI_Cube_0_85TFT_ML307
bool "无名科技星智0.85(ML307)"
config BOARD_TYPE_XINGZHI_Cube_0_96OLED_WIFI
bool "无名科技星智0.96(WIFI)"
config BOARD_TYPE_XINGZHI_Cube_0_96OLED_ML307
bool "无名科技星智0.96(ML307)"
config BOARD_TYPE_XINGZHI_Cube_1_54TFT_WIFI
bool "无名科技星智1.54(WIFI)"
config BOARD_TYPE_XINGZHI_Cube_1_54TFT_ML307
bool "无名科技星智1.54(ML307)"
config BOARD_TYPE_SENSECAP_WATCHER
bool "SenseCAP Watcher"
endchoice
choice DISPLAY_OLED_TYPE
depends on BOARD_TYPE_BREAD_COMPACT_WIFI || BOARD_TYPE_BREAD_COMPACT_ML307 || BOARD_TYPE_BREAD_COMPACT_ESP32
prompt "OLED Type"
default OLED_SSD1306_128X32
help
OLED 屏幕类型选择
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_ESP32_CGC
prompt "LCD Type"
default LCD_ST7789_240X320
help
屏幕类型选择
config LCD_ST7789_240X320
bool "ST7789, 分辨率240*320, IPS"
config LCD_ST7789_240X320_NO_IPS
bool "ST7789, 分辨率240*320, 非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, 非IPS"
config LCD_ILI9341_240X320
bool "ILI9341, 分辨率240*320"
config LCD_ILI9341_240X320_NO_IPS
bool "ILI9341, 分辨率240*320, 非IPS"
config LCD_GC9A01_240X240
bool "GC9A01, 分辨率240*240, 圆屏"
config LCD_CUSTOM
bool "自定义屏幕参数"
endchoice
choice DISPLAY_ESP32S3_KORVO2_V3
depends on BOARD_TYPE_ESP32S3_KORVO2_V3
prompt "ESP32S3_KORVO2_V3 LCD Type"
default LCD_ST7789
help
屏幕类型选择
config LCD_ST7789
bool "ST7789, 分辨率240*280"
config LCD_ILI9341
bool "ILI9341, 分辨率240*320"
endchoice
config USE_WECHAT_MESSAGE_STYLE
bool "使用微信聊天界面风格"
default n
help
使用微信聊天界面风格
config USE_WAKE_WORD_DETECT
bool "启用唤醒词检测"
default y
depends on IDF_TARGET_ESP32S3 && SPIRAM
help
需要 ESP32 S3 与 AFE 支持
config USE_AUDIO_PROCESSOR
bool "启用音频降噪、增益处理"
default y
depends on IDF_TARGET_ESP32S3 && SPIRAM
help
需要 ESP32 S3 与 AFE 支持
config USE_REALTIME_CHAT
bool "启用可语音打断的实时对话模式(需要 AEC 支持)"
default n
depends on USE_AUDIO_PROCESSOR && (BOARD_TYPE_ESP_BOX_3 || BOARD_TYPE_ESP_BOX || BOARD_TYPE_LICHUANG_DEV || BOARD_TYPE_ESP32S3_KORVO2_V3)
help
需要 ESP32 S3 与 AEC 开启,因为性能不够,不建议和微信聊天界面风格同时开启
endmenu

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,7 @@
#include <freertos/FreeRTOS.h>
#include <freertos/event_groups.h>
#include <freertos/task.h>
#include <esp_timer.h>
#include <string>
#include <mutex>
@@ -17,8 +18,10 @@
#include "ota.h"
#include "background_task.h"
#if CONFIG_IDF_TARGET_ESP32S3
#if CONFIG_USE_WAKE_WORD_DETECT
#include "wake_word_detect.h"
#endif
#if CONFIG_USE_AUDIO_PROCESSOR
#include "audio_processor.h"
#endif
@@ -35,6 +38,7 @@ enum DeviceState {
kDeviceStateListening,
kDeviceStateSpeaking,
kDeviceStateUpgrading,
kDeviceStateActivating,
kDeviceStateFatalError
};
@@ -55,53 +59,71 @@ public:
bool IsVoiceDetected() const { return voice_detected_; }
void Schedule(std::function<void()> callback);
void SetDeviceState(DeviceState state);
void Alert(const std::string& title, const std::string& message);
void Alert(const char* status, const char* message, const char* emotion = "", const std::string_view& sound = "");
void DismissAlert();
void AbortSpeaking(AbortReason reason);
void ToggleChatState();
void StartListening();
void StopListening();
void UpdateIotStates();
void Reboot();
void WakeWordInvoke(const std::string& wake_word);
void PlaySound(const std::string_view& sound);
bool CanEnterSleepMode();
private:
Application();
~Application();
#if CONFIG_IDF_TARGET_ESP32S3
#if CONFIG_USE_WAKE_WORD_DETECT
WakeWordDetect wake_word_detect_;
#endif
#if CONFIG_USE_AUDIO_PROCESSOR
AudioProcessor audio_processor_;
#endif
Ota ota_;
std::mutex mutex_;
std::list<std::function<void()>> main_tasks_;
std::unique_ptr<Protocol> protocol_;
EventGroupHandle_t event_group_;
EventGroupHandle_t event_group_ = nullptr;
esp_timer_handle_t clock_timer_handle_ = nullptr;
volatile DeviceState device_state_ = kDeviceStateUnknown;
bool keep_listening_ = false;
ListeningMode listening_mode_ = kListeningModeAutoStop;
#if CONFIG_USE_REALTIME_CHAT
bool realtime_chat_enabled_ = true;
#else
bool realtime_chat_enabled_ = false;
#endif
bool aborted_ = false;
bool voice_detected_ = false;
std::string last_iot_states_;
int clock_ticks_ = 0;
TaskHandle_t main_loop_task_handle_ = nullptr;
TaskHandle_t check_new_version_task_handle_ = nullptr;
// Audio encode / decode
BackgroundTask background_task_;
TaskHandle_t audio_loop_task_handle_ = nullptr;
BackgroundTask* background_task_ = nullptr;
std::chrono::steady_clock::time_point last_output_time_;
std::list<std::vector<uint8_t>> audio_decode_queue_;
std::unique_ptr<OpusEncoderWrapper> opus_encoder_;
std::unique_ptr<OpusDecoderWrapper> opus_decoder_;
int opus_decode_sample_rate_ = -1;
OpusResampler input_resampler_;
OpusResampler reference_resampler_;
OpusResampler output_resampler_;
void MainLoop();
void InputAudio();
void OutputAudio();
void OnAudioInput();
void OnAudioOutput();
void ReadAudio(std::vector<int16_t>& data, int sample_rate, int samples);
void ResetDecoder();
void SetDecodeSampleRate(int sample_rate);
void SetDecodeSampleRate(int sample_rate, int frame_duration);
void CheckNewVersion();
void PlayLocalFile(const char* data, size_t size);
void ShowActivationCode();
void OnClockTimer();
void SetListeningMode(ListeningMode mode);
void AudioLoop();
};
#endif // _APPLICATION_H_

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
main/assets/en-US/0.p3 Normal file

Binary file not shown.

BIN
main/assets/en-US/1.p3 Normal file

Binary file not shown.

BIN
main/assets/en-US/2.p3 Normal file

Binary file not shown.

BIN
main/assets/en-US/3.p3 Normal file

Binary file not shown.

BIN
main/assets/en-US/4.p3 Normal file

Binary file not shown.

BIN
main/assets/en-US/5.p3 Normal file

Binary file not shown.

BIN
main/assets/en-US/6.p3 Normal file

Binary file not shown.

BIN
main/assets/en-US/7.p3 Normal file

Binary file not shown.

BIN
main/assets/en-US/8.p3 Normal file

Binary file not shown.

BIN
main/assets/en-US/9.p3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,52 @@
{
"language": {
"type": "en-US"
},
"strings": {
"WARNING": "Warning",
"INFO": "Information",
"ERROR": "Error",
"VERSION": "Ver ",
"LOADING_PROTOCOL": "Loading Protocol...",
"INITIALIZING": "Initializing...",
"PIN_ERROR": "Please insert SIM card",
"REG_ERROR": "Unable to access network, please check SIM card status",
"DETECTING_MODULE": "Detecting module...",
"REGISTERING_NETWORK": "Waiting for network...",
"STANDBY": "Standby",
"CONNECT_TO": "Connect to ",
"CONNECTING": "Connecting...",
"CONNECTION_SUCCESSFUL": "Connection Successful",
"CONNECTED_TO": "Connected to ",
"LISTENING": "Listening...",
"SPEAKING": "Speaking...",
"SERVER_NOT_FOUND": "Looking for available service",
"SERVER_NOT_CONNECTED": "Unable to connect to service, please try again later",
"SERVER_TIMEOUT": "Waiting for response timeout",
"SERVER_ERROR": "Sending failed, please check the network",
"CONNECT_TO_HOTSPOT": "Hotspot: ",
"ACCESS_VIA_BROWSER": " Config URL: ",
"WIFI_CONFIG_MODE": "Wi-Fi Configuration Mode",
"ENTERING_WIFI_CONFIG_MODE": "Entering Wi-Fi configuration mode...",
"SCANNING_WIFI": "Scanning Wi-Fi...",
"NEW_VERSION": "New version ",
"OTA_UPGRADE": "OTA Upgrade",
"UPGRADING": "System is upgrading...",
"UPGRADE_FAILED": "Upgrade failed",
"ACTIVATION": "Activation",
"BATTERY_LOW": "Low battery",
"BATTERY_CHARGING": "Charging",
"BATTERY_FULL": "Battery full",
"BATTERY_NEED_CHARGE": "Low battery, please charge",
"VOLUME": "Volume ",
"MUTED": "Muted",
"MAX_VOLUME": "Max volume"
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
main/assets/ja-JP/0.p3 Normal file

Binary file not shown.

BIN
main/assets/ja-JP/1.p3 Normal file

Binary file not shown.

BIN
main/assets/ja-JP/2.p3 Normal file

Binary file not shown.

BIN
main/assets/ja-JP/3.p3 Normal file

Binary file not shown.

BIN
main/assets/ja-JP/4.p3 Normal file

Binary file not shown.

BIN
main/assets/ja-JP/5.p3 Normal file

Binary file not shown.

BIN
main/assets/ja-JP/6.p3 Normal file

Binary file not shown.

BIN
main/assets/ja-JP/7.p3 Normal file

Binary file not shown.

BIN
main/assets/ja-JP/8.p3 Normal file

Binary file not shown.

BIN
main/assets/ja-JP/9.p3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,51 @@
{
"language": {
"type": "ja-JP"
},
"strings": {
"WARNING": "警告",
"INFO": "情報",
"ERROR": "エラー",
"VERSION": "バージョン ",
"LOADING_PROTOCOL": "プロトコルを読み込み中...",
"INITIALIZING": "初期化中...",
"PIN_ERROR": "SIMカードを挿入してください",
"REG_ERROR": "ネットワークに接続できません。ネットワーク状態を確認してください",
"DETECTING_MODULE": "モジュールを検出中...",
"REGISTERING_NETWORK": "ネットワーク接続待機中...",
"STANDBY": "待機中",
"CONNECT_TO": "接続先 ",
"CONNECTING": "接続中...",
"CONNECTED_TO": "接続完了 ",
"LISTENING": "リスニング中...",
"SPEAKING": "話しています...",
"SERVER_NOT_FOUND": "利用可能なサーバーを探しています",
"SERVER_NOT_CONNECTED": "サーバーに接続できません。後でもう一度お試しください",
"SERVER_TIMEOUT": "応答待機時間が終了しました",
"SERVER_ERROR": "送信に失敗しました。ネットワークを確認してください",
"CONNECT_TO_HOTSPOT": "スマートフォンをWi-Fi ",
"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": "最大音量"
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
main/assets/zh-CN/0.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-CN/1.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-CN/2.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-CN/3.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-CN/4.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-CN/5.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-CN/6.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-CN/7.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-CN/8.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-CN/9.p3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,51 @@
{
"language": {
"type" :"zh-CN"
},
"strings": {
"WARNING":"警告",
"INFO":"信息",
"ERROR":"错误",
"VERSION": "版本 ",
"LOADING_PROTOCOL":"加载协议...",
"INITIALIZING":"正在初始化...",
"PIN_ERROR":"请插入 SIM 卡",
"REG_ERROR":"无法接入网络,请检查流量卡状态",
"DETECTING_MODULE":"检测模组...",
"REGISTERING_NETWORK":"等待网络...",
"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":"最大音量"
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
main/assets/zh-TW/0.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-TW/1.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-TW/2.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-TW/3.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-TW/4.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-TW/5.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-TW/6.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-TW/7.p3 Normal file

Binary file not shown.

BIN
main/assets/zh-TW/8.p3 Normal file

Binary file not shown.

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