uwburn / cardia

Heart rate monitoring client for gamers
GNU General Public License v3.0
91 stars 23 forks source link

Issues pairing with Wahoo TICKR #19

Closed zerotohero closed 2 years ago

zerotohero commented 5 years ago

Hey, thanks for making the cool application! I'm trying to get it to work with my Wahoo TICKR. However, it's not going smoothly. Log is below:

2018-11-09 02:08:10,705 [1] INFO MGT.Cardia.Program - Starting Cardia 2018-11-09 02:08:13,408 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP 2018-11-09 02:08:13,416 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService TICKR 1BCF with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_fe2c0b36d397#9&143fc30&2&0022#{6e3bb679-4372-40c8-9eaa-4509df260cd8} 2018-11-09 02:08:13,999 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 1 2018-11-09 02:08:14,006 [1] WARN MGT.HRM.HRP.BtHrp - Error configuring HRP device System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index at System.Runtime.InteropServices.WindowsRuntime.IVectorViewToIReadOnlyListAdapter.Indexer_Get[T](Int32 index) at MGT.HRM.HRP.BtHrp.d__77.MoveNext() 2018-11-09 02:08:14,015 [1] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP 2018-11-09 02:08:14,018 [1] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer 2018-11-09 02:08:14,021 [1] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattDeviceService 2018-11-09 02:08:14,025 [1] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters 2018-11-09 02:11:24,258 [1] INFO MGT.Cardia.Program - Starting Cardia 2018-11-09 02:24:28,536 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP 2018-11-09 02:24:28,546 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService TICKR 1BCF with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_fe2c0b36d397#9&143fc30&2&0022#{6e3bb679-4372-40c8-9eaa-4509df260cd8} 2018-11-09 02:24:29,126 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 16 2018-11-09 02:24:29,130 [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__77.MoveNext() 2018-11-09 02:24:29,137 [1] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP 2018-11-09 02:24:29,141 [1] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer 2018-11-09 02:24:29,144 [1] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

Not wanting to send you down a rabbit hole, I found a program called Bluetooth LE Explorer. I'm not sure if it's using the same API, but when querying my TICKR it showed that HeartRate was characteristic 35, but that the value is "Read Not Permitted". I also noticed that Cardia can only accept characteristics 0-16. I tried characteristic 13, which should be BatteryLevel, but that didn't work either. Here's the log from your test program when trying that:

Getting GattDeviceService TICKR 1BCF with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_fe2c0b36d397#9&143fc30&2&0022#{6e3bb679-4372-40c8-9eaa-4509df260cd8} Getting HeartRateMeasurement GattCharacteristic 13 Error configuring HRP device System.NullReferenceException: Object reference not set to an instance of an object. at BtSmartHrp.FrmBtSmartHrp.d__7.MoveNext()

Any chance you know what's going on? It would be great if it's an easy fix.

uwburn commented 5 years ago

Hello, the log line 2018-11-09 02:08:13,999 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 1 2018-11-09 02:08:14,006 [1] WARN MGT.HRM.HRP.BtHrp - Error configuring HRP device System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index at System.Runtime.InteropServices.WindowsRuntime.IVectorViewToIReadOnlyListAdapter.Indexer_Get[T](Int32 index) at MGT.HRM.HRP.BtHrp.d__77.MoveNext()

means that the BTLE api could not lookup a HeartRateMeasurement characteristic on the device.

The 1-16 setting in cardia is just for selecting between multiple characteristics of the same type (HeartRateMeasurement) detected on the device, 1 should always work. It would be interesting to do a log of the full scan of characteristics supported on the device, i might include it.

The error 2018-11-09 02:24:29,130 [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__77.MoveNext()

seems to be the result of some not clear state from the previous run, i will also try to put a log to track it down.

Btw, what windows version (including the build) are you running?

zerotohero commented 5 years ago

I'm running Windows 10 Pro

Version 10.0.17134 Build 17134

uwburn commented 5 years ago

Hello, i released a new version with additional logging, it might help to track down issues.

If you want to try it out it's here: v1.2.0.0_Main

RevNotDev commented 5 years ago

I'm also having issues getting this working with a Wahoo TICKR. Hoping to use this on YouTube videos if I can get it working. Just the kind of program I've been looking for.

Log: 2019-01-13 12:34:51,946 [1] INFO MGT.Cardia.Program - Starting Cardia 2019-01-13 12:34:52,065 [1] DEBUG MGT.Cardia.BtHrpBundle - Retrieving heart rate capable devices 2019-01-13 12:34:52,105 [1] DEBUG MGT.Cardia.BtHrpBundle - Attempting to retrieve async result... 2019-01-13 12:34:52,208 [1] DEBUG MGT.Cardia.BtHrpBundle - Found 1 heart rate capable deices 2019-01-13 12:34:52,211 [1] DEBUG MGT.Cardia.BtHrpBundle - TICKR B321: id = \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_c803f1b90b4e#8&3d99917&0&0022#{6e3bb679-4372-40c8-9eaa-4509df260cd8}, default = False, enabled = True, paired = True 2019-01-13 12:34:55,024 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting HRP 2019-01-13 12:34:55,042 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting GattDeviceService TICKR B321 with id \?\BTHLEDevice#{0000180d-0000-1000-8000-00805f9b34fb}_c803f1b90b4e#8&3d99917&0&0022#{6e3bb679-4372-40c8-9eaa-4509df260cd8} 2019-01-13 12:34:55,749 [1] DEBUG MGT.HRM.HRP.BtHrp - GattDeviceService instatiated successfully 2019-01-13 12:34:55,752 [1] DEBUG MGT.HRM.HRP.BtHrp - GattSession status = Closed, mantain connection = False, can mantain connection = False 2019-01-13 12:34:55,752 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting all GattCharacteristic... 2019-01-13 12:34:55,762 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristicsResult status Success 2019-01-13 12:34:55,765 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic 00002a37-0000-1000-8000-00805f9b34fb: description = , protection level = Plain 2019-01-13 12:34:55,765 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic 00002a38-0000-1000-8000-00805f9b34fb: description = , protection level = Plain 2019-01-13 12:34:55,766 [1] DEBUG MGT.HRM.HRP.BtHrp - Getting HeartRateMeasurement GattCharacteristic 0 2019-01-13 12:34:55,768 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristicsResult status Success 2019-01-13 12:34:55,769 [1] DEBUG MGT.HRM.HRP.BtHrp - GattCharacteristic 00002a37-0000-1000-8000-00805f9b34fb: description = , protection level = Plain 2019-01-13 12:34:55,770 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting EncryptionRequired protection level on GattCharacteristic 2019-01-13 12:34:56,285 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering event handler onction level on GattCharacteristic 2019-01-13 12:34:56,286 [1] DEBUG MGT.HRM.HRP.BtHrp - Reading GattCharacteristic configuration descriptor 2019-01-13 12:34:56,296 [1] DEBUG MGT.HRM.HRP.BtHrp - Setting GattCharacteristic configuration descriptor to enable notifications 2019-01-13 12:35:03,992 [1] DEBUG MGT.HRM.HRP.BtHrp - Device unreachable 2019-01-13 12:35:03,994 [1] DEBUG MGT.HRM.HRP.BtHrp - Registering device connection watcher updated event handler 2019-01-13 12:35:03,995 [1] DEBUG MGT.HRM.HRP.BtHrp - Starting device connection watcher 2019-01-13 12:35:25,201 [9] DEBUG MGT.HRM.HRP.BtHrp - Communication timeout elapsed 2019-01-13 12:35:25,202 [9] DEBUG MGT.HRM.HRP.BtHrp - Stopping HRP 2019-01-13 12:35:25,203 [9] DEBUG MGT.HRM.HRP.BtHrp - Stopping timeout timer 2019-01-13 12:35:25,204 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattCharacteristic 2019-01-13 12:35:25,205 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing device changed watcher 2019-01-13 12:35:25,205 [9] DEBUG MGT.HRM.HRP.BtHrp - Clearing GattDeviceService 2019-01-13 12:35:25,207 [9] DEBUG MGT.HRM.HRP.BtHrp - Resetting counters

Any ideas?

**Forgot to say I'm also running W10 Pro on v1803

uwburn commented 5 years ago

The log seems all good: except from trying several times, i cannot suggest anything, sorry.

uwburn commented 2 years ago

Stale.