brendan-w / python-OBD

OBD-II serial module for reading engine data
GNU General Public License v2.0
1.08k stars 371 forks source link

how to get the milage? #267

Open montio5 opened 1 year ago

montio5 commented 1 year ago

Hi, how are you? i can't find a possible way to find out the total mileage of a car( I mean from the beginning it was released ex: 120k KM until now ).

ItsJustAGitHubMichealWhosGonnaSeeIt5Ppl commented 8 months ago

More of a workaround than a solution, but I am currently planning to use the "miles since last check engine light" and subtract it from my current mileage. Should be accurate as long as the CIL doesn't come on...

TastyHackTheBox commented 7 months ago

2019+ vehicles were mandated in California to provide odometer the codes are: A6 166 - expect 4 bytes You might get lucky if this was done previous to 2019 in your ECU.

Before 2019 its not so easy - relying on either engine hours, or distance traveled before + after a CEL as suggested above

Distance Since Reflash or Module Replacement - C7 199 - two bytes (yes this means only 65k KM) Distance traveled since codes cleared - 31 49 - two bytes Distance traveled with malfunction indicator lamp (MIL) on - 21 33 - two bytes Engine run time - 7F 127 - 13 bytes

Reference: https://en.wikipedia.org/wiki/OBD-II_PIDs