CAN and RS485 BMS Emulated Protocols for DIY Battery to work with LV and HV Invertors - JK BMS JBD Daly 123Smart - OEM Battery


ALL NEW - Battery Finder Search for 12/24/36/48v or by capacity www.batteryfinder.net
New & used Batteries, Solar, accessories, LifePo4 cells & more 5% Coupon "Powerwalls" www.batteryhookup.com
HI, I would like to use your solution with the JK balancers to connect my 96s battery with a Solax X3 inverter.
I have 3 jk bms left from my old low voltage system at the moment and I would like to use them too, but connected with bluetooth to each slave esp to avoid ground loops . Will this work in your opinion?
Can I have the Keys for the following id's; cb865e4, 1bb865e4 , 31b3a3a0, 501cb2b0
I might need some help from You with this project so more than glad to to support your project ,just let know how. Thanks
from my opinion u need to connect via rs485 adaptor at least.
cascade jkbms is not a good idea, each jkbms will balance at different levels because will be like 3 distinct batterie
i dont implement such solution on software
 
from my opinion u need to connect via rs485 adaptor at least.
cascade jkbms is not a good idea, each jkbms will balance at different levels because will be like 3 distinct batterie
i dont implement such solution on software
Indeed is not ideal solution , but it will allow me to use the battery, monitor the cells , test and make sure all the emulator architecture will be ready util aI buy the jk balancers
my goal is to buy as You advised 5 pieces jk balancers connected in cascade and talk rs485 to each slave esp32 emulator and the last master esp32 talk to the solax inverter
I see there are also can jk balancers , are they beter suited , will they work with your hardware /software?
 
You might use 4 JK Balancers and 1 JKBMS and cascade the Balancers.
I'm not sure, if cascading to a BMS is working - if not, you'll need a 5th Balancer to handle 96s.

If you are just trying to test before you buy the balancers, I would suggest to take one ESP32 for each bms, write a little program that connects to them via BT, Serial or RS485 and supply the values through the CAN port. So you can "fake" a JK Balancer to DIYB4I...
But when you have 5 balancers (I'd suggest to take the CAN version), you'll not need to have slave ESPs anymore - you can connect all to the same CAN bus to your master ESP.

Another possibility would be to use the FAKE option in the latest version, which sends of total voltage and current cell health with values, you can enter.
 
Bună ziua, vă rog să mă ajutați cu o cheie de aplicație, codul de identificare: edf9d108, mulțumesc!
 
Hello, please help me with an app key, id code: edf9d108, thank you!
 
If you are just trying to test before you buy the balancers, I would suggest to take one ESP32 for each bms, write a little program that connects to them via BT, Serial or RS485 and supply the values through the CAN port. So you can "fake" a JK Balancer to DIYB4I...
That is exactly what I have intended to do , but in order to do all this I think are need the activation keys , otherwise the esp32 dont connect to each other ,or the Solax inverter ( the DIY4I.. says it has connected to the inverter , but Solax has error BMS missing even with the FAKE BMS option)

Have you succeded to make the balancers and and the DIYB4I... talk and transit data to your inverter, what solution have you used for the current sensor/
 
Yes, you are right.
As I recently found out, the DIYB4I does actually nothing without the activation key! This differs from the older (or different) LV version, where the current should only be limited to 1A without a proper activation.

But you wouldn't need activation keys for all ESPs then, because you will have to write your own code to build a BT->CAN bridge for the JKBMS, aka "Fake Balancer".
Constantins code is always a translator between BMS/Balancer and Inverter. What you are looking for is a kind of combiner/expander that fakes an inverter to a bunch of LV batteries and translate them all to be in series to the real inverter.
As far as I know, there's currently no plan to implement this.
And to be honest: it would save you lots of time and trouble to simply buy the balancers in advance and to not try with the existing BMSs...


I'm in a state where DIYB4I shows the inverter to be connected, but immediately disconnects after a few seconds without sending proper data to the inverter. I have to finish my battery modules first to really connect them to the converter - then I will investigate further.

BTW: With my own code I was able to connect to the inverter, but after a while the inverter complained about "battery average undervoltage", because there was actually no battery connected (as already written here).
 
Hi,

I will present my DIY CAN BMS emulator project , I work from some time to make this interface for integration of DIY battery with different brands of invertors with supported CAN or RS485 communication.

Interface use an esp32 with one or tow CAN ports and RS485 support, can handle multiple JK as inputs for data, and also cand handle LV or HV.

I use in this project all the data i can find online, i know am not the first on this road if u have documents of other BMS protocols u can share it with me.

If u want u can support my work to add more protocols for this project u can find how in the end of the post!

Tnx!!!

Hardware:

Esp32 DevKit 1
CAN : SN65HVD230
RS485: Max485
DC-DC: XL7015
RJ45 Breakout
Optional: Indicator LEDs
View attachment 29858
View attachment 29865

Connectivity:

WIFI Web Portal with Cell Info Data on local IP

View attachment 29861

View attachment 29860

Input BMS supported:

View attachment 29863
JK BMS - TTL, BT , CAN
JBD BMS - BT connection
Daly - work in progress

Protocol Emulated:

View attachment 29864

General BMS LV
Document V1.4 - 07.09.2020
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

Pylonthech LV
Document V1.2 - 08.04.2018
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

Seplos LV
Document V1.0 - 08.04.2018
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

LG Resu LV
Document
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

Growatt LV
Document V1.04 22,02,2019
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Big Endian

SMA LV
Document V1.0 - 07.09.2020
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

Li LV
Document V1.0 06.01.2020
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian


Victron Nemea200
Document V1.0 06.01.2020
CAN: 250Kbps
Transmission Cycle: 1s
Data Mode: Little Endian


Pylon HV
Document V1.18 30.05.2019
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian


GoodWee HV
Document V1.3 31.03.2021
CAN: 250Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

BYD HV
Document
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

Pylontec RS485
Document V2.0 15.10.2019
RS485: 9600bps MODUBUS ASCII
Transmission Cycle: 0.5s Timeout
Data Mode: Little Endian

Seplos RS485
Document V3.3 21.08.2018
RS485: 9600bps MODUBUS ASCII
Transmission Cycle: 0.5s Timeout
Inverter Replay:
Data Mode: Little Endian

Growatt RS485
Document V2.02 24.07.2019
RS485: 9600bps MODUBUS ASCII
Transmission Cycle: 0.5s Timeout
Data Mode: Little Endian

BYD RS485
Document
RS485: 9600bps MODUBUS RTU
Transmission Cycle: 1s Timeout
Data Mode: Little Endian


Inverter Tested LV

Victron: Gx Family - General LV have the most information displayed, this is an combination of more registry i find.
Growatt SPF 5000 ES - Pylon LV, Smplos LV, Li LV
Growatt SPH 5000 TL - Pylon Lv, Smplos LV, Li LV, Growatt LV
Solis S5-EH1P6k - Seplos LV, LI LV
Deye SUN12K-SG04 - Pylon LV, LI LV

Inverter Tested HV

Fronius Primo 6.0 Gen24 - BYD HV
SunGrow SH10RT - BYD HV
GoodWE GW10K - GoodWee HV, Pylon HV
ThinkPower S100TL - Pylon HV


MultiPack:

If u have 2 packs with 2 JkBms u can combine data by connected 1 to Serial Port and one on BT Port
If u have more then 2 u need to use more interfaces. The Rs485 will be use to communicate between interfaces and Master CAN port will raport to bms.


Know Issue:

1 - When u use BT connection u can not connect with the phone app to the JkBMS.
U need to stop the interface power and after connect and make settings with ur phone app.

2 - Pylontech LV - if u use this protocol some inverter limit max charge voltage under 54V for 15S LFP battery.
Use Seplos LV or LI LV protocol is same as pylon with few data changed.

3 - From RS485 Protocols i tested only Fronius Gen24, The Pylon RS485 LV and Semplos RS485 LV are write from documentation for PC App -> Battery communication protocol.

Warranties:

The project is under develop NO WARRANTIES are provided ! USE on ur own RISK!

Software:

In this moment GitHub Repo under construction!

Download & Install:

U can download the bin file from my Google Drive Link and write it on ESP32.
For first install u need to be done with cable an pc, after that u can update the firmware OTA.
i will provide new update as soon i can!


Support my Work:

If u like this project and want to support my work to add more protocols u can invest ur time and also if u can spare some $ will be great too!

Invest Time:

Test the interface on ur inverter and confirm what protocols are compatible to increase invertor compatibility list.
Provide documentation or data communication logs from ur Inverter and OEM battery for reverse engineering new protocols.
Share data if u all ready make some progress on reverse engineering new protocols.

Invest $:

Donate by PayPal and U will receive tech support for ur project: paypal.me/diyenergy
Fallow on Patreon for last updates.
Buy components kit from my ebay for ur projects.

Documentation:

I share my protocols documentation folder if u want to make ur own software.
if u have any other document of interest share it also with me.


Other Projects :

WifiManager https://github.com/tzapu/WiFiManager
TeslaBMS https://github.com/collin80/TeslaBMS
JKEnuPylon https://github.com/botaneta/JKbms_Emu_Pylon
JKBmsToPylonCAN https://github.com/ArminJo/JK-BMSToPylontechCAN
VictronLibCan https://github.com/jmibk/BMS-LIB-CAN-Victron


Implementation of this interface on battery:

LV 14S 180A Li from Kona with JKBms 150A and Can interface

View attachment 29914

HV 23S / module 60A from Kona with JK Activ Balancer and Can interface

View attachment 29913

JK - Victron

View attachment 29915

JK - Growatt

View attachment 29916

JK - Sungrow

View attachment 29917
I‘m a rookie on Can Bus but I‘m coming alone slow a steady. (See pics). Is there a standard for what each can Id means? I‘m reading in 004 and 4201-4207 right when I turn the Sonnen battery on. I see the data too. What it means I have no clue. Wondering if anyone created a spreadsheet. If not I will be creating one. A few Can ID’s are being talk about seems to be important like Ox35C. I’m learning but anybody knows clue me in. Thanks
Hi,

I will present my DIY CAN BMS emulator project , I work from some time to make this interface for integration of DIY battery with different brands of invertors with supported CAN or RS485 communication.

Interface use an esp32 with one or tow CAN ports and RS485 support, can handle multiple JK as inputs for data, and also cand handle LV or HV.

I use in this project all the data i can find online, i know am not the first on this road if u have documents of other BMS protocols u can share it with me.

If u want u can support my work to add more protocols for this project u can find how in the end of the post!

Tnx!!!

Hardware:

Esp32 DevKit 1
CAN : SN65HVD230
RS485: Max485
DC-DC: XL7015
RJ45 Breakout
Optional: Indicator LEDs
View attachment 29858
View attachment 29865

Connectivity:

WIFI Web Portal with Cell Info Data on local IP

View attachment 29861

View attachment 29860

Input BMS supported:

View attachment 29863
JK BMS - TTL, BT , CAN
JBD BMS - BT connection
Daly - work in progress

Protocol Emulated:

View attachment 29864

General BMS LV
Document V1.4 - 07.09.2020
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

Pylonthech LV
Document V1.2 - 08.04.2018
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

Seplos LV
Document V1.0 - 08.04.2018
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

LG Resu LV
Document
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

Growatt LV
Document V1.04 22,02,2019
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Big Endian

SMA LV
Document V1.0 - 07.09.2020
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

Li LV
Document V1.0 06.01.2020
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian


Victron Nemea200
Document V1.0 06.01.2020
CAN: 250Kbps
Transmission Cycle: 1s
Data Mode: Little Endian


Pylon HV
Document V1.18 30.05.2019
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian


GoodWee HV
Document V1.3 31.03.2021
CAN: 250Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

BYD HV
Document
CAN: 500Kbps
Transmission Cycle: 1s
Data Mode: Little Endian

Pylontec RS485
Document V2.0 15.10.2019
RS485: 9600bps MODUBUS ASCII
Transmission Cycle: 0.5s Timeout
Data Mode: Little Endian

Seplos RS485
Document V3.3 21.08.2018
RS485: 9600bps MODUBUS ASCII
Transmission Cycle: 0.5s Timeout
Inverter Replay:
Data Mode: Little Endian

Growatt RS485
Document V2.02 24.07.2019
RS485: 9600bps MODUBUS ASCII
Transmission Cycle: 0.5s Timeout
Data Mode: Little Endian

BYD RS485
Document
RS485: 9600bps MODUBUS RTU
Transmission Cycle: 1s Timeout
Data Mode: Little Endian


Inverter Tested LV

Victron: Gx Family - General LV have the most information displayed, this is an combination of more registry i find.
Growatt SPF 5000 ES - Pylon LV, Smplos LV, Li LV
Growatt SPH 5000 TL - Pylon Lv, Smplos LV, Li LV, Growatt LV
Solis S5-EH1P6k - Seplos LV, LI LV
Deye SUN12K-SG04 - Pylon LV, LI LV

Inverter Tested HV

Fronius Primo 6.0 Gen24 - BYD HV
SunGrow SH10RT - BYD HV
GoodWE GW10K - GoodWee HV, Pylon HV
ThinkPower S100TL - Pylon HV


MultiPack:

If u have 2 packs with 2 JkBms u can combine data by connected 1 to Serial Port and one on BT Port
If u have more then 2 u need to use more interfaces. The Rs485 will be use to communicate between interfaces and Master CAN port will raport to bms.


Know Issue:

1 - When u use BT connection u can not connect with the phone app to the JkBMS.
U need to stop the interface power and after connect and make settings with ur phone app.

2 - Pylontech LV - if u use this protocol some inverter limit max charge voltage under 54V for 15S LFP battery.
Use Seplos LV or LI LV protocol is same as pylon with few data changed.

3 - From RS485 Protocols i tested only Fronius Gen24, The Pylon RS485 LV and Semplos RS485 LV are write from documentation for PC App -> Battery communication protocol.

Warranties:

The project is under develop NO WARRANTIES are provided ! USE on ur own RISK!

Software:

In this moment GitHub Repo under construction!

Download & Install:

U can download the bin file from my Google Drive Link and write it on ESP32.
For first install u need to be done with cable an pc, after that u can update the firmware OTA.
i will provide new update as soon i can!


Support my Work:

If u like this project and want to support my work to add more protocols u can invest ur time and also if u can spare some $ will be great too!

Invest Time:

Test the interface on ur inverter and confirm what protocols are compatible to increase invertor compatibility list.
Provide documentation or data communication logs from ur Inverter and OEM battery for reverse engineering new protocols.
Share data if u all ready make some progress on reverse engineering new protocols.

Invest $:

Donate by PayPal and U will receive tech support for ur project: paypal.me/diyenergy
Fallow on Patreon for last updates.
Buy components kit from my ebay for ur projects.

Documentation:

I share my protocols documentation folder if u want to make ur own software.
if u have any other document of interest share it also with me.


Other Projects :

WifiManager https://github.com/tzapu/WiFiManager
TeslaBMS https://github.com/collin80/TeslaBMS
JKEnuPylon https://github.com/botaneta/JKbms_Emu_Pylon
JKBmsToPylonCAN https://github.com/ArminJo/JK-BMSToPylontechCAN
VictronLibCan https://github.com/jmibk/BMS-LIB-CAN-Victron


Implementation of this interface on battery:

LV 14S 180A Li from Kona with JKBms 150A and Can interface

View attachment 29914

HV 23S / module 60A from Kona with JK Activ Balancer and Can interface

View attachment 29913

JK - Victron

View attachment 29915

JK - Growatt

View attachment 29916

JK - I‘m a rookie on Can Bus but I‘m coming alone slow a steady. (See pics). Is there a standard for what each can Id means? I‘m reading in 004 and 4201-4207 right when I turn the Sonnen battery on. I see the data too. What it means I have no clue. Wondering if anyone created a spreadsheet. If not I will be creating one. A few Can ID’s are being talk about seems to be important like Ox35C. I’m learning but anybody knows clue me in. Thanks
 

Attachments

  • IMG_2926.jpeg
    IMG_2926.jpeg
    1.5 MB · Views: 192
  • IMG_2925.jpeg
    IMG_2925.jpeg
    2.2 MB · Views: 180
  • IMG_2927.jpeg
    IMG_2927.jpeg
    1.7 MB · Views: 178
Is there a standard for what each can Id means? I‘m reading in 004 and 4201-4207 right when I turn the Sonnen battery on. I see the data too. What it means I have no clue. Wondering if anyone created a spreadsheet. If not I will be creating one. A few Can ID’s are being talk about seems to be important like Ox35C.
CAN bus is only the transportation - there are many protocols used out there...
Your scanned IDs 0x42.. reminded my to Sermatec/Pylon protocol, but the battery should answer to requests only and then with 0x4210/0x4211 and 0x4220/0x4221 and so on.

With the help of Google I found, that Sonnen seems to use Pylontech BMS inside [1] - which reminded me also, that these are LV batteries of course, so forget about the HV protocol I mentioned above. Have a look at the Pylontech LV Protocol, which also mentions the 0x35C that you talked about but is not visible in your screenshot.

[1] https://diysolarforum.com/threads/sonnen-bms.34591/
 
Last edited:
A little discussion for HV Battery/BMS:
We are talking about multiple balancers in series/cascade. During a chat with @mrconstantin84 he advised me strongly to use the same number of cells per balancer to have an equal self-discharge, because the balancers are being powered from their connected cells.
This implies to only use 23 cells at most: the first balancer(s) need their 24th balancer lead to cascade to the next and even the last balancer should be powered from 23 cells.

But I think of another problem:
I need additional power for the ESP32 itself and all parts of the "BMS" function, including a relay to cut off power. I am planning to use a Kilovac EV200, which already needs 130mA holding current at 12V, meaning 1.56W!
The JK balancers are rated 0.6 to 1.0W, depending on the balance state.

My plan was to use a 16..120VDC->12VDC converter to power the EV200 and another 12VDC->5VDC isolated converter to power the ESP. But the load would be at least twice of the consumption of the balancers. The input power range does not allow to use all (64) cells as the power source, so I'm forced to get the power of the cells at one balancer only - using 3W instead of 1W at the packs with only the balancer...

Do you have any suggestions for this?
Using an external power supply is not an option, as the battery would need power even without mains to keep the backup function of my inverter.
A small compromise would be to use external power from the backup port of the inverter - this would "only" prevent powering up without mains.

Any more thoughts?
 
CAN bus is only the transportation - there are many protocols used out there...
You scanned IDs 0x42.. reminded my to Sermatec/Pylon protocol, but the battery should answer to requests only and then with 0x4210/0x4211 and 0x4220/0x4221 and so on.

With the help of Google I found, that Sonnen seems to use Pylontech BMS inside [1] - which reminded my also, that these are LV batteries of course, so forget about the HV protocol I mentioned above. So have a look at the Pylontech LV Protocol, which also mentions the 0x35C that you talked about but is not visible in your screenshot.

[1] https://diysolarforum.com/threads/sonnen-bms.34591/
Sven77PV, you are the man! Just joined GitHub yesterday. Downloaded the low voltage Pylontech protocol you posted. Inverter sending 8 bytes of zero to 0x305 I think that is what I need to keep my batteries awake. They come on with the power push botton but go to sleep after 10 minutes. My inverter does not have CAN so I hope to send the zeros to Ox305 and see what happens. Slowly I’m getting there. Bought 7.5 kWh’s of Sonnen batteries for $800 USD. Trusting my skills and everybody on the net skills to make these things work.
 
A little discussion for HV Battery/BMS:
We are talking about multiple balancers in series/cascade. During a chat with @mrconstantin84 he advised me strongly to use the same number of cells per balancer to have an equal self-discharge, because the balancers are being powered from their connected cells.
This implies to only use 23 cells at most: the first balancer(s) need their 24th balancer lead to cascade to the next and even the last balancer should be powered from 23 cells.

But I think of another problem:
I need additional power for the ESP32 itself and all parts of the "BMS" function, including a relay to cut off power. I am planning to use a Kilovac EV200, which already needs 130mA holding current at 12V, meaning 1.56W!
The JK balancers are rated 0.6 to 1.0W, depending on the balance state.

My plan was to use a 16..120VDC->12VDC converter to power the EV200 and another 12VDC->5VDC isolated converter to power the ESP. But the load would be at least twice of the consumption of the balancers. The input power range does not allow to use all (64) cells as the power source, so I'm forced to get the power of the cells at one balancer only - using 3W instead of 1W at the packs with only the balancer...

Do you have any suggestions for this?
Using an external power supply is not an option, as the battery would need power even without mains to keep the backup function of my inverter.
A small compromise would be to use external power from the backup port of the inverter - this would "only" prevent powering up without mains.

Any more thoughts?
Hello.
And why don't you use a power supply with a larger input voltage to handle the entire battery.
For example this one. It can handle 370V DC, which is far away from 64x4,2V.

https://www.aliexpress.com/item/100...id=2024021604084812497925033367760012011175_7
 
Thanks, @zeman51 !!
I was not aware, there are switching power supplies with that DC input range - will definitely have a look at those.
 
1. The red wire on the below diagram on my jkbms carries 48 volt - sounds dangerous to be connecting it to same terminal as the ESP32 3.3 volt
2. the XL_70xx module cannot take 220 uk volt whats the alternative?
3. what the the purpose of the question mark? (next to the ( aux)
4. where is the YAML code to flash the ESP?

My JK model is JK2A24S15P x 2
Solis Inverter
Planning to connect x 2 14s in parallel.


1708645484134.png
 
Back
Top