This is a Python implementation of the miband-6-heart-rate-monitor
Real time heart rate monitor for Mi Band 6 and 7 using Python
Note: Currently Mi Band 7 is not working properly
- Install dependencies:
sudo apt-get install libglib2.0-dev
pip3 install -r requirements.txt
- Clone tiny-ECDH-python
- Copy ecdh.python and utils.py files from the tiny ECDH to this repository
- Find gatt_linux.py on your computer (Should be on /home/user/.local/lib/python3.8/site-packages/gatt)
- Make the following changes on the file gatt_linux.py:
Class DeviceManager:
# Add the following function to the Class
def notification_query(self, function, device):
GObject.timeout_add(10000, function, device)
Class Device:
# Change the following function
def _connect(self):
self._connect_retry_attempt += 1
try:
self._object.Connect()
# Only this line is changed, remove the rest. Some bug doesn't allow to connect with Band 7
if not self.services:
self.services_resolved()
- Clone this repository
- Find your Mi Band's Authentication Key (Check Here)
- Put your authentication key to
auth_key.txt
file in the current directory. - Turn off Bluetooth on your mobile device paired with the band
- Find out your band MAC address using bluetoothctl
sudo bluetoothctl
scan on
devices
- Run main script
# Mi Band 6
python3 main.py -m MAC_ADDRESS -b 6
# Mi Band 7
python3 main.py -m MAC_ADDRESS -b 6
- gzalo/miband-6-heart-rate-monitor
- patyork/miband-7-monitor
- Jaapp-/miband-5-heart-rate-monitor
- satcar77/miband4
- vshymanskyy/miband-js
- vshymanskyy/miband2-python-test
- VladKolerts/miband4
- Gadgetbridge
- Add continuous heart rate measurement to Mi Band 7 class
- Add alarm functionality to Mi Band 7 Class
- Implement spo2 measurement