npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

witmotion-react-native

v1.0.1

Published

React Native SDK for WitMotion BLE IMU sensors (WT901, WT901BLECL, etc.)

Readme

📦 WitMotion React Native BLE SDK

npm version npm downloads License: MIT

React Native SDK for connecting to WitMotion BLE IMU sensors (e.g. WT901, WT901BLECL) using react-native-ble-plx.
Implements the official WIT Standard Protocol in TypeScript/JavaScript.

✨ Features

  • 🔎 Scan for nearby WitMotion BLE devices
  • 🔗 Connect and subscribe to sensor notifications
  • 📡 Parse WIT Standard packets (0x5x, 0x61, 0x71)
  • 📊 Provides accelerometer, gyroscope, angle, magnetometer, quaternion, temperature
  • 📝 Exposes WitMotion commands (reset yaw, calibration, save, set output rate)

📥 Installation

# Install SDK and dependencies
npm install witmotion-react-native
npm install react-native-ble-plx base64-js

📂 Project structure

src/
 ├── witBle.ts      # BLE connection, scanning, command sending
 ├── witParser.ts   # WIT protocol packet parser
 └── index.ts       # entry point exports

🚀 Quick Start

1. Scan for devices

import { scanForDevices } from "witmotion-react-native";

await scanForDevices((device) => {
  console.log("Found:", device.id, device.name, device.rssi);
}, 5000);

2. Connect to a device

import { connectById } from "witmotion-react-native";

const { device, subs, send } = await connectById("DEVICE_ID", (data) => {
  if (data.acc)   console.log("Acceleration:", data.acc);
  if (data.gyro)  console.log("Gyroscope:", data.gyro);
  if (data.angle) console.log("Angles:", data.angle);
  if (data.mag)   console.log("Magnetometer:", data.mag);
  if (data.quat)  console.log("Quaternion:", data.quat);
  if (data.temp !== undefined) console.log("Temperature:", data.temp);
});

3. Send commands

import { WitCmd } from "witmotion-react-native";

// Reset yaw angle
await send?.(WitCmd.resetYaw);

// Start magnetometer calibration
await send?.(WitCmd.startMagCalib);

// Save settings
await send?.(WitCmd.save);

// Set output rate to 50 Hz
await send?.(WitCmd.setRateHz(50));

📡 Protocol Support

| Packet | Bytes | Description | |--------|-------|-------------| | 0x51 | 11 | Accelerometer (X,Y,Z) | | 0x52 | 11 | Gyroscope (X,Y,Z) | | 0x53 | 11 | Angles (Roll, Pitch, Yaw) | | 0x54 | 11 | Magnetometer (X,Y,Z) | | 0x59 | 11 | Quaternion (W,X,Y,Z) | | 0x61 | 20 | Combined BLE packet (ACC+GYRO+ANGLE) | | 0x71 | 20/22 | Register response (Quaternion, Magnetometer, Temperature, etc.) |


🛠 Commands (WitCmd)

| Command | Bytes | Description | |-----------------|---------------------------------|-------------| | startMagCalib | [0xFF, 0xAA, 0x01, 0x07, 0x00] | Start magnetometer calibration | | save | [0xFF, 0xAA, 0x00, 0x00, 0x00] | Save settings | | resetYaw | [0xFF, 0xAA, 0x01, 0x04, 0x00] | Reset yaw angle | | setRateHz(hz) | [0xFF, 0xAA, 0x03, L, H] | Set output rate (Hz) |


⚡ Requirements

  • React Native ≥ 0.70
  • Android 6.0+ / iOS 12+
  • Permissions:
    • Android 12+: BLUETOOTH_SCAN, BLUETOOTH_CONNECT
    • Android <12: ACCESS_FINE_LOCATION

📖 References


📜 License

MIT License © 2025 — Massimiliano Wosz