diy solar

diy solar

JK BMS CAN bus comms now possible for inverters that support Goodwe and Pylontech batteries

Without any logs I can only guess that the inverter is not connected correctly.
Check the wiring to TJA1050 and the inverter.
Check the inverter is configured for CAN communications.

What do the logs say when connected via serial port over USB?
run esphome logs esp32-example-can.yaml select serial port
Ok, so I have connected the system to my inverter today. After a little bit of connection issues with pins being the wrong way, I finally managed to retrieve data from the JK BMS through the ESP home. This data can only be seen through the logs so far.

I have connected to the inverter, and the inverter is detecting the BMS. Fantastic!

However, the inverter is throwing a multitude of alarms. Starting with low battery voltage. For some strange reason, the inverter settings for Pylontech will only 'drain' the batteries to 47.0V.

I charged the battery up to 50V as a buffer, and ran again.

This time it detected fully, but sent a plethora of alarms:

High current discharge
BMS Low voltage
BMS High Temp
BMS OTPC
BMS Low Temp
BMS UTPC
BMS High current charge.

Try as I might, I could not clear these.

Any thoughts? I have attached the logs while running this.
 

Attachments

  • logs_battery_logs.txt
    283.1 KB · Views: 8
This time it detected fully, but sent a plethora of alarms:

High current discharge
BMS Low voltage
BMS High Temp
BMS OTPC
BMS Low Temp
BMS UTPC
BMS High current charge.

Try as I might, I could not clear these.
The ESP32 is not sending any alarms to the inverter:
send can id: 0x359 hex: 0 0 0 0 2 0 0 0
CAN alarmas/warnings are byte 0-3
Byte 4 is the number packs (2) in your case

What Battery type have you have defined?
The inverter manual says:

"3)Select battery type
If you’re using “1. PYLON”, “2. DARFON”, “4. General Lithium”, “5. Alpha. ESS” or “6. SOLTARO” battery types, congratulations, inverter’s first-time setup is complete. Please press “OK” to enter the main interface. But if you’re using “3. DEFAULT” battery type. We need more information regarding your battery"

Pylon is 15s so the voltages will be different assuming you are using 16s

I would maybe try "4. General Lithium All batteries that comply with SOFAR’S BMS CAN communication protocol"
 
The ESP32 is not sending any alarms to the inverter:
send can id: 0x359 hex: 0 0 0 0 2 0 0 0
CAN alarmas/warnings are byte 0-3
Byte 4 is the number packs (2) in your case

What Battery type have you have defined?
The inverter manual says:

"3)Select battery type
If you’re using “1. PYLON”, “2. DARFON”, “4. General Lithium”, “5. Alpha. ESS” or “6. SOLTARO” battery types, congratulations, inverter’s first-time setup is complete. Please press “OK” to enter the main interface. But if you’re using “3. DEFAULT” battery type. We need more information regarding your battery"

Pylon is 15s so the voltages will be different assuming you are using 16s

I would maybe try "4. General Lithium All batteries that comply with SOFAR’S BMS CAN communication protocol"
Today I have tried both the Pylontech and the General lithium, get the same alarms weirdly.

The general lithium allows you to select your charge and discharge amps, whereas the pylontech page required min max voltage to be selected as well. Strange why they ask this.

My setup is a 14S 18650 arrangement, approx 12kWh.

At the same time, the Home Assistant page is still greyed out as per my previous message. I can hit the top activate toggle, but the rest is 'unavailable'. Not sure if this has some effect?
 
My setup is a 14S 18650 arrangement, approx 12kWh.

At the same time, the Home Assistant page is still greyed out as per my previous message. I can hit the top activate toggle, but the rest is 'unavailable'. Not sure if this has some effect?
I would start again eg: delete it from HA, re flash the ESP32 using the standard code(no static IP etc)
Once it working correctly in HA then you might need to power off the inverter and essentially reboot it, it may have it knickers in a knot.
Do you have the temp sensors connected to the BMS and they are reporting correctly in the JK-BMS APP?

Your voltages with 14S 18650 are potentially going to be an issue, most inverters are expecting 16S lifepo4.
What is the full and empty voltage of your pack?
 
I will certainly give it a go. Never could get the normal WiFi settings to work but I will try again.

Yes the temperature sensors are all ok. All the readings within the BMS are fine and acceptable, no concerns reading the data on the app.

The extreme voltages are 42v to 58.8v, however, I am limiting it to 43.4v to 58.5v.
 
I will certainly give it a go. Never could get the normal WiFi settings to work but I will try again.
Wifi will generally not work until you have the inverter communicating due to CAN bus WDT reboot, it seems to hang things up waiting for the CAN bus.
Now that you have it communicating with the inverter the wifi should work normally.

edit: do you have your local domain configured correct in the secrets.yaml?
I find it works better if you use the FQDN when adding it to HA
 
Last edited:
Wifi will generally not work until you have the inverter communicating due to CAN bus WDT reboot, it seems to hang things up waiting for the CAN bus.
Now that you have it communicating with the inverter the wifi should work normally.

edit: do you have your local domain configured correct in the secrets.yaml?
I find it works better if you use the FQDN when adding it to HA
I haven't got a local domain set in secrets.yaml.

Is a local domain a necessity for this system to function properly?
 
Very interested in this topic as anyone connected to a sofar me3000sp with success??
It uses the plyontech protocol
 
Thanks for your response (sorry for the delay).

So I managed to get it connected to the network (static IP only though. I have briefly tried it plugged in between the JKBMS and my inverter (Sofar HYD6000-ES). The inverter has a strange setting when using Pylontech, asking whether it is a US2000 or US3000. Not sure which is best to select, so I have tried both.
From
The inverter alarms out, stating no BMS is connected.

On Home Assistant, I can activate the ESP, but all other buttons are greyed out. I hope to have a proper look this Saturday due to time constraints, and attempt to log it.

All I have altered in the code is the battery size and voltages etc. My pins are connected to RX2 and TX2, D22 and D23.

I have approx 1.6-1.7v coming off the CANH/CANL line, so I know my connection there is good.

Any thoughts?
From experience, on a Sofar ME3000, there needs to be a 120 ohm terminating resistor between CAN H and CAN L, It will not connect to it without it.

Id say the Sofar HYD6000 would be similar.

Sofar has a general lithium battery (on the ME3000 anyway) and it really doesnt like some of the pylontech can protcols when connected to something with a different name. (from experience using the ZEVA BMS, had to get the pylontech removed from the CAN messages (0x359 if i remember correctly, will need to check the code)
Looked up the code, it was 0x359 and 0x35C I removed.
The general lithium on the sofar is the SMA protocol, without any additions from the Pylontech etc.
 
Last edited:
From experience, on a Sofar ME3000, there needs to be a 120 ohm terminating resistor between CAN H and CAN L, It will not connect to it without it.

Id say the Sofar HYD6000 would be similar.

Sofar has a general lithium battery (on the ME3000 anyway) and it really doesnt like some of the pylontech can protcols when connected to something with a different name. (from experience using the ZEVA BMS, had to get the pylontech removed from the CAN messages (0x359 if i remember correctly, will need to check the code)
Looked up the code, it was 0x359 and 0x35C I removed.
The general lithium on the sofar is the SMA protocol, without any additions from the Pylontech etc.
The SMA protocol is very different when it comes to the ALARMS and Warnings.

If it supports Pylon batteries, it should work with the Pylon protocol I use as it is the Pylon Protocol standard I use.
 
The SMA protocol is very different when it comes to the ALARMS and Warnings.

If it supports Pylon batteries, it should work with the Pylon protocol I use as it is the Pylon Protocol standard I use.
Had a quick look over both protocols.

That is likely why on the zeva bms, I had problems with the pylontech can messages.

The sofar (me3000, a storage inverter, it's what I have ) tries to be smart and pick the battery type the battery is providing... And not just do what it's told! And it would be really unstable. (Random charge/discharge spikes)

I could see it flip between the pylon selection and the general lithium ("ZEVA BMS") selection.

A solis on the other hand has no issues with both protocols being active. but was unstable too on the pylontech selection, possibly an error in the code. Needed to select LG chem on the the 4G ones and AoBo on the 5G inverters (people using the seplos, us the AoBo battery setting too)

Possibly for the poster above, if the battery name is changed to "PYLON" it might settle the errors.
 
Update on Hardware interface.

I have made a prototype hardware interface that will essentially make it plug and play for most inverters, more details on my Patreon.
Hardware interface will be available to purchase for Patrons.
 
Update on Hardware interface.

I have made a prototype hardware interface that will essentially make it plug and play for most inverters, more details on my Patreon.
Hardware interface will be available to purchase for Patrons.
just an idea, but have you thought about sending a prototype to some of the popular youtube channels? it would probably help build a lot of support for the project!
 
Get this come up whilst installing??
 

Attachments

  • 20230228_112304.jpg
    20230228_112304.jpg
    505.3 KB · Views: 26
do i have to specify a domain name in the config as i dont use one
neither do i have an api. can i delete these from the script before installing cheers
 
do i have to specify a domain name in the config as i dont use one

Do an ipconfig from a command prompt, your router maybe using a default.

On your adaptor you will see the below:
Connection-specific DNS Suffix . : localdomain.com

.localdomain.com is you domain.
you can set it to nothing eg ""
if you remove it, it defaults to .local as the domain
 
Last edited:
@uksa007 I will be getting a jk b2a24s20p with can soon. I am trying to find a 72v charger (this is for a golf cart build) for my 23s 230ah pack and some chargers have can comms. I understand jkbms is can 2.0a, but some of these dealers are asking for the can protocol or a protocol file. I tell them 2.0a but they treat me like I have no clue what's going on ( surprise I dont!). One dealer said they use 2.0b so my bms can comm isnt compatable. Then they offer me a dumb charger. What do I need to show them or tell them to get me the right can enabled charger.

For the last 5 days I have been looking and always dead end at ur esp github or neey's and those file aren't what I need apparently. But thanks for what you do.

You can just tell me to go with a dumb charger if I'm not making any sense.
 
Back
Top