mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2026-07-21 02:05:52 +00:00
Update project version to 2.3.0 and modify dependencies in idf_component.yml; enhance DHCP hostname configuration in WifiBoard class
This commit is contained in:
+1
-1
@@ -9,5 +9,5 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
|
||||
idf_build_set_property(MINIMAL_BUILD ON)
|
||||
|
||||
set(PROJECT_VER "2.2.6")
|
||||
set(PROJECT_VER "2.3.0")
|
||||
project(xiaozhi)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <freertos/task.h>
|
||||
#include <esp_network.h>
|
||||
#include <esp_log.h>
|
||||
#include <esp_mac.h>
|
||||
#include <utility>
|
||||
|
||||
#include <font_awesome.h>
|
||||
@@ -56,6 +57,14 @@ void WifiBoard::StartNetwork() {
|
||||
WifiManagerConfig config;
|
||||
config.ssid_prefix = "Xiaozhi";
|
||||
config.language = Lang::CODE;
|
||||
// Set a DHCP hostname so the router shows a friendly name instead of "espressif".
|
||||
// Uses the same "<prefix>-<last 2 MAC bytes>" scheme as the config AP SSID.
|
||||
uint8_t mac[6];
|
||||
if (esp_read_mac(mac, ESP_MAC_WIFI_STA) == ESP_OK) {
|
||||
char hostname[32];
|
||||
snprintf(hostname, sizeof(hostname), "%s-%02X%02X", config.ssid_prefix.c_str(), mac[4], mac[5]);
|
||||
config.station_hostname = hostname;
|
||||
}
|
||||
wifi_manager.Initialize(config);
|
||||
|
||||
// Set unified event callback - forward to NetworkEvent with SSID data
|
||||
|
||||
@@ -20,7 +20,7 @@ dependencies:
|
||||
waveshare/custom_io_expander_ch32v003: ^1.0.0
|
||||
espressif/esp_lcd_panel_io_additions: ^1.0.1
|
||||
78/esp_lcd_nv3023: ~1.0.0
|
||||
78/esp-wifi-connect: ~3.2.1
|
||||
78/esp-wifi-connect: ~3.2.2
|
||||
espressif/esp_audio_effects: ~1.3.0
|
||||
espressif/esp_audio_codec: ~2.5.0
|
||||
78/esp-ml307: ~3.6.5
|
||||
|
||||
Reference in New Issue
Block a user