From 8580dc4b4ff4f0c87ac7894e4f057ddadce8c776 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 28 May 2026 19:31:22 -0700 Subject: [PATCH] Nissan Altima: fix fingerprinting without comma power (#3418) * add pt bus fp * fix * add missing engine * keep for now * bump --- opendbc/car/nissan/fingerprints.py | 1 + opendbc/car/nissan/values.py | 18 ++++++++++++------ opendbc/car/tests/test_fw_fingerprint.py | 6 +++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/opendbc/car/nissan/fingerprints.py b/opendbc/car/nissan/fingerprints.py index f60903de..18960bbd 100644 --- a/opendbc/car/nissan/fingerprints.py +++ b/opendbc/car/nissan/fingerprints.py @@ -16,6 +16,7 @@ FW_VERSIONS = { (Ecu.engine, 0x7e0, None): [ b'237106GU3B', b'237109HE2B', + b'237106GV3A', ], (Ecu.gateway, 0x18dad0f1, None): [ b'284U29HE0A', diff --git a/opendbc/car/nissan/values.py b/opendbc/car/nissan/values.py index 2fc16e26..8de0d4fa 100644 --- a/opendbc/car/nissan/values.py +++ b/opendbc/car/nissan/values.py @@ -93,41 +93,47 @@ NISSAN_VERSION_RESPONSE_KWP = b'\x61\x83' NISSAN_RX_OFFSET = 0x20 +# TODO: once we gather enough Altima data on PT bus (1), we can remove OBD queries to speed up fingerprinting FW_QUERY_CONFIG = FwQueryConfig( - requests=[request for bus, logging in ((0, False), (1, True)) for request in [ + requests=[request for bus, obd_multiplexing in ((0, False), (1, False), (1, True)) for request in [ Request( [NISSAN_DIAGNOSTIC_REQUEST_KWP, NISSAN_VERSION_REQUEST_KWP], [NISSAN_DIAGNOSTIC_RESPONSE_KWP, NISSAN_VERSION_RESPONSE_KWP], bus=bus, - logging=logging, + logging=obd_multiplexing, + obd_multiplexing=obd_multiplexing, ), Request( [NISSAN_DIAGNOSTIC_REQUEST_KWP, NISSAN_VERSION_REQUEST_KWP], [NISSAN_DIAGNOSTIC_RESPONSE_KWP, NISSAN_VERSION_RESPONSE_KWP], rx_offset=NISSAN_RX_OFFSET, bus=bus, - logging=logging, + logging=obd_multiplexing, + obd_multiplexing=obd_multiplexing, ), # Rogue's engine solely responds to this Request( [NISSAN_DIAGNOSTIC_REQUEST_KWP_2, NISSAN_VERSION_REQUEST_KWP], [NISSAN_DIAGNOSTIC_RESPONSE_KWP_2, NISSAN_VERSION_RESPONSE_KWP], bus=bus, - logging=logging, + logging=obd_multiplexing, + obd_multiplexing=obd_multiplexing, ), Request( [StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], [StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], rx_offset=NISSAN_RX_OFFSET, bus=bus, - logging=logging, + logging=obd_multiplexing, + obd_multiplexing=obd_multiplexing, ), # Some newer Altima engines respond at normal rx offset Request( [StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], [StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], bus=bus, - logging=logging, + logging=obd_multiplexing, + obd_multiplexing=obd_multiplexing, ), ]], ) diff --git a/opendbc/car/tests/test_fw_fingerprint.py b/opendbc/car/tests/test_fw_fingerprint.py index a6aef90e..42dedad8 100644 --- a/opendbc/car/tests/test_fw_fingerprint.py +++ b/opendbc/car/tests/test_fw_fingerprint.py @@ -232,7 +232,7 @@ class TestFwFingerprintTiming(unittest.TestCase): return self.total_time / self.N def _assert_timing(self, avg_time, ref_time): - assert avg_time < ref_time + self.TOL + assert avg_time < ref_time + self.TOL, avg_time assert avg_time > ref_time - self.TOL, "Performance seems to have improved, update test refs." def test_startup_timing(self): @@ -262,7 +262,7 @@ class TestFwFingerprintTiming(unittest.TestCase): print(f'get_vin {name} case, query time={self.total_time / self.N} seconds') def test_fw_query_timing(self): - total_ref_time = 7.6 + total_ref_time = 8.2 brand_ref_times = { 'gm': 1.0, 'body': 0.1, @@ -271,7 +271,7 @@ class TestFwFingerprintTiming(unittest.TestCase): 'honda': 0.45, 'hyundai': 0.65, 'mazda': 0.1, - 'nissan': 1.0, + 'nissan': 1.6, 'subaru': 0.65, 'tesla': 0.1, 'toyota': 0.7,