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

Bluetooth Documentation and H10 issue #45

Open
primem0ver opened this issue Nov 16, 2022 · 5 comments
Open

Bluetooth Documentation and H10 issue #45

primem0ver opened this issue Nov 16, 2022 · 5 comments

Comments

@primem0ver
Copy link

Hi,
I just downloaded this because I got an Polar H10 to monitor heart rate during sleep (sleep apnea, just got APAP). Unfortunately the app that comes with the hardware doesn't allow me to do that. So I found this. However, I am getting "Unable to locate heartrate device. Ensure it is connected and paired." According to my settings and list of blue tooth devices, both of these are true (though it does occasionally lose connection as mentioned. Shows up as Polar H10 AFEF5B26). I am wondering what I am doing wrong. First time using c# with bluetooth. I am a decent c# programmer who might add functionality to this if I can figure out how to read bluetooth stuff so if you could just point me in the right direction it would be appreciated. However, your link in the HeartRateService file is no longer valid.

@jlennox
Copy link
Owner

jlennox commented Nov 17, 2022

Boy. Unfortunately a lot of bluetooth errors are massive black holes. I really wish I knew of better means to help diagnose what's happening.

If it's happening inside the monitoring program, %appdata%\HeartRate\log.txt may offer some insight.

To give a fast rundown on what it does for device selection:

  • It looks for the first BTLE device that that has a HeartRate GATT (correct term here?) GattServiceUuids.HeartRate
  • If not found, errors out with the error you're seeing.

Perhaps messing around with InitiateDefaultCore can give some insight.

Perhaps messing around with some of https://social.msdn.microsoft.com/Forums/en-US/58da3fdb-a0e1-4161-8af3-778b6839f4e1/bluetooth-bluetoothledevicefromidasync-does-not-complete-on-10015063?forum=wdk can help?

Let me know if I can be of any help.

@primem0ver
Copy link
Author

Yeah... I saw parts of that post earlier because of your registry fix suggestion. Tried it and it didn't work. I suppose I could try some of the other recommendations in that thread like CoInitializeSecurity. Only problem is that I don't know what this string refers too (""O:BAG:BAD:(A;;0x7;;;PS)(A;;0x3;;;SY)(A;;0x7;;;BA)(A;;0x3;;;AC)(A;;0x3;;;LS)(A;;0x3;;;NS)").

Plus... I am not entirely clear exactly what the AppID is in the registry instructions. Here is a copy of what (the reg file) I added to my registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID{C6BFD646-3DF0-4DE5-B7AF-5FFFACB844A5}]
@="Winforms Application"
"AccessPermission"=hex:01,00,04,80,9C,00,00,00,AC,00,00,00,00,00,00,00,14,00,
00,00,02,00,88,00,06,00,00,00,00,00,14,00,07,00,00,00,01,01,00,00,00,00,00,
05,0A,00,00,00,00,00,14,00,03,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00,
00,00,18,00,07,00,00,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,00,00,
00,18,00,03,00,00,00,01,02,00,00,00,00,00,0F,02,00,00,00,01,00,00,00,00,00,
14,00,03,00,00,00,01,01,00,00,00,00,00,05,13,00,00,00,00,00,14,00,03,00,00,
00,01,01,00,00,00,00,00,05,14,00,00,00,01,02,00,00,00,00,00,05,20,00,00,00,
20,02,00,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\HeartRate.exe]
"AppID"="{C6BFD646-3DF0-4DE5-B7AF-5FFFACB844A5}"

@primem0ver
Copy link
Author

Ooops. I forgot to mention that there really isn't much in the log. Just this:
11/15/2022 9:08:57 PM: Starting up
11/15/2022 9:08:57 PM: Loading from D:\Users\Matthew\AppData\Roaming\HeartRate\settings.xml
11/15/2022 9:08:57 PM: Saving to D:\Users\Matthew\AppData\Roaming\HeartRate\settings.xml
11/15/2022 9:09:08 PM: Restarting services...

@FlameSoulis
Copy link

Not a Polar H10 (CooSpo), but noticed the same issues around the same time. Log file included.

Can confirm that the registry thing doesn't seem to fix the issue, AND I have noticed this also occurring for YUR and Cardia, with Cardia only listing "Windows.Devices.Enumeration.DeviceInformation" as the only device. Not sure if this helps at all.

logs.txt

@FlameSoulis
Copy link

Update: After running a Windows update, it seems to have resolved everything. It sounds like certain updates can cause issues with BTLE devices in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants