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

Add extra DTCs for Volvo 850 & S/C/V70 as well as parser for generating them #99

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

brendandburns
Copy link
Contributor

This is a replacement for #95

Consider it a rough draft to see if it is in the right ballpark. It depends on the refactors in #98

Open questions:

  • Do we want to compile both lists in so that users can select at runtime?
  • Previously there was a desire to split into descriptions and tips, any ideas about how to do this programatically?
  • Should we include the original source files into the repo? I'm not sure about the licensing/OSS implications of that.

Anyway, please take a quick look to see if it is reasonable before we move onto more detailed review.

cc @aaeegg

@aaeegg
Copy link
Contributor

aaeegg commented Apr 24, 2024

I think we ought to merge the lists into a single "best available" list.

The tips are mostly enclosed in parentheses or brackets, or after a newline character.

The Xiaotec import didn't come out quite right - decoded suffix is duplicated in the description string, SRS and ROPS codes ended up in the CI table, duplicate SRS codes for 1 and 2 byte DTCs...

@brendandburns
Copy link
Contributor Author

@aaeegg @fenugrec refactored this to match the changes from that were recently merged.

I think that this is mostly ready to go, modulo the discussion about splitting some of the longer descriptions into descriptions and tips.

Please take a look.

Copy link
Owner

@fenugrec fenugrec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you given thought to combining the arrays ecu_dtc_map[] and ecu_list[] ?
e.g.

    { 0x41, "IMMO", "IMM", dtc_list_41 },
    { 0x42, "CCU ( Cab Control Unit ) aka Convertible Top / Roof Module or Later modules known as CAB (Cab Control System)", "unknown", dtc_list_empty },

One drawback I see is that the ECUs with no known DTC lists need to be handled slightly differently to point to a dummy dtc_list_empty array.

@@ -28,6 +29,7 @@ const struct ecu_info *ecu_info_by_name(const char *name) {
}


#ifdef DEFAULT_850_ECU
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to keep these at all ?

// #define __SCANTOOL_850_DTC_XIAOTEC__

// Sourced from Richard Jones (https://jonesrh.info/volvo850/index.html)
// #define __SCANTOOL_850_DTC_FROBBED__
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why frobbed ?

self.prefix = prefix


# this loads dtcs from the xiaotec file export
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this function just applicable to the xiaotec import ?
Then naming should be made more uniform in comments, function names, and filenames; currently I see inconsistent use of "Aleksi", "richard", "xiaotec", and "frobbed"

for d in dtcs:
key = d.prefix + d.suffix
ecu_key = d.ecu
if ecu_key == '2E':
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wha'ts special about 2E / 2F here ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2E is the left power seat and 2F is the right power seat. The DTCs are the same, only the address is different. (Except on model year '96, where they put them both on 2F, and the tester can't talk to them unless you unhook one or the other. Oops.)

.replace('{{ecu_address}}', ecu.address)
.replace('{{ecu_description}}', ecu.description)
.replace('{{ecu_prefix}}', ecu.prefix))
# ecu_list.append(' { .addr = 0x' + ecu.address + ', .desc = "' + ecu.description + '", .dtc_prefix = "' + ecu.prefix + '" },')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead code ? should be removed

suffix_template = suffix_template.replace('{{ecu_list}}', '\n'.join(dtc_ecu_list))
print(suffix_template)

# Example call: python3 parser.py richard sources/export_2024-04-06_frobbed.txt templates/ frobbed > frobbed.c
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are nice !! Better put them near the top, not hidden way at the end

@@ -0,0 +1 @@
{ .addr = 0x{{ecu_address}}, .desc = "{{ecu_description}}", .dtc_prefix = "{{ecu_prefix}}" },
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned earlier, unless there's a really compelling reason to use designated initializers, I think {0x{{ecu_address}}, "{{ecu_description}}", "{{ecu_prefix}}" }, will be unambiguously clear ?

@aaeegg
Copy link
Contributor

aaeegg commented May 14, 2024

@aaeegg @fenugrec refactored this to match the changes from that were recently merged.

I think that this is mostly ready to go, modulo the discussion about splitting some of the longer descriptions into descriptions and tips.

Please take a look.

@brendandburns @fenugrec

{0x05, 313, "ABS-313: Left Rear Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL},

All the entries in xiaotec.c are like this - the suffix is in the description string when it shouldn't be. The dtc command prints the DTC designator, so you would see it twice - it would print "ABS-313 (05) ABS-313: Left Rear Wheel Sensor...". It appears that the code was not tested or proofread before submitting this PR.

    {0x73, 324, "SRS-324: Right Rear Seat Belt Tensioner signal too high", NULL},
    {0x0001, 112, "SRS-112: Crash Sensor Module internal fault", NULL},

One-byte and two-byte SRS DTCs mixed in the same table, mentioned in #99 (comment) before you "refactored", not fixed.

    {0xFD, 414, "CI-414: Road Speed Signal missing or faulty", NULL},
    {0x01, 112, "SRS-112: Crash Sensor Module internal fault", NULL},

SRS and ROPS DTCs wrongly placed in the CI table! Mentioned in #99 (comment)! Not fixed!

    {0x11, 321, "Left Front Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch].", NULL},
    {0x13, 211, "Left Front Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch].", NULL},

DTC 0x12 for ABS missing from frobbed.c. I had mentioned in #95 (comment) that 888, as in Richard's list, is not the real suffix for this DTC; the suffix is (was) unknown. But although the suffix is unknown, the description is known. Removing the DTC is throwing out the baby with the bathwater.

const struct ecu_dtc_table_map_entry ecu_dtc_map[] = {
    {0x01, dtc_list_01},
    {0x11, dtc_list_11},
    {0x29, dtc_list_29},
    {0x41, dtc_list_41},
    {0x51, dtc_list_51},
    {0x58, dtc_list_58},
    {0, NULL},
};

What happened to 0x7A? All the Motronic M4.4 DTCs are missing from frobbed.c! If you try to scan the EFI of your '98 V70, no DTCs for you!

    {0xFE, 337, "EFI-337: Torque Limiting Signal from DSA faulty", NULL},
    {0x65, 112, "EFI-112: MFI Control Module (CM) fault", NULL},

And in xiaotec.c, the DTCs for EMS2000 and M4.4 have been thrown into one table. That's not going to work.

{0x3F, 551, "EFI-551: Misfire, cylinder 1", NULL},

I mentioned in #95 (comment) that EFI-551...555 and 545 are misfires with catalyst damage, description has not been updated to distinguish them.

{0xA4, 335, "EFI-335: Request for MIL lighting from TCM [P1618] [or possibly Comm Failure between Motronic 4.4 ECM and AW 50-42 TCM]", NULL},

As I mentioned in #95 (comment), before you even opened this revised PR, EFI-335 is not MIL request from TCM.

{0x37, 414, "Driver's (or passenger's) side interior temperature sensor inlet fan seized (or open/short circuit or faulty signal) [carefully clean out any lint from temp sensor fan(s)]; else (inlet)Fan motor passenger comp (interior) temp sensor, Faulty Signal [according to xiaotec \"850 OBD-II\" V1.3.4 app].", NULL},

As I mentioned in #95 (comment), there is no such thing as a driver's or passenger's side interior temperature sensor on any vehicle whose ECC we can talk to. This is the code you observed on your car, and you can verify that the description is wrong because there is only one interior temperature sensor.

I don't think the code in this PR is "mostly ready to go".

I submitted a merged, hand-edited table as a new PR #100 with @brendandburns as co-author for the commit.

@fenugrec
Copy link
Owner

fenugrec commented Sep 9, 2024

I merged #100 in the meantime, since this current PR needs work for acceptance. I'm leaving this open since a 'proper' script may be a useful future upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants