mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
updated ota to /toy
This commit is contained in:
parent
fa3de0ec7a
commit
148ff486f7
12 changed files with 19 additions and 19 deletions
|
|
@ -242,7 +242,7 @@ public interface Constant {
|
|||
/**
|
||||
* 无效固件URL
|
||||
*/
|
||||
String INVALID_FIRMWARE_URL = "http://xiaozhi.server.com:8002/xiaozhi/otaMag/download/NOT_ACTIVATED_FIRMWARE_THIS_IS_A_INVALID_URL";
|
||||
String INVALID_FIRMWARE_URL = "http://xiaozhi.server.com:8002/toy/otaMag/download/NOT_ACTIVATED_FIRMWARE_THIS_IS_A_INVALID_URL";
|
||||
|
||||
/**
|
||||
* 字典类型
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ server:
|
|||
min-spare: 30
|
||||
port: 8002
|
||||
servlet:
|
||||
context-path: /xiaozhi
|
||||
context-path: /toy
|
||||
session:
|
||||
cookie:
|
||||
http-only: true
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
VUE_APP_API_BASE_URL=/xiaozhi
|
||||
VUE_APP_API_BASE_URL=/toy
|
||||
VUE_APP_TITLE=cheeko
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
VUE_APP_API_BASE_URL=/xiaozhi
|
||||
VUE_APP_API_BASE_URL=/toy
|
||||
VUE_APP_PUBLIC_PATH=/
|
||||
# 是否开启CDN
|
||||
VUE_APP_USE_CDN=false
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<el-progress v-if="isUploading || uploadStatus === 'success'" :percentage="uploadProgress"
|
||||
:status="uploadStatus"></el-progress>
|
||||
<div class="hint-text">
|
||||
<span>Note: Please upload the original xiaozhi.bin file, not the merged-binary.bin file</span>
|
||||
<span>Note: Please upload the original toy.bin file, not the merged-binary.bin file</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="Remarks" prop="remark">
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ module.exports = defineConfig({
|
|||
devServer: {
|
||||
port: 8001, // 指定端口为 8001
|
||||
proxy: {
|
||||
'/xiaozhi': {
|
||||
'/toy': {
|
||||
target: 'http://127.0.0.1:8002',
|
||||
changeOrigin: true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"production": {
|
||||
"chat_servers": [
|
||||
"ws://192.168.68.66:8000/xiaozhi/v1/"
|
||||
"ws://192.168.68.66:8000/toy/v1/"
|
||||
]
|
||||
},
|
||||
"development": {
|
||||
"chat_servers": ["ws://192.168.68.66:8000/xiaozhi/v1/"],
|
||||
"chat_servers": ["ws://192.168.68.66:8000/toy/v1/"],
|
||||
"mac_addresss": ["d8:43:ae:3e:4b:5a"]
|
||||
},
|
||||
"debug": false
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ async def main():
|
|||
|
||||
if not read_config_from_api:
|
||||
logger.bind(tag=TAG).info(
|
||||
"OTA interface is\t\thttp://{}:{}/xiaozhi/ota/",
|
||||
"OTA interface is\t\thttp://{}:{}/toy/ota/",
|
||||
get_local_ip(),
|
||||
port,
|
||||
)
|
||||
|
|
@ -98,7 +98,7 @@ async def main():
|
|||
websocket_port = int(server_config.get("port", 8000))
|
||||
|
||||
logger.bind(tag=TAG).info(
|
||||
"Websocket address is\tws://{}:{}/xiaozhi/v1/",
|
||||
"Websocket address is\tws://{}:{}/toy/v1/",
|
||||
get_local_ip(),
|
||||
websocket_port,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ class TestClient:
|
|||
|
||||
def get_ota_config(self) -> bool:
|
||||
"""Requests OTA configuration from the server."""
|
||||
logger.info(f"▶️ STEP 1: Requesting OTA config from http://{SERVER_IP}:{OTA_PORT}/xiaozhi/ota/")
|
||||
logger.info(f"▶️ STEP 1: Requesting OTA config from http://{SERVER_IP}:{OTA_PORT}/toy/ota/")
|
||||
try:
|
||||
# Generate a client ID for this session
|
||||
import uuid
|
||||
|
|
@ -335,7 +335,7 @@ class TestClient:
|
|||
},
|
||||
"client_id": session_client_id
|
||||
}
|
||||
response = requests.post(f"http://{SERVER_IP}:{OTA_PORT}/xiaozhi/ota/", headers=headers, json=data, timeout=5)
|
||||
response = requests.post(f"http://{SERVER_IP}:{OTA_PORT}/toy/ota/", headers=headers, json=data, timeout=5)
|
||||
response.raise_for_status()
|
||||
self.ota_config = response.json()
|
||||
print(f"OTA Config received: {json.dumps(self.ota_config, indent=2)}")
|
||||
|
|
@ -347,7 +347,7 @@ class TestClient:
|
|||
logger.info(f"✅ Got websocket URL from OTA: {self.websocket_url}")
|
||||
else:
|
||||
logger.warning("⚠️ No websocket URL in OTA response, using fallback")
|
||||
self.websocket_url = f"ws://{SERVER_IP}:8000/xiaozhi/v1/"
|
||||
self.websocket_url = f"ws://{SERVER_IP}:8000/toy/v1/"
|
||||
|
||||
# Extract MQTT credentials from OTA response
|
||||
mqtt_info = self.ota_config.get("mqtt", {})
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ server:
|
|||
# When deploying with docker or using public network deployment (using SSL, domain names), it may not be accurate
|
||||
# So if you deploy with docker, set websocket to the LAN address
|
||||
# If you deploy on public network, set websocket to the public network address
|
||||
websocket: ws://your-ip-or-domain:port/xiaozhi/v1/
|
||||
websocket: ws://your-ip-or-domain:port/toy/v1/
|
||||
# Visual analysis interface address
|
||||
# Visual analysis interface address sent to devices
|
||||
# If using the default configuration below, the system will automatically generate the visual recognition address and output it in the startup log. You can directly access this address with a browser to confirm
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class OTAHandler(BaseHandler):
|
|||
|
||||
if not websocket_config or "你的" in websocket_config:
|
||||
print(f"[OTA DEBUG] Using default websocket URL")
|
||||
return f"ws://{local_ip}:{port}/xiaozhi/v1/"
|
||||
return f"ws://{local_ip}:{port}/toy/v1/"
|
||||
else:
|
||||
print(f"[OTA DEBUG] Using configured websocket URL: {websocket_config}")
|
||||
return websocket_config
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class SimpleHttpServer:
|
|||
if websocket_config and "you" not in websocket_config:
|
||||
return websocket_config
|
||||
else:
|
||||
return f"ws://{local_ip}:{port}/xiaozhi/v1/"
|
||||
return f"ws://{local_ip}:{port}/toy/v1/"
|
||||
|
||||
async def start(self):
|
||||
server_config = self.config["server"]
|
||||
|
|
@ -51,10 +51,10 @@ class SimpleHttpServer:
|
|||
# If smart control panel is not enabled, just running single module, need to add simple OTA interface for delivering websocket interface
|
||||
self.logger.bind(tag=TAG).info("Adding OTA routes")
|
||||
app.add_routes([
|
||||
web.get("/xiaozhi/ota/", self.ota_handler.handle_get),
|
||||
web.post("/xiaozhi/ota/",
|
||||
web.get("/toy/ota/", self.ota_handler.handle_get),
|
||||
web.post("/toy/ota/",
|
||||
self.ota_handler.handle_post),
|
||||
web.options("/xiaozhi/ota/",
|
||||
web.options("/toy/ota/",
|
||||
self.ota_handler.handle_post),
|
||||
])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue