only query hyundai

import time

reponse pending

no cache

all cars

no timeout to test before
pull/24724/head
Shane Smiskol 3 years ago
parent dcc1552534
commit abe9cfc1b6
  1. 2
      selfdrive/car/car_helpers.py
  2. 6
      selfdrive/car/fw_versions.py
  3. 3
      selfdrive/car/isotp_parallel_query.py

@ -90,7 +90,7 @@ def fingerprint(logcan, sendcan):
if cached_params.carName == "mock":
cached_params = None
if cached_params is not None and len(cached_params.carFw) > 0 and cached_params.carVin is not VIN_UNKNOWN:
if False and cached_params is not None and len(cached_params.carFw) > 0 and cached_params.carVin is not VIN_UNKNOWN:
cloudlog.warning("Using cached CarParams")
vin = cached_params.carVin
car_fw = list(cached_params.carFw)

@ -5,6 +5,7 @@ from collections import defaultdict
from dataclasses import dataclass, field
from typing import Any, List
from tqdm import tqdm
import time
import panda.python.uds as uds
from cereal import car
@ -326,6 +327,7 @@ def get_fw_versions(logcan, sendcan, extra=None, timeout=0.1, debug=False, progr
addrs.insert(0, parallel_addrs)
fw_versions = {}
start_t = time.monotonic()
for i, addr in enumerate(tqdm(addrs, disable=not progress)):
for addr_chunk in chunks(addr):
for r in REQUESTS:
@ -334,12 +336,14 @@ def get_fw_versions(logcan, sendcan, extra=None, timeout=0.1, debug=False, progr
(len(r.whitelist_ecus) == 0 or ecu_types[(a, s)] in r.whitelist_ecus)]
if addrs:
query = IsoTpParallelQuery(sendcan, logcan, r.bus, addrs, r.request, r.response, r.rx_offset, debug=debug)
query = IsoTpParallelQuery(sendcan, logcan, r.bus, addrs, r.request, r.response, r.rx_offset, debug=debug, response_pending_timeout=0)
t = 2 * timeout if i == 0 else timeout
fw_versions.update({addr: (version, r.request, r.rx_offset) for addr, version in query.get_data(t).items()})
except Exception:
cloudlog.warning(f"FW query exception: {traceback.format_exc()}")
cloudlog.warning(f"Took {time.monotonic() - start_t} seconds to get FW versions")
# Build capnp list to put into CarParams
car_fw = []
for addr, (version, request, rx_offset) in fw_versions.items():

@ -135,8 +135,7 @@ class IsoTpParallelQuery:
if error_code == 0x78:
response_timeouts[tx_addr] = time.monotonic() + self.response_pending_timeout
pending_responses.add(tx_addr)
if self.debug:
cloudlog.warning(f"iso-tp query response pending: {tx_addr}")
cloudlog.warning(f"iso-tp query response pending: {tx_addr}")
else:
request_done[tx_addr] = True
cloudlog.warning(f"iso-tp query bad response: {tx_addr} - 0x{dat.hex()}")

Loading…
Cancel
Save