• Stars
    star
    338
  • Rank 121,026 (Top 3 %)
  • Language
    JavaScript
  • License
    GNU General Publi...
  • Created about 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MiBand 2 JS library for Node.JS and HTML5 (WebBluetooth)

SWUbanner

NPM version NPM download GitHub issues GitHub license

Mi Band 2 JS library

A clean implementation of Mi Band 2 library for Browsers and Node.js, using WebBluetooth API. demo

Setting up

It's best to unbind your Mi Band 2 from MiFit App first.
You should be able to bind it back again, but no guaranee here ;)

Browser

LIVE DEMO

You need a browser with WebBluetooth support. Tested with:

  • Chrome on OS X (Yosemite or later)
  • Chrome on Android (6.0 Marshmallow or later)
  • Chrome on Linux (the chrome://flags/#enable-experimental-web-platform-features flag must be enabled)

Node.js

npm install miband -g
miband-test

This should work on Windows, Linux and OSX.
On Linux, you need to grant Bluetooth access for Node.js:

sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)

Features

  • Authentication
  • Device info: time, battery status, hw/sw versions, etc.
  • Button tap event
  • Notifications: message, phone, vibrate
  • Heart Rate Monitor
  • Realtime data (soon)

API usage example

const MiBand = require('miband');

const device = await bluetooth.requestDevice({
  filters: [
    { services: [ MiBand.advertisementService ] }
  ],
  optionalServices: MiBand.optionalServices
});

const server = await device.gatt.connect();

let miband = new MiBand(server);
await miband.init();

log('Notifications demo...')
await miband.showNotification('message');

Here you can find more API examples


Contributing

Please check out DEVELOPMENT.md

More Repositories

1

TinyGSM

A small Arduino library for GSM modules, that just works
C++
1,850
star
2

StandWithUkraine

#StandWithUkraine banner and related documents
JavaScript
1,377
star
3

awesome-wasm-tools

😎 A curated list of awesome, language-agnostic WebAssembly tools
435
star
4

blynk-library-python

Blynk library for Python. Works with Python 2, Python 3, MicroPython.
Python
272
star
5

muon

µON - a compact and simple binary object notation
Python
233
star
6

blynk-library-js

Blynk library for JS. Works with Browsers, Node.js, Espruino.
JavaScript
212
star
7

node-inline-cpp

Inline C++ with Node.js
JavaScript
169
star
8

wasm2native

Turn WASI apps into native executables
C
110
star
9

Preferences

Preferences library for Arduino, ESP8266, RP2040 and Particle. ESP32-compatible API
C
56
star
10

blynk-library-particle

Blynk library for Particle Core, Photon, Electon, P0, P1, RedBear Duo etc.
C++
47
star
11

wasm3_dino_rpi_pico

WebAssembly Dino game for PPi Pico
WebAssembly
41
star
12

Wasm3_RGB_Lamp

Animating an RGB lamp, using WebAssembly!
C++
41
star
13

blynk-library-lua

Blynk library for Lua. Works with Lua 5.1+, LuaJIT, NodeMCU.
Lua
41
star
14

interp

Interpreter experiment. Testing dispatch methods: Switching, Direct/Indirect Threaded Code, Tail-Calls and Inlining
C
40
star
15

w600tool

Firmware upload tool for Winner Micro W600 & W601 WiFi
Python
37
star
16

StreamDebugger

StreamDebugger allows easier debugging of Serial-based communication on Arduino, like AT command interface in ESP8266, SIM800, SIM900, and other GSM modules
C++
34
star
17

randomart

Generative WebGL Random Art renderer
JavaScript
30
star
18

ESP32_PPPoS

PPP over Serial for ESP32
C++
26
star
19

serial-server

Simple serial port server
JavaScript
24
star
20

GY80

Arduino/Processing sketch for GY80 9DOF AHRS
Arduino
22
star
21

blynk-library-openwrt

OpenWRT packages for Blynk C++ library
Makefile
18
star
22

JIDL

Simple, flexible, JSON-based Interface Definition Language
Python
17
star
23

UNO-R4-WiFi-freedom

UNO R4 WiFi set free!
C++
15
star
24

blynk-pc-remote

This app allows you to control your PC remotely using the Blynk App.
JavaScript
12
star
25

espruino-await

async/await example for Espruino
JavaScript
11
star
26

OpenWRT-Espruino-packages

Espruino package for OpenWRT
Makefile
10
star
27

blynk-tools

Tools for working with Blynk IoT Platform
JavaScript
8
star
28

blynk-library-ez-connect

Blynk example for Marvell® EZ-Connect™ MW302
C++
6
star
29

pypp

Python PreProcessor
Python
5
star
30

blynk-community-map

JavaScript
3
star
31

TurtlOS

educational os project
C++
2
star
32

vshymanskyy

2
star
33

ESP_UNO_R4

C
2
star
34

xplat

C++ cross-platform abstraction library
C++
1
star
35

vshymanskyy.github.io

1
star
36

bronyk

bronyk robot control system
C++
1
star
37

kad

kademlia overlay network implementation
C++
1
star