Meshtastic-Android icon indicating copy to clipboard operation
Meshtastic-Android copied to clipboard

Mestastic App Bluetooth Broken on Pixel Phones

Open andymccall opened this issue 1 year ago • 10 comments

Hi,

I've got a 2 x Lilygo T Decks and 2 x Heltec V3 (3.1)'s. I have flashed them with 2.4.0.46d7b82 Beta firmware.

Connecting to them via bluetooth using Pixel phones fails. I have tested this with a Pixel 2 XL and a Pixel 6 Pro

The device appears to pair, prompting for the PIN and then and shows as paired in the phone settings, but the MAC address of the device shows in the Meshtastic app and it is dark grey. You cannot select the device.

I have checked the devices themselves are working by connecting to them via Bluetooth on a Motorola phone, which worked.

I have uninstalled the Meshtastic app, cleared the data, reset the phone turned bluetooth on an off etc. however there is no way to connect using these phones, so I think it is related to Google's Android OS.

andymccall avatar Jul 31 '24 16:07 andymccall

I had the same issue but somehow I got it going again. I'm on a Pixel 7 Pro, last update was on the 5. July 2024

gjelsoe avatar Jul 31 '24 19:07 gjelsoe

I've managed to work it out.

It's the Precise Location. If you turn this off for the app, then it will list the devices. Once you've connected to the device and done a few things, you can turn Precise Location back on and it works going forward.

It looks like there's something related to Precision Location on Pixel phones that's causing it to hang on adding devices over Bluetooth.

You can add them via IP fine, so it's specifically Bluetooth and Precise Location on Pixel phones.

andymccall avatar Jul 31 '24 19:07 andymccall

Something has changed. I had 4 devices already connected to my Pixel and when I tested some new code and had issues with connecting a new devices didn't have any problems with the previous version.

gjelsoe avatar Jul 31 '24 19:07 gjelsoe

In certain versions of android BLE can be used to triangulate user location so it requires location permissions.

garthvh avatar Jul 31 '24 20:07 garthvh

FWIW, running the latest GrapheneOS on the 6 Pro, I've not had any issues

Garrisonsan avatar Jul 31 '24 23:07 Garrisonsan

In certain versions of android BLE can be used to triangulate user location so it requires location permissions.

The manifest of the app details this:

<!-- API 31+ Bluetooth permissions --> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> <uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" tools:targetApi="s" />

Could this be denying BLE permission to triangulate the user location?

andymccall avatar Aug 01 '24 05:08 andymccall

FWIW, running the latest GrapheneOS on the 6 Pro, I've not had any issues

I believe it's something specific to Google's OS.

andymccall avatar Aug 01 '24 05:08 andymccall

I'm also experiencing this on a Pixel 8 Pro, fully updated. Happy to pull any logs or test builds if that's useful.

eiginn avatar Aug 02 '24 21:08 eiginn

Android bellow 12 needs precise location permissions for Bluetooth.

garthvh avatar Aug 03 '24 12:08 garthvh

For everyone having issues with Bluetooth staying connected: do your Meahtastic app permissions look like this? Screenshot_20240827-053426 Specifically, the app needs location access ALL THE TIME. This has something to do with Bluetooth because without it enabled the Meshtastic App won't stay connected with Bluetooth.

madeofstown avatar Aug 27 '24 12:08 madeofstown

there was an issue in 2.4.0 receiving the pairing response from the Android system. this was fixed in recent releases.

andrekir avatar Sep 01 '24 12:09 andrekir