-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
HoloLens 2 OS version: 100.19041.1103 (up to date as of 10am June 2, 2020)
Windows 10 PC OS version 1909
Microsoft.NETCore.UniversalWindowsPlatform v6.2.10
UWP SDK version 1903 (10.0; Build 18362) (target and min)
We're trying to get our HoloLens 2 devices to communicate with Bluetooth LE devices (specifically the u-blox NINA B306 -- which is a standard Bluetooth 5 series -- embedded on an Arduino Nano Sense 33).
NINA info:
https://www.u-blox.com/sites/default/files/NINA-B3_DataSheet_%28UBX-17052099%29.pdf
Nano BE Sense 33 Info:
https://store.arduino.cc/usa/nano-33-ble-sense
Using: https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE
Under a Windows 10 PC (v 1909) the UWP x86/x64 build works 100% fine.
Devices are enumerated, can be connected to and queried for GATT services and characteristics, can listen to value changes. No real problems. We extracted the code from the example to our own app and all works well. Device name, id, isConnected isConnectable, isPaired, and isEnabled properties all report as expected.
Under HoloLens 2 neither the UWP ARM or ARM64 build will work properly. Devices are discovered and my nano device shows up. It seems to fail when either connecting or when trying to get the service list with a CATASTROPHIC FAILURE HR Result.
This failure occurs within this repository's BluetoothLE sample, my app, and the "Bluetooth LE Explorer (by MS)" app on the windows store.
Interestingly on the HoloLens the device names are often not listed. The ID of the devices seems different than Windows desktop sees, and the properties are not the same such as isConnectable (almost always false but sometimes flips very frequently) and isConnected seem to be wrong.
For example (differing IDs):
On HoloLens the name / ID of the Nano is
BLEServduino / BluetoothLE#BluetoothLE84:57:33:69:a6:92-e5:2f:88:f8:d5:ce
On windows PC it is
BLEServduino / BluetoothLE#BluetoothLEfc:77:74:37:b2:97-e5:2f:88:f8:d5:ce
The device's address (according to the ArduinoBLE library running on the device) is:
33:69:a6:92:00:01
Failure occurs at
await device.GetGattServicesAsync(BluetoothCacheMode.Uncached);
I've also tried
await device.GetGattServicesForUuidAsync(MyService_GUID, BluetoothCacheMode.Uncached);
I've tried a few other methods too like using AdvertisementWatcher. Works on Win10 x86/64 but not on ARM/ARM64.
I'm stuck and unfortunately we thought that, like most mobile BLE APIs, this would just work out of the box without a hassle. Now I've spent days trying to work with this and it seems no one knows.