Add extra DTCs for Volvo 850 & S/C/V70 as well as parser for generating them#99
Add extra DTCs for Volvo 850 & S/C/V70 as well as parser for generating them#99brendandburns wants to merge 4 commits intofenugrec:masterfrom
Conversation
|
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... |
fenugrec
left a comment
There was a problem hiding this comment.
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.
| } | ||
|
|
||
|
|
||
| #ifdef DEFAULT_850_ECU |
There was a problem hiding this comment.
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__ |
| self.prefix = prefix | ||
|
|
||
|
|
||
| # this loads dtcs from the xiaotec file export |
There was a problem hiding this comment.
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': |
There was a problem hiding this comment.
wha'ts special about 2E / 2F here ?
There was a problem hiding this comment.
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 + '" },') |
| 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 |
There was a problem hiding this comment.
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}}" }, No newline at end of file | |||
There was a problem hiding this comment.
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 ?
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. One-byte and two-byte SRS DTCs mixed in the same table, mentioned in #99 (comment) before you "refactored", not fixed. SRS and ROPS DTCs wrongly placed in the CI table! Mentioned in #99 (comment)! Not fixed! 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. 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! And in xiaotec.c, the DTCs for EMS2000 and M4.4 have been thrown into one table. That's not going to work.
I mentioned in #95 (comment) that EFI-551...555 and 545 are misfires with catalyst damage, description has not been updated to distinguish them.
As I mentioned in #95 (comment), before you even opened this revised PR, EFI-335 is not MIL request from TCM.
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. |
|
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. |
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:
Anyway, please take a quick look to see if it is reasonable before we move onto more detailed review.
cc @aaeegg