This is a C implementation of the miband-6-heart-rate-monitor
Real time heart rate monitor for Mi Band 6 and 7 using c
Note: Currently Mi Band 7 is not working properly
- Install dependencies:
sudo apt-get install libssl-dev
sudo apt install libbluetooth-dev libreadline-dev
-
Clone this repository
-
Clone gattlib
-
Build Gattlib
cd <gattlib-src-root>
mkdir build && cd build
cmake ..
make
sudo make install
-
Clone tiny-ECDH-c
-
Add this code to a file named CMakeLists.txt, and put it into the tiny ECDH main folder:
cmake_minimum_required(VERSION 3.10)
project(tiny-ECDH-c C)
set(CMAKE_C_STANDARD 11)
add_library(tiny-ECDH-c STATIC ecdh.c)
target_include_directories(tiny-ECDH-c PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
-
Find your Mi Band's Authentication Key (Check Here)
-
Go to the root folder of this repository (cd miband-HR-c)
-
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
- Go to root folder, create a build folder and navigate to it
mkdir build && cd build
- Run:
// For Mi Band 6
cmake -DMAC_ADDRESS="YOUR_MAC_ADDRESS" ..
make
./miband_c
// For Mi Band 7
cmake -DMAC_ADDRESS="YOUR_MAC_ADDRESS" -DBAND_TYPE "7" ..
make
./miband_c
This code is documented using Doxygen style.
- Install Doxygen
sudo apt install doxygen
- Generate Doxyfile
doxygen -g Doxyfile
- Make changed in the Doxyfile
INPUT = .
RECURSIVE = YES
- Run Doxygen
doxygen Doxyfile
- Open index.html inside the html folder
- 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
- More robust memory allocation
- Develop Band 7 interface
- Implement Spo2 measurement