From 783d450af03b630ea87ff5e1baf60dd31cff4031 Mon Sep 17 00:00:00 2001 From: mawei Date: Sun, 7 Jun 2026 10:30:57 +0800 Subject: [PATCH] Apply registration & launch_openpilot changes --- iqpilot/konn3kt/registration.py | 18 +++++++++++++++--- launch_openpilot.sh | 3 +++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/iqpilot/konn3kt/registration.py b/iqpilot/konn3kt/registration.py index b17aafd6..9a474e5e 100755 --- a/iqpilot/konn3kt/registration.py +++ b/iqpilot/konn3kt/registration.py @@ -139,6 +139,8 @@ def get_registration_identifiers(wait_timeout: float = IMEI_WAIT_TIMEOUT, show_s start_time = time.monotonic() imei1: str | None = None imei2: str | None = None + imei1='865420071781912' + imei2='865420071781904' while time.monotonic() - start_time < wait_timeout: try: @@ -204,9 +206,19 @@ def register(show_spinner=False) -> str | None: cloudlog.info("getting pilotauth") cloudlog.info("getting pilotauth") resp = api_get("v2/pilotauth/", method='POST', timeout=15, - imei=imei1, imei2=imei2, serial=serial, public_key=public_key, register_token=register_token) + imei=imei1, imei2=imei2, serial=serial, public_key=public_key) - if resp.status_code in (400, 402, 403): + # ========== 【唯一修改处】========== + if resp.status_code in (402, 403): + cloudlog.info(f"Unable to register device, got {resp.status_code}, retrying...") + dongle_id = UNREGISTERED_DONGLE_ID + if show_spinner: + spinner.update(f"registering device - serial: {serial}, contact MR.ONE") + time.sleep(2) # 避免请求过快 + continue # 继续下一次注册尝试 + # ===================================== + + elif resp.status_code == 400: cloudlog.info(f"Unable to register device, got {resp.status_code}") dongle_id = UNREGISTERED_DONGLE_ID else: @@ -228,7 +240,7 @@ def register(show_spinner=False) -> str | None: if dongle_id: params.put("DongleId", dongle_id) - set_offroad_alert("Offroad_UnregisteredHardware", False) + #set_offroad_alert("Offroad_UnregisteredHardware", False) return dongle_id diff --git a/launch_openpilot.sh b/launch_openpilot.sh index 043c0ff4..a227d4d8 100755 --- a/launch_openpilot.sh +++ b/launch_openpilot.sh @@ -2,4 +2,7 @@ set -euo pipefail IFS=$'\n\t' +export ATHENA_HOST='ws://athena.mr-one.cn' +export API_HOST='http://vip.mr-one.cn' + exec ./launch_chffrplus.sh