8000 Unable to get DTC · Issue #111 · pires/android-obd-reader · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Nov 10, 2017. It is now read-only.

Unable to get DTC #111

Closed
mvglasow opened this issue Jul 14, 2015 · 38 comments
Closed

Unable to get DTC #111

mvglasow opened this issue Jul 14, 2015 · 38 comments

Comments

@mvglasow
Copy link

I have recently tried the latest version available on F-Droid. Unlike in the earlier version I tried before, I can now obtain live data on Android 4.4. However, when I try to get DTCs, I still get an error about the adapter not being reachable and am unable to get any information from the dongle. Could this be a leftover from #7? That is, live data addresses the OBD dongle in a way that is compatible with Android 4.2.1+ but DTC still uses the old way?

@pires
Copy link
Owner
pires commented Jul 15, 2015

@nomwerp any insight?

@nomwerp
Copy link
Collaborator
nomwerp commented Jul 15, 2015

no not really without diving into it, works for me on Android 5-something... any suggestions welcome

@pires
Copy link
Owner
pires commented Aug 2, 2015

@mvglasow can you try latest code, please?

@pires pires closed this as completed Dec 8, 2015
@mvglasow
Copy link
Author

Tried today with 2.0-RC2, still no luck. OS is now Android 5.1.1.

@pires
Copy link
Owner
pires commented Dec 13, 2015

What's your car protocol?

@mvglasow
Copy link
Author

Where can I find that out? The car is a 2005 Audi A4 (B7 model).

@pires
Copy link
Owner
pires commented Dec 13, 2015

Have you tried building the code?

@mvglasow
Copy link
Author

No, so far I've only used the APKs on F-Droid.

@mvglasow
Copy link
Author

A question, though: how come live data works while DTC doesn't? I thought the underlying protocol is the same for both – or am I wrong?

@pires
Copy link
Owner
pires commented Dec 13, 2015

You should try build and install the code. There's protocol nuances for some commands.

@pires pires reopened this Dec 14, 2015
@pires
Copy link
Owner
pires commented Dec 14, 2015

@valens254 anything to add?

@valens254
Copy link

@mvglasow I can't understand, what you get when trying read DTC

@pires
Copy link
Owner
pires commented Dec 14, 2015

@valens254 just to be sure it's clear, @mvglasow is running an old release of this software. I will try and make a new release, but I suggested him to compile the code.

Also @mvglasow, I'm not responsible for F-Droid releases or any other APK releases.

@valens254
Copy link

Yes, the old release can read all except DTC and VIN code, because not all protocols was implemented yet.

@pires
Copy link
Owner
pires commented Dec 14, 2015

@mvglasow please test https://github.com/pires/android-obd-reader/releases/tag/2.0-RC3 and let us know. I'm closing this for now.

@pires pires closed this as completed Dec 14, 2015
@mvglasow
Copy link
Author

Same symptoms here, too: I can collect live data but when I try to get DTC, it says "Unable to connect to Bluetooth device". The error message indicates the error happens lower down in the stack – or the app is giving out a misleading error message.

As for F-Droid: for most apps they simply build an APK from the repo. Thus, apart from the signature, there is no difference between an F-Droid build, a version I have built myself and (presumably) a release build on github. They may occasionally patch apps to remove advertising or non-free dependencies, but they try to limit this to a few exceptional cases because they lack the resources to do such adaptations.

@pires
Copy link
Owner
pires commented Dec 20, 2015

@mvglasow did you run the RC3?

@mvglasow
Copy link
Author

@pires
Copy link
Owner
pires commented Dec 21, 2015

You are correct. @mvglasow the app crashed? Can you provide logs?

@Pho3niX90
Copy link
Contributor

I have fixed this issue in my version. The issue was that it crashes when there are no errors found. I will see if I can incorporate my fix with this.

@pires
Copy link
Owner
pires commented Dec 21, 2015

@Pho3niX90 care to develop further your comment? Is it an app thing? Library thing? I can provide a fix as well if I see some logs.

@pires pires reopened this Dec 21, 2015
@Pho3niX90
Copy link
Contributor

@pires is an app issue. I will provide a fix in the next 30mins.

@pires
Copy link
Owner
pires commented Dec 21, 2015

@Pho3niX90 awesome! Thank you.

@Pho3niX90
Copy link
Contributor

Try this: #153

pires pushed a commit that referenced this issue Dec 21, 2015
@pires pires mentioned this issue Dec 21, 2015
pires added a commit that referenced this issue Dec 21, 2015
@pires
Copy link
Owner
pires commented Dec 21, 2015

@mvglasow
Copy link
Author

@pires OK, will try. Just to clarify: the app does not crash, it simply displays a toast with an error message.

@mvglasow
Copy link
Author

Same issue with RC4. When I try to read DTC, all I get is a toast saying "unable to connect to Bluetooth device".

Logcat is attached. Since at the same time Android was syncing my phone book and dumping all its contents to the log, I've filtered for com.github.pires. If you need other data, let me know.

alogcat.2015-12-21-15-22-32+0100.filtered.txt

@Pho3niX90
Copy link
Contributor

@mvglasow are you able to read any other data? Have you conpletely restrted your phone and then ON 6D40 LY tried reading dtc without clicking on start live data?

@mvglasow
Copy link
Author

@pires I have a suspicion what it might be: LiveData and DTC define their own methods to connect to the OBD dongle, and implementations differ.

Compare ObdGatewayService (live data):
https://github.com/pires/android-obd-reader/blob/2.0-RC4/src/main/java/com/github/pires/obd/reader/io/ObdGatewayService.java#L138

and DTC:
https://github.com/pires/android-obd-reader/blob/2.0-RC4/src/main/java/com/github/pires/obd/reader/activity/TroubleCodesActivity.java#L295

ObdGatewayService has a workaround for certain Bluetooth connection issues, which is missing for DTC. Unfortunately my logcat got cut off at the start, so I can't tell for sure if live data relies on the fallback on my phone, but it's probably a good idea to implement the fallback in DTC as well.

@mvglasow
Copy link
Author

@Pho3niX90 see above – yes, live data works. Didn't try restarting, though. My test cycle was:

  • Upgrade
  • Start live data – works.
  • Stop live data.
  • Get DTC – error.
  • Start live data – works.
  • Stop live data.
  • Get DTC – error.

Currently my suspicion is that it's a low-level issue and that my phone requires the hack in ObdGatewayService to get anything out of the dongle at all, and DTC won't work because it's lacking the fallback machanism.

@pires
Copy link
Owner
pires commented Dec 21, 2015

Interesting!

@Pho3niX90
Copy link
Contributor

Try #155, that should work if it is in fact your issue

@pires
Copy link
Owner
pires commented Dec 21, 2015

@mvglasow care to try #155?

@mvglasow
Copy link
Author

I've just built it myself and implemented a fix, which is functionally equivalent to #155. In fact it works now. I'll just clean up the code to make it a bit more modular (duplicate code isn't very nice) and then send you a merge request.

@pires
Copy link
Owner
pires commented Dec 21, 2015

@mvglasow i'm also in favor if a dedup of code.

mvglasow pushed a commit to mvglasow/android-obd-reader that referenced this issue Dec 21, 2015
…ires#111)

Signed-off-by: mvglasow <michael -at- vonglasow.com>
@mvglasow
Copy link
Author

Just built and tested successfully (live data and DTC work).

I've introduced a new class, io.BluetoothManager, to take the new method, because I didn't find any other class that looked appropriate for this. If you have a better idea (you certainly know the code better than I do), feel free to refactor.

pires added a commit that referenced this issue Dec 21, 2015
De-duplicate Bluetooth connection code, fixes DTC connection issues (#111)
@pires
Copy link
Owner
pires commented Dec 21, 2015

@mvglasow this was a really nice contribution. Thank you for that. And thank you for debugging this issue until a solution was found.

@nomwerp
Copy link
Collaborator
nomwerp commented Jan 11, 2016

i set up F-droid to automatically build from github but that works on the android:versionName
in AndroidManifest.xml .. so if someone updates that to match the latest tag (exactly!) it should
automagically appear on f-droid

On Sunday 20 December 2015 08:52:25 mvglasow wrote:

Same symptoms here, too: I can collect live data but when I try to get DTC, it says "Unable to
connect to Bluetooth device". The error message indicates the error happens lower down in the
stack – or the app is giving out a misleading error message.
As for F-Droid: for most apps they simply build an APK from the repo. Thus, apart from the
signature, there is no difference between an F-Droid build, a version I have built myself and
(presumably) a release build on github. They may occasionally patch apps to remove advertising
or non-free dependencies, but they try to limit this to a few exceptional cases because they lack
the resources to do such adaptations.
—Reply to this email directly or view it on GitHub[1].[2]


[1] #111 (comment)
[2] https://github.com/notifications/beacon/
AJpBTtXf97GYlddrtgixrKxUrz2ayh3mks5pRtRJgaJpZM4FYQXB.gif

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

Successfully merging a pull request may close this issue.

5 participants
0