Azure / azure-spatial-anchors-samples

Azure Spatial Anchors sample code
Other
293 stars 138 forks source link

BT status: NoBeaconsFound #382

Closed jelmerS2 closed 1 year ago

jelmerS2 commented 1 year ago

I'm developing an iOS app and need to use iBeacons because of the complexity of the building we are developing for. However, I can't get it to work and am wondering if there is something wrong with the SDK.

Everything else works, I can create and relocalize anchors with just location, the problem is that there are far to many false positives (e.g. anchors appearing in wrong locations).

Unity: 2021.3.11 XCode: 14.1

SDKs: com.microsoft.azure.spatial-anchors-sdk.core-2.11.0 com.microsoft.azure.spatial-anchors-sdk.ios-2.11.0

running on: iOS 16.1 on iPhone 12 pro.

I have the class: public class CoarseRelocSettings { /// <summary> /// Whitelist of Bluetooth-LE beacons used to find anchors and improve the locatability /// of existing anchors. /// Add the UUIDs for your own Bluetooth beacons here to use them with Azure Spatial Anchors. /// </summary> public static readonly string[] KnownBluetoothProximityUuids = { "E2C56DB5-DFFB-48D2-B060-D0F5A71096E0", "50765CB7-D9EA-4E21-99A4-FA879613A492", "284AC94A-256A-4D4E-9F18-405491B15DEF", "B5B182C7-EAB1-4988-AA99-B5C1517008D9", "E1F54E02-1E23-44E0-9C3D-512EB56ADEC9", "9F6F3985-3521-545C-E86F-96266B530A7E", "B233860B-5F9D-44EF-B657-C2966D89BBFA", "FF44C94C-2720-3BD8-E4EA-90F78F0F5AD2", "3D28731B-3500-02F8-0300-E7655DBFFCAF", "B1A2622B-6F68-5968-3ED5-92FA386A4365" }; }

Which is referred to by:

private void ConfigureSensors() { locationProvider.Sensors.GeoLocationEnabled = SensorPermissionHelper.HasGeoLocationPermission(); locationProvider.Sensors.WifiEnabled = SensorPermissionHelper.HasWifiPermission(); locationProvider.Sensors.BluetoothEnabled = SensorPermissionHelper.HasBluetoothPermission(); locationProvider.Sensors.KnownBeaconProximityUuids = CoarseRelocSettings.KnownBluetoothProximityUuids; }

Which is referred to by the following after ARKit is stable and tracking:

private async Task InitializeSession() { if (CloudManager.Session == null) await CloudManager.CreateSessionAsync(); await CloudManager.StartSessionAsync(); locationProvider = new PlatformLocationProvider(); CloudManager.Session.LocationProvider = locationProvider; SensorPermissionHelper.RequestSensorPermissions(); ConfigureSensors(); }

Furthermore bluetooth permissions are added to PLIST (Privacy - Bluetooth Always Usage Description). When running the app, bluetooth permissions are asked for and given by me, afterwards the app calls CloudManager.Session.LocationProvider.BluetoothStatus With always gives the result BT status: NoBeaconsFound

While the beacons are present when I analyze the area with the BlueSee app on MacOS picture The ASA documentation is a bit unclear when it comes to UUIDs: as I understand it, all Bluetooth devices have an UUID. But iBeacons have an additional Proximity UUID. So which one should one add to ASA? I added both for every beacon I found...

Varnauld commented 1 year ago

Hello @jelmerS2 thank you for the thorough details here. Adding @darax and @XiangyuL-Microsoft to follow up with you, thank you!

jelmerS2 commented 1 year ago

Any updates here? :)

darax commented 1 year ago

Hi @jelmerS2 I need to admit that I've never actually used this feature/bluetooth beacons. :) I've ordered a few so I can get familiar with the feature. They should arrive Saturday. In the meantime, looking through the documentation and the code, I would expect that the UUID in the manufacturer data column is the UUID that is used with the beacon APIs. If I'm understanding correctly, the proximity UUID and major and minor versions should be configurable by you.

darax commented 1 year ago

Hi @jelmerS2 Wanted to update you. I have the beacons and I do think that I'm reproducing the issue. ASA on Android and Windows both see the beacons, but ASA on iOS is not. If I call the CLocationManager API from sample code, the beacons are discovered. I'm investigating.

jelmerS2 commented 1 year ago

Ok good to know that it's not only me running into the issue. Thanks for investigating and I hope you find a fix 🤞

jelmerS2 commented 1 year ago

Hi @jelmerS2 Wanted to update you. I have the beacons and I do think that I'm reproducing the issue. ASA on Android and Windows both see the beacons, but ASA on iOS is not. If I call the CLocationManager API from sample code, the beacons are discovered. I'm investigating.

Hi, I was wondering if you found a fix for this?

darax commented 1 year ago

fixed in 2.14.1