Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 1.41 KB

DEVELOPMENT.md

File metadata and controls

35 lines (25 loc) · 1.41 KB

Mi Band 2 JS library: Development

You can help this project by taking a look at the list of tasks and issues

Enabling debug logs

Node.js: set DEBUG env. variable: DEBUG = MiBand
Browser: open dev. console and run localStorage.debug = 'MiBand', then refresh the page

Useful info on Mi Band 2 protocol

  1. Leo Soares wrote a nice article here: Mi Band 2, Part 1: Authentication. He also provided a Python example.
  2. Andrey Nikishaev described some basic BLE priciples and a good way of intercepting original Mi Fit App communication on Android. Check out his Python library implementation.
  3. Some protocol implementation details can be found in Freeyourgadget project.

Linux cheatsheet

List all visible BLE devices to find out the MAC address:

sudo hcitool lescan

To list all descriptors of a device:

sudo gatttool -b YOUR_MAC -I -t random
> connect
> char-desc

Sometimes, BLE stack might fail, and the reset is needed:

sudo hciconfig hci0 reset