From 870c5f383d2feb1b5dd255fd0c528d1427f8478c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 27 Sep 2022 18:13:13 -0700 Subject: [PATCH] IsoTpParallelQuery: extend timeout for each ISO-TP frame (#25897) * raise timeouts * extend timeout for each message/frame (not multi-frame full response) * bump panda * 100 ms timeout between frames (max I've seen is 20, should be good) * bump panda * remove unused * Add tester present to HKG queries (temp) * send tester present to all ecus first * vin and fw_versions.py sleep, should figure out why sendcan drops packets * None is wildcard (some ecus respond with negative code, that's fine) * typing * try bus 0 * revert brand-specific changes * Update selfdrive/car/isotp_parallel_query.py --- panda | 2 +- selfdrive/car/isotp_parallel_query.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/panda b/panda index 10c0991666..5984fd3509 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit 10c0991666865feb734120f2544586d461292866 +Subproject commit 5984fd35096a9e3f9748435868ad49a199d4404d diff --git a/selfdrive/car/isotp_parallel_query.py b/selfdrive/car/isotp_parallel_query.py index 971309439e..31dc31d7a4 100644 --- a/selfdrive/car/isotp_parallel_query.py +++ b/selfdrive/car/isotp_parallel_query.py @@ -1,7 +1,6 @@ import time from collections import defaultdict from functools import partial -from typing import Optional import cereal.messaging as messaging from system.swaglog import cloudlog @@ -107,12 +106,15 @@ class IsoTpParallelQuery: for tx_addr, msg in msgs.items(): try: - dat: Optional[bytes] = msg.recv() + dat, updated = msg.recv() except Exception: cloudlog.exception(f"Error processing UDS response: {tx_addr}") request_done[tx_addr] = True continue + if updated: + response_timeouts[tx_addr] = time.monotonic() + timeout + if not dat: continue @@ -121,7 +123,6 @@ class IsoTpParallelQuery: response_valid = dat[:len(expected_response)] == expected_response if response_valid: - response_timeouts[tx_addr] = time.monotonic() + timeout if counter + 1 < len(self.request): msg.send(self.request[counter + 1]) request_counter[tx_addr] += 1