Pages: [1] 2
Author Topic: ODIS/MCD project explorer (.db .key file parser)  (Read 12387 times)
kartoffelpflanze
Newbie
*

Karma: +5/-0
Offline Offline

Posts: 20



« on: July 30, 2025, 05:25:36 AM »

Many years after people started asking around here (http://nefariousmotorsports.com/forum/index.php?topic=10318.msg108305#msg108305) for information about ODIS projects (folders with .db and .key files), I have created a few Python scripts to open and dump them.

GitHub repo: https://github.com/kartoffelpflanze/ODIS-project-explorer.

I hope someone will find it useful. It took and embarassing amount of work, and I'm sure it can be improved. The good news is, it's open-source, so anyone can contribute Cheesy

It can dump the data necessary for measuring values (service 0x22) and also parse such a response. Probably this will be the most useful part of the project.
« Last Edit: August 01, 2025, 02:12:36 AM by kartoffelpflanze » Logged
jcsbanks
Full Member
***

Karma: +21/-3
Offline Offline

Posts: 171


« Reply #1 on: August 26, 2025, 09:43:26 AM »

Thanks, great project.

The DTC dump didn't work for me, but I parsed 0.0.0@BL_ECMDFCC.sd.c, or rather ChatGPT did.

https://dynospectrum.com/C7_ECU_DTC.html
Logged
aaronc7
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 11


« Reply #2 on: August 26, 2025, 08:06:27 PM »

Thanks for sharing, everything works great for me-- DTCs, PIDs.

Only thing I had to do to get it working was install older version of jpype1, 1.5.2 to be exact.  The latest at the time was 1.6.0 iirc and it errored out.
Logged
kartoffelpflanze
Newbie
*

Karma: +5/-0
Offline Offline

Posts: 20



« Reply #3 on: August 27, 2025, 11:03:40 PM »

I don't know if I would recommend that, those are some sort of libraries that get referenced by higher levels.

Instead, this is how you would dump the DTCs for the ECM (replace the paths with yours):
Code:
python dumpDTC.py basevariant "C:/ProgramData/OE/MCD-Projects-E/VWMCD/AU21X" "0.0.0@BV_EnginContrModul1UDS.bv" "O:/DTCs" "C:/ProgramData/OE/DIDB/db" en_US

You can omit the last part with DIDB if you don't want translated/detailed descriptions. Those strings are often XML with simple HTML elements, you could parse them.

Different ECU-VARIANTs may support slightly different DTCs, or they might be named differently. On your C7 tool you should probably make a dropdown to select the ECU-VARIANT, you can use dumpECUVariantPatterns (or reimplement your own script based on it) to get them. To be honest, the DTC entry could be a dropdown too instead of text input Smiley
« Last Edit: August 27, 2025, 11:09:55 PM by kartoffelpflanze » Logged
kartoffelpflanze
Newbie
*

Karma: +5/-0
Offline Offline

Posts: 20



« Reply #4 on: August 27, 2025, 11:15:26 PM »

The latest at the time was 1.6.0 iirc and it errored out.

Hm, I'm pretty sure I've had 1.6.0 since the beginning and there were no problems. Now I get a few warnings about an unnamed module, but no error, it still works apart from that.
What error do you have?
Logged
jcsbanks
Full Member
***

Karma: +21/-3
Offline Offline

Posts: 171


« Reply #5 on: August 28, 2025, 04:55:49 AM »

I don't know if I would recommend that, those are some sort of libraries that get referenced by higher levels.

Instead, this is how you would dump the DTCs for the ECM (replace the paths with yours):
Code:
python dumpDTC.py basevariant "C:/ProgramData/OE/MCD-Projects-E/VWMCD/AU21X" "0.0.0@BV_EnginContrModul1UDS.bv" "O:/DTCs" "C:/ProgramData/OE/DIDB/db" en_US

You can omit the last part with DIDB if you don't want translated/detailed descriptions. Those strings are often XML with simple HTML elements, you could parse them.

Different ECU-VARIANTs may support slightly different DTCs, or they might be named differently. On your C7 tool you should probably make a dropdown to select the ECU-VARIANT, you can use dumpECUVariantPatterns (or reimplement your own script based on it) to get them. To be honest, the DTC entry could be a dropdown too instead of text input Smiley

Thanks. That same command produces no files with only the output path changed. I do have AU21X and BV_EnginContrModul1UDS.bv at the same path. I had been trying AU57X and a few others before and wanted to recheck AU21X in case there was some difference from what you tested. There is a slight delay when run, and no errors shown. Perhaps I could add some output to show what it is doing. I don't mind a superset of DTCs for all variants, it is just a guide for users that don't have ODIS/VCDS and where there is a VAG DTC we can show but no OBD code, and it picks up ones that were missing in previous lists I'd amalgamated. It would be interesting to see how different the output is for individual variants though and whether there are any misleading conflicts doing it the way I have so far. I'd previously done similar for OBD 22 requests with info from another source, and checked for conflicts and decided to group them by number of cylinders and fuel type as there were a few conflicts otherwise where the same PID was different, but I found no conflicts when grouped like that. Would be interesting to see for the DTCs, especially if I put this in a memory constrained device as a gzip html file like I did before, then one list suits 30+ ECU versions and I only have to maintain a few.
« Last Edit: August 28, 2025, 04:59:20 AM by jcsbanks » Logged
jcsbanks
Full Member
***

Karma: +21/-3
Offline Offline

Posts: 171


« Reply #6 on: August 28, 2025, 05:55:17 AM »

I'm not very pythonic, but I'm guessing that perhaps an import isn't working properly as even a print("hello") works at the top before the imports but not before "#Handle usage as script"
Logged
jcsbanks
Full Member
***

Karma: +21/-3
Offline Offline

Posts: 171


« Reply #7 on: August 28, 2025, 05:58:06 AM »

It is failing on import LongNameTranslation based on showing progress then commenting that out.
Logged
jcsbanks
Full Member
***

Karma: +21/-3
Offline Offline

Posts: 171


« Reply #8 on: August 28, 2025, 06:19:17 AM »

import jpype is failing but JPype1 is installed. I think it is something to do with Java paths. Will report back.
Logged
kartoffelpflanze
Newbie
*

Karma: +5/-0
Offline Offline

Posts: 20



« Reply #9 on: August 28, 2025, 06:25:35 AM »

This is my output for AU57X:
Code:
BASE-VARIANT BV_EnginContrModul1UDS
  Has no DTCs
ECU-VARIANT EV_ECM00TDI01104L907309AA_001
  Has no DTCs
ECU-VARIANT EV_ECM00TFS02006K907425J_001
  Has no DTCs
ECU-VARIANT EV_ECM18TFS0204G0906264_001
ECU-VARIANT EV_ECM20TDI01103L906018GT_003
ECU-VARIANT EV_ECM20TDI01103L906018HA_003
ECU-VARIANT EV_ECM20TDI01103L906018LA_003
ECU-VARIANT EV_ECM20TDI01103L906018LB_003
...

Here is a sample of the first file generated:
Code:
(627) {
  [0] {
    trouble_code: 0x39E7
    dtc: 'P060600'
    level: 0x2
    raw_description: 'ECM/PCM Processor'
    translated_description: 'ECM/PCM Processor'
  }
  [1] {
    trouble_code: 0x39EB
    dtc: 'P157100'
    level: 0x2
    raw_description: 'Left Electro-Hydraulic Engine Mount Solenoid Valve Short circuit to B+'
    translated_description: '<?xml version="1.0" encoding="UTF-8"?><String>Left Electro-Hydraulic Engine Mount Solen.val.<BR/>Short circuit to B+</String>'
  }
  [2] {
    trouble_code: 0x39EC
    dtc: 'P157200'
    level: 0x2
    raw_description: 'Left Electro-Hydraulic Engine Mount Solenoid Valve Short circuit to ground'
    translated_description: '<?xml version="1.0" encoding="UTF-8"?><String>Left Electro-Hydraulic Engine Mount Solen.val.<BR/>Short circuit to Ground (GND)</String>'
  }
...

If there are import errors, I would expect them to show up in standard output. You can avoid the long name translation by calling only:
Code:
python dumpDTC.py basevariant "C:/ProgramData/OE/MCD-Projects-E/VWMCD/AU57X" "0.0.0@BV_EnginContrModul1UDS.bv" "O:/DTCs"
Logged
jcsbanks
Full Member
***

Karma: +21/-3
Offline Offline

Posts: 171


« Reply #10 on: August 28, 2025, 07:07:58 AM »

Thanks.

import jpype now works (after setting JAVA_HOME and PATH and installing VC++ 64 bit redistributable) and the script is running without "C:/ProgramData/OE/DIDB/db" en_US as the translations aren't working yet on my system, will look at that, but what descriptions there are without are already in English so far.

Without all those steps import jpype failed silently, couldn't print an exception, using Python REPL, import jpype just crashed Python silently without VC redist installed.

Interestingly the number of DTCs for specific ECU versions is very short compared to the other file I extracted, perhaps there is redundancy or a hierarchy involved?
« Last Edit: August 28, 2025, 07:09:50 AM by jcsbanks » Logged
kartoffelpflanze
Newbie
*

Karma: +5/-0
Offline Offline

Posts: 20



« Reply #11 on: August 28, 2025, 07:39:27 AM »

Give me an example of ECU-VARIANT and DTC that exists in the other file but is not exported by dumpDTC, I will check in MCD-Kernel if it gets decoded or not.
Logged
jcsbanks
Full Member
***

Karma: +21/-3
Offline Offline

Posts: 171


« Reply #12 on: August 28, 2025, 08:09:47 AM »

I'm trying various combinations of JDK to see if I can get it to work.

Tried JDK 7 fresh install and it can't find org.jpype.jar support library

Now trying JDK 11.

Have Python 3.13, looks like a few versions earlier work better with jpype.

Which JDK and python versions did you develop this with?
Logged
jcsbanks
Full Member
***

Karma: +21/-3
Offline Offline

Posts: 171


« Reply #13 on: August 28, 2025, 08:22:54 AM »

JDK 11 and Python 3.13 now works for the translations.

The JRE that is with ODIS did not work. JDK 7 did not work.

Now looking at the DTC content.
Logged
EanDem
Full Member
***

Karma: +10/-42
Offline Offline

Posts: 89


« Reply #14 on: August 28, 2025, 08:49:52 AM »

It does job. Great work!
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.032 seconds with 15 queries. (Pretty URLs adds 0.001s, 0q)