From aee1a9276088b7b8c91835d2cd6741ac512b59ef Mon Sep 17 00:00:00 2001 From: linyimin <18316471919@139.com> Date: Thu, 25 Jun 2026 10:06:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20wifi=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.yaml | 2 +- network.py | 22 +++++++++++----------- version.md | 3 ++- version.py | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app.yaml b/app.yaml index ec1727d..a5ad9b0 100644 --- a/app.yaml +++ b/app.yaml @@ -1,6 +1,6 @@ id: t11 name: t11 -version: 2.15.15 +version: 2.15.16 author: t11 icon: '' desc: t11 diff --git a/network.py b/network.py index 3c8b4c9..bb7b680 100644 --- a/network.py +++ b/network.py @@ -624,16 +624,16 @@ class NetworkManager: password = inner_data.get("password") ota_res_url = inner_data.get("url") try: - w = network.wifi.Wifi() - e = w.connect(ssid, password, wait=True, timeout=15) - err.check_raise(e, "connect wifi failed") + ip, err = self.connect_wifi(ssid, password, persist=False, timeout_s=15, verify_host=None, verify_port=None) + if err: + raise RuntimeError(err) if self.logger: - self.logger.info(f"[ota] Connect success, got ip{w.get_ip()}") + self.logger.info(f"[ota] Connect success, got ip{ip}") self.safe_enqueue( { "cmd": 300, "result": "ota start...", - "wifi": w.get_ip(), + "wifi": ip, }, 2, ) @@ -643,7 +643,7 @@ class NetworkManager: { "cmd": 300, "result": "success", - "wifi": w.get_ip(), + "wifi": ip, }, 2, ) @@ -665,16 +665,16 @@ class NetworkManager: ssid = inner_data.get("ssid") password = inner_data.get("password") try: - w = network.wifi.Wifi() - e = w.connect(ssid, password, wait=True, timeout=15) - err.check_raise(e, "connect wifi failed") + ip, err = self.connect_wifi(ssid, password, persist=False, timeout_s=15, verify_host=None, verify_port=None) + if err: + raise RuntimeError(err) if self.logger: - self.logger.info(f"[ota] Connect success, got ip{w.get_ip()}") + self.logger.info(f"[conn wifi] Connect success, got ip{ip}") self.safe_enqueue( { "cmd": 600, "result": "success", - "wifi": w.get_ip(), + "wifi": ip, }, 2, ) diff --git a/version.md b/version.md index c1c04ad..a1f03a7 100644 --- a/version.md +++ b/version.md @@ -25,4 +25,5 @@ # 2.15.12 优化算法 # 2.15.13 优化算法 # 2.15.14 优化算法 -# 2.15.15 优化wifi连接 \ No newline at end of file +# 2.15.15 优化wifi连接 +# 2.15.16 修复wifi连接问题 \ No newline at end of file diff --git a/version.py b/version.py index 5cfe9b7..e2a1183 100644 --- a/version.py +++ b/version.py @@ -4,6 +4,6 @@ 应用版本号 每次 OTA 更新时,只需要更新这个文件中的版本号 """ -VERSION = '2.15.15' +VERSION = '2.15.16'