JDB / XiaoXiang BMS tool

MrSurly

New member
Joined
Jan 1, 2021
Messages
3
Hey everybody,

I have a JBD 4S 60A BMS. But I'm a Linux guy, and the Windows app for this BMS isn't great. So I made my own: BMS Tools. Under active development, and I'm dogfooding it myself. Some the guys from Overkill Solar are also involved in testing and development.

Give it a shot, and please let me know (there's an issue tracker) if you have any problems.

Thanks.

-- Eric

 
There's some discussion of updating the app UI to more closely match the iOS look/feel, and there's a (new) Android app in the works. As a complete side note, I bricked one of the BMSs I have here messing around with the firmware update, so now I'm working on a replacement firmware.
 
Nice, I'm glad it was useful. Just as an FYI, register 0xAA (error_cnts) returns 12 values instead of 11; nobody knows what that 12th value is, and the iOS app just shows it as "unknown." This was specific to the 16s models.
 
Interesting; I've talked with the guy @ JBD who wrote the bluetooth android app (his name is Xiao and hes actually a VP there). I'll ask him about this, but keep in mind I have to use google translate lol.

You really did a nice job with the SW including the UI on Linux.
 
I have a XiaoXiang BMS , I have been accessing it from my android tablet bit hard to connect sometimes, but great to see whats going on,
but would be so much better to read it through my raspberry pi. I have Ubuntu/linux machines so have never used the existing windows program.

What do i need to learn to install this on my pi?
 
Assuming you have a UART version (the bluetooth adapter plugs into), you'd have to with get a PI and connect the UART from the BMS to the PIs UART ports, then you can use any number of linux tools (like my JBDTools or MrSurly's BMS Tools) to monitor/configure the device.

When I was researching BMSs to use for my powerwall (which is comprised of a bunch of BMW EV batteries), I hooked up the JBD (XiaoXiang is the bluetooth app name - actually it's the names of the 2 guys who wrote it @ JBD) via the Serial port and managed it using that.

Now if you don't want to use the serial port and don't want to build my Wi-FI module (which would be kind of expensive if you just want one), you could do what this guy did:


Basically, he used a ESP8266 development board and loaded it up with custom firmware. I used esp-link as the firmware as it had everything I needed. At some point I'll write custom firmware for it, but simply don't have the time right now.
 
Thats great, I've just dug out the UART connection that came with the BMS and im ready to load up your JBD tools,, I 'm just learning (not very fast) how to install and run programs on the PI so it may take me a few trys but at least i know it can be done. A more attainable goal than my other PI projects,

I'd just like to say that I really am in awe at how clued up you guys are with all the programing and configuration of these devices, Ever since i switched to Ubuntu/linux I have been amazed at all the programing and coding done open-source style. great work, Thank you
 
Yep I love the open source stuff too and am glad to contribute to it. When you get to the next step (once you have your BMS hooked to the PI and can pull the data from it), have a look at:


Which will pull the data from the BMS, convert it to JSON and send it out as a MQTT message.

Then, you can travel down road of: MQTT => node-red/telegraf => influxdb => grafana
 
Last edited:
@sshoecraft I already have an influxdb / grafana setup pulling data from my Victron hardware Venus RPi that is out in my shed connected via USB to the victron stuff. Are you saying if the RPi I have in the house is able to communicate with the BMS via BT (range is really excellent on it) then I should be able to ingest data from the BMS using your github / jdbtool ?

That would be ideal to get BMS data added to my existing grafana setup.
 
@sshoecraft I already have an influxdb / grafana setup pulling data from my Victron hardware Venus RPi that is out in my shed connected via USB to the victron stuff. Are you saying if the RPi I have in the house is able to communicate with the BMS via BT (range is really excellent on it) then I should be able to ingest data from the BMS using your github / jdbtool ?

That would be ideal to get BMS data added to my existing grafana setup.

Yep it definitely can. only thing is, with bluetooth you need to compile gattlib without dbus supprt (and use bluez directly) or notifications wont work. I have a Pi3B+ so if you have a 4 it might be a diff story. I'm running debian 10.6.

Also keep in mind all my stuff is in C atm and I don't have automake insalled (for configure). I'm actually considering using cmake.

Here is a terminal program (cellmon) that displays cells for my 14 packs. pack_01 is using bluetooth atm.

1611811856457.png
 
I wonder if the debian 10.6 vs mine (Rasbian) is what was giving me problems with the dependencies for the make command in your jbdtool directory. Unfortunately i have a bunch of other things on this particular RPi.

If you are thinking a plain debian install of 10.6 is the approach, then I'd probably find a different RPI for this install. (I have another one in my attic that is running some piaware things relaying flight data to flightaware / flightradar24 / etc)
 
Did you also download mybmm from github ... and then set MYBMM_SRC= to that location in jbdtool's Makefile?


It has all the drivers for the different BMSs as well as the code for modules etc that jbdtool uses.
 
Yeah I did download that into my "git" directory with jdbtool

delta@piServ:~/git $ ls -la
total 16
drwxr-xr-x 4 delta delta 4096 Jan 27 16:09 .
drwxr-xr-x 10 delta delta 4096 Jan 28 09:49 ..
drwxr-xr-x 4 delta delta 4096 Jan 28 09:55 jbdtool
drwxr-xr-x 3 delta delta 4096 Jan 27 15:40 mybmm

delta@piServ:~/git $ grep MYBMM_SRC\= jbdtool/Makefile
MYBMM_SRC=../mybmm

When I do a make inside mybmm I get this error

mqtt.c:3:24: fatal error: MQTTClient.h: No such file or directory
#include <MQTTClient.h>
 
Thats the MQTT library ... I just added mqtt support and need to put conditions around the code yet. I'll do that today.

In the meantime, you can install MQTT to get past this


You might also need to set MQTT=yes in the Makefile
 
OK I just updated mybmm

do a git pull in the mybmm dir and it should compile fine now with MQTT=no
 
Here's the complete directory without the need for MYBMM

Also, I've included my libgattlib.a, which is compiled without dbus suport. You'll still need
 

Attachments

  • jbdtool_complete.zip
    623.4 KB · Views: 380
Here's the jbdtool binary itself, compiled on my PI3B+

I've since moved away from bluetooth, as I've had nothing but issues with it. I use my Wi-Fi module instead and it has been rock solid (I collect from them every 30s).
 

Attachments

  • jbdtool.zip
    252.2 KB · Views: 320
Ahh yes.. once I compiled mybmm the jdbtool compile was failing for libgattlib.a

I'll try your binary
 
Back
Top