fg1 / BLEHeartRateLogger

Bluetooth Low-Energy Heart Rate Monitor data logging in Python
Other
127 stars 48 forks source link

Change to Support Polar H10 #8

Closed sheeets closed 3 years ago

sheeets commented 6 years ago

This may be related to the bluetooth adapter in the device I am using, but I was unable to get your script to function for the Polar H10 until I changed the timeout from 10 seconds to 30 seconds under main for determining the heart rate handle. This is most likely due to the fact that running char-desc for the H10 takes significantly longer than if I did char-desc 0x000e 0x0013 based on running primary and determining the handle group that corresponds to the heart rate sensor.

This may even be a better implementation to support more devices. If I make the change myself I will send a pull request, but food for thought.

# Heart Rate (org.bluetooth.service.heart_rate)
attr handle: 0x000e, end grp handle: 0x0013 uuid: 0000180d-0000-1000-8000-00805f9b34fb
fg1 commented 6 years ago

Thanks for the feedback! Back when I developed the script, it was mainly tested with my Polar H7 and the (hardcoded) timeout values were set accordingly. Pull requests for supporting more devices are always welcomed.

whacked commented 4 years ago

I have used this with Polar H10 successfully; the pairing seems to work very smoothly on a Lenovo Thinkpad running an Ubuntu 18.04 variant. I had to update the script to support Python3. You can see my fork in https://github.com/whacked/BLEHeartRateLogger. Let me know if you'd want to merge back.

fg1 commented 3 years ago

Pull requests are always welcome.