• 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)

Helllo

I have jk-bms 9x model JK BMS B2A24S15P and 9x adapter JK BMS RS485 connected all together. reads board esp32S3 16gb and RS485 Module 485 To Serial UART connected to 3.3vand I have a problem reading all 9 bms, works correctly up to 6 pieces of bmscan it be a problem with power supply ?? 5V ???

I'm not sure I understand the problem.

Are your 9x BMS configured with the JK RS485 protocol as shown below?

Did you give them an address from 1 to 9 ?

1744987598818.png
 
Bonne nouvelle, ta version de BMS semble supporter le protocole JK RS485 modbus donc je te conseil une des deux solutions ESP32-S3 ci-dessous :

Lilygo T-Connect, choisir la version avec 3x RS485 et 1x CAN. Cette carte offre le plus de possibilités concernant le nombre de port UART RS485 disponible. Tu pourras donc ajouter un shunt facilement dans le futur si besoin.

Sinon un Atoms3 (écran) ou Atoms3 Lite (sans écran) avec une base Atomic CAN et une unité RS485.

Tu trouveras toutes les photos avec référence des pièces dans la doc Github.

Je t'aiderai pour le YAML après en fonction du matériel achetés.

Je parles aussi français donc tu peux répondre en français 😉
Thank you.
I'll get the ESP32 S3 LilyGo.
But isn't anything else needed? I'm hearing about galvanic protection, a CAN transmitter, etc.

Out of respect for others, I'll make the effort to write in English. Thank you.
 
I'm not sure I understand the problem.

Are your 9x BMS configured with the JK RS485 protocol as shown below?

Did you give them an address from 1 to 9 ?

View attachment 293050
yes and device address 1-9 next bms

adress ok

when I add 6 it's ok but when I add 7 the whole bms 485 network fails and none of them worksI put 7, 8, 9 on another board wroom esp32 reads but not 1-9 together?
 
I've got 2x JK's connected ok to my T-Connect, but having trouble with the 3rd JK, so am deciding to just try bluetooth with there third one. Is there a simple way to combine 2x RS485 and 1x BLE in the same yaml on the same board? It's not looking obvious from the examples. Cheers.
 
B > B > C > ESP = only one connection to ESP32 (it's a RS485 bus)
Unfortunately it doesn't work. I can't connect a single JK-PB (address 1) because it doesn't detect anything. Only when I connect 2 x JKPB, one of which has address 0 (sic!) does it detect address 1 and also not completely. When there are 2 pieces, one has address 1 and the other 2, it doesn't detect anything.
 

Attachments

  • logs_yambms_logs (3).txt
    logs_yambms_logs (3).txt
    72.1 KB · Views: 3
  • Przechwytywanie.JPG
    Przechwytywanie.JPG
    83.1 KB · Views: 5
  • Przechwytywanie2.JPG
    Przechwytywanie2.JPG
    125.7 KB · Views: 5
I've got 2x JK's connected ok to my T-Connect, but having trouble with the 3rd JK, so am deciding to just try bluetooth with there third one. Is there a simple way to combine 2x RS485 and 1x BLE in the same yaml on the same board? It's not looking obvious from the examples. Cheers.
I managed to get bluetooth working by adding this code to the main yambms.yaml - don't know if it's the right way, but got it working. When I tried the STANDARD version the board would crash and restart every 60s, when I changed it to MINIMAL it has worked fine for hours. Perhaps someone could help explain as to why this would cause crashing?
 

Attachments

  • Screenshot 2025-04-19 at 17.57.58.png
    Screenshot 2025-04-19 at 17.57.58.png
    52.6 KB · Views: 5
Unfortunately it doesn't work. I can't connect a single JK-PB (address 1) because it doesn't detect anything. Only when I connect 2 x JKPB, one of which has address 0 (sic!) does it detect address 1 and also not completely. When there are 2 pieces, one has address 1 and the other 2, it doesn't detect anything.
I think the problem is in the new version of HA. After the update, even during compilation, it throws warnings where there were none and no longer works correctly on BLE ;-(. It's good that I have a saved bin version of the working BLE. Does anyone else have the problem or is it just me.
INFO ESPHome 2025.4.0
INFO Reading configuration /config/esphome/yambms.yaml...
WARNING Found 'root["mac"] = id(esp32_mac_address).state;
root["version"] = "${yambms_version}";
root["board_chip"] = "${board_chip}";
root["board_name"] = "${board_name}";
root["bms_model"] = "${bms_model}";
root["bms_protocol"] = "${bms_protocol}";
root["bms_count"] = id(${yambms_id}_var_bms_counter);
root["canbus_name"] = id(${yambms_id}_canbus_name);
root["canbus_protocol"] = id(${yambms_id}_canbus_protocol);
root["uptime"] = id(esp32_uptime).state;
root["date_time_now"] = id(esp32_date_time_now).state;' (see interval->3->then->if->then->1->http_request.post->json) which looks like a substitution, but 'bms_model' was not declared
WARNING Found 'root["mac"] = id(esp32_mac_address).state;
root["version"] = "${yambms_version}";
root["board_chip"] = "${board_chip}";
root["board_name"] = "${board_name}";
root["bms_model"] = "${bms_model}";
root["bms_protocol"] = "${bms_protocol}";
root["bms_count"] = id(${yambms_id}_var_bms_counter);
root["canbus_name"] = id(${yambms_id}_canbus_name);
root["canbus_protocol"] = id(${yambms_id}_canbus_protocol);
root["uptime"] = id(esp32_uptime).state;
root["date_time_now"] = id(esp32_date_time_now).state;' (see interval->3->then->if->then->1->http_request.post->json) which looks like a substitution, but 'bms_protocol' was not declared
WARNING Found 'root["mac"] = id(esp32_mac_address).state;
root["version"] = "1.5.5";
root["board_chip"] = "ESP32-S3";
root["board_name"] = "DevKitC-1";
root["bms_model"] = "${bms_model}";
root["bms_protocol"] = "${bms_protocol}";
root["bms_count"] = id(yambms1_var_bms_counter);
root["canbus_name"] = id(yambms1_canbus_name);
root["canbus_protocol"] = id(yambms1_canbus_protocol);
root["uptime"] = id(esp32_uptime).state;
root["date_time_now"] = id(esp32_date_time_now).state;' (see interval->3->then->if->then->1->http_request.post->json) which looks like a substitution, but 'bms_model' was not declared
WARNING Found 'root["mac"] = id(esp32_mac_address).state;
root["version"] = "1.5.5";
root["board_chip"] = "ESP32-S3";
root["board_name"] = "DevKitC-1";
root["bms_model"] = "${bms_model}";
root["bms_protocol"] = "${bms_protocol}";
root["bms_count"] = id(yambms1_var_bms_counter);
root["canbus_name"] = id(yambms1_canbus_name);
root["canbus_protocol"] = id(yambms1_canbus_protocol);
root["uptime"] = id(esp32_uptime).state;
root["date_time_now"] = id(esp32_date_time_now).state;' (see interval->3->then->if->then->1->http_request.post->json) which looks like a substitution, but 'bms_protocol' was not declared
INFO Updating https://github.com/Fabian-Schmidt/esphome-victron_ble.git@None
INFO Updating https://github.com/syssi/esphome-jk-bms.git@main
INFO Updating https://github.com/syssi/esphome-jk-bms.git@main
INFO Generating C++ source...
 
I think the problem is in the new version of HA. After the update, even during compilation, it throws warnings where there were none and no longer works correctly on BLE ;-(. It's good that I have a saved bin version of the working BLE. Does anyone else have the problem or is it just me.

Try using command line (it's a lot more reliable)
 
yes and device address 1-9 next bms

adress ok

when I add 6 it's ok but when I add 7 the whole bms 485 network fails and none of them worksI put 7, 8, 9 on another board wroom esp32 reads but not 1-9 together?

Which ESP board do you use?
 
Unfortunately it doesn't work. I can't connect a single JK-PB (address 1) because it doesn't detect anything. Only when I connect 2 x JKPB, one of which has address 0 (sic!) does it detect address 1 and also not completely. When there are 2 pieces, one has address 1 and the other 2, it doesn't detect anything.

Are these really JK-PBs you have?

What is the firmware version of your BMS?
 
I think the problem is in the new version of HA. After the update, even during compilation, it throws warnings where there were none and no longer works correctly on BLE ;-(. It's good that I have a saved bin version of the working BLE. Does anyone else have the problem or is it just me.

There are problems in your YAML because some variables are not declared. Please send me your YAML.
 
There are problems in your YAML because some variables are not declared. Please send me your YAML.
I rolled back the HA updates and the compilation problem is gone. The Yaml is standard without any additional changes.
############################################################
# You don't have to import a shunt but you must import at least one BMS.
shunt1: !include
file: packages/shunt/shunt_combine_Victron_SmartShunt_BLE.yaml # shunt_combine_Junctek_KHF_UART.yaml
vars:
shunt_id: '1' # must be a number
shunt_name: 'Shunt 1'
# shunt_uart_id: 'uart_esp_3'
# The sniffer represents the ESP node connected to the JK-BMS PB RS485 bus
# If address 0x00 is not detected on the RS485 bus, the sniffer will act directly as a master BMS (mode 2, max 15 BMS)
# sniffer1: !include
# file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer_talk_pin.yaml
# vars:
# sniffer_id: 'sniffer1'
# sniffer_protocol: 'JK02_32S'
# sniffer_uart_id: 'uart_esp_1'
# sniffer_talk_pin: 8 # ESP32: 4, ESP32-S3: 8, ESP32-C3: 10
#sniffer1: !include
# file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml
# vars:
# sniffer_id: 'sniffer1'
# sniffer_protocol: 'JK02_32S'
# sniffer_uart_id: 'uart_esp_1'
bms1: !include
file: packages/bms/bms_combine_JK_BLE_standard.yaml
vars:
bms_id: '1' # must be a number
bms_name: 'JK-BMS 1'
bms_ble_protocol_version: 'JK02_32S' # JK02_24S < hardware version 11.0 >= JK02_32S
bms_ble_mac_address: 'C8:47:80:28:E1:4E'
# Maximum cell charging cycles is used to calculate the battey SoH.
# MB31=8000.0, LF280K v3=8000.0, LF280K v2=6000.0, LF280=3000.0 (decimal is required)
bms_cell_max_cycles: '8000.0'
bms2: !include
file: packages/bms/bms_combine_JK_BLE_standard.yaml
vars:
bms_id: '2' # must be a number
bms_name: 'JK-BMS 2'
bms_ble_protocol_version: 'JK02_32S' # JK02_24S < hardware version 11.0 >= JK02_32S
bms_ble_mac_address: 'C8:47:80:24:77:23'
# Maximum cell charging cycles is used to calculate the battey SoH.
# MB31=8000.0, LF280K v3=8000.0, LF280K v2=6000.0, LF280=3000.0 (decimal is required)
bms_cell_max_cycles: '8000.0'

yambms: !include packages/yambms/yambms.yaml
canbus1: !include
file: packages/yambms/yambms_canbus.yaml
vars:
canbus_id: 'canbus1'
canbus_name: 'CANBUS 1'
canbus_node_id: 'canbus_inverter_1'
canbus_light_id: 'esp_light'
# The CANBUS link will be considered down if no response from the inverter (ID 0x305) for 5s
# The Deye inverter sends the ACK (can_id 0x305) only when it receives the can_id 0x356
canbus_link_timer: '5s'
# +--------------------------------------+
# | DEBUG ( logger level must be DEBUG ) |
# +--------------------------------------+
device_debug: !include
file: packages/base/device_debug_ESP32.yaml
vars:
debug_name: 'Debug'
debug_update_interval: '5s'
 
@michu_m

The current JK RS485 YAMLs are not optimized for JK-B, they were originally intended for JK-PB.
I need to create a dedicated YAML for JK-B by removing all unnecessary sensors, this will reduce the workload on your ESP32-S3.

That said, it's strange that you can't monitor 7x BMS because I know someone who monitors 7 with an AtomS3 (ESP32-S3) and another who monitors 5 with a standard ESP32.

Just to be sure, you haven't enabled PSRAM ?
I recently noticed that enabling PSRAM doesn't provide any benefit and even reduces the number of BMS that can be monitored.

By default I commented out PSRAM in all board.yaml if you haven't changed it that should be the case.

YAML:
# PSRAM activation with default options
# psram:
#   mode: octal
#   speed: 80MHz
 
@michu_m

The current JK RS485 YAMLs are not optimized for JK-B, they were originally intended for JK-PB.
I need to create a dedicated YAML for JK-B by removing all unnecessary sensors, this will reduce the workload on your ESP32-S3.

That said, it's strange that you can't monitor 7x BMS because I know someone who monitors 7 with an AtomS3 (ESP32-S3) and another who monitors 5 with a standard ESP32.

Just to be sure, you haven't enabled PSRAM ?
I recently noticed that enabling PSRAM doesn't provide any benefit and even reduces the number of BMS that can be monitored.

By default I commented out PSRAM in all board.yaml if you haven't changed it that should be the case.

YAML:
# PSRAM activation with default options
# psram:
#   mode: octal
#   speed: 80MHz
my file
 

Attachments


diy solar

diy solar
Back
Top