Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyundai: parse 3 character date code #31254

Closed
wants to merge 8 commits into from
Closed

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Feb 1, 2024

  • TODO: understand this with data. Is it a revision tied to the date in time?

@commaai commaai deleted a comment from github-actions bot Feb 2, 2024
@commaai commaai deleted a comment from github-actions bot Feb 2, 2024
@commaai commaai deleted a comment from github-actions bot Feb 2, 2024
@sshane
Copy link
Contributor Author

sshane commented Feb 2, 2024

From all our Tucsons with VINs, no collisions from other model years. Looks promising! First two characters are usually different from other platforms, so we can't tell exactly which MY it corresponds to yet, but we should be able to fuzzy fingerprint with the min/max range. Wondering what comes after Z 🤔

('Model', 'Model Year') 

('Tucson', '2024')
b'14Z' 31345a 3224666 66  # date code, as hex, as int, last 2 digits

('Tucson', '2023')
b'14X' 313458 3224664 64
b'14X' 313458 3224664 64
b'14X' 313458 3224664 64
b'14W' 313457 3224663 63
b'14W' 313457 3224663 63
b'14T' 313454 3224660 60
b'14T' 313454 3224660 60
b'14T' 313454 3224660 60

('Tucson', '2022')
b'14M' 31344d 3224653 53
b'14K' 31344b 3224651 51
b'14G' 313447 3224647 47
b'14G' 313447 3224647 47
b'14E' 313445 3224645 45
b'14A' 313441 3224641 41
b'14A' 313441 3224641 41
b'14A' 313441 3224641 41

There are some conflicts with the Santa Fe and Optima G4 FL, but they may be explained by the fact that this code is more of an overall part revision code rather than a specific date:

View

If you check the camera part numbers in our database they are very similar while Tucson's vary a bit more.

('Santa Cruz', '2023')
b'14X' 313458 3224664 64
b'14X' 313458 3224664 64
b'14M' 31344d 3224653 53

('Santa Cruz', '2022')
b'14M' 31344d 3224653 53
b'14M' 31344d 3224653 53

('Optima', '2019')
b'h32' 683332 6828850 50
b'h32' 683332 6828850 50

('Optima', '2020')
b'h32' 683332 6828850 50

@sshane
Copy link
Contributor Author

sshane commented Feb 7, 2024

ECU_MANUFACTURING_DATE = 0xF18B worked on our EV6's camera, perhaps we add this query to log the date for a release.

Copy link
Contributor

This PR has had no activity for 30 days. It will be automatically closed in 7 days if there is no activity.

@github-actions github-actions bot added the stale label Mar 10, 2024
Copy link
Contributor

This PR has been automatically closed due to inactivity. Feel free to re-open once activity resumes.

@sshane
Copy link
Contributor Author

sshane commented May 7, 2024

Note that the major and minor version is also bumped when the raw plaintext date is bumped, so we can potentially use that for both types of FW (plaintext and 3 character date code). One caveat is that the versions are specific to the part numbers, so you must group by that.

  ...
  CAR.HYUNDAI_TUCSON_4TH_GEN: {
    (Ecu.fwdCamera, 0x7c4, None): [
      #                               MAJR MINR part number
      b'\xf1\x00NX4 FR_CMR AT EUR LHD 1.00 2.02 99211-N9000 14E',

      b'\xf1\x00NX4 FR_CMR AT CAN LHD 1.00 1.01 99211-N9100 14A',
      b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.01 99211-N9100 14A',

      b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N9210 14G',

      b'\xf1\x00NX4 FR_CMR AT EUR LHD 1.00 1.00 99211-N9220 14K',
      b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N9220 14K',

      b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N9240 14Q',
      b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.01 99211-N9240 14T',

      b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N9250 14W',

      b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N9260 14Y',
    ],

  ...

  CAR.HYUNDAI_IONIQ_5: {
    (Ecu.fwdCamera, 0x7c4, None): [
      #                             MAJR MINR part number
      b'\xf1\x00NE1 MFC  AT EUR LHD 1.00 1.06 99211-GI000 210813',

      b'\xf1\x00NE1 MFC  AT EUR LHD 1.00 1.01 99211-GI010 211007',
      b'\xf1\x00NE1 MFC  AT EUR RHD 1.00 1.01 99211-GI010 211007',
      b'\xf1\x00NE1 MFC  AT USA LHD 1.00 1.01 99211-GI010 211007',
      b'\xf1\x00NE1 MFC  AT USA LHD 1.00 1.02 99211-GI010 211206',
      b'\xf1\x00NE1 MFC  AT EUR RHD 1.00 1.02 99211-GI010 211206',
      b'\xf1\x00NE1 MFC  AT USA LHD 1.00 1.03 99211-GI010 220401',
      b'\xf1\x00NE1 MFC  AT USA LHD 1.00 1.05 99211-GI010 220614',
      b'\xf1\x00NE1 MFC  AT KOR LHD 1.00 1.05 99211-GI010 220614',
      b'\xf1\x00NE1 MFC  AT USA LHD 1.00 1.06 99211-GI010 230110',
      b'\xf1\x00NE1 MFC  AT EUR LHD 1.00 1.06 99211-GI010 230110',

      b'\xf1\x00NE1 MFC  AT KOR LHD 1.00 1.00 99211-GI020 230719',
      b'\xf1\x00NE1 MFC  AT USA LHD 1.00 1.00 99211-GI020 230719',
    ],
  ...

@sshane
Copy link
Contributor Author

sshane commented Aug 20, 2024

We've moved the car interfacing code to our opendbc repository, which is now the new home for car ports and fingerprints. Please re-open your pull request against opendbc at your convenience by using this command below. This will transform all changes under selfdrive/car/ to opendbc_repo/opendbc/car/. Make sure you have initialized submodules beforehand and have checked out the latest opendbc commit.

PR_NUMBER=33045
curl -L https://github.com/commaai/openpilot/pull/$PR_NUMBER.patch | sed -e 's/selfdrive\/car/opendbc_repo\/opendbc\/car/g' | git apply -v --reject

Simply replace the PR number with your own. Once done, add the files, fix any conflicts, and open a new PR. Alternatively, you may start a new PR from scratch if that is easier for you.

@sshane sshane closed this Aug 20, 2024
@adeebshihadeh adeebshihadeh deleted the hkg-parse-3-char-date-code branch August 28, 2024 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant