JDB / XiaoXiang BMS tool


MASSIVE restock of EV Batteries at www.batteryhookup.com 5% coupon "POWERWALLS"

chuckp

Member
Joined
Jul 29, 2018
Messages
415
@sshoecraft

I have replaced the USB to tty converter and that has solved the issue!

It may have had an intermittent fault from new, I remember having some trouble setting up the profile on the BMS. I assumed it was finger trouble!

@chuckp I have had some success emulating Pylon Battery messages over the CANBUS interface to my ME3000SP. The fault light on the inverter is off and it is sending heartbeat messages in response to my status messages. I now need to run a full cycle to check if everything works as expected.

Andrew
Hi Andrew I will be very interested in the outcome, once my nephew has worked his magic I’ll post his code/ hardware etc. Thanks buddy.
 

AndrewL

New member
Joined
Mar 27, 2021
Messages
3
I was looking at the serial code and it looks like it may have been trying to set the stop bits/parity incorrectly.

I updated it to force: 8,N,1

// 8 bits, no parity, one stop bit
options.c_cflag &= ~PARENB;
options.c_cflag &= ~CSTOPB;
options.c_cflag &= ~CSIZE;
options.c_cflag |= CS8;

Attached is an updated binary. If you still have issues, definitely check the serial connections.

Thanks for the update, it has eliminated all of the occasional CRC errors.

Andrew
 

tgalarneau

New member
Joined
Apr 25, 2021
Messages
4
I have written a python bluepy program for for a RaspberryPi Zero W using bluetooth to connect with the JBD bms. The data is written to a unix socket and sent on to influxdb and grafana for graphing.


Tom
 

sshoecraft

Member
Joined
Jan 23, 2021
Messages
51
I have written a python bluepy program for for a RaspberryPi Zero W using bluetooth to connect with the JBD bms. The data is written to a unix socket and sent on to influxdb and grafana for graphing.


Tom
Very cool project tom! I also use influx/grafana and a little node-red. For a complete list of registers and what they do, MrSurly has documented them on his project (https://gitlab.com/bms-tools/bms-tools/-/blob/master/JBD_REGISTER_MAP.md). I have almost completely implemented all of JBD's protocol in my agent for solardirector (https://github.com/sshoecraft/solardirector/tree/main/bms/jbd). Someone was able to document passwords and I'm adding that soon. Also, I don't use bluetooth or serial but a wifi connection (https://diysolarforum.com/threads/jbd-bms-wi-fi-module.17252/).

I really like your grafana layout - it looks great. What Inverter are you using?
 

tgalarneau

New member
Joined
Apr 25, 2021
Messages
4
Very cool project tom! I also use influx/grafana and a little node-red. For a complete list of registers and what they do, MrSurly has documented them on his project (https://gitlab.com/bms-tools/bms-tools/-/blob/master/JBD_REGISTER_MAP.md). I have almost completely implemented all of JBD's protocol in my agent for solardirector (https://github.com/sshoecraft/solardirector/tree/main/bms/jbd). Someone was able to document passwords and I'm adding that soon. Also, I don't use bluetooth or serial but a wifi connection (https://diysolarforum.com/threads/jbd-bms-wi-fi-module.17252/).

I really like your grafana layout - it looks great. What Inverter are you using?
Thanks, I have been off-grid for 15 years and am using a Outback 48v 3600 watt inverter and FM80 charge controller for 16 REC 215w panels. I have been using my 180ah CALB lifepo4 batteries for the last 5 years, almost 2000 cycles, and they are still going strong.
 

sshoecraft

Member
Joined
Jan 23, 2021
Messages
51
Thanks, I have been off-grid for 15 years and am using a Outback 48v 3600 watt inverter and FM80 charge controller for 16 REC 215w panels. I have been using my 180ah CALB lifepo4 batteries for the last 5 years, almost 2000 cycles, and they are still going strong.

Wow that's excellent. I am just now going off grid. How are you powering your whole house with 3600 watts? I'm guess I'm asking what other things have you done to reduce your power requirements?
 

tgalarneau

New member
Joined
Apr 25, 2021
Messages
4
I started on my adventure which a thorough energy audit to find the worst offenders. It always comes down to controlling space heating, air conditioning and water heating. So I did the best thing to fix this and moved to Hawaii.

I built my house to take advantage of the trade winds for cooling and using the sun for roof mounted solar water heating and here there is no need for interior heating. Most of my other needs are daytime requirements and with solar availability - no problem. Rarely hit over 3000 watts from inverter. We use all the major appliances and these are not an issue, but we do watch and try not to use power hungry tools at the same time.

My batteries are sized to cover winter night time loads, the summer takes care of itself. For here that is around 4kwh - 6 kwh, so have a pack to cover this plus my lower and upper end buffers at 10kwh and rarely go below 40% capacity.

Not a solution for everyone but it sure worked out for me.
 

sshoecraft

Member
Joined
Jan 23, 2021
Messages
51
No wind power? Should have a nice night-time breeze going year-round there. Or is it not allowed?

For me, in east Texas, its all about the air conditioning. I have 2 (yes, 2) 5-ton Air Conditioners and they are a problem. I did just put in a heat pump water heater (old natural gas one died), and we do have a hand-dug 120yr old water well right outside the back door (kitchen). I plan on putting poly tubing down there and using it for geo heating/cooling with a water-based air handler. We'll see. The house is an old Victorian so insulation (and frankly, wiring) is an issue. I have four 6k SMA Sunny Islands (24kw total) with only 50k of batteries (which is not nearly enough). I have 60 305w panels on a ground mount, which should provided much-needed 15kw of 240v power during the summer.

My goal here on out is efficiency. I'm looking at split units in the upstairs bedrooms this year. Every little bit helps.

Which island are you on by the way?
 

tgalarneau

New member
Joined
Apr 25, 2021
Messages
4
Wind always seems like a good idea, but the reality of moving parts, noise, and cost, it doesn't add up for here. Can't beat the sun and panel costs. But there are a few rusting skeletons around here from former attempts. We live on the windward side of the Big Island in the middle of nowhere - jungle land. No power, cable or telephone lines nor water or mail.

We use catchment and with around 80 inches of rain a year it isn't a problem. For dark and short days, we use the iron sun, our 2000 watt generator for our batteries to reach what we need to get us through the night. Life is so much sweeter without lead-acid and full charges and equalizations.

I can't imagine your power and complexity with all your panels and batteries. You really need a good monitoring system to keep on top of all this.
 

RGB

New member
Joined
Jul 15, 2021
Messages
1
Hello I have built a battery project from 16 BMS with cells from an electric car. i would like to monitor this via iobroker, but i don't know enough about installing the software. can someone help me to install JBDTool and send it to iobroker with MQTT?

many thanks
 

graham

Member
Joined
Jan 5, 2018
Messages
44
@MrSurly is there a linux version ?
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

 

graham

Member
Joined
Jan 5, 2018
Messages
44
had some time recently , weather n all, to get back to connecting a raspberry pi to a JBD BMS,

BIG thanks to Sshoecraft for the JBD tools program, i have made constant referrals to Sshoecrafts posts in trying to learn how to set all this up.

Heres the set up so far

Raspberry pi 3 Raspi OS buster 10
Jbdtools static Pi
Jbdtools outputs to Mosquitto into node-red

As a starter im trying to send the data from 'Cells' topic to an Influxdb, then onto Grafanna, like Sshoecraft suggests.

after a few evenings head scratching and alot of searching i have installed Influxdb v1.8.7 (lot of problems with newer releases)

In node-red I have a function node that extracts the Cells topic and in the de-bug message i can see the array[7] out put.

But i am having problems getting the influxdb out node to input this to influxdb.

I cant find any instructions as to how to send array data to influxdb,
any help/suggestions would be great.
 

daklein

New member
Joined
Sep 14, 2019
Messages
5
I cant find any instructions as to how to send array data to influxdb,
any help/suggestions would be great.
in nodered, the mqtt in node outputs a parsed JSON object received from the jbdtool mqtt message. That goes to a change node block that sets the msg.payload to
Code:
{"ETF_dC1":payload.Temps[1]}
, where ETF_dC1 is the name I want it to have in influxdb, and payload.Temps[1] is the particular variable from the jbdtool object (pack temperature #2). That goes to an influxdb out node, with the same measurement name. I do that for each value I want to log. Probably there's a way to store the array directly into influx, that could be useful, anyone let me know how to do that.

At some point, I'd like to make a function block that would aggregate the various values (I have two parallel 10s packs, with 2 temp sensors each) to use for control. Do something like average the last 5-10 valid values received into a pack voltage, min & max temps & cell voltage, and store those 5 values into influx, instead of 20 cell voltages and 4 temps.

another option is to use the -F flatten option on jbdtool, so the array values for cell voltages and temperatures are given individually.
 
Last edited:

graham

Member
Joined
Jan 5, 2018
Messages
44
in nodered, the mqtt in node outputs a parsed JSON object received from the jbdtool mqtt message. That goes to a change node block that sets the msg.payload to
Code:
{"ETF_dC1":payload.Temps[1]}
, where ETF_dC1 is the nahanme I want it to have in influxdb, and payload.Temps[1] is the particular variable from the jbdtool object (pack temperature #2). That goes to an influxdb out node, with the same measurement name. I do that for each value I want to log. Probably there's a way to store the array directly into influx, that could be useful, anyone let me know how to do that.

At some point, I'd like to make a function block that would aggregate the various values (I have two parallel 10s packs, with 2 temp sensors each) to use for control. Do something like average the last 5-10 valid values received into a pack voltage, min & max temps & cell voltage, and store those 5 values into influx, instead of 20 cell voltages and 4 temps.

another option is to use the -F flatten option on jbdtool, so the array values for cell voltages and temperatures are given individually.
Thank you for the advice,

First off ,, theres a Flatten function? I haven't seen any mention of that in jbdtool info. ?? how can i use that?

Secondly I dont think i understand properly what i need to do,

mqtt node in - Change node - influxdb out ?

If i run with the code you suggest in the change node i get " Invalid 'to' JSON property"

I guess im missing something?
 

daklein

New member
Joined
Sep 14, 2019
Messages
5
Thank you for the advice,

First off ,, theres a Flatten function? I haven't seen any mention of that in jbdtool info. ?? how can i use that?

Secondly I dont think i understand properly what i need to do,

mqtt node in - Change node - influxdb out ?

If i run with the code you suggest in the change node i get " Invalid 'to' JSON property"
type jbdtool at command line and it will list the current options, it should list -F flatten arrays at the end. It may not have been there from the beginning, but has been for at least 6 months since I last got from github. So in your call to jbdtool, where ever that is, add the -F option to use it. I'm not using it though, I use nodered to select which item in the array.

The change node error you mention may be that you need to select Javascript expression (script J in the pulldown) instead of JSON ( curly braces {} in the pulldown.

Here's an export from nodered of my blocks that get the jbdtool mqtt output and put it out to influx. You may be able to import this and see how each block is configured.
JavaScript:
[{"id":"f6a525ff.3f28a8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"3e581e79.d96d92","type":"debug","z":"f6a525ff.3f28a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":150,"y":80,"wires":[]},{"id":"4a8c2a46.8c1a34","type":"mqtt in","z":"f6a525ff.3f28a8","name":"ET_front","topic":"JBD_ET_front","qos":"0","datatype":"json","broker":"724ca09d.3fbec","x":160,"y":120,"wires":[["3e581e79.d96d92","b7b37695.f6efe8","8b62abff.e1e8c8","7501e0a5.6e08b","a34c02c4.5a9f6"]]},{"id":"8b62abff.e1e8c8","type":"change","z":"f6a525ff.3f28a8","name":"ETF_Vdiff","rules":[{"t":"set","p":"payload","pt":"msg","to":"{   \"ETF_Vdiff\":payload.CellDiff}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":80,"wires":[["6da75959.25c908"]]},{"id":"6da75959.25c908","type":"influxdb out","z":"f6a525ff.3f28a8","influxdb":"98b7f44b.9b4d48","name":"influx","measurement":"ETF_Vdiff","precision":"","retentionPolicy":"","database":"Energy","precisionV18FluxV20":"s","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":550,"y":80,"wires":[]},{"id":"90c300ec.7c3f6","type":"influxdb out","z":"f6a525ff.3f28a8","influxdb":"98b7f44b.9b4d48","name":"influx","measurement":"ETF_Vp","precision":"","retentionPolicy":"","database":"Energy","precisionV18FluxV20":"s","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":590,"y":120,"wires":[]},{"id":"b7b37695.f6efe8","type":"change","z":"f6a525ff.3f28a8","name":"ETF_Vp","rules":[{"t":"set","p":"payload","pt":"msg","to":"{   \"ETF_Vp\":payload.Voltage}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":120,"wires":[["90c300ec.7c3f6"]]},{"id":"7501e0a5.6e08b","type":"change","z":"f6a525ff.3f28a8","name":"ETF_dC0","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"ETF_dC0\":payload.Temps[0]}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":180,"wires":[["34612fc0.86d62"]]},{"id":"a34c02c4.5a9f6","type":"change","z":"f6a525ff.3f28a8","name":"ETF_dC1","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"ETF_dC1\":payload.Temps[1]}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":200,"wires":[["ea1a01e7.3c12d"]]},{"id":"ea1a01e7.3c12d","type":"influxdb out","z":"f6a525ff.3f28a8","influxdb":"98b7f44b.9b4d48","name":"influx","measurement":"ETF_dC1","precision":"","retentionPolicy":"","database":"Energy","precisionV18FluxV20":"s","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":590,"y":200,"wires":[]},{"id":"34612fc0.86d62","type":"influxdb out","z":"f6a525ff.3f28a8","influxdb":"98b7f44b.9b4d48","name":"influx","measurement":"ETF_dC0","precision":"","retentionPolicy":"","database":"Energy","precisionV18FluxV20":"s","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":590,"y":180,"wires":[]},{"id":"724ca09d.3fbec","type":"mqtt-broker","name":"","broker":"192.168.15.15","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"98b7f44b.9b4d48","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"EnergyBridgeDB","name":"","usetls":false,"tls":"","influxdbVersion":"1.8-flux","url":"http://influxdb:8086","rejectUnauthorized":true}]
 

graham

Member
Joined
Jan 5, 2018
Messages
44
Thats great thank you i see what you mean now,

I now have data going into Influxdb..

Thank you
 
Last edited:

sshoecraft

Member
Joined
Jan 23, 2021
Messages
51
had some time recently , weather n all, to get back to connecting a raspberry pi to a JBD BMS,

BIG thanks to Sshoecraft for the JBD tools program, i have made constant referrals to Sshoecrafts posts in trying to learn how to set all this up.

Heres the set up so far

Raspberry pi 3 Raspi OS buster 10
Jbdtools static Pi
Jbdtools outputs to Mosquitto into node-red

As a starter im trying to send the data from 'Cells' topic to an Influxdb, then onto Grafanna, like Sshoecraft suggests.

after a few evenings head scratching and alot of searching i have installed Influxdb v1.8.7 (lot of problems with newer releases)

In node-red I have a function node that extracts the Cells topic and in the de-bug message i can see the array[7] out put.

But i am having problems getting the influxdb out node to input this to influxdb.

I cant find any instructions as to how to send array data to influxdb,
any help/suggestions would be great.

Just following up in this (I know it's been a while), but I added an -F option to jbdtools so it outputs flat mqtt data - no arrays. Looks like this:

Code:
# jbdtool -t ip:pack_01 -F
Voltage                   54.150
Current                   5.410
DesignCapacity            75.000
RemainingCapacity         23.850
PercentCapacity           32
CycleCount                63
Probes                    2
Strings                   14
temp_00                   16.0
temp_01                   15.9
cell_00                   3.865
cell_01                   3.863
cell_02                   3.865
cell_03                   3.864
cell_04                   3.871
cell_05                   3.870
cell_06                   3.869
cell_07                   3.870
cell_08                   3.868
cell_09                   3.868
cell_10                   3.872
cell_11                   3.871
cell_12                   3.871
cell_13                   3.872
Balance                   00000000000000
CellTotal                 54.159
CellMin                   3.863
CellMax                   3.872
CellDiff                  0.009
CellAvg                   3.868
DeviceName                15350021-SP15S008C-P14S-100A
ManufactureDate           20211011
Version                   2.5
FET                       Charge,Discharge
 

graham

Member
Joined
Jan 5, 2018
Messages
44
Just following up in this (I know it's been a while), but I added an -F option to jbdtools so it outputs flat mqtt data - no arrays. Looks like this:

Code:
# jbdtool -t ip:pack_01 -F
Voltage                   54.150
Current                   5.410
DesignCapacity            75.000
RemainingCapacity         23.850
PercentCapacity           32
CycleCount                63
Probes                    2
Strings                   14
temp_00                   16.0
temp_01                   15.9
cell_00                   3.865
cell_01                   3.863
cell_02                   3.865
cell_03                   3.864
cell_04                   3.871
cell_05                   3.870
cell_06                   3.869
cell_07                   3.870
cell_08                   3.868
cell_09                   3.868
cell_10                   3.872
cell_11                   3.871
cell_12                   3.871
cell_13                   3.872
Balance                   00000000000000
CellTotal                 54.159
CellMin                   3.863
CellMax                   3.872
CellDiff                  0.009
CellAvg                   3.868
DeviceName                15350021-SP15S008C-P14S-100A
ManufactureDate           20211011
Version                   2.5
FET                       Charge,Discharge

Looks like im using an older version without the -F function. Where can I find a newer static Pi version?
 
Top