Commit Graph

95 Commits

Author SHA1 Message Date
Adeeb Shihadeh 86b6103657 test_*.py files are no longer executable (#32610)
* test_*.py files are no longer executable

* cleanup empty lines

* update precommit

* fixme

* enable

* build
old-commit-hash: c59887c810
2024-06-03 15:48:56 -07:00
cl0cks4fe 639a634f7c Unittest to pytest (#32366)
* add pytest-asyncio

* switch common

* switch selfdrive

* switch system

* switch tools

* small fixes

* fix setUp and valgrind pytest

* switch to setup

* fix random

* switch mock

* switch test_lateral_limits

* revert test_ui

* fix poetry.lock

* add unittest to banned-api

* add inline ignores to remaining unittest imports

* revert test_models

* revert check_can_parser_performance

* one more skip

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: dd9d5d4528
2024-05-17 11:01:44 -07:00
Shane Smiskol e7511de30b Toyota: remove unecessary ECUs for fingerprinting (#32235)
* remove some ecus

* missing doc

* fix

* fix

* clean up

* update refs

* rm
old-commit-hash: 5d0dc2ded2
2024-04-17 00:09:20 -07:00
Shane Smiskol d82bdc961e FwQueryConfig: test non-essential ecus aren't needless (#32232)
* good test

* remove :D

* typo
old-commit-hash: a076c1e78f
2024-04-16 21:49:30 -07:00
Shane Smiskol accfaa29af Volkswagen: fingerprint on VIN chassis code (#32148)
* add function signature and behavior comment

* add test

* move chassis codes to platform config!

* add a shared chassis code test

* function

* test matching

* this commit isn't complete yet

* Revert "this commit isn't complete yet"

This reverts commit ae77d5cd54.

* need to check WMI

* TODO: test WMI

* test wmi

* radar FW sanity check

* fix test

* fixes from merge

fixes from merge

* whoops

* fix static analysis!

* do match_fw_to_car

match_fw_to_car takes vin

* makes sense to keep it one function, and we can return exact or fuzzy!

* clean up

* kinda pointless

* fix more tests

* back to function being only fuzzy

* revert test_fw_fingerprint

* revert test_fw_fingerprint

* simplify

* clean up/fixes

* rename test

* less duplicatey WMI descriptions

* fix

* convert to enum

* I am confident about these WMIs

* these are also good

* we support 5N AUS/NZ and NAR (North American) AX Tiguans

fixes

* Tiguan also Mexico

* only one user for caddy

* got from the test route

* check that the gateway type matches the platform (each platform has 1 or 2 types)

* ~gateway~ -> exact FW match

* remove re

* ensure WMIs are set

* actually no reason to delete

* move comment up to the platform config

* proper wmis typing

* spacing

* flip
old-commit-hash: 6acf763db4
2024-04-12 22:00:03 -07:00
Shane Smiskol 73e68010ae VW: get VIN from camera without comma power (#31851)
* add VW camera to VIN addrs

* correct VW query

* consistent

* update refs
old-commit-hash: 22aa9a436d
2024-04-08 16:36:13 -07:00
Shane Smiskol 21b5663ecb Hyundai: clean up FW queries (#32022)
* mark MULTI as logging

* rm whitelists

* rm MULTI

* major clean up :D

* faster refs :D

* wow this was a broken test (can fd can be without aux, and this allowed eps)

* expected

* only for camera (needs test change)

* Revert "only for camera (needs test change)"

This reverts commit 6156bcd674.

* better msg

* yes we do
old-commit-hash: 1306edd085
2024-03-26 20:49:08 -07:00
Shane Smiskol 59f94e8134 Honda Civic 2022: fix spotty camera query (#31963)
* no extra ecu

* cmt

* documentation

* update refs

* nice

* for testing

* byebye

* Update launch_openpilot.sh
old-commit-hash: d5cd457f82
2024-03-21 18:49:18 -07:00
Shane Smiskol 2fc4b2ebd6 Subaru: log alt request (#31812)
* add alt query (same as Hyundai)

* refs
old-commit-hash: 5be3f0b7db
2024-03-08 19:36:33 -08:00
Shane Smiskol ae84cb4fc5 Subaru: extra logging request for camera (#31783)
* 7f - service not supported in active session

* update refs

* rm short

* Apply suggestions from code review

* bus 0
old-commit-hash: 66adf8781e
2024-03-08 17:00:07 -08:00
Robbe Derks 8a2766a86b Tesla Raven (#29947)
* fingerprinting

* wip

* bug

* fix another bug

* fix rebase

* clean up raven

* forgot to save

* one more rename

* one more rename

* radar fixes

* AP1 also has bosch radar

* put back dashcamOnly

* small fixes

* raven flag

* fix bug

* fix raven flag

* bump opendbc

* fix radar trigger for non-raven

* fix tests?

* bump panda

* more test fixes

* tesla fingerprinting is a bit slower now

* fix tests

* bump opendbc

* bump submodules to master

---------

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7177ec0631
2024-03-06 21:14:48 +01:00
Shane Smiskol 477e4253f6 GM: add more FW logging (#31633)
* add more DIDs

* one more

* update refs

* rm

* btr

* Update selfdrive/car/gm/values.py
old-commit-hash: ec9856b784
2024-02-28 18:01:58 -08:00
Cameron Clough f7eed2aabf Ford: log interesting module configuration data (#31569)
* Ford: log interesting module configuration data

Ford ECUs have what is called "As-Built Data" which is configured at the
factory/workshop to set what packages/features are enabled on the car.
But they also contain vehicle specific information (VIN, make, model,
weight, wheel base...), DTC information and driver preferences.

I dumped the CAN traffic for the FORScan diagnostic tool to see how it
requests this information from the ECUs.

<details>
<summary>FORScan communication with IPMA (camera)</summary>
<pre>
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': '0200'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'TESTER_PRESENT', 'hex': '00'}
{'addr': 1806, 'type': 'positive_response', 'service': 'TESTER_PRESENT', 'hex': '00'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f190'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00020799dbaa10296516a440000000000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f113'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x13JX7T-19H406-CH\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1134a5837542d3139483430362d434800000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f188'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x88JX7T-14F397-AH\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1884a5837542d3134463339372d414800000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f120'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1 JX7T-14F397-BF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1204a5837542d3134463339372d424600000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f121'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f124'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1$JX7T-14F398-AG\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1244a5837542d3134463339382d414700000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f125'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1%JX7T-14F398-BF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1254a5837542d3134463339382d424600000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f126'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f10a'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f111'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x11JX7T-14F403-CA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1114a5837542d3134463430332d434100000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f18c'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x8c182762191\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f18c31383237363231393100000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f162'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f110'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x10DS-JX7T-19H406-AD\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f11044532d4a5837542d3139483430362d414400000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': '0202'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd100'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd10001'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd700'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd70001010101'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd701'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd70101020000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'dd01'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'dd010102f8'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f113'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x13JX7T-19H406-CH\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1134a5837542d3139483430362d434800000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'fd08'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'fd0800000500500100300000000000000000000000300000000000000000200100400300100200001200f00300500000000000000300c00b00400200000000000000000000000000000000200f01201e01501400a00200200400700d02501d01700700e06405005e05503401100a000000002002002001000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'fd09'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'fd09ffec0001fef60002'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00020799dbaa10296516a440000000000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DTC_INFORMATION', 'hex': '028f'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DTC_INFORMATION', 'hex': '02ff50019768c253002cc401862cc418862c'}
... skip DTC requests ...
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00020799dbaa10296516a440000000000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de01'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de01fd5616db5fffff557fe1f842080000000800000008000000080000000819bfe00f7c00000000000000000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de02'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de02800000008000000080000000800000008337fc00800000008000000080000000800000008337fc0000000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de03'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de03fffc26c3800000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de04'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de04546a8c0000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de05'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de06'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de07'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de08'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de09'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de0a'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de0b'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de0c'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de0d'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de0e'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
</pre>
</details>

Using UDS service `READ_DATA_BY_IDENTIFIER`, we can read the As-Built
blocks from `0xDExx` with no diagnostic session/security access necessary.

I used [Online As-Built databases](https://cyanlabs.net/asbuilt-db/) and
various coding spreadsheets shared online to find values we might be
interested in using for fingerprinting (both vehicle parameters and
identifying the platform).

ABS:
- Payload tier (Base, Mid Payload Upgrade, Heavy Duty Payload
  Upgrade...)
- Wheelbase
- Steering ratio
- Cruise Control Mode (Normal, Adaptive)
- Enable Stop and Go

PSCM:
- Enable Lane Keeping Aid
- Enable Traffic Jam Assist
- Enable Lane Centering Assist

IPMA (Q4):
- Steering ratio
- Wheelbase

APIM (Sync 3 and Sync 4):
- Steering ratio
- Vehicle weight
- Wheelbase

There are more potentially useful signals which I haven't included
although they might not be necessary:
- Vehicle (Ford platform code, like "C344" or "C519" - although the
  source of the mapping from index to code is FORScan and not Ford
themselves unless we can find a better source).
- Fuel type
- Vehicle length/height/front track/rear track
- Tire circumference (could be useful for converting wheel speed rad/s
  to m/s)
- Steering angle source (Pinion, Wheel)
- Country code (letters, e.g. US, CA or UK)
- Transmission type
- CAN network architecture
- More feature flags (the APIM also stores settings for ACC, LCA, BLIS)

The full list of settings I have found is
[here](https://github.com/incognitojam/op-notebooks/blob/main/ford/settings.py).

* FwQueryConfig: add data_requests

* add car_data to CarInterface get_params

* Revert "add car_data to CarInterface get_params"

This reverts commit aa161a6b82.

* test_ford: add APIM ecu address

* Revert "FwQueryConfig: add data_requests"

This reverts commit dc5484a9b8.

* fix block numbers and add extra queries

* bump test_fw_query_timing

* add missing query whitelists

* simplify asbuilt requests

* use forscan block ids

* formatting

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: c724d1c86c
2024-02-27 04:22:10 -08:00
Shane Smiskol e0322ba82f Volkswagen: log FW on non-OBD buses (#31556)
* log lots

* update refs

* cmt
old-commit-hash: 72a7f008ab
2024-02-23 04:00:28 -08:00
Shane Smiskol 0766214043 Ford: add back OBD queries for logging (#31543)
* Revert "Reapply "Ford: don't fingerprint on engine (#31195)" part 2 (#31320)"

This reverts commit 69a5ada092202482380241584ecdb6a3424b0087.

* fix refs

* mark logging
old-commit-hash: a2bda8724d
2024-02-22 01:34:15 -08:00
Shane Smiskol 7089ac644b TestFwFingerprint: test to prevent mismatches when utilizing non-essential ECUs (#31478)
* test

* same speed
old-commit-hash: baa77ced19
2024-02-15 00:35:21 -08:00
Shane Smiskol df43e2539d Leaf: get VIN (#31398)
* Add Leaf VIN query

* add lots of requests

* add exception for nissan

* no more logging

* update refs

* lower worst case

* Update selfdrive/car/car_helpers.py

* update refs

* it's the vcm!
old-commit-hash: c65dfaac68
2024-02-14 20:06:14 -08:00
Shane Smiskol 8e7578fc23 VIN: lower retries (#31471)
* lower retries

* comment
old-commit-hash: 9acc55861c
2024-02-14 17:08:12 -08:00
Shane Smiskol 7ef1812968 fix static analysis
old-commit-hash: 0355ceaeac
2024-02-07 19:57:33 -08:00
Shane Smiskol b8952216c0 test_fw_fingerprint: remove timeout
it's fast now
old-commit-hash: 1b0a4746eb
2024-02-07 19:47:20 -08:00
Shane Smiskol 6d956f9297 Hyundai: log camera manufacture date (#31345)
* log manufac date

* oof

* should be safe

* update refs
old-commit-hash: fabec99645
2024-02-07 00:07:01 -08:00
Shane Smiskol b0f087bb7d Hyundai: add PT queries for all ECUs (#31334)
* We never had any bus 0 logging queries for CAN!

* should be logging

* try all, and try on can fd as well

* update refs

* oof forgot about hda2 can fd where pt is bus 1

* sheesh

* fix the timing

* fix ref
old-commit-hash: bcd29a2b8a
2024-02-06 20:37:26 -08:00
Shane Smiskol 07bb2e7e89 FW query timing test: fix total reference time (#31344)
* We never had any bus 0 logging queries for CAN!

* should be logging

* try all, and try on can fd as well

* update refs

* oof forgot about hda2 can fd where pt is bus 1

* sheesh

* fix the timing

* not here

* revert

* this just simply measured the total time of all the brands with aux queries (1.25s)

* clean up
old-commit-hash: 4ec0ed311c
2024-02-06 20:10:06 -08:00
Shane Smiskol 6171b1b6f3 Reapply "Ford: don't fingerprint on engine (#31195)" part 2 (#31320)
* Reapply "Ford: don't fingerprint on engine (#31195) part 2"

This reverts commit 0dccc2ab5776145bc3458d75c7c8b6ad51fff57d.

* add comment

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>

---------

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
old-commit-hash: dd6065c33b
2024-02-05 23:57:46 -08:00
Shane Smiskol 680169a4c9 Revert "Ford: don't fingerprint on engine (#31195)"
This reverts commit d104dcd9dbf3a79dbfca57dd0385ea6f2a44ab64.

old-commit-hash: 7694712cd6
2024-02-05 01:35:39 -08:00
Shane Smiskol fee938a524 FW_QUERY_CONFIGS: type annotate (#31265)
* annotate

* fix

* clean up

* test

* clean up

* space

* fix
old-commit-hash: c9bd4e4c0d
2024-02-01 21:01:31 -08:00
Shane Smiskol e2059a9293 fw_versions: type annotate test_brand_ecu_matches (#31272)
* test this

* we
old-commit-hash: 341f8420db
2024-02-01 15:11:10 -08:00
Shane Smiskol 55f88260d1 Mazda: use bus 0 to fingerprint (#31261)
* for testing

* switch OBD port to logging

* revert

* cmt

* cmt

* remove OBD query

* Update selfdrive/car/mazda/values.py
old-commit-hash: f0b6f48948
2024-02-01 00:28:00 -08:00
Cameron Clough a2db032930 Ford: don't fingerprint on engine (#31195)
* Ford: do not fingerprint engine

* add notebook

* Ford: add missing Explorer FW

* revert

* revert

* Revert "revert"

This reverts commit ad32feaa68.

* TestFwFingerprintTiming: try these

* TestFwFingerprintTiming: update total ref time

* remove notebook

* fix ref

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 1d1c9936cf
2024-01-30 02:42:33 -08:00
Shane Smiskol b41683d323 GM: FPv2 logging (#31221)
* bump

* from https://github.com/commaai/openpilot/pull/27929

* get VIN on bolt!

* might as well try on other gms

* remove vin

* ugh gm is going to be slow

* fix

* should really fix this

* revert

* happy?1

* fix unit test

* bump

* functional addressing must be an OBD gateway feature, this does nothing

* fix vin response

* fix addr!

* finally fix fw_versions bugs since boardd IsOnroad refactor

* for

* only bus 0

* clean up

* Update selfdrive/car/gm/values.py

* ChatGPT re-write

* filter out did

* todo

* oof

* preview: what multiple DIDs per ECU would look like in the future

* Revert "preview: what multiple DIDs per ECU would look like in the future"

This reverts commit 88f0d8611e.

* function to get all ecus

* we can remove this!

* can also do this!

* and this one too :o

* consistency

* yay

* clean up
old-commit-hash: 06f0e50964
2024-01-30 02:19:12 -08:00
Shane Smiskol 849504bfe7 FPv2: support FwQueryConfig with no FW versions (#31227)
* bump

* from https://github.com/commaai/openpilot/pull/27929

* get VIN on bolt!

* might as well try on other gms

* remove vin

* ugh gm is going to be slow

* fix

* should really fix this

* revert

* happy?1

* fix unit test

* bump

* functional addressing must be an OBD gateway feature, this does nothing

* fix vin response

* fix addr!

* finally fix fw_versions bugs since boardd IsOnroad refactor

* for

* only bus 0

* clean up

* Update selfdrive/car/gm/values.py

* ChatGPT re-write

* filter out did

* todo

* oof

* preview: what multiple DIDs per ECU would look like in the future

* Revert "preview: what multiple DIDs per ECU would look like in the future"

This reverts commit 88f0d8611e.

* function to get all ecus

* we can remove this!

* can also do this!

* and this one too :o

* consistency

* yay

* add tests

* revert GM stuff

* another PR

* reads better

* revert rest of gm

* use that

* interesting

* these are exactly the same (with ordering differences)

* Revert "these are exactly the same (with ordering differences)"

This reverts commit a9e918dc35.

* flip
old-commit-hash: 2c0f7b8727
2024-01-30 02:08:08 -08:00
Shane Smiskol b2fcda8419 GM camera ACC: get VIN from camera (#31224)
* bump

* gm vin

* that's not right

* only check relevant buses

* instead try queries for each bus first

* clean up

* use default retry in function

* all
old-commit-hash: c3fcf75737
2024-01-29 23:24:21 -08:00
Shane Smiskol 2e4f6b23fe Honda: add logging request for radarless Civic 2022+ camera (#31176)
* try tester present

* radar

* rm whitelist

* refs
old-commit-hash: 52d7cfa689
2024-01-25 23:58:27 -08:00
Shane Smiskol 7c70aef5de vin: reduce retries (#31175)
reduce retries
old-commit-hash: c99cd3251b
2024-01-25 22:40:39 -08:00
Shane Smiskol ff6ae8f1b9 VIN: query on bus 0 to log data (#31165)
* query on bus 0

* fix

* log vin_rx_bus

* fix!
old-commit-hash: 289868297e
2024-01-25 18:01:49 -08:00
Shane Smiskol f01651d440 Nissan: log FW responses on bus 0 (#31138)
* nissan: log FW responses on bus 0

* update refs
old-commit-hash: b9ad854451
2024-01-23 23:12:48 -08:00
Shane Smiskol 8200f32b5f FW query timing test: mock inconsistent, timing-based functions (#31048)
* Revert "Revert "FW query timing test: mock get_data function for timeout" (#30696)"

This reverts commit 799cdee1e97bd45946ffb31a03e1fcc1c5da5ac6.

* no thread

* clean up a bit

* no thread!

* combine functions

* re-enable total time check

* back to 5

* minimal diff

* minimal diff
old-commit-hash: f96aa247cc
2024-01-17 19:05:31 -08:00
Justin Newberry ff12759e80 Move all fingerprints to fingerprints.py (#30790)
* move fingerpints

* fix circular imports

* fix circular imports

* fix auto fingerprint

* fix those tests

* and controlsd

* add labeler rule

* no defaultdict
old-commit-hash: 28eed156e0
2023-12-18 14:04:27 -08:00
Shane Smiskol 4596da1508 Revert "FW query timing test: mock get_data function for timeout" (#30696)
Revert "FW query timing test: mock get_data function for timeout (#29712)"

This reverts commit 3014e27e57cf3a281eac656391615299ba981958.
old-commit-hash: b1ecfd55ce
2023-12-11 22:12:21 -08:00
Justin Newberry 05a6da6e96 FW query timing test: mock get_data function for timeout (#29712)
* use a mock function to simulate timeout

* Cleanup

* Cleanup

* clean refs

* tolerance can also go down

* fix

* better name

revert refs

* use unittest

* revert

* Revert "use unittest"

This reverts commit 7a1d6a6fc7.

* order

* local

* use a context

* revert

* stress test it

* let's try

* it's consistent

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 4028cb6121
2023-12-11 19:24:01 -08:00
Shane Smiskol cf9ed48dfb FW fingerprinting timing: fix refs (#30566)
old-commit-hash: e687be939e
2023-11-30 16:36:20 -08:00
Justin Newberry cc625f1a0c Subaru: non-obd FW queries logging (#30552)
* add subaru logging fw

* whitelist + comma

* whitelist is empty for the other requests

* all whitelisted
old-commit-hash: a2bb41e0ec
2023-11-29 17:47:09 -08:00
Shane Smiskol ef8028f134 Car tests: fix serialize error on fail (#30185)
* Update test_toyota.py

* fix others

* fix
old-commit-hash: 9350b7e179
2023-10-06 00:07:37 -07:00
Justin Newberry 5b1e60f5da Pytest: enforce a default timeout (#29793)
* pytest: enforce default timeout

* disable that for now

* 30 second timeout on tests
old-commit-hash: b0a71d4553
2023-09-07 17:53:51 -07:00
Justin Newberry 839e72de70 CI: use pytest for unittesting (#29709)
* switch to pytest

* static analysis

* fix the helpers

* static analysis

* remove that

* more parallel test

* cleanup

* static analysis

* durations min and tolerance

* reduce those iterations

* sleep time could be decreased too

* in case it's negative

* try using caching

* remove parallelization for first PR

* PR Cleanup

* reduce diff

* fix that

* bump panda
old-commit-hash: ca435d3447
2023-09-04 11:54:35 -07:00
Shane Smiskol aa3c44dcdd FW query timing test: fix refs (#29692)
* fix refs

* don't round added values

* fix
old-commit-hash: 3cc328163b
2023-08-28 17:52:49 -07:00
Shane Smiskol 7ecfda8b79 Revert "FW query: query one sub-address in parallel" (#29550)
Revert "FW query: query one sub-address in parallel (#28675)"

This reverts commit 3d4c32284699dfd4f78bb2f5bb645344c98f1b46.
old-commit-hash: 365bdd3422
2023-08-23 01:41:28 -07:00
Shane Smiskol c5099d5000 FW query: query one sub-address in parallel (#28675)
* put one subaddr in parallel_addrs

* p

* remove print

* update test refs

* test

* revert test changes

* do same in present ECU query, lower threshold to catch (~0.82 to ~0.72 right within bounds)

* type

* clean up

* update test ref
old-commit-hash: 861ceb2fee
2023-08-23 01:31:04 -07:00
Shane Smiskol c9ca332b3f Update FW query total time
old-commit-hash: 1ea310b202
2023-08-22 23:58:29 -07:00
Shane Smiskol 4699eed8f3 FW Query: test noOBD queries on aux panda (#29547)
* huh, this test just works!

* fix

* Update selfdrive/car/tests/test_fw_fingerprint.py
old-commit-hash: 7de9842245
2023-08-22 23:43:52 -07:00