update check wifi connetction
This commit is contained in:
parent
dc8ba69b8d
commit
20f4f4316b
|
@ -25,6 +25,7 @@ except ImportError:
|
||||||
|
|
||||||
|
|
||||||
def close_app():
|
def close_app():
|
||||||
|
orangepi.set_led_off('red')
|
||||||
# 获取当前Flask应用程序的进程ID
|
# 获取当前Flask应用程序的进程ID
|
||||||
flask_pid = os.getpid()
|
flask_pid = os.getpid()
|
||||||
|
|
||||||
|
@ -173,11 +174,9 @@ def submit():
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
# 检查是否成功连接Wi-Fi
|
# 检查是否成功连接Wi-Fi
|
||||||
if check_wifi_connection() and connected:
|
if check_wifi_connection() and connected:
|
||||||
orangepi.set_led_off('red')
|
|
||||||
# connected successfully, close flask
|
# connected successfully, close flask
|
||||||
close_app()
|
close_app()
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print(f"{datetime.datetime.now()}: Wi-Fi连接失败。")
|
print(f"{datetime.datetime.now()}: Wi-Fi连接失败。")
|
||||||
restart_hotspot()
|
restart_hotspot()
|
||||||
|
|
Loading…
Reference in New Issue