-
Notifications
You must be signed in to change notification settings - Fork 21
Generic Chinese Bluetooth BMS unit as data input
There are a number of generic Bluetooth BMS units based around the TI BQ76940 BMS controller with a number of different configurations. I am not sure if they are manufactured by one or a number of different manufacturers. The thing they have in common is that they can be used with an Android app called xiaoxiang and with a Windows program called JBDTools.
I have reverse engineered the communication protocol, the details are here for those that are interested.
To use my BMS software with this board use this line in the [files] section of the config file battery.cfg
interface = 'from getbms import Raw'
There is a sample config file for a 12S battery called battery12cellBMS.cfg, copy this to battery.cfg in the same directory as the software and edit it to suit your configuration. You will also have to copy a skeleton of the summary file called summary.12cell to the directory where you are storing the BMS data and rename it summary.
The best way to get my software is to install git on your system, change directory to where you want to install the software and install it with the command
git clone https://github.com/simat/BatteryMonitor.git
Another option if you don't want to use git is to download the file as a zip file from here
To run the software you will need python3 on your system.
If you want to access the output from my program over the internet you will have to set up a Web Server and PHP on your machine. Then copy the files batday.php and battery.php to the WWW server root directory or make a link to them or whatever.
Edit the line
$config = file_get_contents("/home/simat/gadgets/bms/BatteryMonitor/battery.cfg");
at the beginning of batday.php to point to the location of your battery config file
and edit
$myfile = fopen("/home/simat/gadgets/bms/BatteryMonitor/data", "r") or die("Unable to open file!");
at the beginning of battery.php.
If you used git clone a directory BatteryMonitor will be created with all the software in it, change to this directory and set up battery.cfg and the summary file to suit your system.
You should now be able to run my software with the command
python3 batteries.py [ah]
where ah is the current DOD of the battery (0=full), if no argument given my program will use the current DOD from the sample file.
If you have any problems or questions use the git messaging system.