diy solar

diy solar

JDB BMS -- New open source tool

MrSurly

New Member
Joined
Nov 20, 2020
Messages
17
Hi everyone,

tl;dr -- I made some open source code for the JBD BMS -- any interest in use / beta testing / development?



Never posted before, just been lurking a bit. I have a JBD-SP04S020 that I'm using for a non-solar project. I wanted to have a little e-ink screen to monitor the cell/pack status, and pursuant to that, I've kind of fallen down the rabbit hole of the BMS serial protocol, since (1) I'm a Linux guy (2) the JBD app for Windows is kinda ... klunky.

So I wrote my own (screenshot below). I've been dogfooding this stuff for a while now, and it's getting better every day.

Here's the current status:

Implemented:
  • "info" tab to show current status (below)
  • "settings" tab to read/write the eeprom settings, and load/save from file
In progress:
  • "Calibration" tab
Coming soon:
  • "Other Function" tab
  • Info logging ("Save Data")
Probably not going to be implemented:
  • Firmware updates -- mostly because I cannot find a firmware hex file for my device so I can sniff the protocol.
Support:
  • Linux
  • Windows
  • Mac
The caveat for these OS's is that my app packager (pyinstaller) requires you do your "build" on the target system. I have Linux and Windows, but no access to a Mac, so if there's a Mac dev out there that could help out, that'd be great. For Linux and (especially) Windows, I'd appreciate testers / feedback / bug reports.

The code:

The code is all open source; my Gitlab page is still private, I need to clean up a few things before making public. Currently this consists of:
  • A backend python library
  • A frontend GUI
Planned:
  • Microcontroller C source code to read the basic info and display on an e-ink screen (which is my personal ultimate goal).


Screenshot from 2020-12-18 10-46-39.png
Screenshot from 2020-12-18 10-51-13.png
 
I have the Overkill Solar BMS. I'm a Data Warehouse Architect, but I've done some programming to interface with external devices (but it was a long, long time ago in a city far, far away). I only have the bluetooth interface for my two BMS devices, so that probably doesn't work for your tool. My interesting in posting here is that I would - eventually - like to see/administer both BMS devices on the same screen.
 
I have the Overkill Solar BMS. I'm a Data Warehouse Architect, but I've done some programming to interface with external devices (but it was a long, long time ago in a city far, far away). I only have the bluetooth interface for my two BMS devices, so that probably doesn't work for your tool. My interesting in posting here is that I would - eventually - like to see/administer both BMS devices on the same screen.
I take it you'd be interested in logging using the library?
 
I'm not that interested in logging. My system is in an RV, which sits at the storage lot for weeks/months by itself. Logging implies another device that I don't want to have to provide power to.

My complaint about the XiaoXiang app is that it's kludgy, slow and can't display a dashboard for more than one BMS at a time. When I configured the parameters on my two BMS devices, I had to keep switching back and forth from one BMS to the other, which was time consuming. If I had a known set of specific parameters that needed to be set and proper values for them, this wouldn't be a problem. But I kept finding parameters that I had missed. Side-by-side configuration in one screen/window probably isn't going to happen. But if I could at least have each BMS up in separate windows that I can look at on the same monitor, that would help. I'm not sure a laptop can physically connect to two BMS at the same time, so I may be asking for too much.
 
But if I could at least have each BMS up in separate windows that I can look at on the same monitor, that would help.
Yes, you can do this. I've run the (my) app twice accidentally -- I was thinking of adding something to prevent this, but your use case indicates maybe I shouldn't do that. You just need to make sure they're configured to look at two different serial ports.

Also, the app "plays nice" with the official JBD app, and you can have both running at the same time, as long as they're both not accessing the same BMS concurrently.

Let me get my ducks in a row, I'll make the repo public, and do a release for Windows.

Would you be willing to help test? Note that I'm using this software right now, but that doesn't mean it's 100% bug-free.
 
Great work I’m very interested. I’ve just bought the pc module from my mate Ali in anticipation . The PC module should land in Australia by April next year so I’ll be keep to year when it arrives.
 
Last edited:
... and can't display a dashboard for more than one BMS at a time.

Simple solution: Two iPad minis mounted to the wall, each connected to their own bms. Complex but fun solution: Building a Home Assistant integration for a combined dashboard.


I'd probably be interested in the project too, and I'd definitely want logging. It's always nice to have data to play with.
 
I don't think my BMS are setup for serial communication. I think all I have is the bluetooth. :(
I bought the USB module for mine and it plugs into the bluetooth port. Not sure if that is an option for your model but Overkill does sell the modules as an option for all of the BMS's he is currently selling. It's like 9 bucks.
 
I bought the USB module for mine and it plugs into the bluetooth port. Not sure if that is an option for your model but Overkill does sell the modules as an option for all of the BMS's he is currently selling. It's like 9 bucks.
If it has the 4-pin port that plugs to a BT module, then that port is very likely a 3.3v TTL serial port running 9600, 8N1. I am using a very basic USB <--> serial module which lets you switch between 3.3V and 5V.

Connections (USB Serial --> BMS) in left-to-right order of the BMS port. Labels in "quotes" are what my BMS PCB silkscreen is for that pin:
  • None --> ">" (This is power out from BMS for BT module; the USB module is powered by the computer)
  • RX --> "T"
  • TX --> "R"
  • GND --> "GND"
Note that the ">" (power) from the BMS seems to be 12v -- not actual pack voltage.
 
My complaint about the XiaoXiang app is that it's kludgy, slow and can't display a dashboard for more than one BMS at a time.
Hi The "new" Version 2 of the app displays more than I device at a time. If you go onto the developers GitHub and send him your eMail address he will add you to the group. I will see if I can post a pic.

Regards
 
I'd be very interested in this as soon as the boat from China gets here. Decently versed in Linux. Running it on this very laptop and two desktops. One of those dual booting Win10. I'd imagine that the BT adapter that you can get with the BMS is probably just serial over bluetooth.
 
@corporate.joe
The BT adapter that most people use is actually BLE, and there isn't a specification for SPP in BLE (there is in traditional BT). Having said that, I do have a Python script that is able to talk to the BMS using the backend JBD library using the BLE devices available.
 
I'd be interested in having a look at the code. I have written python to extract the data from the Tracer line of charger controllers (over modbus), and display them on a 5" 12V automotive screen that is attached to my rig. I've ordered UART modules to go with my Overkill BMS(s), and now I want to access the registers to create a similar display for the state of the LiFePO4 cells. I've got a link to the register mapping, and installed the FTDI drivers on my raspberry Pi, but I'm not having much luck reading data from the BMS.
 
I'd be interested in having a look at the code. I have written python to extract the data from the Tracer line of charger controllers (over modbus), and display them on a 5" 12V automotive screen that is attached to my rig. I've ordered UART modules to go with my Overkill BMS(s), and now I want to access the registers to create a similar display for the state of the LiFePO4 cells. I've got a link to the register mapping, and installed the FTDI drivers on my raspberry Pi, but I'm not having much luck reading data from the BMS.
All the code is here: https://gitlab.com/bms-tools/bms-tools

It includes a backend Python library in bmstools/jbd
 
If anyone had issues compiling on linux, here are my notes
Tested with LMDE4 (Based on Debian 10 Buster), fresh install, all updates as of 2021-05-28
1) Download latest https://gitlab.com/bms-tools/bms-tools
2) Extract, open terminal in extracted dir, check python versions
python -V
Python 2.7.16
python3 -V
Python 3.7.3
pip install .
Command 'pip' not installed
sudo apt install python-pip (probably not required)
sudo apt install python3-pip pip3 install .
Should compile ok
pip3 install .[gui]
Failed building wheel for wxPython
sudo apt install gtk+3.0 sudo apt install libgtk-3-dev pip3 install .[gui] -v
Took a while to compile, about 11mins on an i7-4770 with 8GB ram (hence why I used the -v switch to confirm it wasn't stalled)
make (didn't work at first)
sudo apt install git make clean make
ELF executable found in ./dist dir
./bms_tools_jbd_linux_
couldn't select /dev/ttyUSB0 had to select port in command line
./bms_tools_jbd_linux_ -p /dev/ttyUSB0

jbd-bms.jpg
 
Last edited:
Back
Top