Apply registration & launch_openpilot changes
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user