uwburn/cardia

release for the Bt Smart branch

emanuelstanciu opened this issue · 84 comments

Any chance you can generate a build for the BT Smart branch?
I have a device and would love to test it out. Thanks.

ATM i'm away from home, i can upload the build when i get back home.
Anyway, i would be surprised to see that it works on first try.

@uwburn Thanks Michele, I look forward to hear from you once you're back.
Even if it doesn't we can try and fix it if it doesn't :)

@uwburn Hi again, any news on this one? Apologies if you are still away, but just wanted to kindly remind you if it's possible

@Ariestar I just uploaded a preview release: BT-Smart-pre.1.

You should use a device recognized as a HRM profile and connect it before executing Cardia, otherwise it will not be recognized. In the device menu you should select Bluetooth Smart HRP and then open the Device->Configuration panel where your device should be listed. If it shows up we're half done. Then you should just hit the start button and see if it reads.

In the meantime, i bought a cheap BT Smart HRM on eBay but was crappy... that was not working at all, not even with some fitness apps on the phone, i'm waiting for the substitution, i hope to have more luck with it.

@uwburn thanks for making that available. I have another problem before I can confirm on the status of the ones you mentioned.
The sensor is recognised by my Windows 10 tablet, however the app doesn't start. I tried it with admin rights and various compatibility modes, it simply doesn't start..
There are no log files as far as I can see.. I can only test on that tablet as it has BLE and the supported drivers. Please advise if we can do anything about it. Thanks

@Ariestar what kind of tablet is that? Is it x86 based?
If you try the 1.0 release, does it open up?

@uwburn it's an Intel tablet running win10 x64. The 1.0 release runs fine.

I'm afraid that's caused by how the libraries for accessing the BT Smart are referenced. Unfortunately that's hackish, and probably it's looking for the libraries for my system localization (italian), as on my office PC (that's also italian) it's working ok.

I will try to make it independent, maybe copying the required DLLs in the cardia.exe folder will do the trick.

Can you check out if on your system the folder "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5.1" is present?

If so, are the following files present?

  • System.Runtime.dll
  • System.Runtime.InteropServices.WindowsRuntime.dll
  • System.Runtime.WindowsRuntime.dll
  • System.Threading.dll
  • System.Threading.Tasks.dll

I have the same problem as ariestar. I got a desktop pc with Windows 10, which runs Cardia just fine, but has no bluetooth. And my Surface Pro 4 which won't even start Cardia. I have no idea of programming, but I have a Polar H7 HRM and a lot of spare time this weekend, but I didn't come far.

I installed Visual Studio and tried to find all prerequisites for compiling Cardia. Took a little (seems that on a surface there are some core components missing), but eventually I got it running. But as soon as I launch it, it throws a "System.InvalidOperationException" at
"BtSmartDevices = task.GetResults();" in Cardia.cs
If I put a "System.Threading.Thread.Sleep(10000);" right before that, Cardia comes up :)
(Yeah, I got some really basic programming skills from way back in time smile)
Seems that task.GetResults is called before task is filled by FindAllAsync, but I didn't understand the await / GetAwaiter / async stuff so that was my time to give up finding a fix.

If I connect and pair my Polar H7 before I start Cardia, I get a "System.NullReferenceException" at DeviceInformation backup = Device; at BtHrp.cs

Here are some ressources I found:
http://developer.polar.com/wiki/H6_and_H7_Heart_rate_sensors
https://code.msdn.microsoft.com/windowsapps/Bluetooth-Generic-5a99ef95

With the sample app, my heart rate monitor worked fine. I tried to implement there a network transmission of the heartrate via UDP sockets (and later add that to Cardia), but my basic programming skills were far from enough for that so I failed there, too.

Thank's for your great piece of software so far and for making it open source. I hope I was able to help a little and I really hope you don't loose interest in that project. Is there any way to donate for it? Maybe an Amazon wishlist with a Polar H7 on it? ;-) If you implement it and are willing to add another small feature for me, I would be glad to donate one for you :)

Thanks for the feedback! Just to be sure: after installing Visual Studio on the Surface, you were able to run Cardia BT-Smart-pre.1 on it?

Moving to the experiments: i would recommend you to stay away from the UDP routing, i mean, it's a nice idea, but it's overcomplicated and once again device specific.

As for the await/async, some of the methods used in there are asynchronous, that means normally, when you invoke them, you have to pass as a parameter a callback method that will deal with their result when they complete their task. As this concept tends to break the "normal" programming style (thing happenings one after another, follwoing the flow of the instructions) you can use the await keyword to "resync" the asynchronous call, making it return the result as a normal method. That's nice, but there's a price to pay: the methods where you use await have to be async as well, so that's basically moving the start of the asynchronous execution up in the stack. That's the basic idea if you wanna try to mess again with it, there are some further details specific to C#/.NET i might not be remembering.

Anyway, i'm wtill waiting for the replacement of my HRM to ship... if it's lost or it doesn't work as the previous one, i will open a wishlist for donations.

No, I just installed Visual Studio to see, why it is failing. It was the "System.InvalidOperationException" at
"BtSmartDevices = task.GetResults();" As soon as I delay this line for 10 seconds, it at least starts :)

A friend of mine helped me to get it running. No serious programming, just a quick and dirty solution for my usecase (Polar H7 via Bluetooth). I don't even have to send you the code because it almost just worked. I put here and there a second sleep in to dirty, really dirty, fix some async tasks (like the one mentioned above). And there was a ProcessPackets() missing, I think. And some List casts to Devicelists I didn't understand (I just commented them out and assumed that there is just one device in the system.). Everything else worked out of the box. Thank you again for that. Really great project.
I'm not familiar with github, so I don't know how to upload code here (but I think no one should see my bad fixes anyway), but if you want it, just let me know how to send it to you :)

Any posibillity someone can upload this?

How is the program going?

Quick update: thanks to donations, i just bought a Polar H7 and i'm awaiting the shipping. I hope to finally nail the BT Smart support down.

Awesome stuff.

Please check out BT-Smart-pre.2, it should allow BT Smart to work on Windows 8.1 and later.

Please keep in mind that BT Smart devices support on regular Windows Desktop is hacky to say the least (unless something changed with Windows 10, but i have not find anything in that regard).
So, be sure of:

  • Pair your device before starting Cardia
  • Select Bluetooth Smart HRP in Device menu
  • Check that in Device -> Configuration your device name appear as selected in the dropdown menu
  • If it times out when starting, TRY AGAIN: i don't know why with my Polar H7 sometimes it starts, sometimes it needs several retries

Please note that this version will not start up on Windows 7, and i'm unsure if Windows 7 support has to be dropped in Bluetooth Smart version.

If someone can provide feedback it would be appreciated!

Just downloaded it now and it now runs when you have a device connected although it still refuses to start... Am I that dead inside? haha

By refuse to start you mean that you hit Start button, the chart starts running and you have no reading until it stops, timing out?

Can you please list:

Uploaded BT-Smart-pre.3, i restructured a little Start/Stop logic and added a few options. On Polar H7 i had no more issues starting the devices, yet the reasons behind it are not clear.

I also added two options:

  • Characteristic Index: if your devices has several characteristics, changing the index may allow it to work; usually value 0 is fine, if you insert a value not supported by your device it will fail to start immediatly.
  • InitDelay: a delay applied before certain start phase instructions, adding a delay seems to help out (as above i don't know why...).

I would push start and it would just hang on starting with no timeout. I just downloaded the BT-Smart-pre 3 and it actually comes up with Bluetooth device is not transmitting this time although, it seems to pick up on my iPhone so i'm not sure what's going off here.

OS - Windows 10
HRM im using is called a CooSpo
Adapter type is Microsoft.

Hopefully this information helps.

When you hit start and it hangs, you also cannot move the window and open the menus? Is the UI freezed?

BTW, what is the OS language?

It doesn't freeze I can move everything about but it comes up with "Bluetooth HRP device not transmitting" after about 20-30 secs.
The OS language is ENG (United Kingdom)

Sorry, hangs sounded to me like a freeze, "Bluetooth HRP device not transmitting" after 30 seconds is the starting timeout.

If you haven't already tried, you can play with the Characteristic Index and Init Delay. In the next few day i will try to put some logging instruction down the code.

Uploaded BT-Smart-pre.4, including logging to help track down comm issues. When you run it, it will create a log directory with a log file for each day you use it. Please include the logs contents in case of problems reports.

Here is the log from a first time run of the new release:
2017-07-01 23:59:18,459 [1] INFO MGT.Cardia.Program - Starting Cardia
2017-07-01 23:59:27,705 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-07-01 23:59:27,723 [7] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService heart rate sensorwith id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_f0c77fe841ad#8&16443534&4&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-07-01 23:59:57,846 [6] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed
2017-07-01 23:59:57,847 [6] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2017-07-01 23:59:57,847 [6] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2017-07-01 23:59:57,848 [6] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

Hope this may help with my issues.

Yeah, apparently it gets stuck on this instruction:
service = await GattDeviceService.FromIdAsync(device.Id);
at HRM/HRP/BtHrp.cs - line 208

That means that there's either a problem with the device (pairing? communication?) or that there's a deadlock (that is likely from the symptoms, but yet it's strange as it never happened to me and looking at the code i could not figure it out).

Please ensure that:

  • the device is correctly paired (eventually remove it and pair it again)
  • the device is not paired with another device (e.g. phone)

I've tried all of the above and still cannot get it working. I get the feeling it might have something to do with my USB Bluetooth connector or the device i'm using is going crazy. After removing the device it sometimes struggles to find it again/connect to the device after a few attempts... I'm out of ideas and might just purchase the H7.

I got the same problem as Tristay, here is my log. I have a Polar H7 bluetooth smart.
2017-07-04 18:43:30,567 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-07-04 18:43:30,567 [17] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService Polar H7 CE85B81Bwith id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_Dev_MA&Polar_Electro_Oy_MO&H7_FW&1.4.0_0022d0ce85b8#8&37527f2&1&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-07-04 18:44:00,731 [11] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed
2017-07-04 18:44:00,731 [11] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2017-07-04 18:44:00,732 [11] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2017-07-04 18:44:00,732 [11] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

Definitely a deadlock then. I will try it also on my brother PC, to see if i can reproduce it there, otherwise we will have to try with a few more prereleases.

Tried out on my brother PC (Windows 10 laptop, always with Polar H7) and it worked, here's the log, how it should look like:
2017-07-05 21:03:24,662 [1] INFO MGT.Cardia.Program - Starting Cardia
2017-07-05 21:03:39,584 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-07-05 21:03:39,693 [7] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService Polar H7 0340FD2Fwith id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_Dev_MA&Polar_Electro_Oy_MO&H7_FW&1.4.0_a09e1a0340fd#8&3b6ad779&1&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-07-05 21:03:40,568 [9] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2017-07-05 21:03:40,568 [9] DEBUG MGT.HRM.HRP.BtHrp - Setting EncryptionRequired protection level on GattCharacteristic
2017-07-05 21:03:41,084 [9] DEBUG MGT.HRM.HRP.BtHrp - Registering event handler onction level on GattCharacteristic
2017-07-05 21:03:41,146 [9] DEBUG MGT.HRM.HRP.BtHrp - Reading GattCharacteristic configuration descriptor
2017-07-05 21:03:41,146 [9] DEBUG MGT.HRM.HRP.BtHrp - Configuration successfull
2017-07-05 21:04:09,791 [7] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed
2017-07-05 21:04:09,791 [7] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2017-07-05 21:04:09,791 [7] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2017-07-05 21:04:09,791 [7] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattCharacteristic
2017-07-05 21:04:09,791 [7] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattDeviceService
2017-07-05 21:04:09,854 [7] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters
2017-07-05 21:04:21,452 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-07-05 21:04:21,452 [10] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService Polar H7 0340FD2Fwith id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_Dev_MA&Polar_Electro_Oy_MO&H7_FW&1.4.0_a09e1a0340fd#8&3b6ad779&1&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-07-05 21:04:21,984 [12] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2017-07-05 21:04:22,718 [12] DEBUG MGT.HRM.HRP.BtHrp - Setting EncryptionRequired protection level on GattCharacteristic
2017-07-05 21:04:23,234 [12] DEBUG MGT.HRM.HRP.BtHrp - Registering event handler onction level on GattCharacteristic
2017-07-05 21:04:23,234 [12] DEBUG MGT.HRM.HRP.BtHrp - Reading GattCharacteristic configuration descriptor
2017-07-05 21:04:23,234 [12] DEBUG MGT.HRM.HRP.BtHrp - Configuration successfull
2017-07-05 21:04:23,749 [10] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic value changed, args = Windows.Devices.Bluetooth.GenericAttributeProfile.GattValueChangedEventArgs
2017-07-05 21:04:23,781 [10] DEBUG MGT.HRM.HRP.BtHrp - Processing HRP payload, data = System.Byte[]
2017-07-05 21:04:23,781 [10] DEBUG MGT.HRM.HRP.BtHrp - Constructed HRP packet = MGT.HRM.HRP.BtHrpPacket[ HeartRate = 82 ]
2017-07-05 21:04:23,781 [10] DEBUG MGT.HRM.HRP.BtHrp - Processing HRP packets
...

On first try the configuration step was successfull, but there was no data received. Trying again the communication was successful, and it started reading.

However it seems to have hit a deadlock when pressing stop, so the situation is pretty confused. I will try to change the startup logic, if possible, and see what happens.

Uploaded BT-Smart-pre.5, with new start logic, hope to see some changes, otherwise i'm running out of ideas.

If it doesnt work, try reducing init delay parameter in device config panel to 0 and chack if it changes anything.

Tried all of the above even ranging from 0-16 characteristic on different delays and still no luck as it still does the timeout... Even tried running it as admin to see if that changed anything.

Can you post the log anyway? Are there the following lines?
2017-07-05 21:03:40,568 [9] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2017-07-05 21:03:40,568 [9] DEBUG MGT.HRM.HRP.BtHrp - Setting EncryptionRequired protection level on GattCharacteristic
2017-07-05 21:03:41,084 [9] DEBUG MGT.HRM.HRP.BtHrp - Registering event handler onction level on GattCharacteristic
2017-07-05 21:03:41,146 [9] DEBUG MGT.HRM.HRP.BtHrp - Reading GattCharacteristic configuration descriptor

Ahhh i'm still getting the same lines as the previous release it seems....

2017-07-05 21:04:17,282 [1] INFO MGT.Cardia.Program - Starting Cardia
2017-07-05 21:07:50,134 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-07-05 21:07:50,173 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService heart rate sensor with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_f0c77fe841ad#8&2688b932&d&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-07-05 21:08:20,220 [6] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed
2017-07-05 21:08:20,222 [6] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2017-07-05 21:08:20,222 [6] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2017-07-05 21:08:20,223 [6] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

I wanted to clear out the situation a little, i created a bare minimum application to show up the heart rate reading from BT smart. Project repository is here and here's v0.1 release.
This is basically a stripped down porting of MS Heart Rate Profile to a WinForm application, the log is printed directly on the window, you can copy paste it. Tested on my brother PC (no VS installed), if this doesn't work i'm definitely out of ideas... feedback is welcome!

Nothing is happening. Am I doing something wrong?

I click start but nothing happening. This is the report from the v0.1

Getting GattDeviceService Polar H7 CE85B81B with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_Dev_MA&Polar_Electro_Oy_MO&H7_FW&1.4.0_0022d0ce85b8#8&37527f2&3&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}

And I'm still getting this on the prelease 5

2017-07-06 20:15:53,127 [1] INFO MGT.Cardia.Program - Starting Cardia
2017-07-06 20:16:02,482 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-07-06 20:16:02,486 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService Polar H7 CE85B81B with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_Dev_MA&Polar_Electro_Oy_MO&H7_FW&1.4.0_0022d0ce85b8#8&37527f2&3&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-07-06 20:16:32,674 [6] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed
2017-07-06 20:16:32,676 [6] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2017-07-06 20:16:32,676 [6] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2017-07-06 20:16:32,676 [6] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

Thanks for the report. As said, BtSmartHrp v0.1 has just bare minimum functionality to test out Windows BT Smart API calls in a simplified situation, so no timeout is implemented.

@Funkiekitty, @Tristay: are you running Windows 10 Creators Update (the big update released in April)? Googling around it seems they added some new stuff for BT Smart in it. I don't have it installed on my machine nor does my brother on his laptop, considering that BT Smart support in desktop applications is hacky, something might have broken down.

I am indeed running the creators update so it must have something to do with it. I got a rig with windows 10 before the creators update I could try this on so I shall post the results later.

EDIT: Okay now we have something different! Using my other rig it now says this.

2017-07-07 13:51:40,415 [1] INFO MGT.Cardia.Program - Starting Cardia
2017-07-07 13:51:50,521 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-07-07 13:51:50,547 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService heart rate sensor with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_f0c77fe841ad#8&f85db32&1&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-07-07 13:51:52,590 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2017-07-07 13:51:52,612 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting EncryptionRequired protection level on GattCharacteristic
2017-07-07 13:51:54,638 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering event handler onction level on GattCharacteristic
2017-07-07 13:51:54,661 [1] DEBUG MGT.HRM.HRP.BtHrp - Reading GattCharacteristic configuration descriptor
2017-07-07 13:51:54,678 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting GattCharacteristic configuration descriptor to enable notifications
2017-07-07 13:51:54,698 [1] WARN MGT.HRM.HRP.BtHrp - Error configuring HRP device
System.Exception: Incorrect function. (Exception from HRESULT: 0x80070001)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at MGT.HRM.HRP.BtHrp.d__2.MoveNext()
2017-07-07 13:51:54,722 [1] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2017-07-07 13:51:54,734 [1] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2017-07-07 13:51:54,745 [1] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattCharacteristic
2017-07-07 13:51:54,757 [1] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattDeviceService
2017-07-07 13:51:54,769 [1] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

Yes I am. So what do I have to do?

@Tristay: that's informative, thank you. Look like the various updates have something to do with it.

@Funkiekitty: atm nothing, it's just to try to track down a pattern in what's going on.

I will try to install Win 10 on a spare HDD and update it, maybe the API has been expanded.

Any updates for windows 10?

I've been rather busy lately and i got back on it yesterday. Unfortunately my Win 10 install was not working anymore (have been playing with my spare hdd), so i had to reinstall but creators updates doesn't want to install, it keeps redownloading. I'm trying again right now, otherwise i will need another clean install with an updated ISO. It's getting annoying... :/

Tested right now, the problem is there but i can't find a way to get around it. I tried to recompile everything referencing Win10 SDK instead of 8, but still no go.

Googling around, i found this: https://social.msdn.microsoft.com/Forums/en-US/fda7e9db-d2e0-411c-8f4f-75efa7f0af53/rs21703can-not-connect-ot-the-ble-device-after-creators-update?forum=wpdevelop
The problem seems related, let's see if MS will spend time fixing it.

bump there seems to be an update on that forum post! https://social.msdn.microsoft.com/Forums/en-US/fda7e9db-d2e0-411c-8f4f-75efa7f0af53/rs21703can-not-connect-ot-the-ble-device-after-creators-update?forum=wpdevelop

I'm currently installing the update to see if there is any changes.

Edit: Using my current rig (Windows 10 Creators) I'm now getting this -

7 23:58:23,561 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-08-07 23:58:23,562 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService heart rate sensor with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_f0c77fe841ad#8&2688b932&12&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-08-07 23:58:24,148 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2017-08-07 23:58:24,154 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting EncryptionRequired protection level on GattCharacteristic
2017-08-07 23:58:24,660 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering event handler onction level on GattCharacteristic
2017-08-07 23:58:24,660 [1] DEBUG MGT.HRM.HRP.BtHrp - Reading GattCharacteristic configuration descriptor
2017-08-07 23:58:24,662 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting GattCharacteristic configuration descriptor to enable notifications
2017-08-07 23:58:32,361 [1] DEBUG MGT.HRM.HRP.BtHrp - Device unreachable
2017-08-07 23:58:32,362 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering device connection watcher updated event handler
2017-08-07 23:58:32,362 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting device connection watcher
2017-08-07 23:58:53,770 [9] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed
2017-08-07 23:58:53,770 [9] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2017-08-07 23:58:53,771 [9] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2017-08-07 23:58:53,772 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattCharacteristic
2017-08-07 23:58:53,773 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing device changed watcher
2017-08-07 23:58:53,774 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattDeviceService
2017-08-07 23:58:53,777 [9] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

Using Pre-Release 5 it seems to state the device unreachable line. On the small program you wrote it comes up with this -

Getting GattDeviceService heart rate sensor with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_f0c77fe841ad#8&2688b932&12&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
Getting HeartRateMeasurement GattCharacteristic 0
Setting EncryptionRequired protection level on GattCharacteristic
Registering event handler onction level on GattCharacteristic
Reading GattCharacteristic configuration descriptor
Setting GattCharacteristic configuration descriptor to enable notifications
Device unreachable
Registering device connection watcher updated event handler
Starting device connection watcher

and it seems to hang there..

I'm currently away from home, so i cannot test it... when i last test it on Creators it configured everything successfully but yet i would not receive any data packet. That's bad, because it's the kind of things you cannot debug, Also, the post you linked tells basically the same stuff: configuration works but notifications (where you get data) doesn't. I joined the discussion linking my projects, maybe it will get some attention.

On some forums there are comments about the BT API working fine only in UWP (Universal Windows Platform, the new app style for Windows), eventually i can try to port the test app to UWP to see if it works or not.

I'm trying Cardia with Polar H7 HRM on latest Windows 10 version 1703 (build 15063.483) and it doesn't work. Here's my logfile if that can help.

2017-08-16 19:49:03,960 [1] INFO MGT.Cardia.Program - Starting Cardia
2017-08-16 19:49:08,181 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-08-16 19:49:08,503 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService Polar H7 D1E3D514 with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_Dev_MA&Polar_Electro_Oy_MO&H7_FW&1.4.0_0022d0d1e3d5#9&1b6fe52e&0&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-08-16 19:49:09,095 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2017-08-16 19:49:09,096 [1] WARN MGT.HRM.HRP.BtHrp - Error configuring HRP device
System.NullReferenceException: Object reference not set to an instance of an object.
at MGT.HRM.HRP.BtHrp.d__2.MoveNext()
2017-08-16 19:49:09,100 [1] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2017-08-16 19:49:09,100 [1] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2017-08-16 19:49:09,101 [1] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters
2017-08-16 19:50:49,167 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-08-16 19:50:49,167 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService Polar H7 D1E3D514 with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_Dev_MA&Polar_Electro_Oy_MO&H7_FW&1.4.0_0022d0d1e3d5#9&1b6fe52e&0&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-08-16 19:50:49,765 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2017-08-16 19:50:49,767 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting EncryptionRequired protection level on GattCharacteristic
2017-08-16 19:50:50,267 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering event handler onction level on GattCharacteristic
2017-08-16 19:50:50,268 [1] DEBUG MGT.HRM.HRP.BtHrp - Reading GattCharacteristic configuration descriptor
2017-08-16 19:50:50,270 [1] DEBUG MGT.HRM.HRP.BtHrp - Configuration successfull
2017-08-16 19:51:19,326 [9] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed
2017-08-16 19:51:19,326 [9] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2017-08-16 19:51:19,326 [9] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2017-08-16 19:51:19,327 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattCharacteristic
2017-08-16 19:51:19,327 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattDeviceService
2017-08-16 19:51:19,329 [9] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters
2017-08-16 19:51:21,328 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2017-08-16 19:51:21,328 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService Polar H7 D1E3D514 with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_Dev_MA&Polar_Electro_Oy_MO&H7_FW&1.4.0_0022d0d1e3d5#9&1b6fe52e&0&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2017-08-16 19:51:21,926 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2017-08-16 19:51:21,926 [1] WARN MGT.HRM.HRP.BtHrp - Error configuring HRP device
System.NullReferenceException: Object reference not set to an instance of an object.
at MGT.HRM.HRP.BtHrp.d__2.MoveNext()
2017-08-16 19:51:21,927 [1] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2017-08-16 19:51:21,927 [1] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2017-08-16 19:51:21,927 [1] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

About the UWP, maybe you can get some tips from here: https://github.com/DrJukka/Heart-rate-monitor-UWP- and here http://www.drjukka.com/blog/wordpress/?p=193

That's what i get also on my PC: sometimes it gets the System.NullReferenceException as the GattCharacteristic returned is null (failed to read device available characteristics), other times it seems to configure correctly but then no notification (HR reading) ever comes up.

As for UWP, i need to get VS 2015, and to understand a little how it works, anyway thanks for the links.

Do you think you'll be able to have a solution for when Halloween comes up?
If not is there maybe another heart monitor I could get that would work with your system on a windows 10?

No, sorry, i don't think so: actually is more of a Microsoft problem than mine, unless i try to reimplement Cardia for UWP, but i'm busy with other projects.

As for another HRM, don't waste your money, it will have the same issues.

so there is nothing I can do?

uwburn, I'm really looking forward to this app on latest Windows 10 builds. Is there no chance to get this working? I have no programming skills, but I stumbled on this project and I think it could be useful: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE

I just tried out version pre5 on Windows 10 Falls Creators Update (version 1709 - build 16299.15) and it's working fine.

If someone else can confirm this i can finalize the changes and merge back everything in the master branch.

I'll update to version 1709 in the next day or so and test it out :)

Okay I've updated to 1709 and tested it first on the smaller program you wrote and it's giving me this now:

Getting GattDeviceService heart rate sensor with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_f0c77fe841ad#8&2688b932&14&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
Getting HeartRateMeasurement GattCharacteristic 0
Setting EncryptionRequired protection level on GattCharacteristic
Registering event handler onction level on GattCharacteristic
Reading GattCharacteristic configuration descriptor
Setting GattCharacteristic configuration descriptor to enable notifications
Device unreachable
Registering device connection watcher updated event handler
Starting device connection watcher
Device connection updated, args = Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate
Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate

I may invest in a Polar H7 if we know they work. Really weird that i get no issues on my iPhone with this HRM i have o.o

Umh, can you try it out on Cardia directly? The test program is not really up to date.

In any case, be sure to check the association of the HRM in Windows Bluetooth devices panel, eventually try reassociating it.

I have moved all BT Smart changes to master and released new versions, if someone is willing to carry out tests, please use v1.1 Main.

Tested my HRM out on another computer and it still gets Device unreachable. New HRM will be ordered soon and i'll test it then ^^

By any chance, do you have the logs?

I had feedback from another Polar HRM user that was working OK. Today, i strapped on mine to test the release: at first it connected fine, but was reading 0 (probably because was not fitted correctly/too dry), then it started to timeout or refuse to configure, then again it worked ok. Unfortunately, even with the debugger, i could not track down what was wrong when it refused to work: simply the API calls fail.

On my experience it works 3 times out of 4: when it doesn't start i poke around with the band (i'm never sure it's fitted properly) and then i reassociate the bluetooth device and restart Cardia. Also trying several times helps sometimes, as the bluetooth advertisement cycle is not continuous.

2018-01-14 18:32:14,909 [1] INFO MGT.Cardia.Program - Starting Cardia
2018-01-14 18:32:23,623 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2018-01-14 18:32:23,644 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService heart rate sensor with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_f0c77fe841ad#8&2688b932&16&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2018-01-14 18:32:24,242 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2018-01-14 18:32:24,254 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting EncryptionRequired protection level on GattCharacteristic
2018-01-14 18:32:24,757 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering event handler onction level on GattCharacteristic
2018-01-14 18:32:24,760 [1] DEBUG MGT.HRM.HRP.BtHrp - Reading GattCharacteristic configuration descriptor
2018-01-14 18:32:24,770 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting GattCharacteristic configuration descriptor to enable notifications
2018-01-14 18:32:32,482 [1] DEBUG MGT.HRM.HRP.BtHrp - Device unreachable
2018-01-14 18:32:32,486 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering device connection watcher updated event handler
2018-01-14 18:32:32,487 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting device connection watcher
2018-01-14 18:32:53,753 [9] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed
2018-01-14 18:32:53,755 [9] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2018-01-14 18:32:53,756 [9] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2018-01-14 18:32:53,756 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattCharacteristic
2018-01-14 18:32:53,758 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing device changed watcher
2018-01-14 18:32:53,759 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattDeviceService
2018-01-14 18:32:53,763 [9] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

I sit here for atleast 15-20 minutes fiddling round with the strap/re-pairing the device to still not avail.

Compared to the log of the test program, the lines Device connection updated, args = Device connection updated, args = Windows.Devices.Enumeration.Pnp.PnpObjectUpdate are missing, i was hoping to see them here as well (i added other log info there).

Do you still get thoose lines in the test program? If so that would be an hint to see what are the differences.

Getting GattDeviceService heart rate sensor with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_f0c77fe841ad#8&2688b932&19&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
Getting HeartRateMeasurement GattCharacteristic 0
Setting EncryptionRequired protection level on GattCharacteristic
Registering event handler onction level on GattCharacteristic
Reading GattCharacteristic configuration descriptor
Setting GattCharacteristic configuration descriptor to enable notifications
Device unreachable
Registering device connection watcher updated event handler
Starting device connection watcher

Not getting the same as before now :( It's really temperamental it seems.

Hello, i hope you can help me. I just bought some cheap BT senson from aliexpress, it should be some "KYTO 2809". I paired it with my Win10 laptop with built in bluetooth, downloaded Cardia, the app founded my HRM, but no data are sent to the app.. I tried it with my phone, and several apps had no problem, always showed me my heart rate. Can you help me? Is there something i should enable in Windows?

Here's log:
2020-06-09 18:33:14,429 [1] INFO MGT.Cardia.Program - Starting Cardia
2020-06-09 18:33:14,608 [1] DEBUG MGT.Cardia.BtHrpBundle - Retrieving heart rate capable devices
2020-06-09 18:33:14,665 [1] DEBUG MGT.Cardia.BtHrpBundle - Attempting to retrieve async result...
2020-06-09 18:33:14,780 [1] DEBUG MGT.Cardia.BtHrpBundle - Found 1 heart rate capable deices
2020-06-09 18:33:14,794 [1] DEBUG MGT.Cardia.BtHrpBundle - 2809_3F9D82: id = \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_e7ef243f9d82#8&28b25868&3&000c#{6e3bb679-4372-40c8-9eaa-4509df260cd8}, default = False, enabled = True, paired = False
2020-06-09 18:33:20,680 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2020-06-09 18:33:20,688 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService 2809_3F9D82 with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_e7ef243f9d82#8&28b25868&3&000c#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2020-06-09 18:33:21,338 [1] DEBUG MGT.HRM.HRP.BtHrp - GattDeviceService instatiated successfully
2020-06-09 18:33:21,344 [1] DEBUG MGT.HRM.HRP.BtHrp - GattSession status = Closed, mantain connection = False, can mantain connection = False
2020-06-09 18:33:21,345 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting all GattCharacteristic...
2020-06-09 18:33:21,372 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristicsResult status Success
2020-06-09 18:33:21,372 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic 00002a37-0000-1000-8000-00805f9b34fb: description = , protection level = Plain
2020-06-09 18:33:21,376 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic 00002a38-0000-1000-8000-00805f9b34fb: description = , protection level = Plain
2020-06-09 18:33:21,377 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2020-06-09 18:33:21,382 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristicsResult status Success
2020-06-09 18:33:21,384 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic 00002a37-0000-1000-8000-00805f9b34fb: description = , protection level = Plain
2020-06-09 18:33:21,385 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting EncryptionRequired protection level on GattCharacteristic
2020-06-09 18:33:21,903 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering event handler onction level on GattCharacteristic
2020-06-09 18:33:21,904 [1] DEBUG MGT.HRM.HRP.BtHrp - Reading GattCharacteristic configuration descriptor
2020-06-09 18:33:21,921 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting GattCharacteristic configuration descriptor to enable notifications
2020-06-09 18:33:22,187 [1] DEBUG MGT.HRM.HRP.BtHrp - Device unreachable
2020-06-09 18:33:22,187 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering device connection watcher updated event handler
2020-06-09 18:33:22,187 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting device connection watcher
2020-06-09 18:33:51,126 [6] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed
2020-06-09 18:33:51,129 [6] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP
2020-06-09 18:33:51,129 [6] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer
2020-06-09 18:33:51,133 [6] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattCharacteristic
2020-06-09 18:33:51,134 [6] DEBUG MGT.HRM.HRP.BtHrp - Clearing device changed watcher
2020-06-09 18:33:51,134 [6] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattDeviceService
2020-06-09 18:33:51,147 [6] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

Hello, beside trying again, i cannot suggest much more.
The only point raising any idea is the line from your logs:

2020-06-09 18:33:14,794 [1] DEBUG MGT.Cardia.BtHrpBundle - 2809_3F9D82: id = \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_e7ef243f9d82#8&28b25868&3&000c#{6e3bb679-4372-40c8-9eaa-4509df260cd8}, default = False, enabled = True, paired = False

If i recall correctly it should state paired = True, not false. Check that Windows states that your device is paired and remove pairing with any other device (e.g. your phone)

Also try with setting the Characteristic index in Device > Configuration to either 0 (wich is default) or 1, as your device seems to expose two values.

Anyway, ss was already mentioned in the discussion, Windows support for BT Smart devices in Winform (the framework used for Cardia GUI) is not official and seems to not always work properly, even if the code was ported pretty much from MS examples.

I double checked everything in Windows, in bluetooth settings it says it's paired, in Control Panel looks everything alright.. I've tried change Configuration to 1, but it wasnt working at all, when it was 0, after I pressed "Start", Cardia waited 10 seconds, and then said, that HRM is not transmitting any data.. Maybe it's indeed the Winform framework, after some googling, i've discovered another heart rate app from github (https://github.com/jlennox/HeartRate), which is working. Right after i open the app, it shows my heart rate. The app is a bit simpler, it's a shame, that it hasnt so many functions like your app, but it works in my case.. But anyway, thanks for your help :)

Thanks for pointing me out the other project. I will take a look at it sooner or later, i will try to compare the implementation and see if i can finally fix this.

I can confirm HeartRate app mentioned in @dejv997's comment is working though with the Zephyr HMX I see "No serial port found" in the status bar, I am unable to press "Configuration" or "Start" unless I use Emulator. I am not sure if it is the same problem as being discussed since there was no mention of serial port not found in this thread.
In the debug log I can see

2020-06-19 12:35:02,632 [1] DEBUG MGT.Cardia.BtHrpBundle - Retrieving heart rate capable devices
2020-06-19 12:35:02,647 [1] DEBUG MGT.Cardia.BtHrpBundle - Attempting to retrieve async result...
2020-06-19 12:35:02,748 [1] DEBUG MGT.Cardia.BtHrpBundle - Found 1 heart rate capable deices
2020-06-19 12:35:02,750 [1] DEBUG MGT.Cardia.BtHrpBundle - Zephyr HXM200016027: id = \\?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_Dev_VID&01000d_PID&0000_REV&0110_f45eab09c4e2#8&119521df&0&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}, default = False, enabled = True,  paired = False

So the device is detected.

Huh. After just clicking through all the available devices I found that Bluetooth Smart HRP worked for me... I wonder if that was related to the comment about being compatible with more BT devices on a more generic level?

Hello, as you figured out, your device is BT HRP compliant. Two Zephyr HxM version exists, an older one that required serial port emulation and a new one that use the generic HRP.

Happy to see it worked, have fun!

It's been a while since I've tried this app and since the release of the newer windows apps I thought i'd give it another bash.

This time round it seems to give me a bit more information than previous attempts:

2020-09-22 20:36:26,548 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP
2020-09-22 20:36:26,548 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService heart rate sensor with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_f0c77fe841ad#9&15ac7dc8&1&0010#{6e3bb679-4372-40c8-9eaa-4509df260cd8}
2020-09-22 20:36:28,616 [1] DEBUG MGT.HRM.HRP.BtHrp - GattDeviceService instatiated successfully
2020-09-22 20:36:28,617 [1] DEBUG MGT.HRM.HRP.BtHrp - GattSession status = Closed, mantain connection = False, can mantain connection = False
2020-09-22 20:36:28,617 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting all GattCharacteristic...
2020-09-22 20:36:28,623 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristicsResult status Success
2020-09-22 20:36:28,623 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic 00002a37-0000-1000-8000-00805f9b34fb: description = , protection level = Plain
2020-09-22 20:36:28,624 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic 00002a38-0000-1000-8000-00805f9b34fb: description = , protection level = Plain
2020-09-22 20:36:28,624 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic 00002a39-0000-1000-8000-00805f9b34fb: description = , protection level = Plain
2020-09-22 20:36:28,624 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0
2020-09-22 20:36:28,625 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristicsResult status Success
2020-09-22 20:36:28,625 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic 00002a37-0000-1000-8000-00805f9b34fb: description = , protection level = Plain
2020-09-22 20:36:28,626 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting EncryptionRequired protection level on GattCharacteristic
2020-09-22 20:36:30,638 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering event handler onction level on GattCharacteristic
2020-09-22 20:36:30,638 [1] DEBUG MGT.HRM.HRP.BtHrp - Reading GattCharacteristic configuration descriptor
2020-09-22 20:36:30,640 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting GattCharacteristic configuration descriptor to enable notifications
2020-09-22 20:36:38,341 [1] DEBUG MGT.HRM.HRP.BtHrp - Device unreachable
2020-09-22 20:36:38,342 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering device connection watcher updated event handler
2020-09-22 20:36:38,342 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting device connection watcher
2020-09-22 20:36:56,711 [6] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed

Saw that it outputs 3 different characteristics now and tried changing them in the program with no avail still. By this time I could of just invested into a Polar H7 and be done with it haha.

Hope all is well!

Using CooSpo at the moment I get 'Bluetooth HRP device not transmitting'
cardia_2021-03-17.log

Is anyone tried to use MZ3 from myZone and does it work ? would like to use this as a video game feature

Tested on CooSpoo H808S. Program gets heartbeat when I connect first time, but fails with [Bluetooth HRP device not transmitting] every other time even after pc reboot. After I connect pulse monitor through other software it will work again - once. The reason is HRM\HRP\BtHrp.cs:204. When Cardia does this command everithing works OK. But it always skips this part because of contitional. I placed it outside and it works now. Here is working (first part) and not working (second part) log.
cardia_2022-07-22.log
.

@effgenesis, can you show me the edited file? Did you just remove the conditional?

Lines 204-217 in the conditional are there just for logging, sounds strange that they really make a difference. it's been a long time, i don't recall if the release EXE was built with debug enabled or not, so i'm not sure this is really the culprit.

Thanks for the interest, btw.

Sorry, i'm stupid. Wrong line. it's this command: GattCommunicationStatus status =
await characteristic.WriteClientCharacteristicConfigurationDescriptorAsync(
CHARACTERISTIC_NOTIFICATION_TYPE);
Here is BtHrp.cs:
BtHrp.txt
Cool project btw. I like it.

@effgenesis, i see, changes make sense, probably there are some devices where using the cached values ends up not working.

I finally had the chance to fire up VS again and luckily my Polar still works ok: i made some changes to reflect your initialization sequence and published a new draft release (related branch is bthrpfix). For what it counts on the Polar it worked ok on first try.

If you have time to test it out let me know if it works... it would be really nice to fix this issues after such a long time!

Got it to work easily with BT:
Windows 10 21H2
Magene H64

Paxy commented

Works OK with cheap Chinese BLE HRM presented in Windows as "heart rate sensor".

Thanks for feedback!

Closed, as the new version seems to fix this definitely.

I still get the [Bluetooth HRP device not transmitting] on my XOSS X2 (version used: v1.2.0.1_Main; log files still show "paired = False"), but the possible root cause may have been found now and it might be the device packet initialization process. I launched Cardia and set it aside in the background, then launched the mentioned HeartRate app and exited then quickly started Cardia, it worked and it didn't get the [Bluetooth HRP device not transmitting] error. Starting Cardia without launching and closing the HeartRate app, Cardia had the error again, so it made me think that it may be the device packet initialization process; it's more of an assumption that that's the issue as I lack understanding and skill in coding, but hopefully with this demonstration it would be the real cause and be fixed.

Here's the video demonstration:
cardiaDataTransmissionIssue

Here's the log file:
cardia_2023-04-17.log

My Polar H10 worked after a long trouble... I had to enable all devices in my bluetooth configuration (I'm running on Windows 11 btw), then I had to keep trying to connect with my Polar Band with no sucess, then suddenly it connected (?) and, as the instructions says, the Cardia was able to identify and display the data