Commit Graph

24 Commits

Author SHA1 Message Date
Shane Smiskol
6acf763db4 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 ae77d5cd54e1f43d390fb70c4da38a95ac34f8da.

* 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
2024-04-12 22:00:03 -07:00
Robbe Derks
7177ec0631 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>
2024-03-06 21:14:48 +01:00
Cameron Clough
995250ae49 use pyupgrade to update to new typing syntax (#31580)
* add pyupgrade hook

* run pyupgrade (pre-commit run -a)

* ruff --fix

* Revert "add pyupgrade hook"

This reverts commit 56ec18bb6b8602a0b612f3803d96cdad14b52066.

* revert changes to third_party/

* manual type fixes

* explicit Optional wrapping capnp objects
2024-02-24 16:41:23 -08:00
Shane Smiskol
62c51e2d0c HKG CAN FD: fix bus 0 VIN addr
Added camera addr instead of cluster on accident here: https://github.com/commaai/openpilot/pull/31348
2024-02-14 23:35:59 -08:00
Shane Smiskol
c65dfaac68 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!
2024-02-14 20:06:14 -08:00
Shane Smiskol
8f5dcb3019 HKG CAN FD: potentially get VIN without OBD port on some platforms (#31348)
* add cluster

* think this works

* update refs

not 1

* only add the new address

* bb

* comment
2024-02-07 00:23:16 -08:00
Shane Smiskol
55cc3989d8 Ford: add ABS address to get VIN without OBD port (#31308)
* consider ford abs

* cmts

* fix

* who

* Revert "who"

This reverts commit eef45b147fab715a9f35b9712e8b9d7ebb1b2fdf.

* this doesn't work correctly

* add cmt

* fix

* Revert "fix"

This reverts commit 60dfe09c426e74293711df9e2f3b2f75cf3a1da9.
2024-02-05 21:48:57 -08:00
Shane Smiskol
c9bd4e4c0d FW_QUERY_CONFIGS: type annotate (#31265)
* annotate

* fix

* clean up

* test

* clean up

* space

* fix
2024-02-01 21:01:31 -08:00
Shane Smiskol
2c0f7b8727 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 88f0d8611e638de644adc5feabade848c03d59e4.

* 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 a9e918dc351d24f1b7c8a05c7ec402e057a0e09a.

* flip
2024-01-30 02:08:08 -08:00
Shane Smiskol
c3fcf75737 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
2024-01-29 23:24:21 -08:00
Shane Smiskol
3a0033e81e vin: fix retry logging (#31225)
* retry should really be outside inner query loop

* just req

* nls

* bump

* rmnl

* useful to have

* is it though
2024-01-29 21:28:29 -08:00
Justin Newberry
adca970ca9 cleanup fingerprinting typing (#30801)
* wip

* undo + add can fingerprints

* add can fingerpints

* those should go there
2023-12-19 09:41:09 -08:00
Justin Newberry
28eed156e0 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
2023-12-18 14:04:27 -08:00
Shane Smiskol
09ce869ee7 fw_versions: clean up some typing (#29350)
* another common type

* here too

* unused
2023-08-11 18:37:17 -07:00
Shane Smiskol
f788edb6a5 HKG: use platform codes to fuzzy fingerprint (#28531)
* get gas/ev/hev from FW (not all correct, poc)

* add test for essential ecus for fuzzy fingerprinting

* kinda works

* stash

* clean up

* add code

* simpler

* use the function

* test it with our cars

* no re

no re

no re

* debugging

* handle empty dict

* simpl

* this is promising

start on making existing fingerprinting functions use the config, instead of entirely replacing them

* needs to allow 1 match

* lay out how this should look

* changes

* executable

* some work

* use config

* fuzzy ecus

* config test

* comment and some clean up

* test platform codes

* use regex, simpler and fixes bug

* in func

* rm bad func

* typing for new func and remove old from dc

* todo done

* tested!

* remove fake platform codes

* thought we needed this, but actually...

* not needed

* not applicable any more

* use config for essential ecus

* first draft of test to make adding/removing fuzzy FP platform intentional

* compile

* clean up test

* even cleaner

* fix default ecus type

* temp fix

* this is mostly in tests now

* test every fuzzy ecu fw returns one platform code

* experiment with dates

* Revert "experiment with dates"

This reverts commit 3251b9cc5c3ca41ca92c8b75ad9b2234b720aa0b.

* clean that up

* comment

* test

* work on all cars

* fix fuzz_fw_fingerprint

* comment

* get first by search

* bit more clean up

* and more

* use compiled pattern for nicer syntax

* default

* flip dat around, much cleaner

* clean up hyundai test a bit

* flip order

same here

* rename test and flip subTest

* fix pylint

* revert fw changes

revert fw changes

* line

* add original functions to test

* needs to be a list

* cmt

* draft (need to count one ecu as a match)

* tiny clean up

* todo: date range

* only in notebook

* remove comment (still can be either list or set)

* same, only notebook

* more consistent signature

* copilot inspired

* copilot no good

* test for date parsing

* better name

* good, now we don't have to worry about the dates mismatching in another test/logic

* comment up+

* some stuff

* clean up

fix test

fix test

* test

* comment

* use utils

* clean up (utils are cleaner and less buggy)

* clean up (utils are cleaner and less buggy)

* fixup test

* use a dash (prettier) and remove some platforms that can fingerprint now!

* compile global pattern

* same as what we do in values

* remove comments

* fuzzy_get_platform_codes is one or none here

* more clean up

* sort imports

* woah woah woah

* add comment

* fix reassigning different types

* add types

* adapt fuzzy test recently added (nice it caught this!)

* update lock

* options

comments

* stash

* comments and fixes

* better comments

* better

* test: run on exact fuzzy matching logic, same results!

* use match_fw_to_car

* test all fw

* ex

* unused random

* this is a possibility

* this is more clear

* fix

* revert

* revert to needing both ECUs to match to reduce false positives, test

* fix excluded platform test :( but it's ok

* add comment

* we actually want to only test fuzzy ecus to make it explicit

* fix mypy

* comment for tomorrow

* just add matches with fuzzy FP

* add comment

* this was the cleanest I could think of, but still working on it. not very easy to understand

* think this is better, but also worse...

* comment: reframing how this works

* revert back to what we did before

* was swapped

* else set

* remove old comment

* fixes from merge

* remove fuzzy_min_match_count from this pr

* fix static analysis

* also unused

* different method first draft

* copy existing fuzzy func

* check all possible ecus exist, only platform codes, slightly refactor main loop

* fix

* Revert recent

Revert "fix"

This reverts commit 5cdb7bda835f1e48e750ab4195e891afe08e11ea.

Revert "check all possible ecus exist, only platform codes, slightly refactor main loop"

This reverts commit d3e918fa20fa4ce881445850f5f7428a3c11adf8.

Revert "copy existing fuzzy func"

This reverts commit 34c8c0545097c84f55f4b4f61907606c93760ddd.

Revert "different method first draft"

This reverts commit b91139055d7d1802c1eb726504798c156a183c9c.

* new func

* fixup test

* remove changes from v1 from fw_versions.py

* clean up a bit

* return part as part of code

* fix test

* add original fuzzy function

* add an ecu match if the date is within range (or date doesn't exist)

* add format for what we're going to do

* not working stash

* the exact matching function does more of what we want with less code and less custom logic

* we don't care about found versions, only codes and dates

* actually we do have an exception

* this works pretty nicely now

* up here

* this is better

* some minor clean up

* old function=now junk

* fix platform code test

* remove old platform code function

* now rename _new to

* use FW_QUERY_CONFIG

* clean up imports

* rename that too

* one line

* correct typing

correct typing

* draft tests

* so that works

* fixup excluded platform test now too

* this is tested by excluded platform test

* test parts and dates

* remove old comment

* old import

* take platform code stuff out of FwQueryConfig

* fix test

* revert debug script

* flip order

* make this a set by default

* revert this part

* correct typing

* clean up comments

* clean that test up too/pylint

* combine these three tests ina clean way

* not right

* more general

* be consistent with quotes

* comment

* comment

* comment in fw_versions

* flip order

* this is more readable

* could test all this, but it's tested in test_hyundai and doesn't do a lot here

* only assert brands which use this

* invalidate all CAN FD ICE and hybrid

* tuple

* can get away without filtering

* add comment reasons

* fix

* some review suggestions

* this works (first draft)

* this is better

* script to print platform codes and dates

* sanity check for dates are in correct ecus and platforms

* mypy

* better variable name and comment

* rename

* same

* slightly better name

* subset

* exclude platforms and live car without dates

* consistent

* self explan

* better name

* test to make sure the functions agree

* clean that up

* comment

* we get other responses from queries not in DB, only check any

* not used or typed
2023-06-15 02:50:45 -07:00
Shane Smiskol
572a221a86 FwQueryConfig: remove platform codes (#28538)
* bring platform codes out of config for now (can re-introduce later)

* clean that up

* flake8

* comment

* comments and better test names

* typo

* Update selfdrive/car/hyundai/tests/test_hyundai.py

* Update selfdrive/car/hyundai/tests/test_hyundai.py
2023-06-13 20:41:03 -07:00
Shane Smiskol
f5e032b67f FwQueryConfig: add platform code support and tests (#28475)
* add config options

* you know what, platform codes don't need to be related to fuzzy fingerprinting at all

* better comment?

* add comment

* add test from other PR

* add platform code function to hyundai

* comment and add eps!

* clean up config test

* fix test

* add error message to test

* until we have multiple ways a brand can set up fuzzy FP, let's leave func name fuzzy-specific

* rename in comment too

* hyundai tests

* simpler test!

* check all ecus with platform codes

* add types-python-dateutil = "^2.8.19.13"

* these aren't used any more

* Update selfdrive/car/hyundai/tests/test_hyundai.py

* not to imply this is active yet
2023-06-09 22:51:55 -07:00
Shane Smiskol
ecbd7150eb FwQueryConfig: auxiliary field to add requests for first aux panda (#27666)
* mid-solution stash

* pretty cleannnnnnn

* everything seems to be working

* rename

* space

* reduce obd multiplexing transitions from 3 to 1 (0.3s to 0.1s)
2023-03-23 23:47:15 -07:00
Shane Smiskol
42449b482d boardd: ability to switch between ELM safety params (#27656)
* indecisive

* rename to generic FW query

* remove code and update comment

* we need this to start off, unless we set multiplexing immediately

* draft

* draft 2

* try that

* can't do this either, boardd might read Enabled after removing, but before setting new Request param

* this should work

* use one less param

* fix params

* match behavior (set all pandas to safety param of 1, disabling multiplexing for fingerprinting

* clean up (some tests may temp break)

* fix param name and sort

* time it

* yes it does matter

* add to hyundai's bus 5 query

* remove hyundai for now

* this should work

* clean up

* clean up

* flip argument around, clean up

* fix test_startup

* some clean up

* rm line

* comment makes more sense

* required typing

* clean up common type

* comments

* Update selfdrive/car/car_helpers.py

* line

* whoops, need to set before vin!

* fix debug

* annoying

* more debugging

* bug fix (needs both keys always)

* debuGG

debuGG

* Revert "debuGG"

This reverts commit 55b2f429324c0b92d5cfb2cabf8b20db1e166248.

* Revert "more debugging"

This reverts commit 02934c3403ad5270f03093508b704c151d1ccb2a.

* Revert "annoying"

This reverts commit 8b4e5e09989f9a0217e3ec1c0ba68735929b7366.

* clean that up

* bumpback

* bumpback

* every second write param

* flip

* stuff

* move up?

* fix timing out in CI

* rm
2023-03-23 00:14:31 -07:00
Shane Smiskol
c4b84783a0 Honda Bosch: gather available ECUs from camera (#27180)
* add flag

* actually use in fw_versions.py

* simpler

* not here

* Comment

* better name

* add param and block

* keys

keys

* block

* with a value

with a value

* add query for bosch PT bus

* different name

* fix

* .

* fix test

fix test

* add cloulogs

* mark as logging
2023-02-14 17:55:41 -08:00
Shane Smiskol
f29e19cf42 FPv2: log responses from data collection queries (#27345)
* log responses from logging/debugging queries

* don't add logging FW to FW dict for fingerprinting

* flip?

* fine before

* log if extra in debug ecus

* clean up

* test extra ecus too

* Revert "test extra ecus too"

This reverts commit 8f7867844db95f48631348551551148bf504e37b.

* bump to master
2023-02-14 16:59:20 -08:00
Erich Moraga
d12146fbd6 Add several missing LEXUS_RC firmwares (#26905)
* Add several missing LEXUS_RC firmwares

`@Vranesh#9912` 2020 RC350  DongleID/route d6303cdeea512a4e|2023-01-09--17-11-55

* lexus now has two engines

* todo

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-01-09 18:57:51 -08:00
Shane Smiskol
7e9961b9ac FPv2: support collecting versions for specific ecus (#25699)
* Add VMCU address for EV6

* Rename vmcu

* add to tests

add to tests

* rename to more generic name

* more explicit

* remove print

* Like this much better, removes subtle fingerprinting problems

* clean up

* add test and clean up

* remove hyundai stuffs

* global

* Fpv2Config class

* fix missing fw versions from import order

* unused

* revert for now

* test for fpv2 configs with subtests

* subtests don't work that way

* remove this

* .

* intersection

* print ecus

* shorter

* fix typing

* use config
2022-10-13 17:40:07 -07:00
Shane Smiskol
0ef6bb48df FPv2: move car-specific configuration into interfaces (#25711)
* Add VMCU address for EV6

* Rename vmcu

* add to tests

add to tests

* rename to more generic name

* more explicit

* remove print

* Like this much better, removes subtle fingerprinting problems

* clean up

* add test and clean up

* remove hyundai stuffs

* global

* Fpv2Config class

* fix missing fw versions from import order

* unused

* revert for now

* test for fpv2 configs with subtests

* subtests don't work that way

* do toyota as an example

* revert

revert

* do chrysler

* do rest

* stash

* much smaller of a diff than the alternative

* remove unused test

* fix tests

* remove brand from Request

* Make StandardQueries class

* add missing_ecus

clean up

* rename file

* unused

* test implemented

* add comment and rename

add comment and rename

add comment and rename

* should be impossible now

* this is a fixme

* rename to fw_query

* rename this too

* and this

* move vin queries to class

* order

* can use p16!

* formatting

* whoops, this wasn't gated on not len(found_versions)

* make this clear

* Standardize manufacturer software version query
2022-09-09 16:24:29 -07:00