From f6ee8b112503c7e3d46bf55d3fc85397d1c31808 Mon Sep 17 00:00:00 2001 From: IrvingGao <1729854488@qq.com> Date: Sat, 25 May 2024 23:04:33 +0800 Subject: [PATCH] [v1.0] hotspot --- wifi_manager.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/wifi_manager.py b/wifi_manager.py index 1553c58..fdb1a4f 100644 --- a/wifi_manager.py +++ b/wifi_manager.py @@ -244,36 +244,29 @@ def submit(): if __name__ == '__main__': - debug_mode = True # 设置为 True 以跳过 Wi-Fi 连接状态检测 + debug_mode = False # 设置为 True 以跳过 Wi-Fi 连接状态检测 if debug_mode: disconnect_wifi() - wifi_list = scan_wifi() print(wifi_list) start_hotspot() - app.run(host='0.0.0.0', port=80) - - - - - + # app.run(host='0.0.0.0', port=80) if connect_wifi("Innoxsz-Public", "innox2023"): close_app() - ''' if led_enabled: orangepi.set_led_on('blue') - + if check_wifi_connection(): print(f"{datetime.datetime.now()}: 系统已自动连接到 Wi-Fi 网络,退出程序") close_app() else: + wifi_list = scan_wifi() print(f"{datetime.datetime.now()}: 未连接到 Wi-Fi 网络") + start_hotspot() + app.run(host='0.0.0.0', port=80) - # 启动 Flask 服务器 - app.run(host='0.0.0.0', port=80) - ''' \ No newline at end of file