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

How to simulate obd II ? #143

Closed mabed-fr closed 5 years ago

mabed-fr commented 5 years ago

Thank you very much for your work. We want to use your solution but must it necessarily be connected to the car to execute and test our code?

Which solution do you use?

thank you and good evening

alistair23 commented 5 years ago

You will need an OBD2 Simulator or Emulator. You can look around online for different versions at different price points. A contributor to this project has written this fork: https://github.com/Ircama/ELM327-emulator

alistair23 commented 5 years ago

Obviously you could also just connect to a car, but you might need to test against multiple cars with different protocols.

mabed-fr commented 5 years ago

thank you for your answer, there is no software emulator sooner than hardware? because we are mounting a student project and it is true that test the code on our car slowed the project.

Do you have an idea?

Ircama commented 5 years ago

ELM327-emulator allows simulating different cars and can handle different use cases including hardware failure. It also includes an auxiliary feature that builds the PID dictionary of a specific vehicle by automatically querying all standard PIDs one by one (as well as additional custom PIDs specified by the user via CSV file). The dictionary can then be used to emulate the specific car.

alistair23 commented 5 years ago

Does that work for you?

Ircama commented 5 years ago

Does that work for you?

Hopefully. Please open an issue if you found a bug.

mabed-fr commented 5 years ago

It's amazing it works well thank you for your help I will not hesitate to post

Ircama commented 5 years ago

It's amazing it works well thank you for your help I will not hesitate to post

Good. It would be useful to share dictionaries produced by distinct cars (maybe including custom PIDs), especially when dealing with different protocol than ISO 15765-4. This will surely help testing python-OBD (like usage of custom headers).