Skip to content

encap/better-bms-app

Repository files navigation

Add it to the homescreen for the best experience!

Web app for managing Battery Management Systems (BMS) via Bluetooth with live data visualization. Currently, it only supports my own JK-BMS, but additional protocols and devices can be added easily using strictly-typed config files in src/devices. I have been using this app for a year without many issues on my high-power e-bike. I also added additional features for vehicles. This project is built from scratch by reverse-engineering the protocol used by the original app, partial Chinese documentation, and other community projects.

NOTE: I'm not responsible for bricked devices, explosions, and fires. Use at your own risk, especially when using write commands. Android/Chrome freezes occasionally. This is due to corrupted packets from the BMS. Also, the BMS itself sometimes stops responding (rarely, don't panic), but it does come back after a while without any intervention. If you see ping below 10ms (should be 300-1000ms), please reconnect the device. It's a bug in the Browser/Android when it queues the packets.

Screenshots

Installation and usage

  1. Make sure you have Node >=16 installed and yarn package manager.
  2. Install dependecies
    yarn install
  3. Fire up dev server
    yarn start
  4. Make sure to turn on bluetooth, allow permissions and enable this browser flags:
    • Experimental web platform features
    • Web Bluetooth API
    • Bluetooth new permissions backend

Motivation

The original app was freezing and crashing when switching to other apps (e.g., Maps) while riding my bike. The password prompt was annoying when riding with gloves. Scraping data from the screen or connecting with Tasker was unreliable. Modifying the Qt 5 APK was difficult since it's a compiled .so library, and messing up offsets was a concern. However, I managed to bypass the password and change some colors. As a front-end developer, I realized that with the Bluetooth API now supported in browsers, making my own app in React should be possible!

Features and Roadmap

  • ✅ Proof-of-concept using Web Bluetooth API
  • ✅ Protocol reverse-enginnering
  • ✅ Protocol and device-agnostic implementation
  • ✅ OLED friendly GUI
  • ✅ Animated bar indicators, left (white) for state-of-charge and right for power
  • ✅ Completelely offline PWA app.
  • ✅ Public Beta release
  • ✅ Live Chart with Current (red), Voltage (blue), Ping (gray)
  • ✅ Current speed from GPS with chart (white)
  • ✅ Mileage (wh/km) and range estimation
  • ✅ Charge and Discharge toggle control ⚠️
  • Rest of settings (for now use original app)
  • Themes
  • BMS mock (to not brick the real one during development)
  • Notifications
  • History

References

About

JK BMS React.js client using Web Bluetooth API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published