Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General Start Up: Connections, Etc. #1

Open
matthewjonesvsp opened this issue Sep 14, 2018 · 4 comments
Open

General Start Up: Connections, Etc. #1

matthewjonesvsp opened this issue Sep 14, 2018 · 4 comments

Comments

@matthewjonesvsp
Copy link

This seems like a great platform. Is anyone following this? Not new to programming but I am no expert neither. Looking for a general foundation to get started on connection.

Any ideas?

@outlandnish
Copy link
Owner

Hey, thanks for taking a look! I wrote this code about 4 or so years ago but I still remember a decent amount of it. What would you like help with?

@matthewjonesvsp
Copy link
Author

Well its some very solid code in regards to OBDII and probably some of the more organized code I have seen.

Honestly I am looking for some start up to get started on developing a connection with a OBDII USB device. I am actually writing some code in VB.net but could probably copy over to C# with minimal issues.

I have looked through the code and was just curious is you could help me get started on developing an actual connection with your code. Once I get the connection between the computer and vehicle, I think I would be good to go, for now.

@matthewjonesvsp
Copy link
Author

In short, I have an already established connection using some generic VB code. Working great with the OBDII USB device. Primarily I need help with: obtaining the VIN of the vehicle.

I like your code way better than any other code I have seen. It appears our code is producing a lot more information than other code I have come across.

@outlandnish
Copy link
Owner

@matthewjonesvsp sorry, I completely forgot to revisit your question. Depending on the chipset you use, you can write an IVehicleService implementation. The example provided uses the popular Elm327 chipset (and works for STN chipsets with ELM backward compatability).

In your code, you would open up a connection to the device. If via USB, this would be a COM connection with an input stream and an output stream. If via Bluetooth, it would be the same using your platform's C# Bluetooth implementation. The code is generic enough to take any type of Stream object and read and write from them.

Once you have a stream setup, you can then run the following methods:

ConnectToVehicle() - which for the ELM327 sends a reset command, turns off headers, and detects the vehicle protocol. This in turn calls GetReportedPids to see what the OBD2 bus "officially supports" and then GetSupportedPids to see what the ECUs respond with (which might be different).

From here, you can use the Run methods to get OBD2 data from the bus and pass the data to the OBDParser class. You will have to write your own implementation because I had never gotten around to that implementation when I originally wrote this library.

Good luck and feel free to ping me for any other help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants