Closed txubelaxu closed 3 months ago
This is the traffic if only the MASTER (0x00 address) is connected to bus:
011016200001020000d6f1
021016200001020000c201
031016200001020000cf91
041016200001020000e9a1
051016200001020000e431
061016200001020000f0c1
071016200001020000fd51
081016200001020000bca1
091016200001020000b131
0a1016200001020000a5c1
0b1016200001020000a851
0c10162000010200008e61
0d101620000102000083f1
0e10162000010200009701
0f10162000010200009a91
55aaeb900200120d120d120d110d110d120d110d110d120d110d110d110d120d120d110d110d0000000000000000000000000000000000000000000000000000000000000000ffff0000120d01000002530050004f004a004d004b004d004d0053004e004d004a004c004d00520051000000000000000000000000000000000000000000000000000000000000000000df000000000019d100000000000000000000c800ce0000000000000000642e9e040080a30400000000002f0d0000640000006a8b2a0001010000000000000000000000000000ff00010000009a030000000060543f4000000000e814000000010101000600004488650000000000df00
c900d0009a036b270a007f0000008051010000000000000000000000000000feff7fdd2f0101b00700000029001016200001059a
55aaeb900100ac0d0000280a00005a0a0000240e0000780d000005000000790d0000500a00007a0d0000160d0000c409000050c30000030000003c000000102700002c0100003c00000005000000d0070000bc02000058020000bc0200005802000038ffffff9cffffffe8030000200300001000000001000000010000000100000080a30400dc0500007a0d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000500000060e3160010023c3218feffffffbfe9010200000000f50010161e00016456
011016200001020000d6f1
021016200001020000c201
031016200001020000cf91
041016200001020000e9a1
051016200001020000e431
061016200001020000f0c1
071016200001020000fd51
081016200001020000bca1
091016200001020000b131
0a1016200001020000a5c1
0b1016200001020000a851
0c10162000010200008e61
0d101620000102000083f1
0e10162000010200009701
0f10162000010200009a91
55aaeb900200120d120d120d110d120d110d120d110d110d110d110d110d110d120d120d110d0000000000000000000000000000000000000000000000000000000000000000ffff0000120d01000002530050004f004a004d004b004d004d0053004e004d004a004c004d00520051000000000000000000000000000000000000000000000000000000000000000000df000000000019d100000000000000000000c800ce0000000000000000642e9e040080a30400000000002f0d000064000000708b2a0001010000000000000000000000000000ff00010000009a030000000060543f4000000000e814000000010101000600008888650000000000df00
c900d0009a0371270a007f0000008051010000000000000000000000000000feff7fdd2f0101b00700000079001016200001059a
55aaeb900100ac0d0000280a00005a0a0000240e0000780d000005000000790d0000500a00007a0d0000160d0000c409000050c30000030000003c000000102700002c0100003c00000005000000d0070000bc02000058020000bc0200005802000038ffffff9cffffffe8030000200300001000000001000000010000000100000080a30400dc0500007a0d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000500000060e3160010023c3218feffffffbfe9010200000000f50010161e00016456
i have to adress bms1 to adress 1, bms2 to adress 2 and so on The JK programm also cannot connect, if there is the first bms adressed to 0
In the "internal" JK RS485 network (using connectors on the right), 1 of the JK-BMS must be "MASTER" (RS485 0x00) and other JK-BMS must be "SLAVE" (RS485 address inside interval: [0x01,0x0f]). MASTER asks in a pooling mode always to every address from 0x01 to 0x0f. Slave receiving "asking message" answers. So, in RS485 network cannot be another master node asking anything. The only way is to insert a "sniffer" and listen to the network gathering information. Now I am using one ESP32 via bluetooth for one BMS, and another ESP32 via bluetooth for the other BMS. Both ESP32 are integrated with Home Assistant. The target is to have only one ESP32 gathering information from this RS485 network. This way, bluetooth is free to connect with mobile when needed.
In my previous messages the info was fragmented because a bug in my capture script.
These are some examples of captured information, if can be of your interest:
20240223_172400.log 20240223_172455.log 20240223_172751.log 20240223_172756.log 20240223_173223.log
Great research!.
So the problem is as understood that there could be only one MASTER that is querying SLAVES. If we add ESP32 it cannot be Master, and as a SLAVE it cannot query other SLAVES and MASTER bms Status?
The only working way is Bluetooth ESP32 for multiple BMS (have 3) Is there more efficient way then 3x ESP32, Maybe there are some Multi Bluetooth versions or something?
If we add ESP32 it cannot be Master, and as a SLAVE it cannot query other SLAVES and MASTER bms Status?
That is correct. One of the BMSs in the network is the Master. ESP32 cannot be another Master. Only 1 Master in a RS485/Modbus network. An slave cannot query other slaves. The only way I have found is to "listening to" or "sniffing" the traffic. I am developing a code "jk_modbus2" that is a mixture of jk_bms_ble & jk_modbus. I have got compiled OK, but it is not working by the moment. Anyway, I could upload that code.
The main advantage of RS485 is that one ESP32 could manage all the BMSs in the network and the bluetooth could it be available to connect with other device to control it (change a setting...)
If we add ESP32 it cannot be Master, and as a SLAVE it cannot query other SLAVES and MASTER bms Status?
That is correct. One of the BMSs in the network is the Master. ESP32 cannot be another Master. Only 1 Master in a RS485/Modbus network. An slave cannot query other slaves. The only way I have found is to "listening to" or "sniffing" the traffic. I am developing a code "jk_modbus2" that is a mixture of jk_bms_ble & jk_modbus. I have got compiled OK, but it is not working by the moment. Anyway, I could upload that code.
The main advantage of RS485 is that one ESP32 could manage all the BMSs in the network and the bluetooth could it be available to connect with other device to control it (change a setting...)
Sounds extremely fantastic! Will be waiting for any updates
There is a new pull request that has the code. https://github.com/syssi/esphome-jk-bms/pull/464
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
I have given a try to RS485 ports using a linux ubuntu + USB2RS485 converter + cable attached to any of the RS485 ports of the BMSs. The BMS number 0 has address=0x00 (MASTER) The BMS number 1 has address=0x01 (SLAVE)
The JK Windows program is working with this configuration and wiring. So, I have given a try to linux and python3 serial... with some success? I don't know. In a listening/sniffing mode, all the communication in the RS485 bus is received by python program:
THIS IS THE python3 code
Is esphome-jk-bms compatible with this configuration in order to gathering information?
This is some of the traffic in hex: