This is a Python test script to access and test responses from a range of BLE sensors using the Python BLEAK library for Bluetooth. E.g. Heart Rate straps, Power meters, FTMS trainers, etc.
This also attempts to demonstrate how to maintain a connection to a device when there are connection failures, either due to the device reseting, interference, stack issues, etc.
Run the script, optionally with enough of the device name to match.
With one (or more) Polar devices active:
python bleexpolorer.py # default to Polar
python bleexpolorer.py Pola # Match Polar
python bleexpolorer.py H10 # Match H10
python bleexpolorer.py 'Polar H10' # Match 'Polar H10'
The script will use BleakScanner to find all devices available and match each to see if it should explore.
To terminate the script use Ctrl-C to interrupt.
For each device found:
- Connect
- Verify the PMD and PFC services are present
- Get supported Feature list from the PFC service
- Get the supported Measurements from the PMD service
- For each supported Measurement start a sample stream
- Wait for termination
- Stuart Lynne [email protected]