diy solar

diy solar

YamBMS JK-BMS-CAN with new Cut-Off Charging Logic (open-source)

Concerning the canbus boards @shvm received boards with reversed tx and rx, to test.
Before trying this, make sure you have exhausted other things first.

Like, soldering proper headers to the pads (if they aren't already) on the CAN transceiver board. Just pins in contact on a breadboard will probably won't work due to high-speed nature.
 
Installed today two PB BMS with board_esp32-devkit-v1, i have updated the files in packages to last version. I can see all parameters from BMS but ESP is not communicating with inverter over CAN. I have tested also with ESP32 C3 and i have the same issue. I have changed the CAN board thinking that i may have a faulty one. No luck!

Looking over yambms_canbus file editor is reporting the fallowing error:

unknown tag !<!extend> (75:34)

72 | # +--------------------------------------+
73 |
74 | canbus: # 0x305 - Inverter ACK - SMA/LG/Pylon/Goodwe reply
75 | - id: !extend ${canbus_node_id}
---------------------------------------^
76 | on_frame:

What i am doing wrong?
The ESP32 C3 is NOT supported from what I know, that's an entirely different Architecture (RISC-V) ....

You should be using the ESP32 S3.
 
Before trying this, make sure you have exhausted other things first.

Like, soldering proper headers to the pads (if they aren't already) on the CAN transceiver board. Just pins in contact on a breadboard will probably won't work due to high-speed nature.
I don't think we are at those speed to be honest ...

I am using one of these for ESP32 - Inverter CANBus (in am using a Cat 6 SSFP Cable and the easier to hook up to the Atom S3 CANbus Transceiver was to use this Adapter) and it's working fine:
1722142655380.png

I wouldn't expect a breadboard to be *that* bad (initially at least) ... But yeah, over several Months/Years, it WILL get worse ...
 
As for me I need to start setting up the PVBrain2 Board with these Adapters (RS485 to UART) since I have relatively long Cabling Distances and I will use the JK BMS RS485 Converter as well:

Need to figure out exactly where to solder the Pins though (2 Options on the left, 2 Options on the right) :rolleyes: .

EDIT 1: Took real Picture
1722143908458.png

And yeah, on the PVBrain2 Board it's also quite confusing because the 2 sets of pins e.g. on the Left can be COMPLETELY different things:

1. RX / TX / GND / VCC
2. VCC / GND / TX / RX

1722144054189.png


And on the right:
1. ?? / A+ / B- / ??
2. GND / TX / RX

So on the left it's quite clear which one needs to "fit" (VCC / GND / TX / RX).

You can argue also on the right (there is only a 4 pin Option on the PVBrain2, but why aren't VCC and GND indicated on the Silkscreen: ?? / A+ / B- / ??) ?

EDIT 2: shouldn't I ISOLATE the other set of pins in order to prevent a short-circuit ?
1722144444144.png


1722144482220.png

I guess some Plastic Bushings could be used for that (instead of chopping the pins off):


Maybe something like this ?
1722144885843.png


Not sure if 2.0-2.5 mm is already too much for the "wider" VIAs though.

EDIT 3: Yeah, now I figured it out ... The White Silkscreen Rectangles clearly show which Pins are for RS485 and which Pins are for RS232 :fp2.

EDIT 4: should I solder some Female Headers (this way I don't really need to add the plastic Insulator Bushing), which makes it easier in case of e.g. Replacement ?

Or should I use the Bushing on the NON-used pins and Solder the Pins of the PVBrain2 Board directly onto this Adapter (better electrical Contact long-term)
 

Attachments

  • 1722143891326.png
    1722143891326.png
    339.5 KB · Views: 1
Last edited:
BLE is so convenient. What board do you recommend for BLE that can keep up with three?

Concerning the boards it is clear that an ESP32-S3 is the best choice for our project. Be careful! Atom S3 is nice but provides very few GPIOs, you must choose your board according to the type of BMS supervision you will set up UART vs BLE or a mix of both.

BLE is practical but requires more resources, I'm currently struggling with the stability of a classic ESP32 with dual UART + BLE supervision and my uptime is not stable, the ESP32 restarted 3x in 8 hours which is not good.

So honestly I really recommend UART especially with ESP32 DevKit v1.

I suppose that ESP32-S3 should have fewer problems managing BLE supervision, to be tested.

Concerning BLE stability, it would be interesting to hear Der_Hannes on this subject. @Der_Hannes

1722146494703.png
 
BLE is practical but requires more resources, I'm currently struggling with the stability of a classic ESP32 with dual UART + BLE supervision and my uptime is not stable, the ESP32 restarted 3x in 8 hours which is not good.
Just to clarify ... in the GitHub Issue you were REALLY using the ESP32 (NOT the ESP32-S3) ?

I also mentioned "ESP32" in that Issue but I am using the ESP32-S3 (Atom S3 Lite). I am using the Atom S3 Lite since I moved from syssi' Original Code to your Project essentially. No problem with your old Code (except that crazy impossible BUG with the Watchdog if I pull out the USB - WiFi Adapter from the Computer) and 1 x BLE Connection.

I think/thought that we were both using the Term ESP32 "loosely" (since from a Firmware/Software/ESPHome Point of View it's almost the same Thing at our "High" Level), but you were ACTUALLY using an ESP32 (NOT the ESP32-S3) ?

Sorry if there was a Misunderstanding :cry: . I was pretty sure you remembered that I was on the Atom S3 Lite since the beginning with your Code/Project ...

EDIT 1: on a separate note I Think I have some issues with Entities and Time Synchronization
Devices -> Jk-Bms-Bat02 works Correctly
1722148803242.png

Battery 02 Dashboard is broken
1722148781069.png


Some Funky stuff related to these duplicate Names of Entities I guess (e.g. "jk-bms-bat02 jk-bms-bat02 Last Complete Charge"), like I reported in that old Issue on GitHub.

Renaming everything to a "single" jk-bms-bat02 Entity in Home Assistant (e.g. "jk-bms-bat02 Last Complete Charge") seems to fix this:
1722149025794.png
 
Last edited:
I also notice that you are not yet part of the user list.

And I didn't feel like disassembling the board (for now) that is inside my battery.

View attachment 231869

Yeah, same reason as to why I don't really want to touch my existing Battery :( . Especially since restarting it proved to be quite difficult ...

(I have the RS485 wires of the JK BMS Adapter sitting on some Terminal Blocks, so in Theory it could be as simple as bringing a short Cable from there to some output RJ45 Terminals through the adapter I mentioned before ... but going in the Battery with a Screwdriver when it's energized ? No thanks 😅)

As for the User List, I see my Inverter is already in the list (reported by lucize). Do you also want to add me there (SUN-12K-SG04LP3-EU with Atom S3 Lite with BLE) ?
 
Last edited:
With which CAN module?

PYLON 1.2 protocol I suppose?
The one that was NOT Reccomended hence the 1 Day Confusion about why I wasn't getting ANY CANBus Communication (because it's using different Pins) 😅 . That was what I could get at the Time though ...

Using CANBus Unit (CA-IS3050G) - SKU: U085 with Atom S3 Lite with the following Settings:
YAML:
can_tx_pin: GPIO2
can_rx_pin: GPIO1

Pylon+ as the Protocol (at least from what HomeAssistant lists).
1722151284862.png
 
The one that was NOT Reccomended hence the 1 Day Confusion about why I wasn't getting ANY CANBus Communication (because it's using different Pins) 😅 . That was what I could get at the Time though ...

Using CANBus Unit (CA-IS3050G) - SKU: U085 with Atom S3 Lite with the following Settings:
YAML:
can_tx_pin: GPIO2
can_rx_pin: GPIO1

Pylon+ as the Protocol (at least from what HomeAssistant lists).

I suspected it for the CAN module, I just wanted confirmation. 😁

PYLON + is not useful with Deye (I put PYLON 1.2 in the table), you send 3 can_id in addition which are not supported but it does not pose any problems either.
 
I suspected it for the CAN module, I just wanted confirmation. 😁

PYLON + is not useful with Deye (I put PYLON 1.2 in the table), you send 3 can_id in addition which are not supported but it does not pose any problems either.
I don't want to touch it really :ROFLMAO: ... it mostly works as it should for now ... knock on wood :ROFLMAO:
 
@Sleeper85: would you happen to know the pinout (to RJ45 Connector) if I want to bring out the JK BMS Adapter RS485 Wires to a RJ45, and from there go to the PVBrain2 (in the long term, won't happen overnight ...)

One Image on Google seems to suggest this:
1722151598886.png
 
Installed today two PB BMS with board_esp32-devkit-v1, i have updated the files in packages to last version. I can see all parameters from BMS but ESP is not communicating with inverter over CAN. I have tested also with ESP32 C3 and i have the same issue. I have changed the CAN board thinking that i may have a faulty one. No luck!

Looking over yambms_canbus file editor is reporting the fallowing error:

unknown tag !<!extend> (75:34)

72 | # +--------------------------------------+
73 |
74 | canbus: # 0x305 - Inverter ACK - SMA/LG/Pylon/Goodwe reply
75 | - id: !extend ${canbus_node_id}
---------------------------------------^
76 | on_frame:

What i am doing wrong?

At first we had problems when using Atom S3 uarts (ESP32-S3).
The option below solved the problems.
This was tested by @arzaman.

This is also valid for ESP32-C3.

YAML:
logger:
  hardware_uart: USB_SERIAL_JTAG


1722152208041.png
 
Last edited:
This is correct and you can see it easily on the PCB of this adapter.
And you mean ... the pinout I decide for the RJ45 doesn't really matter if I do myself the conversion with
1722152595376.png

on the PVBrain2 side as well ?

The Deye Modbus Port is like this, maybe I should follow the same Convention ?
1722152661524.png
 
Well ... I'm more afraid of opening the Battery to be honest.

Yours is quite neat. Mine is an accessibility Nightmare ...

1722153130837.png

And yep, the 2 BMSs and Terminal Blocks are right in the middle on that Vertical Metal Plate :rolleyes: .

Next one is being built on a Wooden Box. Cannot really say it's much cheaper/easier though (it's NOT straight at all).
 
I don't think we are at those speed to be honest ...

I am using one of these for ESP32 - Inverter CANBus (in am using a Cat 6 SSFP Cable and the easier to hook up to the Atom S3 CANbus Transceiver was to use this Adapter) and it's working fine:
View attachment 231844

I wouldn't expect a breadboard to be *that* bad (initially at least) ... But yeah, over several Months/Years, it WILL get worse ...
I was warning about using something like these without soldering headers first IMG_20240724_130652090_HDR.jpg
 
For those using UART with multi BMS, how are you landing the wires from JK on the ESP32? My Atom Lite with CANBUS build for single BMS is great with the Grove cable/connectors.
 
For those using UART with multi BMS, how are you landing the wires from JK on the ESP32? My Atom Lite with CANBUS build for single BMS is great with the Grove cable/connectors.
When I get to it (read: could take several months) I'll be using the PVBrain2 Board.

Up to 8 UART to RS485 Adapters <-> RJ45 <-> JK BMS RS485 Converter <-> JK BMS.
 

diy solar

diy solar
Back
Top