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

11
main.py
View File

@@ -213,7 +213,16 @@ def cmd_str():
pass
# 6. 启动通信与校准线程
_thread.start_new_thread(network_manager.tcp_main, ())
# 若已进入 AP 配网兜底(/boot/wifi.ap则不启动 TCP 主循环;等待用户配网后 reboot。
try:
if os.path.exists("/boot/wifi.ap"):
if logger:
logger.warning("[NET] 当前处于 AP 配网模式(/boot/wifi.ap 存在),跳过 TCP 主线程启动")
else:
_thread.start_new_thread(network_manager.tcp_main, ())
except Exception as e:
if logger:
logger.error(f"[NET] 启动 TCP 主线程失败: {e}")
if not config.HARDCODE_LASER_POINT:
_thread.start_new_thread(laser_calibration_worker, ())