mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-20 16:52:10 +08:00
athena: remove redirect detection for old prime (#24662)
This worked on old magenta, but doesn't work on new magenta or blue prime. old-commit-hash: e38b93fc31f3ff89a3806675bc090c2149434cf7
This commit is contained in:
@@ -144,7 +144,6 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"PandaHeartbeatLost", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF},
|
||||
{"PandaSignatures", CLEAR_ON_MANAGER_START},
|
||||
{"Passive", PERSISTENT},
|
||||
{"PrimeRedirected", PERSISTENT},
|
||||
{"PrimeType", PERSISTENT},
|
||||
{"RecordFront", PERSISTENT},
|
||||
{"RecordFrontLock", PERSISTENT}, // for the internal fleet
|
||||
|
||||
@@ -725,7 +725,6 @@ def main():
|
||||
enable_multithread=True,
|
||||
timeout=30.0)
|
||||
cloudlog.event("athenad.main.connected_ws", ws_uri=ws_uri)
|
||||
params.delete("PrimeRedirected")
|
||||
|
||||
conn_retries = 0
|
||||
cur_upload_items.clear()
|
||||
@@ -735,22 +734,13 @@ def main():
|
||||
break
|
||||
except (ConnectionError, TimeoutError, WebSocketException):
|
||||
conn_retries += 1
|
||||
params.delete("PrimeRedirected")
|
||||
params.delete("LastAthenaPingTime")
|
||||
except socket.timeout:
|
||||
try:
|
||||
r = requests.get("http://api.commadotai.com/v1/me", allow_redirects=False,
|
||||
headers={"User-Agent": f"openpilot-{get_version()}"}, timeout=15.0)
|
||||
if r.status_code == 302 and r.headers['Location'].startswith("http://u.web2go.com"):
|
||||
params.put_bool("PrimeRedirected", True)
|
||||
except Exception:
|
||||
cloudlog.exception("athenad.socket_timeout.exception")
|
||||
params.delete("LastAthenaPingTime")
|
||||
except Exception:
|
||||
cloudlog.exception("athenad.main.exception")
|
||||
|
||||
conn_retries += 1
|
||||
params.delete("PrimeRedirected")
|
||||
params.delete("LastAthenaPingTime")
|
||||
|
||||
time.sleep(backoff(conn_retries))
|
||||
|
||||
@@ -57,7 +57,7 @@ void Sidebar::updateState(const UIState &s) {
|
||||
ItemStatus connectStatus;
|
||||
auto last_ping = deviceState.getLastAthenaPingTime();
|
||||
if (last_ping == 0) {
|
||||
connectStatus = params.getBool("PrimeRedirected") ? ItemStatus{"NO\nPRIME", danger_color} : ItemStatus{"CONNECT\nOFFLINE", warning_color};
|
||||
connectStatus = ItemStatus{"CONNECT\nOFFLINE", warning_color};
|
||||
} else {
|
||||
connectStatus = nanos_since_boot() - last_ping < 80e9 ? ItemStatus{"CONNECT\nONLINE", good_color} : ItemStatus{"CONNECT\nERROR", danger_color};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user