VIN: lower retries (#31471)

* lower retries

* comment
pull/31349/head^2
Shane Smiskol 1 year ago committed by GitHub
parent 20db82641f
commit 9acc55861c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      selfdrive/car/car_helpers.py
  2. 2
      selfdrive/car/tests/test_fw_fingerprint.py
  3. 2
      selfdrive/car/vin.py

@ -141,9 +141,10 @@ def fingerprint(logcan, sendcan, num_pandas):
cached = True
else:
cloudlog.warning("Getting VIN & FW versions")
# enable OBD multiplexing for Vin query, also allows time for sendcan subscriber to connect
# enable OBD multiplexing for VIN query
# NOTE: this takes ~0.1s and is relied on to allow sendcan subscriber to connect in time
set_obd_multiplexing(params, True)
# Vin query only reliably works through OBDII
# VIN query only reliably works through OBDII
vin_rx_addr, vin_rx_bus, vin = get_vin(logcan, sendcan, (0, 1))
ecu_rx_addrs = get_present_ecus(logcan, sendcan, num_pandas=num_pandas)
car_fw = get_fw_versions_ordered(logcan, sendcan, ecu_rx_addrs, num_pandas=num_pandas)

@ -225,7 +225,7 @@ class TestFwFingerprintTiming(unittest.TestCase):
def test_startup_timing(self):
# Tests worse-case VIN query time and typical present ECU query time
vin_ref_times = {'worst': 1.5, 'best': 0.5} # best assumes we go through all queries to get a match
vin_ref_times = {'worst': 1.0, 'best': 0.5} # best assumes we go through all queries to get a match
present_ecu_ref_time = 0.75
def fake_get_ecu_addrs(*_, timeout):

@ -15,7 +15,7 @@ def is_valid_vin(vin: str):
return re.fullmatch(VIN_RE, vin) is not None
def get_vin(logcan, sendcan, buses, timeout=0.1, retry=3, debug=False):
def get_vin(logcan, sendcan, buses, timeout=0.1, retry=2, debug=False):
for i in range(retry):
for bus in buses:
for request, response, valid_buses, vin_addrs, functional_addrs, rx_offset in (

Loading…
Cancel
Save