brendan-w / python-OBD

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

Odometer #194

Open kj7rrv opened 4 years ago

kj7rrv commented 4 years ago

Is odometer data available? I need it for a self driving car.

Lizardskins commented 3 years ago

I would also like to know if this is already available in the code. Or would this be a custom command?

Lizardskins commented 3 years ago

Just answered my own question. Odometer information is blocked by manufacturers for security reasons. It is not available through the ELM327 OBD interface.

cewbdex commented 3 years ago

I do not think it is blocked, it is just not a part of the OBD standard, you might get the value, but you need to reverse engineer the communication with vehicle.

tkyanaga commented 1 year ago

Bumping this up; added the odometer to mode1 of the commands.py file, but got null data when used.

PID reference (A6 found on both sites) https://en.wikipedia.org/wiki/OBD-II_PIDs https://www.csselectronics.com/pages/obd2-pid-table-on-board-diagnostics-j1979

Is this how others queried data?

OBDCommand("ODOMETER"                   , "Odometer"        , b"01A6", 6, uas(0x25), ECU.ALL, True),

*I've also tried ECU.ENGINE but still get null data

Lizardskins commented 1 year ago

Excellent Find @tkyanaga, I might have to resurrect this project and try it out.

tkyanaga commented 1 year ago

according to the small wiki note I missed yesterday, the Odometer readout was only required for Manufacturing Year 2019 and beyond.

I believe that is why I'm getting null data - the above commands.py edit may work for 2019+ vehicles

Lizardskins commented 1 year ago

Ah, yes I do remember that now that you mention it. I am also testing on a vehicle pre 2019 so I think that's why I wasn't able to get it to work for me as well. I'll post here if I figure anything out in the future. Thanks for reviving this project for me! :P