Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JK-B1A24S / JK-B2A24S Active Balancer
#11
michu_michu,

looks like it is working for you...  What is the application sequence to obtain the data??

I follow the part where I need to modify the config file but after that I am Lost!!

thanks  
Reply
#12
(09-14-2020, 11:38 PM)bwolten Wrote: michu_michu,

looks like it is working for you...  What is the application sequence to obtain the data??

I follow the part where I need to modify the config file but after that I am Lost!!

thanks  

If you installed it correctly, all you have to do is just type in jkbms -D and that will go into debug mode and display what michu_michu had posted (or is it jkbms -p I forget?!). Now as far as getting it into grafana, that's where I didn't follow the script. It uses something called mqqt and I'm just not familiar with it. So that's why I had to hack mine to make it work with what I know (which is using telegraf and getting the raw data into influxdb). I know! it's confusing!

I'm kinda tied up right now and had to break down the setup, so when I have a chance, I can look into mqqt and see how it works and write up something. Or if someone here's familiar with mqqt maybe they can chime in.

Code:
pi@raspberrypi:~ $ jkbms --help
usage: jkbms [-h] [-c CONFIGFILE] [-q MQTTBROKER] [-n NAME] [-p] [-r RECORDS]
             [-x DECODEHEX] [-d] [-D] [-I]

JKBMS Utility, version: 0.1.0

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIGFILE, --configFile CONFIGFILE
                        Config file
  -q MQTTBROKER, --mqttBroker MQTTBROKER
                        MQTT Broker
  -n NAME, --name NAME  Process on the device with this section name in the
                        config file
  -p, --printResultsOnly
                        Just print the results, dont try to send to the MQTT
                        Broker
  -r RECORDS, --records RECORDS
                        Number of records to get from the BMS
  -x DECODEHEX, --decodeHex DECODEHEX
                        Hex to decode (will not communication to BMS)
  -d, --dumpConfigFile  Print the config file and exit
  -D, --enableDebug     Enable Debug and above (i.e. all) messages
  -I, --enableInfo      Enable Info and above level messages
pi@raspberrypi:~ $ jkbms -D

(09-14-2020, 08:57 AM)ajw22 Wrote: not2bme, the active BMS is certainly efficient and very powerful... very envious... but I'm afraid that in my system, it would mask faulty cells.  My puny 50mA passive balancer simply cannot keep up with any abnormal self-discharging cells, and I can easily see the problem in the voltage graphs after a few days~weeks.
How has been your experience on that front?  Do you have some sort of counter to track which packs needed the most balancing?

Honestly I haven't installed it yet. It's part of my setup to move to 48V (I got a new inverter last year so I had been meaning to switch to it). But I don't expect it to behave any different than my current balancer. In fact, with this setup you can program your balance point. So for example you set your unit to only balance at 50mV, then the one that drags behind will be your culprit. So the highest pack will start charging the lowest pack, but it will stop once the deviation between the highest and the lowest is 50mV. And if one is self discharging, you'd bet it'll always be the one that's the lowest.

The problem is my packs are pretty well balanced so they never even hit the limit for me to see it in action.

If you're impatient, I can show you how I do it on mine, even though it's not elegant. Attached is my version of this python script. The original author had this whole install setup and service, etc. Pretty cool stuff. I'm just old school and want it all in one script. So I merged all the different code in all the different folders and put it all in one file.

So this is how mine works:
1. Run my version of the jkbms.py. It outputs in json data.
2. Use telegraf (an influxdb tool) that will execute the above script, take the data and push it into my influxdb database server on 10.1.1.10.
3. I have a database called 'powerwall' already set up and my bms table where all these data are dumped is called 'jkbms'. Influxdb will automatically generate this table as soon as you push data to it through telegraf.
3. Then use grafana and select the powerwall database and the choose the jkbms table and voila that's how I roll Smile

To test my script it you type in python3 jkbms.py (in the same directory as the file)

You have to edit the file first by nano jkbms.py and put in the address of the bluetooth mac.

It outputs in json data (some formatted data that I use through telegraf to import into my influxdb server). Below is part of the config showing the inputs plugin for the /etc/telegraf/telegraf.conf file. That jkbms script is actually on my desktop on the raspberry pi. It's a test after all.


 
Code:
[agent]
  ## Default data collection interval for all inputs
  interval = "15s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  debug = false
  quiet = false
  logfile = ""
  hostname = ""
  omit_hostname = false


###############################################################################
#                            OUTPUT PLUGINS                                   #
###############################################################################

# Configuration for sending metrics to InfluxDB
[[outputs.influxdb]]
urls = ["http://10.1.1.10:8086"]
database = "powerwall"



###############################################################################
#                            INPUT PLUGINS                                    #
###############################################################################

# # Read metrics from one or more commands that can output to stdout

[[inputs.exec]]
   commands = [
     "/home/pi/Desktop/jkbms.py"
   ]

   timeout = "20s"
name_suffix = ""
name_override = "jkbms"
   data_format = "json"
Patalhetas likes this post


Attached Files
.zip   jkbms.zip (Size: 4.17 KB / Downloads: 9)
Reply
#13
Hey thanks,

looks like your rolling in the right direction..  I saw tutorials on telgraph and influxdb so I will head that way with your script...

Thank you for your effort and taking the time for your reply..
Reply
#14
(09-14-2020, 08:57 AM)ajw22 Wrote: not2bme, the active BMS is certainly efficient and very powerful... very envious... but I'm afraid that in my system, it would mask faulty cells.  My puny 50mA passive balancer simply cannot keep up with any abnormal self-discharging cells, and I can easily see the problem in the voltage graphs after a few days~weeks.
How has been your experience on that front?  Do you have some sort of counter to track which packs needed the most balancing?
This is a great point.   An 'active balancer' sounds attractive - but as I've discovered, healthy packs do not need but the smallest balance during operation.   My packs run months at a time with no balance needed.    The thing I appreciate about Batrium is that I can turn balance on / off  - so I can use it to touch things up but leave it off most of the time....   so I can see if any of the packs need attention.      

I've come to view balancing as a useful tool (e.g. when you first hookup a battery or for touch-ups) but not something I aspire to run all the time.
Reply
#15
Hello, does anyone know how to change this script to read rs485 instead of bluetooch?
Reply
#16
Try emailing the seller or try the contact us page on https://www.jkbms.com/

I contacted one of the aliexpress sellers and they were able to provide me with a canbus version a while back. It's not what you're looking for but just in case if anyone else is looking it's on this post https://secondlifestorage.com/showthread...7#pid58487
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)