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) '''