fix: maixcam wifi连接

This commit is contained in:
2026-06-25 11:02:19 +08:00
parent aee1a92760
commit 6d8de56bfa
+12 -12
View File
@@ -624,16 +624,16 @@ class NetworkManager:
password = inner_data.get("password")
ota_res_url = inner_data.get("url")
try:
ip, err = self.connect_wifi(ssid, password, persist=False, timeout_s=15, verify_host=None, verify_port=None)
if err:
raise RuntimeError(err)
w = network.wifi.Wifi()
e = w.connect(ssid, password, wait=True, timeout=15)
err.check_raise(e, "connect wifi failed")
if self.logger:
self.logger.info(f"[ota] Connect success, got ip{ip}")
self.logger.info(f"[ota] Connect success, got ip{w.get_ip()}")
self.safe_enqueue(
{
"cmd": 300,
"result": "ota start...",
"wifi": ip,
"wifi": w.get_ip(),
},
2,
)
@@ -643,7 +643,7 @@ class NetworkManager:
{
"cmd": 300,
"result": "success",
"wifi": ip,
"wifi": w.get_ip(),
},
2,
)
@@ -665,16 +665,16 @@ class NetworkManager:
ssid = inner_data.get("ssid")
password = inner_data.get("password")
try:
ip, err = self.connect_wifi(ssid, password, persist=False, timeout_s=15, verify_host=None, verify_port=None)
if err:
raise RuntimeError(err)
w = network.wifi.Wifi()
e = w.connect(ssid, password, wait=True, timeout=15)
err.check_raise(e, "connect wifi failed")
if self.logger:
self.logger.info(f"[conn wifi] Connect success, got ip{ip}")
self.logger.info(f"[ota] Connect success, got ip{w.get_ip()}")
self.safe_enqueue(
{
"cmd": 600,
"result": "success",
"wifi": ip,
"wifi": w.get_ip(),
},
2,
)
@@ -2148,7 +2148,7 @@ class NetworkManager:
self.logger.info(f"password: {password}")
ota_manager._start_update_thread()
self._spawn_cmd_thread(ota_manager.handle_wifi_and_update,
(ssid, password, ota_url))
(ssid, password, ota_url))
elif inner_cmd == 6:
try:
ip = os.popen(