diff --git a/main/xiaozhi-server/core/connection.py b/main/xiaozhi-server/core/connection.py index e88cf8a9..9e0b06b1 100644 --- a/main/xiaozhi-server/core/connection.py +++ b/main/xiaozhi-server/core/connection.py @@ -888,7 +888,7 @@ class ConnectionHandler: def clear_queues(self): # 清空所有任务队列 - self.logger.bind(tag=TAG).info( + self.logger.bind(tag=TAG).debug( f"开始清理: TTS队列大小={self.tts_queue.qsize()}, 音频队列大小={self.audio_play_queue.qsize()}" ) for q in [self.tts_queue, self.audio_play_queue]: @@ -902,7 +902,7 @@ class ConnectionHandler: q.queue.clear() # 添加毒丸信号到队列,确保线程退出 # q.queue.put(None) - self.logger.bind(tag=TAG).info( + self.logger.bind(tag=TAG).debug( f"清理结束: TTS队列大小={self.tts_queue.qsize()}, 音频队列大小={self.audio_play_queue.qsize()}" ) diff --git a/main/xiaozhi-server/docker-compose.yml b/main/xiaozhi-server/docker-compose.yml index 34bd1c3e..f66f9eea 100644 --- a/main/xiaozhi-server/docker-compose.yml +++ b/main/xiaozhi-server/docker-compose.yml @@ -13,6 +13,8 @@ services: ports: # ws服务端 - "8000:8000" + # ota服务端 + - "8002:8002" volumes: # 配置文件目录 - ./data:/opt/xiaozhi-esp32-server/data diff --git a/main/xiaozhi-server/test/test_page.html b/main/xiaozhi-server/test/test_page.html index 65182c4d..d9b2eff6 100644 --- a/main/xiaozhi-server/test/test_page.html +++ b/main/xiaozhi-server/test/test_page.html @@ -446,7 +446,7 @@

设备配置 - MAC: 00:11:22:33:44:55 + MAC: 客户端: web_test_client @@ -455,7 +455,7 @@
- +
@@ -1582,6 +1582,19 @@ } } + // 生成随机MAC地址 + function generateRandomMac() { + const hexDigits = '0123456789ABCDEF'; + let mac = ''; + for (let i = 0; i < 6; i++) { + if (i > 0) mac += ':'; + for (let j = 0; j < 2; j++) { + mac += hexDigits.charAt(Math.floor(Math.random() * 16)); + } + } + return mac; + } + // 初始化事件监听器 function initEventListeners() { connectButton.addEventListener('click', connectToServer); @@ -1595,10 +1608,22 @@ const displayMac = document.getElementById('displayMac'); const displayClient = document.getElementById('displayClient'); + // 从localStorage加载MAC地址,如果没有则生成新的 + let savedMac = localStorage.getItem('deviceMac'); + if (!savedMac) { + savedMac = generateRandomMac(); + localStorage.setItem('deviceMac', savedMac); + } + deviceMacInput.value = savedMac; + displayMac.textContent = savedMac; + // 更新显示的值 function updateDisplayValues() { - displayMac.textContent = deviceMacInput.value; + const newMac = deviceMacInput.value; + displayMac.textContent = newMac; displayClient.textContent = clientIdInput.value; + // 保存MAC地址到localStorage + localStorage.setItem('deviceMac', newMac); } // 监听输入变化