Compare commits

...

8 Commits

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

* fix: Moji LCD initialization configuration.

* fix: DISPLAY_MIRROR_X false >> true

* fix: Moji GPIO conflict

* fix: Moji GPIO conflict

* fix: Cuican Build config
2025-04-09 00:48:46 +08:00
繁花君1号
27a14c249a 修复 bug (#454)
Co-authored-by: geng_MAX <geng_MAX@hotmail.com>
2025-04-08 23:13:26 +08:00
33 changed files with 81 additions and 34 deletions

View File

@@ -4,7 +4,7 @@
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
set(PROJECT_VER "1.5.6")
set(PROJECT_VER "1.5.8")
# Add this line to disable the specific warning
add_compile_options(-Wno-missing-field-initializers)

View File

@@ -1,7 +1,7 @@
#include "box_audio_codec.h"
#include <esp_log.h>
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/i2s_tdm.h>
static const char TAG[] = "BoxAudioCodec";

View File

@@ -3,7 +3,7 @@
#include "audio_codec.h"
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/gpio.h>
#include <esp_codec_dev.h>
#include <esp_codec_dev_defaults.h>

View File

@@ -3,7 +3,7 @@
#include "audio_codec.h"
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <esp_codec_dev.h>
#include <esp_codec_dev_defaults.h>

View File

@@ -78,7 +78,9 @@ void AudioProcessor::Start() {
void AudioProcessor::Stop() {
xEventGroupClearBits(event_group_, PROCESSOR_RUNNING);
afe_iface_->reset_buffer(afe_data_);
if (afe_data_ != nullptr) {
afe_iface_->reset_buffer(afe_data_);
}
}
bool AudioProcessor::IsRunning() {

View File

@@ -83,7 +83,9 @@ void WakeWordDetect::StartDetection() {
void WakeWordDetect::StopDetection() {
xEventGroupClearBits(event_group_, DETECTION_RUNNING_EVENT);
afe_iface_->reset_buffer(afe_data_);
if (afe_data_ != nullptr) {
afe_iface_->reset_buffer(afe_data_);
}
}
bool WakeWordDetect::IsDetectionRunning() {

View File

@@ -1,7 +1,7 @@
#include "k10_audio_codec.h"
#include <esp_log.h>
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/i2s_tdm.h>
#include <cmath>

View File

@@ -1,7 +1,7 @@
#include "box_audio_codec_lite.h"
#include <esp_log.h>
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/i2s_tdm.h>
static const char TAG[] = "BoxAudioCodecLite";

View File

@@ -195,7 +195,11 @@ private:
{
.text_font = &font_puhui_20_4,
.icon_font = &font_awesome_20_4,
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
.emoji_font = font_emoji_32_init(),
#else
.emoji_font = font_emoji_64_init(),
#endif
});
}

View File

@@ -126,7 +126,11 @@ private:
{
.text_font = &font_puhui_20_4,
.icon_font = &font_awesome_20_4,
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
.emoji_font = font_emoji_32_init(),
#else
.emoji_font = font_emoji_64_init(),
#endif
});
}

View File

@@ -9,7 +9,7 @@
#include <esp_log.h>
#include "i2c_device.h"
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/ledc.h>
#include <wifi_station.h>
#include <esp_lcd_panel_io.h>

View File

@@ -9,7 +9,7 @@
#include <esp_log.h>
#include "i2c_device.h"
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/ledc.h>
#include <wifi_station.h>
#include <esp_lcd_panel_io.h>

View File

@@ -9,7 +9,7 @@
#include <esp_log.h>
#include "i2c_device.h"
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/ledc.h>
#include <wifi_station.h>
#include <esp_lcd_panel_io.h>

View File

@@ -10,7 +10,7 @@
#include <esp_log.h>
#include "i2c_device.h"
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/ledc.h>
#include <wifi_station.h>
#include <esp_lcd_panel_vendor.h>

View File

@@ -1,7 +1,7 @@
#include "tcamerapluss3_audio_codec.h"
#include <esp_log.h>
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/i2c_master.h>
#include <driver/i2s_tdm.h>

View File

@@ -1,7 +1,7 @@
#include "tcircles3_audio_codec.h"
#include <esp_log.h>
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/i2c_master.h>
#include <driver/i2s_tdm.h>

View File

@@ -1,7 +1,7 @@
#include "cores3_audio_codec.h"
#include <esp_log.h>
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/i2c_master.h>
#include <driver/i2s_tdm.h>

View File

@@ -301,7 +301,11 @@ private:
{
.text_font = &font_puhui_20_4,
.icon_font = &font_awesome_20_4,
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
.emoji_font = font_emoji_32_init(),
#else
.emoji_font = font_emoji_64_init(),
#endif
});
}

View File

@@ -3,7 +3,11 @@
"builds": [
{
"name": "movecall-cuican-esp32s3",
"sdkconfig_append": []
"sdkconfig_append": [
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions_8M.csv\"",
"CONFIG_COMPILER_OPTIMIZATION_SIZE=y"
]
}
]
}

View File

@@ -1,7 +1,7 @@
#include "sensecap_audio_codec.h"
#include <esp_log.h>
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/i2s_tdm.h>
static const char TAG[] = "SensecapAudioCodec";

View File

@@ -7,7 +7,7 @@
#include "iot/thing_manager.h"
#include <esp_log.h>
#include <driver/i2c.h>
#include <driver/i2c_master.h>
#include <driver/ledc.h>
#include <wifi_station.h>
#include <esp_lcd_panel_io.h>

View File

@@ -4,6 +4,12 @@
{
"name": "xingzhi-cube-1.54tft-ml307",
"sdkconfig_append": []
},
{
"name": "xingzhi-cube-1.54tft-ml307-wechatui",
"sdkconfig_append": [
"CONFIG_USE_WECHAT_MESSAGE_STYLE=y"
]
}
]
}

View File

@@ -155,7 +155,11 @@ private:
{
.text_font = &font_puhui_20_4,
.icon_font = &font_awesome_20_4,
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
.emoji_font = font_emoji_32_init(),
#else
.emoji_font = font_emoji_64_init(),
#endif
});
}

View File

@@ -159,7 +159,11 @@ private:
{
.text_font = &font_puhui_20_4,
.icon_font = &font_awesome_20_4,
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
.emoji_font = font_emoji_32_init(),
#else
.emoji_font = font_emoji_64_init(),
#endif
});
}

View File

@@ -174,6 +174,7 @@ RgbLcdDisplay::RgbLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_h
ESP_LOGI(TAG, "Initialize LVGL port");
lvgl_port_cfg_t port_cfg = ESP_LVGL_PORT_INIT_CONFIG();
port_cfg.task_priority = 1;
port_cfg.timer_period_ms = 50;
lvgl_port_init(&port_cfg);
ESP_LOGI(TAG, "Adding LCD screen");

View File

@@ -10,7 +10,7 @@ dependencies:
78/esp_lcd_nv3023: "~1.0.0"
78/esp-wifi-connect: "~2.3.1"
78/esp-opus-encoder: "~2.3.0"
78/esp-ml307: "~1.7.3"
78/esp-ml307: "~1.8.1"
78/xiaozhi-fonts: "~1.3.2"
espressif/led_strip: "^2.4.1"
espressif/esp_codec_dev: "~1.3.2"

View File

@@ -100,14 +100,16 @@ bool MqttProtocol::StartMqttClient(bool report_error) {
return true;
}
void MqttProtocol::SendText(const std::string& text) {
bool MqttProtocol::SendText(const std::string& text) {
if (publish_topic_.empty()) {
return;
return false;
}
if (!mqtt_->Publish(publish_topic_, text)) {
ESP_LOGE(TAG, "Failed to publish message: %s", text.c_str());
SetError(Lang::Strings::SERVER_ERROR);
return false;
}
return true;
}
void MqttProtocol::SendAudio(const std::vector<uint8_t>& data) {
@@ -174,7 +176,9 @@ bool MqttProtocol::OpenAudioChannel() {
message += "\"audio_params\":{";
message += "\"format\":\"opus\", \"sample_rate\":16000, \"channels\":1, \"frame_duration\":" + std::to_string(OPUS_FRAME_DURATION_MS);
message += "}}";
SendText(message);
if (!SendText(message)) {
return false;
}
// 等待服务器响应
EventBits_t bits = xEventGroupWaitBits(event_group_handle_, MQTT_PROTOCOL_SERVER_HELLO_EVENT, pdTRUE, pdFALSE, pdMS_TO_TICKS(10000));

View File

@@ -54,7 +54,7 @@ private:
void ParseServerHello(const cJSON* root);
std::string DecodeHexString(const std::string& hex_string);
void SendText(const std::string& text) override;
bool SendText(const std::string& text) override;
};

View File

@@ -69,7 +69,7 @@ protected:
std::string session_id_;
std::chrono::time_point<std::chrono::steady_clock> last_incoming_time_;
virtual void SendText(const std::string& text) = 0;
virtual bool SendText(const std::string& text) = 0;
virtual void SetError(const std::string& message);
virtual bool IsTimeout() const;
};

View File

@@ -33,15 +33,18 @@ void WebsocketProtocol::SendAudio(const std::vector<uint8_t>& data) {
websocket_->Send(data.data(), data.size(), true);
}
void WebsocketProtocol::SendText(const std::string& text) {
bool WebsocketProtocol::SendText(const std::string& text) {
if (websocket_ == nullptr) {
return;
return false;
}
if (!websocket_->Send(text)) {
ESP_LOGE(TAG, "Failed to send text: %s", text.c_str());
SetError(Lang::Strings::SERVER_ERROR);
return false;
}
return true;
}
bool WebsocketProtocol::IsAudioChannelOpened() const {
@@ -116,7 +119,9 @@ bool WebsocketProtocol::OpenAudioChannel() {
message += "\"audio_params\":{";
message += "\"format\":\"opus\", \"sample_rate\":16000, \"channels\":1, \"frame_duration\":" + std::to_string(OPUS_FRAME_DURATION_MS);
message += "}}";
websocket_->Send(message);
if (!SendText(message)) {
return false;
}
// Wait for server hello
EventBits_t bits = xEventGroupWaitBits(event_group_handle_, WEBSOCKET_PROTOCOL_SERVER_HELLO_EVENT, pdTRUE, pdFALSE, pdMS_TO_TICKS(10000));

View File

@@ -26,7 +26,7 @@ private:
WebSocket* websocket_ = nullptr;
void ParseServerHello(const cJSON* root);
void SendText(const std::string& text) override;
bool SendText(const std::string& text) override;
};
#endif

View File

@@ -51,7 +51,7 @@ def release_current():
def get_all_board_types():
board_configs = {}
with open("main/CMakeLists.txt") as f:
with open("main/CMakeLists.txt", encoding='utf-8') as f:
lines = f.readlines()
for i, line in enumerate(lines):
# 查找 if(CONFIG_BOARD_TYPE_*) 行
@@ -73,10 +73,6 @@ def release(board_type, board_config):
# Print Project Version
project_version = get_project_version()
print(f"Project Version: {project_version}", config_path)
release_path = f"releases/v{project_version}_{board_type}.zip"
if os.path.exists(release_path):
print(f"跳过 {board_type} 因为 {release_path} 已存在")
return
with open(config_path, "r") as f:
config = json.load(f)
@@ -86,7 +82,11 @@ def release(board_type, board_config):
for build in builds:
name = build["name"]
if not name.startswith(board_type):
raise ValueError(f"name {name} 必须 {board_type} 开头")
raise ValueError(f"name {name} 必须 {board_type} 开头")
output_path = f"releases/v{project_version}_{name}.zip"
if os.path.exists(output_path):
print(f"跳过 {board_type} 因为 {output_path} 已存在")
continue
sdkconfig_append = [f"{board_config}=y"]
for append in build.get("sdkconfig_append", []):

View File

@@ -26,6 +26,9 @@ CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER=y
CONFIG_CODEC_I2C_BACKWARD_COMPATIBLE=n
# Fix ML307 FIFO Overflow
CONFIG_UART_ISR_IN_IRAM=y
# LVGL 9.2.2
CONFIG_LV_OS_NONE=y