fr3ts0n / AndrOBD

Android OBD diagnostics with any ELM327 adapter
http://fr3ts0n.github.io/AndrOBD/
GNU General Public License v3.0
1.36k stars 297 forks source link

Add support for electric cars/protocol #231

Open Hausmeister0815 opened 1 year ago

Hausmeister0815 commented 1 year ago

Hi, first thanks for your work. :)

It would be great if the app could be used with electric cars. I havnt any expirience with OBD, so sorry if i am wrong.

On first test with an opel corsa-e i could connect to the elm327 but no connection to car.

I think that they use another protocol not supported. Or maybe only a PSA related protocol addition? Because of this i dont added logs now. If you think it is helpfull anyway, is there a prefered log level for you?

Testing with another app it is connecting but shows only "Opel OBD II / EOBD Electric / Hybrids (PSA based)".

Searching for this keywords is not helpfull.

It looks like the base is the iso-15765-4 (11bit 500kb), but up to now dont found a list with the relevant pids. Most detailed information i found is this. https://www.goingelectric.de/forum/viewtopic.php?p=1514148#p1514148

What do you think, is it possible? For testing and log creation i will do my best to support.

Best Regards Tom

fr3ts0n commented 1 year ago

Hi Tom, Technically it definitely is possible. The ELM Adapters and communication library of AndrOBD would even support the required UDS based services. However, the thing is that as soon as you leave the standardized path of OBD protocol, you drastically increase the effort of analysis of documentation (best case) or reverse engineering (worst case). This effort would definitely exceed the limits of a spare time, free of charge, OSS project.

I have also explained this here in the FAQ

Hausmeister0815 commented 1 year ago

Hi, i understand your point and agree. Of course, the part of reverse engineeing will be on my side if there are non standard pids.

But anyway, i think the basic OBD protocoll should be able to connect to the car, even if there is only e.g. the 12V battery voltage available. Or read out error codes. Isn't it defined by the OBD standard?

I made a log and it seems that there are some commands like ATPC are answered with ok but later at 0900 "unable to connect". Havent checked the source code (same problem with spare time) and not sure what 0900 mean. In settings it is not listed at the disable ELM command page.

Test case. Car ready -> Start App. Connect -> Vehicle Info -> Wait a few seconds -> disconnect. Connect -> OBD Data -> wait -> disconnect Connect -> OBD fault codes -> wait -> disconnect -> close app. AndrOBD.log.0.txt

fr3ts0n commented 1 year ago

Hi, It really looks like there is no answer of your car from any ECU on the network to any requested OBD service. Communication with the ELM adapter looks fine, but the car just plainly doesn't answer OBD protocol.

The "0900" does request OBD service 0x09, PID 0x00 (Get List of supported PIDs (0-31) of OBD vehicle information) (see https://en.wikipedia.org/wiki/OBD-II_PIDs)

Based on your link above it looks like the vehicle does UDS protocol and reports data on service 22 (Read data by identifier) (see: https://en.wikipedia.org/wiki/Unified_Diagnostic_Services)