From 39fa1c9dab4e8ac7feb519617022c9713af1e387 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 12 Mar 2024 21:31:49 -0700 Subject: [PATCH 1/4] add VW camera to VIN addrs --- selfdrive/car/fw_query_definitions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/fw_query_definitions.py b/selfdrive/car/fw_query_definitions.py index 236ade49bbc738..bbc16f32ee4586 100755 --- a/selfdrive/car/fw_query_definitions.py +++ b/selfdrive/car/fw_query_definitions.py @@ -15,9 +15,9 @@ OfflineFwVersions = dict[str, dict[EcuAddrSubAddr, list[bytes]]] # A global list of addresses we will only ever consider for VIN responses -# engine, hybrid controller, Ford abs, Hyundai CAN FD cluster, 29-bit engine, PGM-FI +# engine, hybrid controller, VW camera, Ford abs, Hyundai CAN FD cluster, 29-bit engine, PGM-FI # TODO: move these to each brand's FW query config -STANDARD_VIN_ADDRS = [0x7e0, 0x7e2, 0x760, 0x7c6, 0x18da10f1, 0x18da0ef1] +STANDARD_VIN_ADDRS = [0x7e0, 0x7e2, 0x74f, 0x760, 0x7c6, 0x18da10f1, 0x18da0ef1] def p16(val): From 43aebf2f10c3b2288ce6833ae713313bd6fec84a Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 8 Apr 2024 15:53:19 -0700 Subject: [PATCH 2/4] correct VW query --- selfdrive/car/fw_query_definitions.py | 4 ++-- selfdrive/car/vin.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/fw_query_definitions.py b/selfdrive/car/fw_query_definitions.py index bbc16f32ee4586..236ade49bbc738 100755 --- a/selfdrive/car/fw_query_definitions.py +++ b/selfdrive/car/fw_query_definitions.py @@ -15,9 +15,9 @@ OfflineFwVersions = dict[str, dict[EcuAddrSubAddr, list[bytes]]] # A global list of addresses we will only ever consider for VIN responses -# engine, hybrid controller, VW camera, Ford abs, Hyundai CAN FD cluster, 29-bit engine, PGM-FI +# engine, hybrid controller, Ford abs, Hyundai CAN FD cluster, 29-bit engine, PGM-FI # TODO: move these to each brand's FW query config -STANDARD_VIN_ADDRS = [0x7e0, 0x7e2, 0x74f, 0x760, 0x7c6, 0x18da10f1, 0x18da0ef1] +STANDARD_VIN_ADDRS = [0x7e0, 0x7e2, 0x760, 0x7c6, 0x18da10f1, 0x18da0ef1] def p16(val): diff --git a/selfdrive/car/vin.py b/selfdrive/car/vin.py index e668c35f7d5086..b2d25df2d447ab 100755 --- a/selfdrive/car/vin.py +++ b/selfdrive/car/vin.py @@ -23,6 +23,7 @@ def get_vin(logcan, sendcan, buses, timeout=0.1, retry=2, debug=False): (StdQueries.OBD_VIN_REQUEST, StdQueries.OBD_VIN_RESPONSE, (0, 1), STANDARD_VIN_ADDRS, FUNCTIONAL_ADDRS, 0x8), (StdQueries.GM_VIN_REQUEST, StdQueries.GM_VIN_RESPONSE, (0,), [0x24b], None, 0x400), # Bolt fwdCamera (StdQueries.KWP_VIN_REQUEST, StdQueries.KWP_VIN_RESPONSE, (0,), [0x797], None, 0x3), # Nissan Leaf VCM + (StdQueries.UDS_VIN_REQUEST, StdQueries.UDS_VIN_RESPONSE, (0,), [0x74f], None, 0x6a), # VW camera harness ): if bus not in valid_buses: continue From c2b8bfc93eaa7d9361be6571624814a620bc942a Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 8 Apr 2024 16:00:37 -0700 Subject: [PATCH 3/4] consistent --- selfdrive/car/vin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/vin.py b/selfdrive/car/vin.py index b2d25df2d447ab..e8c9c5804298aa 100755 --- a/selfdrive/car/vin.py +++ b/selfdrive/car/vin.py @@ -23,7 +23,7 @@ def get_vin(logcan, sendcan, buses, timeout=0.1, retry=2, debug=False): (StdQueries.OBD_VIN_REQUEST, StdQueries.OBD_VIN_RESPONSE, (0, 1), STANDARD_VIN_ADDRS, FUNCTIONAL_ADDRS, 0x8), (StdQueries.GM_VIN_REQUEST, StdQueries.GM_VIN_RESPONSE, (0,), [0x24b], None, 0x400), # Bolt fwdCamera (StdQueries.KWP_VIN_REQUEST, StdQueries.KWP_VIN_RESPONSE, (0,), [0x797], None, 0x3), # Nissan Leaf VCM - (StdQueries.UDS_VIN_REQUEST, StdQueries.UDS_VIN_RESPONSE, (0,), [0x74f], None, 0x6a), # VW camera harness + (StdQueries.UDS_VIN_REQUEST, StdQueries.UDS_VIN_RESPONSE, (0,), [0x74f], None, 0x6a), # Volkswagen fwdCamera ): if bus not in valid_buses: continue From 7753ec8d4e8b2ea0a68672783041a57594df4d1f Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 8 Apr 2024 16:26:39 -0700 Subject: [PATCH 4/4] update refs --- selfdrive/car/tests/test_fw_fingerprint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index eaef1677e7513e..4a17fc34ecc7eb 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -236,7 +236,7 @@ def _assert_timing(self, avg_time, ref_time): def test_startup_timing(self): # Tests worse-case VIN query time and typical present ECU query time - vin_ref_times = {'worst': 1.2, 'best': 0.6} # best assumes we go through all queries to get a match + vin_ref_times = {'worst': 1.4, 'best': 0.7} # best assumes we go through all queries to get a match present_ecu_ref_time = 0.75 def fake_get_ecu_addrs(*_, timeout):