debug hotspot
This commit is contained in:
parent
1b55622b26
commit
ac7913d1f7
|
@ -21,6 +21,10 @@ app = Flask(__name__)
|
||||||
def close_app():
|
def close_app():
|
||||||
if led_enabled:
|
if led_enabled:
|
||||||
orangepi.set_led_off('red')
|
orangepi.set_led_off('red')
|
||||||
|
|
||||||
|
# 关闭热点
|
||||||
|
close_hotspot()
|
||||||
|
|
||||||
# 获取当前Flask应用程序的进程ID
|
# 获取当前Flask应用程序的进程ID
|
||||||
flask_pid = os.getpid()
|
flask_pid = os.getpid()
|
||||||
|
|
||||||
|
@ -245,6 +249,15 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
print(scan_wifi())
|
print(scan_wifi())
|
||||||
|
|
||||||
|
start_hotspot()
|
||||||
|
|
||||||
|
app.run(host='0.0.0.0', port=80)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if connect_wifi("Innoxsz-Public", "innox2023"):
|
if connect_wifi("Innoxsz-Public", "innox2023"):
|
||||||
close_app()
|
close_app()
|
||||||
|
|
||||||
|
@ -258,12 +271,6 @@ if __name__ == '__main__':
|
||||||
else:
|
else:
|
||||||
print(f"{datetime.datetime.now()}: 未连接到 Wi-Fi 网络")
|
print(f"{datetime.datetime.now()}: 未连接到 Wi-Fi 网络")
|
||||||
|
|
||||||
print(f"{datetime.datetime.now()}: Starting Flask server")
|
|
||||||
print("----------------------------")
|
|
||||||
wifi_list = scan_wifi()
|
|
||||||
print("----------------------------")
|
|
||||||
|
|
||||||
restart_hotspot()
|
|
||||||
# 启动 Flask 服务器
|
# 启动 Flask 服务器
|
||||||
app.run(host='0.0.0.0', port=80)
|
app.run(host='0.0.0.0', port=80)
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Reference in New Issue