Compare commits
3
Commits
aee1a92760
...
abbf30d7c0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abbf30d7c0 | ||
|
|
5cf752bb3f | ||
|
|
6d8de56bfa |
@@ -1,6 +1,6 @@
|
|||||||
id: t11
|
id: t11
|
||||||
name: t11
|
name: t11
|
||||||
version: 2.15.16
|
version: 2.15.18
|
||||||
author: t11
|
author: t11
|
||||||
icon: ''
|
icon: ''
|
||||||
desc: t11
|
desc: t11
|
||||||
@@ -18,8 +18,6 @@ files:
|
|||||||
- laser_manager.py
|
- laser_manager.py
|
||||||
- logger_manager.py
|
- logger_manager.py
|
||||||
- main.py
|
- main.py
|
||||||
- model_270139.cvimodel
|
|
||||||
- model_270139.mud
|
|
||||||
- network.py
|
- network.py
|
||||||
- ota_curl.sh
|
- ota_curl.sh
|
||||||
- ota_manager.py
|
- ota_manager.py
|
||||||
|
|||||||
+26
-11
@@ -624,16 +624,21 @@ class NetworkManager:
|
|||||||
password = inner_data.get("password")
|
password = inner_data.get("password")
|
||||||
ota_res_url = inner_data.get("url")
|
ota_res_url = inner_data.get("url")
|
||||||
try:
|
try:
|
||||||
ip, err = self.connect_wifi(ssid, password, persist=False, timeout_s=15, verify_host=None, verify_port=None)
|
for _f in ("/etc/wpa_supplicant.conf", "/boot/wpa_supplicant.conf", "/boot/wifi.ssid", "/boot/wifi.pass"):
|
||||||
if err:
|
try:
|
||||||
raise RuntimeError(err)
|
os.remove(_f)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
w = network.wifi.Wifi()
|
||||||
|
e = w.connect(ssid, password, wait=True, timeout=15)
|
||||||
|
err.check_raise(e, "connect wifi failed")
|
||||||
if self.logger:
|
if self.logger:
|
||||||
self.logger.info(f"[ota] Connect success, got ip{ip}")
|
self.logger.info(f"[ota] Connect success, got ip{w.get_ip()}")
|
||||||
self.safe_enqueue(
|
self.safe_enqueue(
|
||||||
{
|
{
|
||||||
"cmd": 300,
|
"cmd": 300,
|
||||||
"result": "ota start...",
|
"result": "ota start...",
|
||||||
"wifi": ip,
|
"wifi": w.get_ip(),
|
||||||
},
|
},
|
||||||
2,
|
2,
|
||||||
)
|
)
|
||||||
@@ -643,7 +648,7 @@ class NetworkManager:
|
|||||||
{
|
{
|
||||||
"cmd": 300,
|
"cmd": 300,
|
||||||
"result": "success",
|
"result": "success",
|
||||||
"wifi": ip,
|
"wifi": w.get_ip(),
|
||||||
},
|
},
|
||||||
2,
|
2,
|
||||||
)
|
)
|
||||||
@@ -665,19 +670,29 @@ class NetworkManager:
|
|||||||
ssid = inner_data.get("ssid")
|
ssid = inner_data.get("ssid")
|
||||||
password = inner_data.get("password")
|
password = inner_data.get("password")
|
||||||
try:
|
try:
|
||||||
ip, err = self.connect_wifi(ssid, password, persist=False, timeout_s=15, verify_host=None, verify_port=None)
|
for _f in ("/etc/wpa_supplicant.conf", "/boot/wpa_supplicant.conf", "/boot/wifi.ssid", "/boot/wifi.pass"):
|
||||||
if err:
|
try:
|
||||||
raise RuntimeError(err)
|
os.remove(_f)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
w = network.wifi.Wifi()
|
||||||
|
e = w.connect(ssid, password, wait=True, timeout=15)
|
||||||
|
err.check_raise(e, "connect wifi failed")
|
||||||
if self.logger:
|
if self.logger:
|
||||||
self.logger.info(f"[conn wifi] Connect success, got ip{ip}")
|
self.logger.info(f"[ota] Connect success, got ip{w.get_ip()}")
|
||||||
self.safe_enqueue(
|
self.safe_enqueue(
|
||||||
{
|
{
|
||||||
"cmd": 600,
|
"cmd": 600,
|
||||||
"result": "success",
|
"result": "success",
|
||||||
"wifi": ip,
|
"wifi": w.get_ip(),
|
||||||
},
|
},
|
||||||
2,
|
2,
|
||||||
)
|
)
|
||||||
|
self._session_force_4g = False
|
||||||
|
self.disconnect_server()
|
||||||
|
self._tcp_connected = False
|
||||||
|
self._network_type = None
|
||||||
|
self.logger.info("[conn wifi] WiFi已连接,等待主循环重新登录")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.error(f"cmd600 失败: {e}")
|
self.logger.error(f"cmd600 失败: {e}")
|
||||||
self.safe_enqueue(
|
self.safe_enqueue(
|
||||||
|
|||||||
@@ -27,3 +27,5 @@
|
|||||||
# 2.15.14 优化算法
|
# 2.15.14 优化算法
|
||||||
# 2.15.15 优化wifi连接
|
# 2.15.15 优化wifi连接
|
||||||
# 2.15.16 修复wifi连接问题
|
# 2.15.16 修复wifi连接问题
|
||||||
|
# 2.15.17 修复wifi连接问题
|
||||||
|
# 2.15.18 wifi连接成功重新登录
|
||||||
+1
-1
@@ -4,6 +4,6 @@
|
|||||||
应用版本号
|
应用版本号
|
||||||
每次 OTA 更新时,只需要更新这个文件中的版本号
|
每次 OTA 更新时,只需要更新这个文件中的版本号
|
||||||
"""
|
"""
|
||||||
VERSION = '2.15.16'
|
VERSION = '2.15.18'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user