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

I got a hit yesterday watching the Canbus data and the data coming off the RS232. Canbus ID_0x4203 bit 8 is the Coulomb percentage.
Yesterday when my Coulomb percent was 100 this bit read 64. 64 Hex = 100 Decimal. Today my Coulomb is 94 this bit reads "5e" which is 94 decimal. The slow process of hacking is tough, but somebody got to do it, might as well be me. :)
 

Attachments

  • Coulomb.jpeg
    Coulomb.jpeg
    257.8 KB · Views: 122
  • Coulomb2.jpg
    Coulomb2.jpg
    226.1 KB · Views: 128
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
Hi,

i have been on another project and succesfully deployed an implementation of 2 48 v batteris in parralel - but it only has a master connection to the Solis 3kw inverter with no RS485 comms between the batteries, works fine but i would like to have an RS comm included and i see this solution covers the solution for just that.

This is my Planned Config:
1710775374747.png


can i get some support please?
I don't want to start the project and its time for a code to be issued and i am stuck at that point - it will just translate to a massive waste of my valuable time

regards

Ps

Any Chance we could use S3 instead as well?
1710775346468.png
 
I know DEYE use CAN port so u can make only one interface with 2 serial connections for jk.

In the Setup u need to select the Interface Name:

BT CAN / Serial CAN is for this:
View attachment 30360

RS485 CAN for the one with 2 RJ ports and with RS485 support

View attachment 30361

after u tested send me some pics with the invertor data.
Hi

Can you assist me to set this up as well?
 
I all ready answare to u on other topic, but put it again,

u have only 2 bateries

just conect one on rs485 and one on serial on same interface with lv fremwere.
use pylon or seplos protocol will work directly on solis lv is already tested.
Hi
I missed this reply

rs485 and one on serial on same interface with lv fremwere
1. Please send me a Diagram - I am a picture person - Did you mean to connect one battery to RS485 of the Inverter and the other to the ESP firmware project? if yes, i currently have a meter plugged to the RS485 of my solis inverter ...so that is used up.

2. Please send me a direct link to the lv firmware - and Filename to flash as i have downloaded so much i am now confused...
I have not been successful in flashing your ESP code - please advise (i am able to flash other YaML like sleeper85 Code for example)

# Edit
Why can't we get along with the CAN port also an RS485 from the same ESP32 chips?

and what is the DRM port used for?
 
Last edited:
Hi
I missed this reply


1. Please send me a Diagram - I am a picture person - Did you mean to connect one battery to RS485 of the Inverter and the other to the ESP firmware project? if yes, i currently have a meter plugged to the RS485 of my solis inverter ...so that is used up.

2. Please send me a direct link to the lv firmware - and Filename to flash as i have downloaded so much i am now confused...
I have not been successful in flashing your ESP code - please advise (i am able to flash other YaML like sleeper85 Code for example)

# Edit
Why can't we get along with the CAN port also an RS485 from the same ESP32 chips?

and what is the DRM port used for?

Ur JkBMS have the GPS port where u connect jk rs485 adaptor.

20240319_100301.jpg

Also u can connect without adaptor direct to Serial port

20240319_100607.jpg

1 : jkbms - > jk rs485 - > rs485 port of interface

2 : jkbms - > Serial port of interface

CAN PORT of interface - > Invertor

With one interface take data from 2 jkbms and send to can on invertor.
 
Ur JkBMS have the GPS port where u connect jk rs485 adaptor.

View attachment 31650

Also u can connect without adaptor direct to Serial port

View attachment 31651

1 : jkbms - > jk rs485 - > rs485 port of interface

2 : jkbms - > Serial port of interface

CAN PORT of interface - > Invertor

With one interface take data from 2 jkbms and send to can on invertor.
I feel I am almost understanding your description

1. would this be on the slave battery?
- jkbms - > Serial port of interface
2. what the the interface in this case ? the inverter or ESP32? - Please mark out the ESP interface leg that represents the Serial


1710846171896.png


#
I have the jk rs485 adaptor by the way.

So Basically
Serial port of interface and
rs485 port of interface is what i am not sure and then the exact code that works with this..please

Thank you very much for your reply - i know you are a very busy man...
 
for u the solution is like that:

connect to each interface 2 jkmbs with rs485 , put different battery id on settings of interface.
and will need one interface will the master to combine of the data.
for example for reg 0x305
first will be 0x1305 , second will be 0x2305 ....etc this is extended frame usually the lv invertors not read extended regs so in same can network u will have the master with reg 0x305 and salve with extended regs.

so u can connect 11 jkbms with 5 interfaces to send data to invertor
Thanks for this info. I'll try it.
Could I please get the key for ID d1e0f908?
 
Okay, as MrConstantin’s software is still not running for me, I accepted the need to do the programming myself...

Does anyone here know a simple implementation of SOC estimation for LiFePo4-Cells?
I know many charge- and discharge-tables. But do I really have to look if current is flowing in or out and use different algorithms then?
And do I split those curves into 3 lines, or should I add more single points and interpolate between them?
Or is coulomb counting the only way to go?

Thousands of questions, but no answers from my side...
 
Okay, as MrConstantin’s software is still not running for me, I accepted the need to do the programming myself...

Does anyone here know a simple implementation of SOC estimation for LiFePo4-Cells?
I know many charge- and discharge-tables. But do I really have to look if current is flowing in or out and use different algorithms then?
And do I split those curves into 3 lines, or should I add more single points and interpolate between them?
Or is coulomb counting the only way to go?

Thousands of questions, but no answers from my side...
Hi Sven,
Can you not get that from the bms? Or do you not trust that figure? The jk I'm using has that available in the data. It's a BD4A24S4P but I believe the data format is the same across all the JK bms.

Andy.

Ps I made progress with my own implemetation if you've a moment to check out the repo.
 
Can you not get that from the bms?
I don't have any BMS, only several balancers in series.

MrConstantin first used a setup to have 1 BMS and then further balancers in series. But the BMS models are not certified for High Voltage - and I need a HV battery. So I decided to go the "preferred" way to only have balancers, along with a current sensor and a contactor to cut off the battery in emergency.

I can already retrieve the voltage from the balancers and the current from the sensor. But now I have to report some SOC (and later even SOH) to the inverter...
 
But the BMS models are not certified for High Voltage - and I need a HV battery.
Hmm, yes, problem. I'm going to need to address that as well. I need 3x 20 cell packs in series which, like you say, exceeds the voltage switching capability of a 24 cell BMS.

ATM I'm using one BMS for balancing/cycling the cells for grouping so I'm not exceeding any specifications. But it's a looming problem.

My plan is to make an add-on board with mosfets (and/or emergency contactor) rated to HV switching and integrate that into the -ve most BMS and have that responsible for switching the pack. The other two would be set to be always on (or even have their mosfets bypassed. (I'm an Electronics Engineer so quite happy with reverse engineering the output stage of the BMS.)

I'm exploring the use of ESP32 integration to link the data between all the BMS for over/undervoltage and charge/discharge control so the three BMS effectively become one HV BMS.

Rome wasn't built in a day...

A,
 
Does anyone here know a simple implementation of SOC estimation for LiFePo4-Cells?
I know many charge- and discharge-tables. But do I really have to look if current is flowing in or out and use different algorithms then?

But now I have to report some SOC (and later even SOH) to the inverter...

My first observations are:
The system is running now with my SOC-calculation-by-voltage-only, but it's not useful at all. The voltages do not only differ between charge/discharge/idle, but are also dependent of the charging current.
So again: @mrconstantin84 are you going to share your source of SOC calculation/estimation?
 
Hi, please can you help with the APP Id for the two devices with IDs

54b865e4​

d4ef49c0​

I want to run 2 packs in parallel physically connected. Thanks.
 
Serious question.
Has anyone actually got this working or heard from mrconstanin84 over the past month?

 
Because i am involved in some project for ukraine i cant be be so "active", sorry for delay, will give free support when i can! in march if anybody need it!
At least he told, that he is involved in "some projects" and I know he was there in February.
His last post here was on March 19.
 
Hello all,
First of all I hope that you are doing okey @mrconstantin84

I have a question regarding the post from @Sven77PV on the functioning of the software.
After scrolling the net for several days and doing some research myself, I stumbled upon this forum and the discussion on the forum ect. After getting myself familiar with what is already out there (JK BMS communicating with CAN bus using Victron and Pylontech protocols ect) and the more expensive Batrium HV BMS that also includes HV protocols), I am looking for a middle mode, as I have 24S 88v li ion batteries which are not worth the Batrium system and not compatible with the specific JK BMS that has the built in protocols (only up to 16s) and even if this version went up to 24S it would not work because of the lack of HV protocols.

I support paying for the development and product itself, supporting your work but I would like to know if it would work in my situation after the reply of sven if anyone got it working.

As I read on the forum the HV protocols are in the DIYB4I version. Will it work if I make the hardware, connect it to the JK24S or JBD24S and the inverter (probably SolaX) and upload the three software bin files to the ESP32 from the DIYB4I and set the correct protocol trough the by WiFi acceded ESP32?

Will this work or is it more difficult or does it require programming some things yourself?

So just a single battery to a single inverter. Converting the output of the BMS to CAN with HV polytech protocol.

Would like to hear from someone, thanks a lot in advance for answering.
 
@laurens-van-beusekom@hotm
Unfortunately the HV protocols in DIYB4I will not work without an application key, so you'll have to wait for MrConstrantin to get back here to start testing. Until then, please allow some questions:
- Do you already know or own the target inverter? (you said "probably" SolaX)
- Do you already know or own the BMS (JK / JBD) and its interface (CAN / RS485 / serial / BT)?
- Is there any real sense in using HV protocols with "only" 24s/88V?

I got far enough to operate my JK Balancers CAN-Bus now with PYLON or BYD CAN-Protocol to my Sungrow inverter. But the latter would not work with batteries lower than 150 volts. AND I did not spend time to implement any other protocols yet (RS485 / serial / BT or other vendors).
But if you have a working BMS and "only" need to translate its data to Pylontech HV protocol, it is a quite simple job - but yes, you might need someone to program this for you...
When I finish to clean up (or better rewrite) my code, I will hopefully publish it on Github - which would allow further enhancements in protocols or supported BMS/balancers.

If you are willing to support this by testing in your environment, feel free to also contact me via PM and we will try to find a solution.
 
Back
Top