• Have you tried out dark mode?! Scroll to the bottom of any page to find a sun or moon icon to turn dark mode on or off!

diy solar

diy solar

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

Been away from this for a bit dealing with other issues, see that 1.4.5 is out :). Still using 2 BLE, have not gone down the single Victron Shunt route although it is hooked up and I have the ve connect cable ready. Seems like with my Atom S3/display and CAN only thing I need to make sure is I'm using ESPHome 2024.7.3 to compile.
 
My CAN bus modules keep frying(!) - one went today, but no idea how because nothing got unplugged or anything, but I was doing other things on another system connected to the same AC. (As far as I can see I've got everything correctly grounded to all the equipment). I think it's the TJA1050 board that I'm using and its plugged into a Solis hybrid.
Do I need a termination resistor on the end, and would it help with this sort of thing? Are any of these CAN chips/boards more resilient to static etc, or is there an isolated CAN board? Cheers.

SKU:U085 : CAN unit
1729334564453.png
 
Well a false start using 1.4.5 and don't have time to troubleshoot at the moment. This is the error on the downloaded, unmodified file, won't even pass esphome config:

Code:
chrisg@Chris-MacBook-Air esphome-yambms % esphome config multi-bms_JK-ALL_BLE.yaml
INFO ESPHome 2024.7.3
INFO Reading configuration multi-bms_JK-ALL_BLE.yaml...
ERROR Error while reading config: Invalid YAML syntax:

while parsing a block mapping
  in "multi-bms_JK-ALL_BLE.yaml", line 20, column 1
expected <block end>, but found '<block mapping start>'
  in "multi-bms_JK-ALL_BLE.yaml", line 80, column 3
chrisg@Chris-MacBook-Air esphome-yambms % esphome run multi-bms_JK-ALL_BLE.yaml
INFO ESPHome 2024.7.3
INFO Reading configuration multi-bms_JK-ALL_BLE.yaml...
ERROR Error while reading config: Invalid YAML syntax:

while parsing a block mapping
  in "multi-bms_JK-ALL_BLE.yaml", line 20, column 1
expected <block end>, but found '<block mapping start>'
  in "multi-bms_JK-ALL_BLE.yaml", line 80, column 3

1729353583982.png
 
Well a false start using 1.4.5 and don't have time to troubleshoot at the moment. This is the error on the downloaded, unmodified file, won't even pass esphome config:

Code:
chrisg@Chris-MacBook-Air esphome-yambms % esphome config multi-bms_JK-ALL_BLE.yaml
INFO ESPHome 2024.7.3
INFO Reading configuration multi-bms_JK-ALL_BLE.yaml...
ERROR Error while reading config: Invalid YAML syntax:

while parsing a block mapping
  in "multi-bms_JK-ALL_BLE.yaml", line 20, column 1
expected <block end>, but found '<block mapping start>'
  in "multi-bms_JK-ALL_BLE.yaml", line 80, column 3
chrisg@Chris-MacBook-Air esphome-yambms % esphome run multi-bms_JK-ALL_BLE.yaml
INFO ESPHome 2024.7.3
INFO Reading configuration multi-bms_JK-ALL_BLE.yaml...
ERROR Error while reading config: Invalid YAML syntax:

while parsing a block mapping
  in "multi-bms_JK-ALL_BLE.yaml", line 20, column 1
expected <block end>, but found '<block mapping start>'
  in "multi-bms_JK-ALL_BLE.yaml", line 80, column 3

View attachment 250915

All YAML files are tested (esphome config) before being sent to Github.
I downloaded this YAML from Github and I don't have this problem on my side, it's strange.

Bash:
$ esphome config multi-bms_JK-ALL_BLE.yaml
INFO ESPHome 2024.7.3
INFO Reading configuration multi-bms_JK-ALL_BLE.yaml...
INFO Updating https://github.com/syssi/esphome-jk-bms.git@main
INFO Updating https://github.com/syssi/esphome-jk-bms.git@main
WARNING GPIO2 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Detected timezone 'Europe/Brussels'
...
...
...
INFO Configuration is valid!
 
All YAML files are tested (esphome config) before being sent to Github.
I downloaded this YAML from Github and I don't have this problem on my side, it's strange.

Bash:
$ esphome config multi-bms_JK-ALL_BLE.yaml
INFO ESPHome 2024.7.3
INFO Reading configuration multi-bms_JK-ALL_BLE.yaml...
INFO Updating https://github.com/syssi/esphome-jk-bms.git@main
INFO Updating https://github.com/syssi/esphome-jk-bms.git@main
WARNING GPIO2 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Detected timezone 'Europe/Brussels'
...
...
...
INFO Configuration is valid!
Did you accidentally add a space while configuring your MAC addresses?
 
I can confirm that i have compiled 1.4.5 with no issues.
Check if you have inserted a extra space on the selection of the boards. I suspect there is the problem.
 
Hi @jahyde

Does this setup work for you ?
The battery side works fine on BLE/rs485, and now the CAN module loads fine without any errors after I corrected the pin config with tips from Waveshare support, but the inverter never sees it, and HA shows no active CAN connection.
 
The battery side works fine on BLE/rs485, and now the CAN module loads fine without any errors after I corrected the pin config with tips from Waveshare support, but the inverter never sees it, and HA shows no active CAN connection.
I’m wondering if you need termination resistor or is the can bus voltage correct/compatible. It may be good to try the other can transceiver chip or design just incase.
 
The battery side works fine on BLE/rs485, and now the CAN module loads fine without any errors after I corrected the pin config with tips from Waveshare support, but the inverter never sees it, and HA shows no active CAN connection.

@goldserve succeeded with the same inverter as you and a board using a MCP2515 like you, maybe he can help you with the can bus commissioning?
 
@goldserve succeeded with the same inverter as you and a board using a MCP2515 like you, maybe he can help you with the can bus commissioning?
With the mcp2515, if the init of it succeeds, it is usually okay and the crystal selection/spi comms is okay. Give me a link to all your hardware and config and I can comb through it.
 
The battery side works fine on BLE/rs485, and now the CAN module loads fine without any errors after I corrected the pin config with tips from Waveshare support, but the inverter never sees it, and HA shows no active CAN connection.

Note: for the can bus link to be activated you must have at least one combined BMS.
 
Note: for the can bus link to be activated you must have at least one combined BMS.

Edit: Now have combined=on for both BMS, and both BMS updating in HA... On latest 1.4.5 YamBMS.

1729554790564.png

1729556859652.png

@goldserve I am using the Waveshare S3 with their Pico CAN module, their support gave me these corrected pin settings:
1729555129160.png

So I used the conf files: multi-bms_JK-ALL_BLE.yaml and board_esp32-s3-devkitc-1_mcp2515.yaml
Here is my CAN conf:
YAML:
spi:
  # BUS SPI 1
  - id: bus_spi1
    mosi_pin: 48
    miso_pin: 15
    clk_pin: 47

canbus:
  # CANBUS NODE 1
  - platform: mcp2515
    spi_id: bus_spi1
    id: canbus_node1
    cs_pin: 16
    can_id: 1
    bit_rate: 500kbps

Not sure if protocol versions are right:
1729555577795.png
 

Attachments

Last edited:
That’s what threw me for a loop but in HA,
I have combined... On latest 1.4.5 YamBMS. The "Combined" status is confusing, not sure how to get all BMS to combined=on, my HA shows a few different things there, but at least one is combined, still no CAN... I do have a question, one BMS is not fully updating charge/discharge status in HA (shows all other values for cell voltages, etc) , I wonder is it because the bluetooth app passcode on one is 1234, and the other is 123456??

View attachment 251358
Under BMS1 I have:
View attachment 251359
BMS2:
View attachment 251360
View attachment 251361

@goldserve I am using the Waveshare S3 with their Pico CAN module, their support gave me these corrected pin settings:
View attachment 251362

So I used the conf files: multi-bms_JK-ALL_BLE.yaml and board_esp32-s3-devkitc-1_mcp2515.yaml
Here is my CAN conf:
YAML:
spi:
  # BUS SPI 1
  - id: bus_spi1
    mosi_pin: 48
    miso_pin: 15
    clk_pin: 47

canbus:
  # CANBUS NODE 1
  - platform: mcp2515
    spi_id: bus_spi1
    id: canbus_node1
    cs_pin: 16
    can_id: 1
    bit_rate: 500kbps

Not sure if protocol versions are right:
View attachment 251363
do you have any boot up uart logs that you can paste?
 
That’s what threw me for a loop but in HA,

do you have any boot up uart logs that you can paste?
I see a lot of send, no receive.

I have tried flipping the H/L wires. using standard CAT5, currently have H=pin 4 (solid blue) L=pin 5 (white/blue)
 

Attachments

I see a lot of send, no receive.

I have tried flipping the H/L wires. using standard CAT5, currently have H=pin 4 (solid blue) L=pin 5 (white/blue)
Can low is white/blue and high is solid blue.

I also see the schematics that your mcp board uses 16mhz crystal so you need that in your esp config.
 
Any pointers on how to set that 16mhz? I see some examples like this:
Code:
if(CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK)

Not sure where to put it.
 
Any pointers on how to set that 16mhz? I see some examples like this:
Code:
if(CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK)

Not sure where to put it.
canbus:
# CANBUS NODE 1
- platform: mcp2515
spi_id: bus_spi1
id: canbus_node1
cs_pin: 5
can_id: 2
bit_rate: 500kbps
clock: 16MHZ
 

diy solar

diy solar
Back
Top