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

Vehicle metrics doesn't reconnect OBD Bluetooth #21257

Closed
Davi427 opened this issue Nov 6, 2024 · 13 comments · Fixed by #21284 or #21405
Closed

Vehicle metrics doesn't reconnect OBD Bluetooth #21257

Davi427 opened this issue Nov 6, 2024 · 13 comments · Fixed by #21284 or #21405
Assignees
Milestone

Comments

@Davi427
Copy link

Davi427 commented Nov 6, 2024

Description

Since updating to OsmAnd+ 4.9.3, Released: 2024-11-01, the OBD Bluetooth connection isn't automatically reestablished on relaunch of osmand, after having had the car ignition turned off and on.

Steps to reproduce

Connect obd Bluetooth
Turn off car ignition
Turn on car ignition
exit osmand
Start osmand

Actual result

The obd Bluetooth connection isn't automatically reestablished

Expected result

Connection should be reestablished.
Preferably without having to relaunch osmand but definitely on relaunch the connection should establish automatically, since it takes 11 touches to get it working again (when Osmand is already running in foreground)

Your Environment (required)

WARNING Crash-Logs MAY contain information you deem sensitive.
Review this CAREFULLY before posting your issue!

OsmAnd Version: OsmAnd+ 4.9.3, Released: 2024-11-01
Android/iOS version: 14
Device model: FP5
Crash-Logs: ?
@vshcherb
Copy link
Member

vshcherb commented Nov 6, 2024

We will implement that OBD will reconnect automatically once AA is connected again. Otherwise we don't want to continoulsy lookup connections

@Davi427
Copy link
Author

Davi427 commented Nov 6, 2024

I noticed that the Bluetooth connection is lost when I open another app for a while and osmand is in the background. When I foreground osmand again, it has lost the connection to the obd Bluetooth dongle and I have to manually reestablish it.

@Davi427
Copy link
Author

Davi427 commented Nov 6, 2024

We will implement that OBD will reconnect automatically once AA is connected again. Otherwise we don't want to continoulsy lookup connections

I do not have AA, I am just using my phone.

@vshcherb vshcherb added this to the 4.9-android milestone Nov 6, 2024
@Corwin-Kh Corwin-Kh linked a pull request Nov 8, 2024 that will close this issue
@vshcherb vshcherb added Observed Needs more clarification, feedback, or research and removed widgets labels Nov 12, 2024
@vshcherb
Copy link
Member

We've implemented after connection to Android Auto though we can't receive signal that device is connected by bluetooth. Suggested api doesn't work as it requires to manually connect to Bluetooth device or constant Bluetooth scanning which is very bad for battery.

@vshcherb vshcherb removed this from the 4.9-android milestone Nov 12, 2024
@Davi427
Copy link
Author

Davi427 commented Nov 14, 2024

We've implemented after connection to Android Auto though we can't receive signal that device is connected by bluetooth. Suggested api doesn't work as it requires to manually connect to Bluetooth device or constant Bluetooth scanning which is very bad for battery.

I see the dilemma, yeah.

Would it be possible to have "reconnect obd Bluetooth" as a custom button action?
Then anyone who wants can add that button and mash it as often as they like without the structural battery drain.

@vshcherb
Copy link
Member

Yes I think quick action should definitely ok, though I'm thinking we could try to discover on route recalculation

@BipedalPossum
Copy link

Yes I think quick action should definitely ok, though I'm thinking we could try to discover on route recalculation

That sounds like a good idea! There are likely a decent number of us with older vehicles that lack AA.

@vshcherb vshcherb added this to the 4.9-android milestone Nov 19, 2024
@DmitryAlexei
Copy link
Contributor

DmitryAlexei commented Nov 19, 2024

To be implemented:

  • before attempting to reconnect you should check, that OBD plugin is on and widgets are added to the navigation profile (if no, no reconnection)
  • app should try to connect to the pre-connected OBD, 2 attempts will be enough
  • when recalculating the route, it should also try to reconnect with OBD sensor

@Corwin-Kh Corwin-Kh linked a pull request Nov 20, 2024 that will close this issue
@Chumva Chumva closed this as completed Nov 21, 2024
@Zirochkabila
Copy link
Contributor

Zirochkabila commented Nov 26, 2024

Cannot be tested - OsmAnd crashes if connected to simulated sensors and display widgets on the main screen
Driving (1).osf.zip

2024-11-26.16.26.10.mp4

@Zirochkabila Zirochkabila reopened this Nov 26, 2024
@Corwin-Kh
Copy link
Contributor

Not reproduced on last build

@Corwin-Kh Corwin-Kh linked a pull request Nov 27, 2024 that will close this issue
@Chumva
Copy link
Member

Chumva commented Nov 27, 2024

Crash should be fixed here

@Chumva Chumva closed this as completed Nov 27, 2024
@Zirochkabila
Copy link
Contributor

This depends on your car and the model of your OBD Bluetooth adapter. In most cases:

  1. OBD port always active: If the OBD port receives power even after the ignition is off, the Bluetooth adapter will stay on until you manually unplug it.
  2. OBD port powers down with ignition: In some cars, the OBD port automatically loses power when the ignition is turned off. In this case, the Bluetooth adapter will also turn off.

Considering the first point above, this behavior can only be tested with the actual presence of OBD sensors.

However, if we consider the second point, this case can be tested by turning Bluetooth off and on (on the mobile device, as demonstrated in the video).

Therefore, the issue is still present, as after “Turn off car ignition, Turn on car ignition” - “Turn off, Turn on Bluetooth module,” the Bluetooth connection does not automatically reconnect.

OsmAnd~ 5.0.0#3830m, Released: 2024-11-28

2024-11-28.12.32.11.mp4

@vshcherb
Copy link
Member

I've tested with real device and real car and with AA it works as expected. Based on the code I see, once route is calculated (after restart or in old session) attempt to reconnect widgets will be made

@vshcherb vshcherb removed the Observed Needs more clarification, feedback, or research label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment