jeffmcfadden / CarDash

OBD2 iOS Communications and Car Dashboard App
MIT License
58 stars 28 forks source link

Need Help #2

Closed JitenGoswami closed 8 years ago

JitenGoswami commented 8 years ago

Hello Jeff,

I hope you are going great.

I went through different OBD2 devices. And i found plenty of OBD-2 devices. And also searched for there SDK, but many of them don't have any such kind of SDK.

And then i found your code, but i don't know how your code is working can you explain a bit. I compiled your code started streaming from settings screen and also getting some data on dashboard. But yet is not clearing from where we are getting data can you help me with it?

Secondly you have mentioned that you have tested your project with below device: https://www.amazon.com/ieGeek%C2%AE-Wireless-Scanner-Adapter-iPhone/dp/B00B3K2X4M/ref=as_li_ss_tl?s=automotive&ie=UTF8&qid=1435444136&sr=1-3&keywords=obdii&linkCode=sl1&tag=jeffmcfaddenc-20&linkId=3I7JFPHZU3733MFP So does that work completely fine with your code? Does you got PID or a code like: http://www.obd-codes.com/ as i am not getting this kind of code.

Please help me with my issues.

Waiting for your positive feedback.

Regards, Jiten

jeffmcfadden commented 8 years ago

CarDash interfaces via the ELM327 AT interface. You can find the commands here: https://www.sparkfun.com/datasheets/Widgets/ELM327_AT_Commands.pdf

The product that I got works perfectly with CarDash. I can't vouch for anything else, though technically anything with an ELM327 should be workable.

All the communication with the device happens here: https://github.com/jeffmcfadden/CarDash/blob/master/CarDash/FAOBD2Communicator.m

Cheers,

-- Jeff

JitenGoswami commented 8 years ago

Hello Jeff,

Thanks for your response.

PDF in first URL is yet not clear as of now what is the use of it in your source code. So can you elaborate more on it?

I have debugged your code and in FAOBD2Communicator.m i have found below code in which we get 14 digit data bytes. So we need to convert that NSData bytes to fetch PID?

NSString message = [NSString stringWithFormat:@"01%@1\r", sensorPID]; NSData data = [[NSData alloc] initWithData:[message dataUsingEncoding:NSASCIIStringEncoding]]; [self.outputStream write:[data bytes] maxLength:[data length]];

As i need to have a actual Diagnostic Code at last and for that i am also referring one pdf: https://www.elmelectronics.com/wp-content/uploads/2016/07//ELM323DS.pdf Does the pdf make as sense to get Diagnostic Code from car?

So now i am stuck over here can you help me out for my above issue?

Regards, Jiten

jeffmcfadden commented 8 years ago

If you want to change which PIDs the code is requesting, then go to line 67: https://github.com/jeffmcfadden/CarDash/blob/master/CarDash/FAOBD2Communicator.m#L67

Change that line to be just the PIDs you want. You'll have to know what the data format is of the PIDs you're asking for so that you can parse the raw data that comes back from the unit. Parsing is done here: https://github.com/jeffmcfadden/CarDash/blob/master/CarDash/FAOBD2Communicator.m#L247

Common PIDs can be found here: https://en.wikipedia.org/wiki/OBD-II_PIDs

If all you want to do is read trouble codes, then CarDash is massive overkill. Just use Terminal.app and telnet to the IP/Port of your adapter and send the raw AT codes, then decode them by hand.

Or get one of the many OBD2 apps on the app store and get the codes that way.

-- Jeff

JitenGoswami commented 8 years ago

Hello Jeff,

Thanks for your feedback.

Today I have tested Car Doctor App which i have downloaded from app store and connect it with ELM-327 Obd-II device. I worked properly by providing real time data.

Then i tried same thing with your code and i got some data but they were not correct and also without connecting your app with Obd device it still provides some sort of data. So can you let me know how is it possible that i can get data without connecting your app with Obd-II device.

Let me know your feedback.

Regards, Jiten

jeffmcfadden commented 8 years ago

Maybe you were getting cached data, or you had it in demo mode, or you were connected when you didn't think you were?

CarDash is really a hobby-level project at best, so I can't say it's reliable, sorry.