syssi / esphome-jk-bms

ESPHome component to monitor and control a Jikong Battery Management System (JK-BMS) via UART-TTL or BLE
Apache License 2.0
482 stars 161 forks source link

Could it work with new JK BMS's communication board's RS232 port? #408

Closed txubelaxu closed 8 months ago

txubelaxu commented 10 months ago

This is the new JK BMS: https://www.jkbms.com/product/jk-pb2a16s15p-jk-pb2a16s-15p/

It has a comms board with 5 ports:

I have given a try to RS232 port but ESP uses modbus protocol.

Is any way to use serial protocol instead?

More info about HW: image image image image image image

txubelaxu commented 10 months ago

I have tested with no success. ESP32 (Serial2) connected directly to RS232 RJ11 connector. ESP32 RX pin in a pull-up input config. I send: byte bytesToSend[] = {0x4E, 0x57, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x01, 0x29}; and... there is no response at all. I send: byte bytesToSend[] = {0x4E, 0x57, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x01, 0x29, 0x13, 0x10}; and... no response at all.

I think it is because JK-BMS UART protocol is fixed to a kind of "GPS INPUT" and it cannot be changed from app: image

If you try to change the setting, BMS responses that the new setting can not be saved.

syssi commented 10 months ago

@txubelaxu How many items / protocols are available at the drop-down?

txubelaxu commented 10 months ago

Hi syssi,

There are 3 lines in the settings menu item (status/settings/control) regarding to protocols: image UART1 and CAN have "OK" button. UART2 has not. Anyway, "OK" button of UART1 does not work with all values, so any selection cannot be saved at this firmware/app version.

UART1 Protocol No.: has the next list inside: image image image image Some of the items are disabled in the list. The other ones are enabled, so you can select from the list but when applying the change using "OK" button a "Sending failure" message can appears. If you reload the screen you can see that the old setting (000 - 4G...) is the active value. So:

UART2 Protocol No.: 1 is fixed and has not a list.

CAN Protocol No. has the next list (I have not tested what values are selectable at this moment): image image image image

txubelaxu commented 8 months ago

See --> https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md

txubelaxu commented 8 months ago

See --> https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md

kptkip commented 5 months ago

The given link describes RS485 not RS232 definition

gianfrdp commented 1 month ago

I also am interested in RS232. I tried to connect PC App BMS Monitor w/o success. Could 00 protocol be same as old JK TTL one?