-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does mpp-solar works with new JK-BMS (using RS485 internal bus or CAN bus)? #460
Comments
it might work with serial rs232/rs485 - I dont have this device so i cant test, if you try and post debug results then fixes can be made |
Hi, I have connected with RS485. I attach here the debug info Many thanks!!! |
Try the jkserial protocol (jk02 is for ble connections)
…On Sat, 17 Feb 2024, 1:16 am txubelaxu, ***@***.***> wrote:
Hi, I have connected with RS485. I attach here the debug info
capture.txt
<https://github.com/jblance/mpp-solar/files/14310819/capture.txt>
Many thanks!!!
—
Reply to this email directly, view it on GitHub
<#460 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJVKNT7H3U5PRAIQ35QRL3YT5E2FAVCNFSM6AAAAABCX5YRPWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBYGI4DGMZTGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Well, I will give it a try but:
This is the received data if MASTER, CLIENT and "listener script" are connected:
This is the received data if MASTER and "listener script" are connected:
|
this looks a lot like the jk02_32 protocol decode im work with in #275, running a 'response' (from 55aaeb till next instance of 55aaeb) through the decode Im working on (in utils/jk/py current;y) gives:
note most numbers need /1000 (except temperatures which are /10) from the raw decodes above |
any feedback, or script output with the correspondin app screenshot would be a huge help in getting the decode correct |
MASTER ALONE IN THE RS485 NETWORK: (MASTER HAS ADDRESS 0x00)
MASTER AND 1 CLIENT IN THE RS485 NETWORK: (MASTER HAS ADDRESS 0x00, CLIENT HAS ADDRESS 0x01)
|
latest verision (in v 0.16.23+) of jk02_32 decodes the responses, not sure if it will work with the serial ports but worth a try |
jk02_32_definition fields depend on what is the value for Record_Type. I can confirm too that the starting "01" "02" "03" is the address of the client. So, 011016200001020000d6f1 means MASTER is ASKING to client addressed 0x01 for information. I changed my client to address 0x03 and client answered when MASTER sent 031016200001020000cf91 message and there were no response to 011016200001020000d6f1. |
I am going to change some values in my BMS to confirm. :-) |
|
so the serial data is continuous? ie you dont need to send a command (and get a response) if so then I'd guess we need to build the data into full responses and have the decode distinguish between the different responses? |
updated jk.py - added record type 1 definition record_01 = cs.Struct(
"Record_Counter" / cs.Byte,
"voltage_smart_sleep" / cs.Int32ul,
"cell_under_voltage_protection" / cs.Int32ul,
"cell_under_voltage_protection_recovery" / cs.Int32ul,
"cell_over_voltage_protection" / cs.Int32ul,
"cell_over_voltage_protection_recovery" / cs.Int32ul,
"balance_trigger_voltage" / cs.Int32ul,
"soc_100%_voltage" / cs.Int32ul,
"soc_0%_voltage" / cs.Int32ul,
"cell_request_charge_voltage" / cs.Int32ul,
"cell_request_float_voltage" / cs.Int32ul,
"power_off_cell_voltage" / cs.Int32ul,
"continued_charge_current" / cs.Int32ul,
"charge_ocp_delay_sec" / cs.Int32ul,
"charge_ocpr_time_sec" / cs.Int32ul,
"unknown2" / cs.Int32ul,
"discharge_ocp_delay_sec" / cs.Int32ul,
"discharge_ocpr_time_sec" / cs.Int32ul,
"scpr_time_sec" / cs.Int32ul,
"max_balance_current" / cs.Int32ul,
"charge_otp_c" / cs.Int32ul,
"charge_otpr_c" / cs.Int32ul,
"discharge_otp_c" / cs.Int32ul,
"discharge_otpr_c" / cs.Int32ul,
"charge_utp_c" / cs.Int32sl,
"charge_utpr_c" / cs.Int32sl,
"mos_otp_c" / cs.Int32ul,
"mos_otpr_c" / cs.Int32ul,
"cell_count" / cs.Int32ul,
"unknown7" / cs.Bytes(4),
"unknown8" / cs.Bytes(4),
"unknown9" / cs.Bytes(4),
"unknown10" / cs.Int32ul,
"scp_delay_us" / cs.Int32ul,
"start_balance_voltage" / cs.Int32ul,
"unknown11" / cs.Bytes(8),
"unknown12" / cs.Bytes(8),
"unknown13" / cs.Bytes(8),
"unknown14" / cs.Bytes(8),
"unknown15" / cs.Bytes(8),
"rest" / cs.GreedyBytes,
) gave:
based on python construct logic: jk02_32_definition = cs.Struct(
"header" / cs.Bytes(4),
"record_type" / cs.Byte,
"record_decode" / cs.Switch(cs.this.record_type, {1: record_01, 2: record_02, 3: cs.GreedyBytes}),
) unknown10 might be capacity ? |
confirmed: unknown10 is the capacity of the whole battery below BMS.
The definition of RS485 does not allow multiple MASTER devices, so, we can only "listen to" the network. But the information flowing is very interesting: all the status data of each node and the config data of each node.
|
Here is a table with those balues, I think: esphome-jk-bms |
I have just tested powermon changing the content of conf.yaml with a lot of combinations with no success. |
I have managed to map the Record 2 which is the 0x1200 registers I will work on the mapping of the Record1 0x1000 registers:
Example output:
2024-02-28 16:24:04,150 Master -> ID: 1, Write Multiple registers: 0x10, Write address: 5664, Write quantity: 1, Write data: [00 00] |
You have here: https://github.com/txubelaxu/esphome-jk-bms working code about it. It is not 100% working, because I have to improve the addressing, but that code is getting info from frames, reusing BLE code + MODBUS code |
|
Until now, I had got ESP acting as a "sniffer". There is one user that have tested (previous version) with 1 MASTER and 6 SLAVES. Well, I have got now the ESP working as master. https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md So, there is only one thing to do: speaking from ESP to inverter. lol If you need something from me for mpp-solar project, ask for it with no problem. Anything that I could help. |
This is the new JK BMS: https://www.jkbms.com/product/jk-pb2a16s15p-jk-pb2a16s-15p/
It has a comms board with 5 ports:
1 RS485 ((RJ45) to be connected to Inverter
1 CAN (RJ45) to be connected to Inverter
1 RS232 (RJ11)
2 RS485 (RJ45) for paralling other (same) BMS
The text was updated successfully, but these errors were encountered: