Commit Graph

403 Commits

Author SHA1 Message Date
cl0cks4fe
dd9d5d4528 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>
2024-05-17 11:01:44 -07:00
Shane Smiskol
593ea504e7 test_car_interface: run CC once (#32449)
run once
2024-05-16 15:41:20 -07:00
Shane Smiskol
d0d44a51a0 card: create pedal pressed event (#32417)
* card: create pedal pressed event (#32393)

* move pedalPressed to card

* rm

* needs to be a builder

* move these

* clean up

* reader later

* Update ref_commit

* moved to card
2024-05-13 16:18:55 -07:00
Shane Smiskol
e5107b1eab debug test_models script fixes (#32362)
* some things were renamed without checking

* fix that
2024-05-06 15:01:06 -07:00
Alexandre Nobuharu Sato
17ec4ad24e Honda: Brazilian HR-V 2023 fingerprint (#32243)
* fingerprint Honda HR-V 2023, brazilian market

* update routes

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-04-21 02:29:43 -07:00
Shane Smiskol
692a21e4a7 lateral limits: remove Subaru exception (#32244)
* remove exception

* update Outback params

* clean up

* adjust to the upper limit

* don't change control, only docs

* rough
2024-04-17 23:36:58 -07:00
Shane Smiskol
5d0dc2ded2 Toyota: remove unecessary ECUs for fingerprinting (#32235)
* remove some ecus

* missing doc

* fix

* fix

* clean up

* update refs

* rm
2024-04-17 00:09:20 -07:00
Shane Smiskol
a076c1e78f FwQueryConfig: test non-essential ecus aren't needless (#32232)
* good test

* remove :D

* typo
2024-04-16 21:49:30 -07:00
Cameron Clough
7bc81341e1 Ford: add Ranger 2024 (CAN FD, dashcam only) (#31956)
* Ford: add Ranger 2024 (CAN FD, dashcam only)

* force fingerprint

* debug

* add FW (using debug_fw_fingerprinting_offline)

* add test route

* Revert "debug"

This reverts commit 9d128cb1bbb28fb0cb8da6725c291ebe285e7467.

* Revert "force fingerprint"

This reverts commit 421d92172f354b4713a1371bec9dc9b1bbb6318f.

* update package and finalise steer ratio

"Adaptive Cruise Control with Lane Centering" is part of the Raptor
Standard Equipment Group (i.e. only on the Raptor trim). However,
looking at As-Built/VIN data for Raptor LARIATs show that although Ford
does not advertise it they do come with Lane Centering (the configurator
only says they have ACC with Stop and Go).

ACC with Stop and Go can also be added to the lower XLT trim as part of
the Technology Package, but it is unclear at this point whether that
includes Lane Centering.

The 2021 Ranger had a 17.0 steer ratio. The As-Built data suggests
17/18. PlotJuggler shows the liveParameters.steerRatio between 16.5-17.5
on two short drives.

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-04-14 18:00:34 -07:00
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
Shane Smiskol
16bb4a9ccd Volkswagen: combine platforms with common chassis codes (#32147)
* fix curb weight for Ateca to match Leon better

https://www.auto-data.net/en/seat-ateca-i-1.6-tdi-115hp-start-stop-23096

https://www.seat.com/content/dam/public/seat-website/car-shopping-tools/brochure-download/brochures/ateca/cars-specs-brochure-KH7-NA-december-2018.pdf

* combine leon and ateca

* combine fw

* migrate

* great, both use same torque params

* scala and kamiq

* remove duplicates

* fix

* fix!
2024-04-09 21:00:56 -07:00
Shane Smiskol
22aa9a436d VW: get VIN from camera without comma power (#31851)
* add VW camera to VIN addrs

* correct VW query

* consistent

* update refs
2024-04-08 16:36:13 -07:00
Shane Smiskol
1306edd085 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 6156bcd674f856e9a6476277d2b14b14b659f597.

* better msg

* yes we do
2024-03-26 20:49:08 -07:00
Shane Smiskol
d5cd457f82 Honda Civic 2022: fix spotty camera query (#31963)
* no extra ecu

* cmt

* documentation

* update refs

* nice

* for testing

* byebye

* Update launch_openpilot.sh
2024-03-21 18:49:18 -07:00
Cameron Clough
90ff0dd047 test_models: migrate fingerprint (#31936) 2024-03-20 10:57:28 -07:00
Justin Newberry
b0eb3ba4f4 cars: platform enums -> prepend brand name (#31927)
* with brand name

* migrate

* Fix

* fixes

* more

* passes

* fix

* fix the doc

* collects

* these too

* more stuff

* body exception :/

* more

* hardcode i guess

* update ref

* toyota

* more toyota

* and here

* final!

* fix notebooks and ccs

* move this here
2024-03-19 17:29:50 -07:00
thenhnn
489528dcae PlatformConfig: automatically get platform_str from the enum name (#31868)
* get platform_str from the enum name

* fix tests

* add migration table

* remove impossible todo

* Add link to PR in MIGRATION table

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Remove useless brand name comments and rename RAM_1500 to RAM_1500_5TH_GEN

* rename RAM_HD to RAM_HD_5TH_GEN

* rename references to RAM_HD and RAM_1500

* change "mock" to "MOCK" and rename torque data of Nissan Leaf 2018 IC

* remove MOCK from fingerprints.py

* change hard-coded car model in test_can_fingerprint.py/test_timing

* migration

* update ref

* space

* prius

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: justin newberry <justin@comma.ai>
Co-authored-by: Justin Newberry <jnewberry0502@gmail.com>
2024-03-19 11:16:02 -07:00
Adeeb Shihadeh
fa12a67228 remove pedal (#31903)
* remove pedal

* bump panda

* fix

* update refs
2024-03-17 22:42:49 -07:00
Justin Newberry
0b92f4e9ee more car info -> car docs (#31885) 2024-03-17 16:53:57 -07:00
Justin Newberry
655e5f7c3e rename CarInfo to CarDocs (#31879)
car info to car docs
2024-03-15 11:45:44 -07:00
Justin Newberry
ca5a2ed942 move getting platform to get_params (#31871)
* better

* string

* not here
2024-03-14 21:58:25 -07:00
Shane Smiskol
5be3f0b7db Subaru: log alt request (#31812)
* add alt query (same as Hyundai)

* refs
2024-03-08 19:36:33 -08:00
Shane Smiskol
66adf8781e 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
2024-03-08 17:00:07 -08:00
Justin Newberry
a919d27afc fix car test routes typing (#31773)
* Fix typing

* and fix test_car_model

* fix
2024-03-07 11:33:40 -08: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
Justin Newberry
25ccb2426c cars: remove CAR_INFO map (#31739)
* no carinfo map

* smaller diff

* not on mock
2024-03-06 11:22:12 -08:00
Shane Smiskol
bf20358440 CI: increase test car interfaces examples (#31641)
* increase

* huh

* Revert "huh"

This reverts commit 1a652cbed06a7c814711db6f2bc6b3146d3aec04.

* no huge fp dicts

* ugh

* try 300

* test

* at least increase a bit
2024-03-01 16:11:48 -08:00
Jason Young
50a754f470 VW PQ: Volkswagen Caddy Mk3 (#31670) 2024-03-01 16:41:56 -05:00
Justin Newberry
b0eae8c1b7 platformconfig and carspecs are now required, carspecs no longer kwarg (#31667)
* required

* mock can be a platform!

* default is mock

* fix that

* and that one
2024-03-01 11:31:51 -08:00
Justin Newberry
a5ee1638b8 Body: move to car specs (#31666)
* specs

* override

* fixes 1

* fix 3

* fixes 4

* fixes

* fixes

* fixc

* fix number 723124

* that too

* fixes

* aa

* do body real quick too

* body too
2024-03-01 10:32:31 -08:00
Justin Newberry
00f2703bbb basic platform config tests 2024-03-01 04:01:59 +00:00
Justin Newberry
5734d7c2bf Honda: move to platformconfig (#31637)
* first

* Fixes

* not

* not

* Fixes

* fix

* cleanup + use sets for now

* update ref

* update ref
2024-02-29 11:29:40 -08:00
Shane Smiskol
ec9856b784 GM: add more FW logging (#31633)
* add more DIDs

* one more

* update refs

* rm

* btr

* Update selfdrive/car/gm/values.py
2024-02-28 18:01:58 -08:00
Shane Smiskol
ce6637cd8f Honda Accord: allow fingerprinting without comma power (#31477)
* Do Accord

* add comment

* good test

* this catches the accord/accordh issue!

* as expected, only if both radar&camera have in common FW does the test fail

* cmt

* clean up

* better

* Use HondaFlags

* detect alt brake

* for test

* hypothesis isn't installed

* test failure

* works

* Revert " works"

This reverts commit bfc0d808abe548630e6507431f13b01e8a1316cb.

* Revert "test failure"

This reverts commit 10ab6eb63ccd411740751b742f31fd610397fe8e.

* Revert "hypothesis isn't installed"

This reverts commit d474cc3f0ed7e84fe8bd24f452b3315fd2b8d47c.

* Revert "for test"

This reverts commit 98e039f4fc0189ccb57c1dae6b344209ef15eb1c.

* this is important too

* clean up

* merge accord fingerprints, test

* remove duplicates

* accordh doesn't have these

* rm

* no unknown

* start over, merge platforms

* add cmt

* note non-essential ecus

* add non essential obd ecus

* combine FW

* format fingerprints (remove dups)

* migrate test models segs

* cmt

* Update ref_commit

* clean up
2024-02-27 20:09:02 -08:00
Cameron Clough
c724d1c86c 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 aa161a6b82082705db97bea2c4317e1888a74845.

* test_ford: add APIM ecu address

* Revert "FwQueryConfig: add data_requests"

This reverts commit dc5484a9b80be5bc61a7fdf55560b8813bc43ef7.

* 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>
2024-02-27 04:22:10 -08: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
Justin Newberry
1161d33c18 Subaru: move carspecs to PlatformConfig (#31550)
* subaru platform config

* forester wrong dbc

* spacing

* subaru car specs

* someday!

* more red diff

* all brands can be done like this

* but this should be done first and thats subaru specific

* that seems very low but we shouldn't change it here

* as long as it subclasses str its fine

* fix
2024-02-23 13:23:40 -08:00
Shane Smiskol
72a7f008ab Volkswagen: log FW on non-OBD buses (#31556)
* log lots

* update refs

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

This reverts commit dd6065c33b.

* fix refs

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

* same speed
2024-02-15 00:35:21 -08:00
Shane Smiskol
b1f452d42b Toyota TSS2: radar disable support (#29094)
* try to disable radar

* fix bug and bump panda

* prep

* always attempt longitudinal for testers

* fix rav4

* send ACC_HUD

* bump panda

* revert

* check for failure to disable

* fix arg

* allow

* this has no effect

* bump

* update docs

* bug fix

* fix

* check relay malfunc for acc control

* remove route where SDSU caused a relay malfunction

* missing rav4

* bump

* use chr route

* bump

* add back

* relay malfunction

* bump to master

* add to releases
2024-02-14 23:27:07 -08:00
Shane Smiskol
622d099d00 Toyota: check ACC_CONTROL for relay malfunction (#31475)
toyota: check acc control for relay malfunction
2024-02-14 21:55:33 -08:00
Shane Smiskol
55ba64568d test_models: add RAV4 route without relay malfunction (#31474)
add it back
2024-02-14 21:41:01 -08:00
Shane Smiskol
0e94567a18 Toyota: only read gas interceptor if we're using it (#31473)
* we shouldn't be reading from interceptor and not writing/sending gas command

* better

* add a test!

* comment is clear
2024-02-14 21:32:44 -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
9acc55861c VIN: lower retries (#31471)
* lower retries

* comment
2024-02-14 17:08:12 -08:00
Adeeb Shihadeh
6f905ed979 radard: remove sleep for cars without radar (#31467)
* radard: remove sleep for cars without radar

* fix

* update refs
2024-02-14 13:12:54 -08:00
Shane Smiskol
9479686fa3 test models: more examples in CI (#31444)
* more examples

* how is it so fast?!

* 500

* is there a hypothesis cache?

all

* Revert "is there a hypothesis cache?"

This reverts commit e628ba73d5b639e36f95df0ab9049697b34a58b8.

* same as jenkins
2024-02-13 23:00:44 -08:00
Eric Brown
416e8253ec GM: Remove Equinox from dashcam mode (#31257)
* Remove Equinox from dashcam mode

* Add fingerprint

* Set moving backward only if not moving forward

* Bump opendbc

* Update moving backward definition

* Update docs

* Bump opendbc

* REVERTME: Add assert statement at Shane's request

* REVERTME: check unsupported and fault status

* Revert "REVERTME: check unsupported and fault status"

This reverts commit 5a0ebad66c4dcd33ee4eb5d0c5d3f036244653e2.

* Revert "REVERTME: Add assert statement at Shane's request"

This reverts commit b4b885eb11ad3079a84033f20f670cc905113bb9.

* Use or

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Add comment

* Add test route

* Use newer fingerprint

* Emtpy commit to rerun CI

* Empty commit to rerun CI

* Update selfdrive/car/gm/fingerprints.py

* little more

* remove from non-tested

* update

* add to releases

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Justin Newberry <justin@comma.ai>
2024-02-12 21:35:44 -08:00
Justin Newberry
78e4508e3b FCA: car port for Dodge Durango 2021 (#31015)
* dodge durango

* add dodge

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* add comment

* more exact

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-02-12 21:04:53 -08:00