修改了4g分片下载,改了版本号约定 最后数字是模型版本号
This commit is contained in:
@@ -770,12 +770,12 @@ class OTAManager:
|
||||
# 很多 ML307R 的 MHTTP 对 https 不稳定;对已知域名做降级
|
||||
|
||||
if isinstance(url, str) and url.startswith("https://static.shelingxingqiu.com/"):
|
||||
base_url = "https://static.shelingxingqiu.com"
|
||||
# TODO:使用https,看看是否能成功
|
||||
self._is_https = True
|
||||
base_url = "http://static.shelingxingqiu.com"
|
||||
self._is_https = False
|
||||
else:
|
||||
base_url = f"http://{host}"
|
||||
self._is_https = False
|
||||
self.logger.info(f"base_url: {base_url}, self._is_https: {self._is_https}")
|
||||
# logger removed - use self.logger instead
|
||||
|
||||
def _log(*a):
|
||||
@@ -1160,8 +1160,8 @@ class OTAManager:
|
||||
self.logger.error(f"[OTA-4G][PWR] before_urc read_failed: {e}")
|
||||
|
||||
t_dl0 = time.ticks_ms()
|
||||
success, msg = self.download_file_via_4g(ota_url, downloaded_filename, debug=False)
|
||||
t_dl_cost = time.ticks_diff(t_dl0, time.ticks_ms())
|
||||
success, msg = self.download_file_via_4g(ota_url, downloaded_filename, debug=True)
|
||||
t_dl_cost = time.ticks_diff(time.ticks_ms(), t_dl0)
|
||||
self.logger.info(f"[OTA-4G] {msg}")
|
||||
self.logger.info(f"[OTA-4G] download_cost_ms={t_dl_cost}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user