wifi config while no 4g and wifi

This commit is contained in:
gcw_4spBpAfv
2026-04-07 17:29:24 +08:00
parent bdc3254ed2
commit ead2060ab3
7 changed files with 588 additions and 5 deletions

View File

@@ -132,6 +132,12 @@ class WiFiManager:
def is_wifi_connected(self):
"""检查WiFi是否已连接"""
# AP 模式下 wlan0 也可能有 IP如 192.168.66.1),但这不代表已作为 STA 连上路由器。
# 业务侧(选网/TCP只应在 STA 已关联到上游 AP 时认为 WiFi 可用。
if not self.is_sta_associated():
self._wifi_connected = False
return False
# 优先用 MaixPy network如果可用
try:
from maix import network