A Windows C++ command-line tool that fetches health data from Da Fit / MOYOUNG smart bands via Bluetooth LE — and displays a beautiful terminal dashboard.
Tested with Marv Neo (MOYOUNG-V2 platform, firmware MOY-BJQ3-2.3.5).
Scans for nearby Bluetooth LE devices for 10 seconds. Use this to find your band's MAC address.
Connects to the band via Bluetooth LE, reads GATT services (battery, activity, device info), sends MOYOUNG V2 protocol commands, subscribes to notifications, and renders a formatted health dashboard with ANSI colors and Unicode box-drawing.
Same BLE connection as above but streams every raw hex packet to the console (and to build/dafit_ble_log.txt). Useful for protocol analysis and reverse engineering.
Reads a Da Fit SQLite database pulled from an Android device via ADB. Extracts steps, heart rate, and sleep records.
| Requirement | Details |
|---|---|
| OS | Windows 10 or 11 with a Bluetooth LE adapter |
| Compiler | Visual Studio 2022 — "Desktop development with C++" workload |
| Windows SDK | 10.0.17763 or newer (for C++/WinRT headers) |
| CMake | 3.20+ |
| SQLite3 | Optional — auto-detected, or place sqlite3.c + sqlite3.h in third_party/ |
Download the SQLite amalgamation from https://sqlite.org/download.html if you want DB mode.
git clone <repo-url>
cd DaFitDesktop
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022"
cmake --build . --config ReleaseThe binary is produced at build\Release\DaFitDesktop.exe.
| Option | Default | Description |
|---|---|---|
DAFIT_ENABLE_BLE |
ON |
Bluetooth LE support (requires Windows SDK) |
DAFIT_ENABLE_SQLITE |
OFF to disable |
SQLite database reader |
cmake .. -DDAFIT_ENABLE_BLE=OFF # Disable Bluetooth LE
cmake .. -DDAFIT_ENABLE_SQLITE=OFF # Disable SQLite readerImportant: Disconnect your band from the Da Fit phone app before connecting with this tool. BLE only allows one active connection at a time.
.\DaFitDesktop.exe scanOutput:
Scanning for BLE devices (10s) ...
[1] Marv Neo FB:36:0B:37:18:37 RSSI: -52
[2] Mi Band 5 C4:29:A1:0D:88:12 RSSI: -71
Found 2 devices.
.\DaFitDesktop.exe ble FB:36:0B:37:18:37The tool will:
- Connect to the band via Bluetooth LE
- Read Device Information (serial, hardware, firmware, manufacturer)
- Read Battery Level (standard BLE 0x180F service)
- Read Activity Snapshot (steps, distance, calories from MOYOUNG 0xFEE1)
- Send request commands for Heart Rate and SpO2
- Listen for 8 seconds for notification responses
- Render the dashboard with ANSI colors and box-drawing characters
.\DaFitDesktop.exe ble-raw FB:36:0B:37:18:37Subscribes to every notify characteristic and prints raw hex. Packets are also logged to build\dafit_ble_log.txt.
# Show steps, heart rate, and sleep data
.\DaFitDesktop.exe db dafit_data.db
# List all tables (for exploration)
.\DaFitDesktop.exe db dafit_data.db tablesRequires a rooted device or ADB root access:
adb shell su -c "cp /data/data/com.crrepa.band.dafit/databases/*.db /sdcard/"
adb pull /sdcard/dafit_data.db .Then read it:
.\DaFitDesktop.exe db dafit_data.dbThis tool speaks the MOYOUNG V2 BLE protocol used by Da Fit / CRREPA bands.
| Service | UUID | Purpose |
|---|---|---|
| MOYOUNG Data | 0000feea-0000-1000-8000-00805f9b34fb |
Activity data, commands, notifications |
| Standard Heart Rate | 0000180d-0000-1000-8000-00805f9b34fb |
BLE SIG Heart Rate (0x2A37) |
| Battery | 0000180f-0000-1000-8000-00805f9b34fb |
BLE SIG Battery Level (0x2A19) |
| Device Info | 0000180a-0000-1000-8000-00805f9b34fb |
Serial, HW rev, FW rev, manufacturer |
| Characteristic | UUID | Direction | Purpose |
|---|---|---|---|
| Activity snapshot | 0000fee1-... |
Read/Notify | Steps, distance, calories |
| Command write | 0000fee2-... |
Write | Send AB-header request commands |
| Response notify | 0000fee3-... |
Notify | Responses to commands |
| Status/keepalive | 0000fee7-... |
Notify | Real-time heartbeat/keep-alive |
Band → Phone (response/notification):
FE EA <type> <subtype> <value...>
Phone → Band (command request):
AB 00 04 00 <cmd> 00 FF
| Raw Bytes | Meaning |
|---|---|
5A 0A 78 |
Heart Rate: 120 BPM |
5A 0B 62 |
Blood Oxygen: 98% |
5A 20 4B 01 |
Battery: 75%, charging |
5A 01 xx xx |
Step count (16-bit) |
5A 10 ... |
Sleep segment data |
DaFitDesktop/
├── CMakeLists.txt # Build config (C++20, WinRT, SQLite options)
├── README.md
├── .gitignore
├── include/
│ ├── BleScanner.h # BLE scanning, connection, FetchBandInfo()
│ ├── DaFitProtocol.h # Protocol constants, packet structs, Command enum
│ └── DbReader.h # SQLite reader (steps, heart rate, sleep)
├── src/
│ ├── main.cpp # CLI entry point, ANSI dashboard rendering
│ ├── BleScanner.cpp # WinRT BLE implementation (GATT services)
│ ├── DaFitProtocol.cpp # Packet parser (0x5A and standard HR)
│ └── DbReader.cpp # SQLite queries with multi-schema support
└── third_party/ # Place sqlite3.c + sqlite3.h here
| Problem | Solution |
|---|---|
| Band not found during scan | Disconnect from Da Fit phone app first. Only one BLE connection at a time. |
| All values show N/A | Band may need to be on your wrist with good skin contact. Try moving it. |
| Heart rate shows "keep still" | HR measurement takes a few seconds. Wear the band and stay still during the 8s listen window. |
| Build error: sqlite3.c not found | Download from https://sqlite.org/download.html and place in third_party/. |
| Build error: WinRT headers missing | Install Windows 10 SDK (10.0.17763+) via Visual Studio Installer. |
| LNK error: windowsapp.lib | Ensure "Universal Windows Platform development" workload is installed. |
- Run
DaFitDesktop.exe scanto list nearby BLE devices - Or install nRF Connect (Android/iOS) and scan there
- Look for your band's name (e.g., "Marv Neo", "D20", "M5 Band")
- Copy the
AA:BB:CC:DD:EE:FFaddress
MIT
