Commit Graph

121 Commits

Author SHA1 Message Date
Xiaoxia
9215a04a7e Delay init success sound playback and remove gif playback delay (#1748)
* refactor: Remove hardcoded loop delay for GIF playback in LcdDisplay class

* chore: Update esp-ml307 and uart-eth-modem component versions in idf_component.yml

- Bump esp-ml307 version from ~3.6.3 to ~3.6.4
- Update uart-eth-modem version from ~0.3.1 to ~0.3.2

* feat: Add PrintPmLocks method to SystemInfo class

- Introduced PrintPmLocks method to display power management locks using esp_pm_dump_locks.
- Updated system_info.h to declare the new method.

* refactor: Streamline audio codec initialization and enablement

- Removed redundant channel enable checks from AudioCodec::Start.
- Added channel enablement in CreateDuplexChannels for various audio codecs.
- Implemented EnableInput and EnableOutput methods in NoAudioCodec for better control over input/output states.

* refactor: Delay audio success sound playback until after activation completion

- Moved the success sound playback to a scheduled task to ensure it occurs after the activation process is complete.
- This change improves the responsiveness of the application during activation events.

* refactor: Update camera integration from EspVideo to Esp32Camera

- Replaced EspVideo with Esp32Camera for improved camera configuration and initialization.
- Streamlined camera setup by utilizing a new configuration structure for better clarity and maintainability.
- Updated README.md to remove outdated camera sensor configuration instructions.

* refactor: Update audio demuxing process in AudioService

- Replaced the existing demuxer instance with a local unique pointer in the PlaySound method for better memory management.
- Moved the OnDemuxerFinished callback setup into the PlaySound method to ensure it is correctly associated with the new demuxer instance.
- Removed the member variable demuxer_ from AudioService to streamline the class structure.
2026-02-08 22:09:45 +08:00
baidxi
173eaa7463 在Display基类中添加SetupUI虚函数 (#1742)
Signed-off-by: jeck.chen <jeck.chen@dbappsecurity.com.cn>
2026-02-04 21:03:08 +08:00
Xiaoxia
2b025c4ea6 Enhance audio processing and wake word detection (#1739)
* Enhance audio processing and wake word detection

- Set task priority in Application::Run to improve responsiveness.
- Log detected wake words with their state in HandleWakeWordDetectedEvent.
- Streamline audio feeding in AudioService to handle both wake word and audio processor events.
- Implement input buffering in AfeAudioProcessor, AfeWakeWord, CustomWakeWord, and EspWakeWord to manage audio data more efficiently.
- Clear input buffers on stop to prevent residual data issues.

* Refactor audio processing to enhance thread safety and state management

- Implement early return checks in Feed methods of AfeAudioProcessor, AfeWakeWord, CustomWakeWord, and EspWakeWord to prevent processing when not running.
- Introduce std::atomic for running state in CustomWakeWord and EspWakeWord to ensure thread-safe access.
- Consolidate input buffer management with mutex locks to avoid race conditions during Stop and Feed operations.

* Refactor listening mode handling and wake word detection configuration

- Replace direct mode setting logic with a new GetDefaultListeningMode method for improved clarity and maintainability.
- Update HandleToggleChatEvent, HandleWakeWordDetectedEvent, and ContinueWakeWordInvoke to utilize the new method for determining listening mode.
- Introduce Kconfig option WAKE_WORD_DETECTION_IN_LISTENING to enable or disable wake word detection during listening mode, enhancing configurability.
2026-02-04 14:28:21 +08:00
Xiaoxia
0883a36537 Refactor audio channel handling and wake word detection in Application class (#1722)
- Introduced ContinueOpenAudioChannel and ContinueWakeWordInvoke methods to streamline audio channel management and wake word processing.
- Updated HandleToggleChatEvent and HandleWakeWordDetectedEvent to utilize scheduling for state changes, improving UI responsiveness.
- Simplified logic for setting listening modes based on audio channel state, enhancing code clarity and maintainability.
2026-02-01 14:55:47 +08:00
Xiaoxia
b6c61fe390 Update project version to 2.2.2, Noto fonts and emoji support. (#1720) 2026-02-01 01:04:24 +08:00
Copilot
5b874bc3ad Fix LVGL object deletion crash and thread safety issues in SetChatMessage (#1708)
* Initial plan

* Fix LVGL object deletion issue in SetChatMessage

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

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

* Address code review feedback on LVGL object deletion fix

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

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

* Final review: LVGL object deletion fix complete

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

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

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

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

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

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

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

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 78 <4488133+78@users.noreply.github.com>
2026-01-31 00:11:42 +08:00
Wang is proud
6b3659c2f5 Fixed an issue where the tail of the sound might be truncated in auto mode. (#1675) 2026-01-24 15:50:46 +08:00
Xiaoxia
89674f8838 v2.2.0: Add bread-compact-nt26 board (#1663)
* Refactor application error handling and improve network task logic

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

* Add support for Bread Compact NT26 board

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

* Update project version and improve build configuration

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

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

* fix compile errors

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

* fix esp32 compiling errors

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

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

* Add esp_driver_ppa as a dependency in CMakeLists.txt
2026-01-19 21:46:21 +08:00
Xiaoxia
564018c762 Enhance audio feedback mechanism by introducing a flag to play a popup (#1560)
* Enhance audio feedback mechanism by introducing a flag to play a popup sound after transitioning to listening mode. Update Schedule method to accept rvalue references for callbacks. Bump esp-ml307 component version to 3.5.3. Adjust signal strength thresholds in Ml307Board for better accuracy.

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

* Adjust Wi-Fi signal strength thresholds in WifiBoard for improved accuracy in network state icon representation.
2025-12-15 12:54:17 +08:00
Xiaoxia
b7db68457c v2.1.0: Upgrade esp-wifi-connect to 3.0; New device state machine (#1528)
* Upgrade component version

* update fonts component version

* Handle OTA error code

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

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

* fix compile errors

* Refactor power saving mode implementation to use PowerSaveLevel enumeration

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

* Refactor power save level checks across multiple board implementations

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

* Refactor EnterWifiConfigMode calls in board implementations

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

* Add cellular modem event handling and improve network status updates

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

* update esp-wifi-connect version

* Update WiFi configuration tool messages across multiple board implementations to clarify user actions
2025-12-09 09:24:56 +08:00
Xiaoxia
511349a7bd Change LCD display layout from grids to layers (#1438)
* Upgrade component version

* update fonts component version

* change lcd display layout from grids to layers

* Update English README as default

* Handle OTA error code
2025-11-17 22:38:31 +08:00
virgil
a601a5cbc1 feat: sensecap watcher add inference (#1312)
* feat: Wake up when a person is detected

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

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

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

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

主要更新包括:

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

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

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

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

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

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

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

3. 性能优化:

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

* feat: Inference using Model 4

* feat: default inference disable

* feat: version cmd change to output json

* fix: fix image display

* Fix include directives for esp_check and esp_app_desc

---------

Co-authored-by: Spencer <love4yzp@gmail.com>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-10-20 21:18:44 +08:00
Xiaoxia
d3e7fee828 fix multiple wakenet words and custom wake word (#1226)
* fix multiple wakenet words and custom wake word

* fix idf_component.yml
2025-09-22 10:49:08 +08:00
Xiaoxia
5018f6c03a feat: build default assets instead of downloading and v2 tables for esp-hi, echoear (#1203)
* fix: call flush ready on io ready

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

* stop gif if previewing an image

* feat: build default assets instead of downloading

* version updates

* fix None error

* delay 1s before enter wifi config mode

* fix compiling with v1 partition table

---------

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

* add README to gif/jpeg

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

* feat: add snapshot mcp tool

* fix compiling errors

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

* update ml307 version

* remove v1 theme colors
2025-09-14 15:16:49 +08:00
Terrence
f79506d58b feat: add manual upgrade firmware 2025-09-12 08:45:29 +08:00
Xiaoxia
83f6f8c703 Switch to 2.0 branch (#1152)
* Adapt boards to v2 partition tables

* fix esp log error

* fix display style

* reset emotion after download assets

* fix compiling

* update assets default url

* Add user only tools

* Add image cache

* smaller cache and buffer, more heap

* use MAIN_EVENT_CLOCK_TICK to avoid audio glitches

* bump to 2.0.0

* fix compiling errors

---------

Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
2025-09-04 15:41:28 +08:00
Xiaoxia
5d3f597137 Bump to v1.9.0 (#1157)
* update v2 partition table readme

* feat: Add user only tool

* Add image cache

* smaller cache and buffer, more heap

* use MAIN_EVENT_CLOCK_TICK to avoid audio glitches

* fix: esp_psram_get_size not found in c3

* Bump to 1.9.0
2025-09-04 12:30:26 +08:00
Xiaoxia
d09537ed5c Add V2 parition tables (#1137)
* v1.9.0: update font icons, add mqtt reconnect

* Add v2 parition tables
2025-08-29 09:04:23 +08:00
Xiaoxia
9ae34d3b45 feat: Add locales with OGG sounds (#1057)
* fix jiuchuan build problem

* feat: Add locales with OGG sounds

* fix building echoear

* Support ogg files frame duration <= 60
2025-08-12 18:41:00 +08:00
Xiaoxia
363073658a fix: OTA buffer overflow caused by slow SetChatMessage (#1031) 2025-08-06 01:16:52 +08:00
Terrence
d58d55cfe7 Bump to 1.8.5 2025-08-02 01:27:14 +08:00
Terrence
6a7a403117 修复C3唤醒提示音 2025-07-21 14:40:35 +08:00
Terrence
a35a344f42 Fix frame samples for server AEC 2025-07-20 07:53:52 +08:00
Xiaoxia
3c71558a5f v1.8.0: Audio 代码重构与低功耗优化 (#943)
* Reconstruct Audio Code

* Remove old IoT implementation

* Add MQTT-UDP documentation

* OTA升级失败时,可以继续使用
2025-07-19 22:45:22 +08:00
laride
5c8707075f feat: add state change events and callbacks (#798) 2025-07-18 01:35:31 +08:00
ZhouKe
1aea59a472 multinet wakeword (#927)
Co-authored-by: zk <982145@qq.com>
2025-07-18 01:18:40 +08:00
Ky1eYang
0c971f76e3 feat: 添加自定义消息接收并打印在display或串口上 (#921)
* feat: 添加声波配网, 需调整application的ReadAudio公有, 需添加条件编译, 位于'afsk_demod.h'内定义参数

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

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

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

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

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

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

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

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

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

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

---------

Co-authored-by: yangkaiyue <yangkaiyue1@tenclass.com>
2025-07-18 01:07:57 +08:00
Xiaoxia
6bb95073a4 v1.7.7: 支持 EC801E 模组,增加 xmini-c3-v3, xmini-c3-4g (#930) 2025-07-17 20:18:21 +08:00
Terrence
d1c586239c fix CPU usage of esp32c3 with ml307 2025-06-29 06:01:41 +08:00
Terrence
b3ab3d0920 在S3芯片上使用更多的PSRAM,解决立创开发板拍照时可能出现内存不足的问题 2025-06-24 04:59:00 +08:00
Terrence
bf125446b3 feat: Use BOOT button to enter audio testing state when Wi-Fi configuring 2025-06-13 19:57:07 +08:00
Terrence
7bc5f7bb0c Add audio debugger 2025-06-06 20:24:00 +08:00
Terrence
24ede22197 wechat ui支持摄像头预览 2025-06-06 16:54:53 +08:00
Xiaoxia
8729fad9a8 v1.7.1: fix send audio (#771)
* screen -> display

* Add AUDIO_CODEC_DEFAULT_MIC_GAIN

* WebRTC -> NSNet

* fix: send audio priority
2025-06-06 14:03:46 +08:00
Terrence
5621fa5a65 fix: 长按切换到点按后,无法唤醒的问题 2025-06-05 18:41:23 +08:00
Xiaoxia
ae57131c15 Add wake word to xmini-c3 (#730)
* esp-hi: MCP protocol is not ready yet

* Add wake word to xmini-c3
2025-05-31 22:21:03 +08:00
espressif2022
f5c1c30c5e feat: add new board esp-hi (#666)
* feat: add new board esp-hi

* feat(esp-hi): update servo_dog_ctrl

---------

Co-authored-by: Li Junru <lijunru@espressif.com>
Co-authored-by: Xiaoxia <terrence@tenclass.com>
2025-05-29 23:29:33 +08:00
Xiaoxia
d80f94387a v1.6.6: Set MCP as default IoT Protocol (#690) 2025-05-27 14:58:49 +08:00
Terrence
3a2e6875b6 Add audio_send_queue to synchronize timestamp 2025-05-27 05:44:46 +08:00
Terrence
0c57df1cd8 v1.6.5: Improve performance and memory usage 2025-05-26 14:30:44 +08:00
Terrence
0204b8800b update status bar immediately after network started 2025-05-24 07:25:34 +08:00
Terrence
0b98392286 Remove update display timer 2025-05-24 03:03:33 +08:00
Terrence
5da66773d5 Add MCP server 2025-05-22 19:19:48 +08:00
Terrence
7925f77739 Fix: 切换状态后一段时间内无法录音问题 2025-05-19 01:29:39 +08:00
Ky1eYang
27d85356e4 修改send packet时直接获取时间戳为队列获取时间戳 (#628)
* 修改实时aec传输时间戳改队列方式

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

---------

Co-authored-by: yangkaiyue <yangkaiyue1@tenclass.com>
2025-05-16 18:46:20 +08:00
Xiaoxia
be18c1aa04 Add server AEC option 2025-05-09 14:00:26 +08:00
Terrence
f6334246ca Add dummy audio processor 2025-04-29 18:17:08 +08:00
Xiaoxia
b804343d30 Audio stream packet with timestamp 2025-04-28 23:10:24 +08:00