Code Monkey home page Code Monkey logo

overkill-xiaoxiang-jbd-bms-ble-reader's Introduction

overkill-xiaoxiang-jbd-bms-ble-reader

This simple code reads a Overkill Solar (XiaoXiang) BMS's cell voltages and summary information (overall voltage, current, SOC% and other fields) through BLE. It works on Adafruit's nrf52 based devices.

I've keep code splatter to a minimum, and this single C++ file (it can be renamed as a .ino) does this:

  • Scans for devices
  • Finds BMSes named XiaoXiang and with the required service (0000ff00-0000-1000-8000-00805f9b34fb)
  • Initiates a connection with them
  • On connection, discovers the service and a Rx then Tx characteristic that will allow communication with the BMS
  • Every five seconds send a command (which alternates between 0x03 and 0x04) to the BMS
  • Receives notifications
  • Concatenates messages requiring more than the 20 bytes each notification provides
  • If no errors, it Serial.prints out the data received in human readable form

Copyright Neil Shepherd 2022 Released under MIT license

I acknowledge several other sources of information and inspiration:

https://overkillsolar.com/support-downloads/ - overkill solar's respository of docs and code https://github.com/FurTrader/OverkillSolarBMS/blob/master/Comm_Protocol_Documentation/JBD%20Protocol%20English%20version.pdf - a detailed doc behind the protocol used to read and write data

https://wnsnty.xyz/entry/jbd-xiaoyang-smart-bluetooth-bms-information - a central repository of a number of links

https://github.com/kolins-cz/Smart-BMS-Bluetooth-ESP32 - a version using an ESP32

https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/custom-central-hrm - Adafruit's hrm example, which is similar in methodology

overkill-xiaoxiang-jbd-bms-ble-reader's People

Contributors

neilsheps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

v222008 casainho

overkill-xiaoxiang-jbd-bms-ble-reader's Issues

Disconnected, reason = 0x3E

Hi Neil,

Trying your code, and it does discover my BMS.
When I try to connect to it I keep getting a "Disconnected, reason = 0x3E".
Anyway to fix this?

I know. The code is old, but so it the BMS I'm using :-)

Noel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.