fix: wifi连接

This commit is contained in:
2026-06-25 10:06:36 +08:00
parent c34efed6f9
commit aee1a92760
4 changed files with 15 additions and 14 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
id: t11 id: t11
name: t11 name: t11
version: 2.15.15 version: 2.15.16
author: t11 author: t11
icon: '' icon: ''
desc: t11 desc: t11
+11 -11
View File
@@ -624,16 +624,16 @@ class NetworkManager:
password = inner_data.get("password") password = inner_data.get("password")
ota_res_url = inner_data.get("url") ota_res_url = inner_data.get("url")
try: try:
w = network.wifi.Wifi() ip, err = self.connect_wifi(ssid, password, persist=False, timeout_s=15, verify_host=None, verify_port=None)
e = w.connect(ssid, password, wait=True, timeout=15) if err:
err.check_raise(e, "connect wifi failed") raise RuntimeError(err)
if self.logger: 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( self.safe_enqueue(
{ {
"cmd": 300, "cmd": 300,
"result": "ota start...", "result": "ota start...",
"wifi": w.get_ip(), "wifi": ip,
}, },
2, 2,
) )
@@ -643,7 +643,7 @@ class NetworkManager:
{ {
"cmd": 300, "cmd": 300,
"result": "success", "result": "success",
"wifi": w.get_ip(), "wifi": ip,
}, },
2, 2,
) )
@@ -665,16 +665,16 @@ class NetworkManager:
ssid = inner_data.get("ssid") ssid = inner_data.get("ssid")
password = inner_data.get("password") password = inner_data.get("password")
try: try:
w = network.wifi.Wifi() ip, err = self.connect_wifi(ssid, password, persist=False, timeout_s=15, verify_host=None, verify_port=None)
e = w.connect(ssid, password, wait=True, timeout=15) if err:
err.check_raise(e, "connect wifi failed") raise RuntimeError(err)
if self.logger: 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( self.safe_enqueue(
{ {
"cmd": 600, "cmd": 600,
"result": "success", "result": "success",
"wifi": w.get_ip(), "wifi": ip,
}, },
2, 2,
) )
+1
View File
@@ -26,3 +26,4 @@
# 2.15.13 优化算法 # 2.15.13 优化算法
# 2.15.14 优化算法 # 2.15.14 优化算法
# 2.15.15 优化wifi连接 # 2.15.15 优化wifi连接
# 2.15.16 修复wifi连接问题
+1 -1
View File
@@ -4,6 +4,6 @@
应用版本号 应用版本号
每次 OTA 更新时,只需要更新这个文件中的版本号 每次 OTA 更新时,只需要更新这个文件中的版本号
""" """
VERSION = '2.15.15' VERSION = '2.15.16'