JK-B1A24S / JK-B2A24S Active Balancer

There's multiple ways to power the unit, the most important is that there's 40-100V between the PWR and GND. Like Stefanseiner, I also have been successful in booting it up when it's under 40V. I used an external power supply and it was only able to get to around 37-38V while I was testing with 4 cells. I don't see why it wouldn't report a low voltage cell as long as the board is powered correctly.

JKBMS_Batt.png
 
Try sudo python3 setup.py install

I may have left that part out.
Hey Buddy, Take a look of that, After few weeks working flawless, Stop to read the BLE, doing some checks found a error in the plugin..

pi@JK-BMS-Pi:~ $ sudo telegraf -debug

2021-02-09T05:06:04Z I! Starting Telegraf 1.17.2
2021-02-09T05:06:04Z I! Using config file: /etc/telegraf/telegraf.conf
2021-02-09T05:06:05Z I! Loaded inputs: cpu disk diskio exec kernel mem processes swap system
2021-02-09T05:06:05Z I! Loaded aggregators:
2021-02-09T05:06:05Z I! Loaded processors:
2021-02-09T05:06:05Z I! Loaded outputs: influxdb
2021-02-09T05:06:05Z I! Tags enabled: host=JK-BMS-Pi
2021-02-09T05:06:05Z I! [agent] Config: Interval:30s, Quiet:false, Hostname:"JK-BMS-Pi", Flush Interval:10s
2021-02-09T05:06:05Z D! [agent] Initializing plugins
2021-02-09T05:06:05Z D! [agent] Connecting outputs
2021-02-09T05:06:05Z D! [agent] Attempting connection to [outputs.influxdb]
2021-02-09T05:06:05Z D! [agent] Successfully connected to outputs.influxdb
2021-02-09T05:06:05Z D! [agent] Starting service inputs
2021-02-09T05:06:15Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-02-09T05:06:25Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-02-09T05:06:35Z D! [outputs.influxdb] Wrote batch of 13 metrics in 44.254286ms
2021-02-09T05:06:35Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-02-09T05:06:45Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-02-09T05:06:48Z E! [inputs.exec] Error in plugin: invalid character 'C' looking for beginning of value
2021-02-09T05:06:55Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-02-09T05:07:05Z D! [outputs.influxdb] Wrote batch of 18 metrics in 29.179523ms
2021-02-09T05:07:05Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-02-09T05:07:14Z E! [inputs.exec] Error in plugin: invalid character 'C' looking for beginning of value
2021-02-09T05:07:15Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-02-09T05:07:25Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-02-09T05:07:35Z D! [outputs.influxdb] Wrote batch of 18 metrics in 70.553285ms
2021-02-09T05:07:35Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-02-09T05:07:43Z E! [inputs.exec] Error in plugin: exec: exit status 1 for command '/home/pi/jkbms.py': Traceback (most recent call last):...

pi@JK-BMS-Pi:~ $ sudo python3 /home/pi/jkbms.py
Traceback (most recent call last):
File "/home/pi/jkbms.py", line 458, in <module>
jk.getBLEData()
File "/home/pi/jkbms.py", line 309, in getBLEData
serviceId = self.device.getServiceByUUID(btle.AssignedNumbers.genericAccess)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 488, in getServiceByUUID
rsp = self._getResp('find')
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 407, in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 362, in _waitResp
raise BTLEDisconnectError("Device disconnected", resp)
bluepy.btle.BTLEDisconnectError: Device disconnected

And this is my telegraf input and your .py located in /home/pi

# # Read metrics from one or more commands that can output to stdout
[[inputs.exec]]
# ## Commands array
commands = [
"/home/pi/jkbms.py",
]
#
# ## Timeout for each command to complete.
timeout = "20s"
#
# ## measurement name suffix (for separating different commands)
name_suffix = ""
#
# ## Data format to consume.
# ## Each data format has its own unique set of configuration options, read
# ## more about them here:
# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
data_format = "json"

#!/usr/bin/python3
from bluepy import btle
import math
import json


EXTENDED_RECORD = 1
CELL_DATA = 2
INFO_RECORD = 3

getInfo = b'\xaa\x55\x90\xeb\x97\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11'
getCellInfo = b'\xaa\x55\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10'

name = 'wtfsection'
model = 'JK-B2A24S'
mac = '3C:A5:19:7B:23:FE'
command = 'command'
tag = 'Powerwall_1'
format = 'influx2'

out=dict()
c_high=0.00
c_low=10.00
c_diff=0.00
 
See if compeletely unplugging the pi and then plugging it in fixes it. Sometimes the BTLE on the pi acts up. Also just make sure the bluetooth mac is still the same. I've heard that the pi sometimes acts funny with the bluetooth and people recommend using an external bluetooth, but I've had mine running for over 3 months without any hiccup.
 
I have the JK-DZ11-B2A24S, the one with RS485 comms. I first tried the QR code on the label and got fed up, so I looked at www.jkbms.com and that filled in a few missing pieces...

It requires >2.4v on B1 in order to wake up :(
As well as at least 40V total voltage

So I did some further testing while running on 3s lifepo4, and it doesn't mind if B1 is temporarily disconnected.
So I then reconnected my 24s wiring harness, again it doesnt wake up, I cut B1 wire in half and added an AA battery in series with my fingers (effectively it sees B1 around 3.5V), wait for the balancer to fully boot up and then remove AA battery and twist B1 wires back together.

It is now alive... I then find my harness has high resistance on an number of wires that the balancer warnings me about and means I cant turn the active balancing feature on yet. (the harness was from a different monitor setup which I cut at the plug soldered leads onto JK loom, this will need replacing...)

Getting closer to a solution...
Last issue I might have is that I cannot set the shut down voltage to below 2V, if it will self shutdown under 48V then it is clearly not suitable to keep going (which would mean a manual AA battery wake up everytime I have a few cloudy days)

Are there any people out there running Lead Acid / Lead Carbon or even LTO (which has a slightly higher cell voltage but still potentially a problem) on these active balancers???

piglet posted this work-around the 2.4v required to wake up:​


 
Here's the RS485 protocol that I was able to obtain for the JK-B1A24S. I don't have the board with this interface so I can't use it but is up for anyone else that could use it.

View attachment 5
Wow thank you for this ... I have one of these with bluetooth/can/485 and have asked the company several times for protocol info on them and got nothing.
 
So I am using a couple of this new versions of the JK-B2A24S-15P
Two at my actual system with 2x 14s60p on a Infini E5.5K, and another two on my second system which is still in building process with 2x 14s120p on a MPP MPI 10k.

View attachment 16000

View attachment 17011


Both systems are in my backyard and I would like to monitor them from inside the house

View attachment 11499


The new ones come with CAN and RS485

View attachment 16860


and an option for addional modules

View attachment 22003


not sure, for what you will need them. Asked the seller and the answer was "to connect with the computer" but there are no USB or ethernet connectors on it, so...

View attachment 11406

View attachment 13014



Two questions:
1.) does anybody know if a need this modules to connect the BMS with a computer or can I directly use the RS485 / CAN ports at the bms itselfes?
2.) how would I proceed the best way to get the BMS data in my house?

I have CAT7 network cables to both inverter locations and would prefer some communication over ethernet. For the inverters I am using some Modbus -> Ethernet adapters.
I do not own an Pi and would prefer to avoid one because I am planing to install an "real" server with ESXi running 24/7 at my cellar. Network switch and hardware is there, just not setting up the stuff for now.

I have both of these modules for mine. I made a Wi-FI module for my JBD BMS:


And I think I'm going to do the same here. My util for the PI connects via bluetooth:


But it doesnt do much other than dump data atm. Looks like jblance has made some great progress and I need to review his repo (just so many hours in the day lol)

I'll try to get an esp8266 module working over the serial/rs485 interface (I much prefer that to bluetooth).
 
RS485 would be the most better way I think, becaus he BT connection to the JKBMS is very instable.
Sometimes it lasts an hour, sometimes just a couble of minutes, sometimes only 1 minute.
You can reconnect just a second later that's not the problem when you are using the smartphone app, but for a constant and reliable monitoring this is a no-go.
I would highly appreaciate an option to connect the JKBMS with a Pi / Linux / Grafana and I think other people would do so too. I read here and there in the internet and there are some people out there using this BMS for powerwall buildings
 
I bought both the rs485 module and CAN module for my JK-BD6A20S10P. I am unable to get _any_ response out of either port. I have a SMA Sunny Island and I use a CAN/RS485 card on my Raspberry Pi to talk to it (CAN for updates/485 for config changes), so I know its working on my platform and I am familiar with both protocols.

I have the 2 docs members have shared for these BMS (attached), 1 for CAN, and 1 for 485 and have been using those as a starting point.

Has anyone gotten either CAN or 485 to work on these BMS?
 

Attachments

  • JIKONG JK-B1A24S-RS485-protocol-english.pdf
    108 KB · Views: 291
  • JK-DZ08_B1A24S_V4.zh-CN.en.pdf
    697.6 KB · Views: 249
First of all the attached PDF is the wrong version. You have the JK-BD6A20S10P which I believe is the BMS version, while the document is the balancer version only. So the registers might be different. I don't have either version with the RS485 or canbus so I won't be able to help much.

Ugh I just wrote a whole thing about modbus then realized that this isn't a modbus protocol. It looked so much like a modbus protocol! Just removed all that content.

But check out jblance's github repository. He has built a python program that communicates to the BMS. I believe he started work on the RS485 protocol. It used to be a separate program but he merged it into his main mpp-solar program.
 
Last edited:
First of all the attached PDF is the wrong version. You have the JK-BD6A20S10P which I believe is the BMS version, while the document is the balancer version only. So the registers might be different. I don't have either version with the RS485 or canbus so I won't be able to help much.

Ugh I just wrote a whole thing about modbus then realized that this isn't a modbus protocol. It looked so much like a modbus protocol! Just removed all that content.

But check out jblance's github repository. He has built a python program that communicates to the BMS. I believe he started work on the RS485 protocol. It used to be a separate program but he merged it into his main mpp-solar program.

Yep I knew doc was for the balancer; I hoped that it would also apply to the BMS since it's the same manufacturer.

In any case, I tried your script with both a USB-based 485 adapter on my PI3B and on the can/485 hat I use for my Sunny Island (I literally took the working 485 wires out and put the 485 wires from the bms into it). Here's what the pymodbus module says:

"Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 2 bytes (0 received)"

I contacted the manufacturer and they said "Our factory now only responsible the after service for customers who ordered from us directly for we can track the detail model with detail protocol for that." I bought my BMS off aliexpress and the seller doesnt respond.
 
Yeah I thought it was modbus. Strikingly similar. But not quite.

Try jblance's program. Also since you have the raspberry pi, might as well see if the bluetooth connection will work. At least try that method as well. That's the version that I know jblance's program will work. The script I use currently is based on his program and I connect through bluetooth.
 
yea ive been using the bluetooth connection; however the entire protocol isnt published (turning on/off charging/discharge/balancem, etc)

I've written an agent for the bms as part of my system:


I guess I'll have to create a bluetooth proxy and try to figure out the protocol ... or dump these for something that the manufacturer is willing to work with customers
 
Try contacting this seller. That's where I bought mine from and where I obtained some of the documentation from.


I saw that's where you got the docs from so I contacted them a while back - they asked what my order # was ... and I told them I didnt buy from them and they said they cant support me.

I did hear back from the seller I bought mine from tonight: he said "You need to develop it yourself." LOL. This is why I like the JDB BMS so much; they published complete docs on the supported protocols. I picked up an active balancer from IC GOGOGO


I've seen some very positive reviews about them so will give one a try.

If they work well alongside the JBD BMS (which has balance turned off), then I have a magic combo (~6A balance current).
 
OK I did get a reply from IC GOGOGO; they provided me this link:


It turns out the protocol is the exact same one used on the JBD BMS - at least for basic info!

So, I set about to make a Wifi module for it using the same materials I did for the JBD Wifi module


However, the voltage coming out of the BMS ... is the pack voltage (~48v)! Which means I needed a much bigger voltage reducer. So I ordered this from amazon:


And then built the Wifi module:

1620865936504.png
 
I tested writing to the MOS to turn on/off charging and discharging - that works. I'm going to try to build a register map and figure how to enable eeprom mode (if I even need to) to set parameters. Very cool!
 
I do not use the phone app. I use my own program to access the BMS. My program was able to stay connected to the BMS for long periods of time (as long as it did not try to disconnect/reconnect). I have now switched to Wifi which is much faster and much more reliable.
 
I have the JK-B2A16S for my 14 pack system.

Is it possible to control the JK via Blutooth from Rasspery.
I would like to switch the balancer on automatically at over 4Volt (56Volt package) and switch it off again when the voltages drop below 4Volt in the evening and at night. does someone already have a script running with the https://github.com/jblance/jkbms system. Greetings Dirk
 
Back
Top