Skip to content

Commit abe9cfc

Browse files
committed
debug
only query hyundai import time reponse pending no cache all cars no timeout to test before
1 parent dcc1552 commit abe9cfc

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

selfdrive/car/car_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def fingerprint(logcan, sendcan):
9090
if cached_params.carName == "mock":
9191
cached_params = None
9292

93-
if cached_params is not None and len(cached_params.carFw) > 0 and cached_params.carVin is not VIN_UNKNOWN:
93+
if False and cached_params is not None and len(cached_params.carFw) > 0 and cached_params.carVin is not VIN_UNKNOWN:
9494
cloudlog.warning("Using cached CarParams")
9595
vin = cached_params.carVin
9696
car_fw = list(cached_params.carFw)

selfdrive/car/fw_versions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from dataclasses import dataclass, field
66
from typing import Any, List
77
from tqdm import tqdm
8+
import time
89

910
import panda.python.uds as uds
1011
from cereal import car
@@ -326,6 +327,7 @@ def get_fw_versions(logcan, sendcan, extra=None, timeout=0.1, debug=False, progr
326327
addrs.insert(0, parallel_addrs)
327328

328329
fw_versions = {}
330+
start_t = time.monotonic()
329331
for i, addr in enumerate(tqdm(addrs, disable=not progress)):
330332
for addr_chunk in chunks(addr):
331333
for r in REQUESTS:
@@ -334,12 +336,14 @@ def get_fw_versions(logcan, sendcan, extra=None, timeout=0.1, debug=False, progr
334336
(len(r.whitelist_ecus) == 0 or ecu_types[(a, s)] in r.whitelist_ecus)]
335337

336338
if addrs:
337-
query = IsoTpParallelQuery(sendcan, logcan, r.bus, addrs, r.request, r.response, r.rx_offset, debug=debug)
339+
query = IsoTpParallelQuery(sendcan, logcan, r.bus, addrs, r.request, r.response, r.rx_offset, debug=debug, response_pending_timeout=0)
338340
t = 2 * timeout if i == 0 else timeout
339341
fw_versions.update({addr: (version, r.request, r.rx_offset) for addr, version in query.get_data(t).items()})
340342
except Exception:
341343
cloudlog.warning(f"FW query exception: {traceback.format_exc()}")
342344

345+
cloudlog.warning(f"Took {time.monotonic() - start_t} seconds to get FW versions")
346+
343347
# Build capnp list to put into CarParams
344348
car_fw = []
345349
for addr, (version, request, rx_offset) in fw_versions.items():

selfdrive/car/isotp_parallel_query.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ def get_data(self, timeout, total_timeout=60.):
135135
if error_code == 0x78:
136136
response_timeouts[tx_addr] = time.monotonic() + self.response_pending_timeout
137137
pending_responses.add(tx_addr)
138-
if self.debug:
139-
cloudlog.warning(f"iso-tp query response pending: {tx_addr}")
138+
cloudlog.warning(f"iso-tp query response pending: {tx_addr}")
140139
else:
141140
request_done[tx_addr] = True
142141
cloudlog.warning(f"iso-tp query bad response: {tx_addr} - 0x{dat.hex()}")

0 commit comments

Comments
 (0)