From ac7913d1f7cb04742b4697350b9336dcdb0b0779 Mon Sep 17 00:00:00 2001 From: IrvingGao <1729854488@qq.com> Date: Sat, 25 May 2024 22:52:14 +0800 Subject: [PATCH] debug hotspot --- wifi_manager.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/wifi_manager.py b/wifi_manager.py index 21f86ba..f3c0221 100644 --- a/wifi_manager.py +++ b/wifi_manager.py @@ -21,6 +21,10 @@ app = Flask(__name__) def close_app(): if led_enabled: orangepi.set_led_off('red') + + # 关闭热点 + close_hotspot() + # 获取当前Flask应用程序的进程ID flask_pid = os.getpid() @@ -245,6 +249,15 @@ if __name__ == '__main__': print(scan_wifi()) + start_hotspot() + + app.run(host='0.0.0.0', port=80) + + + + + + if connect_wifi("Innoxsz-Public", "innox2023"): close_app() @@ -258,12 +271,6 @@ if __name__ == '__main__': else: print(f"{datetime.datetime.now()}: 未连接到 Wi-Fi 网络") - print(f"{datetime.datetime.now()}: Starting Flask server") - print("----------------------------") - wifi_list = scan_wifi() - print("----------------------------") - - restart_hotspot() # 启动 Flask 服务器 app.run(host='0.0.0.0', port=80) '''