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

AndrOBD crashes when establishing USB connection to ELM327 adapter #285

Closed
20210213 opened this issue Dec 14, 2024 · 10 comments
Closed

AndrOBD crashes when establishing USB connection to ELM327 adapter #285

20210213 opened this issue Dec 14, 2024 · 10 comments
Labels
bug test version available https://github.com/fr3ts0n/AndrOBD/actions/workflows/android_beta_apk.yml

Comments

@20210213
Copy link

Describe the bug

When establishing the USB connection in the usual way, recent versions of AndrOBD crash as follows:

Steps to reproduce the behavior:

  1. plug USB cable from the adapter into the cellphone
  2. confirm to open AndrOBD
  3. The proposed USB connection is displayed. Click on it to confirm.
  4. Android displays that AndrOBD has crashed.

Expected behavior

Instead of crashing according to item 4, AndrOBD should open and communicate with the ELM327 adapter.

AndrOBD Debug log files

Please attach AndrOBD debug log files.
AndrOBD.log.1.txt

Important details on your environment:

  • Android OS version: 9
  • AndrOBD version: 2.6.13
  • OBD adapter type: noname ELM327 USB adapter

Additional context

Note: When no USB connection is established, e. g. with no cable connected to the cell phone, AndrOBD 2.6.13 will start.

The last version which worked OK with the same adapter was 2.6.7.

We encountered an identically looking issue already in February 2021; it was fixed after a bug report.

@fr3ts0n
Copy link
Owner

fr3ts0n commented Dec 15, 2024

Thank you for your report,
I can reproduce the problem on connecting to my USB adapter.
(Pls remind me to include this as a smoke test for releases)

I can see following error message in the android logcat output when the USB device class is instantiated:
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.usb.UsbEndpoint.getMaxPacketSize()' on a null object reference

I'll contact @mik3y who is the developer of the USB device library used by AndrOBD.
Reverting the library to the version 3.3, which was used with V2.6.7 (your reported last known good version) would fix the problem.
However, there are several extensions and fixes listed in the changelog of the library.

@fr3ts0n fr3ts0n added the bug label Dec 15, 2024
@fr3ts0n
Copy link
Owner

fr3ts0n commented Dec 15, 2024

@20241229-hub
Copy link

Unfortunatly V2.6.7 is not available any more on F-Droid until last release on 09.12.2024. Only last 3 versions are provided. I need this V2.6.7 apk to run my USB-ELM327 to get a car problem identified. It worked well 8 month ago. Can you please provide the executable (apk) on F-Droid, github or by mail.

@fr3ts0n
Copy link
Owner

fr3ts0n commented Jan 1, 2025

In fdroid APP you can enable the archive in repo settings. This allows you to install historical versions.

@20241229-hub
Copy link

20241229-hub commented Jan 1, 2025 via email

@TheBagarius
Copy link

I'm having the same error on my android head unit

Important details on your environment:

Android OS version: 10
AndrOBD version: 2.6.13
OBD adapter type: chinesium ELM327 USB adapter

never attempted to use 2.6.7 so cannot say if that will work.
I will dump the debug files from the car tomorrow and share tomorrow / look into where the issue might be.

looking forward to working with everyone to get this fixed (and more in the future)

@fr3ts0n
Copy link
Owner

fr3ts0n commented Jan 6, 2025

Beta build (V2.6.14) with workaround is here for testing.
https://github.com/fr3ts0n/AndrOBD/actions/runs/12634570022/artifacts/2390670941

@fr3ts0n fr3ts0n added the test version available https://github.com/fr3ts0n/AndrOBD/actions/workflows/android_beta_apk.yml label Jan 6, 2025
@20210213
Copy link
Author

20210213 commented Jan 6, 2025

This looks good:

  1. plug USB cable from the adapter into the cellphone
  2. confirm to open AndrOBD
  3. The proposed USB connection is displayed. Click on it to confirm.
  4. AndrOBD displays that the USB connection has been established (and the adapter starts to flash).
    This was a fast, however preliminary test because the ELM327 adapter wasn't connected to a car; should be properly confirmed.
    Nevertheless - thank you!

@TheBagarius
Copy link

TheBagarius commented Jan 7, 2025 via email

@20210213
Copy link
Author

20210213 commented Jan 9, 2025

This looks good:

1. plug USB cable from the adapter into the cellphone

2. confirm to open AndrOBD

3. The proposed USB connection is displayed. Click on it to confirm.

4. AndrOBD displays that the USB connection has been established (and the adapter starts to flash).
   This was a fast, however preliminary test because the ELM327 adapter wasn't connected to a car; should be properly confirmed.
   Nevertheless - thank you!

This is to confirm that the test version #285 (comment) works properly. The cell phone connects via usb to the ELM327 adapter which transfers the readout data from the car.
Thank you for fixing this issue.

@fr3ts0n fr3ts0n closed this as completed Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug test version available https://github.com/fr3ts0n/AndrOBD/actions/workflows/android_beta_apk.yml
Projects
None yet
Development

No branches or pull requests

4 participants