Skip to content
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

Add JK balancer support #18

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add JK balancer support #18

wants to merge 3 commits into from

Conversation

syssi
Copy link
Owner

@syssi syssi commented Nov 6, 2021

@bobwho69: Could you download this feature branch and flash the esp32-example.yaml to your esp32:

wget https://github.com/syssi/esphome-jk-bms/blob/add-jk-balancer-support/esp32-example.yaml
esphome run esp32-example.yaml

I've added a single query to this feature branch. Your BMS should respond if it supports the 9600 baud balancer protocol. Please provide some responses of your BMS.

Closes: #16

@bobwho69
Copy link

bobwho69 commented Nov 6, 2021

I'm sorry, I'm a novice pi user, with my ESP Home instance running on a Home Assistant Supervised docker and me not understanding this feature of github... how do I do this feature branch?

@syssi
Copy link
Owner Author

syssi commented Nov 6, 2021

Okay in this case just flash this configuration (you've to change it a bit to use ethernet instead of wifi f.e.):

substitutions:
  name: jk-bms

esphome:
  name: ${name}
  platform: ESP32
  board: esp-wrover-kit

external_components:
  - source: github://syssi/esphome-jk-bms@add-jk-balancer-support
    refresh: 0s

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

api:
  reboot_timeout: 0s

ota:
logger:
  level: VERY_VERBOSE
  logs:
    api.service: WARN
    ota: WARN
    sensor: WARN
    jk_bms_ble: VERY_VERBOSE
    uart_esp32: VERY_VERBOSE

uart:
  id: uart0
  baud_rate: 9600
  rx_buffer_size: 384
  tx_pin: GPIO14
  rx_pin: GPIO4

jk_modbus:
  id: modbus0
  uart_id: uart0

jk_bms:
  id: bms0
  jk_modbus_id: modbus0

sensor:
  - platform: jk_bms
    cell_voltage_1:
      name: "${name} cell voltage 1"

@bobwho69
Copy link

bobwho69 commented Nov 6, 2021

OK tried that, same repeated result. I swapped the pins around and same answer.

[00:24:53][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=152640 (now=157640)
[00:24:53][VV][uart.arduino_esp32:121]:     Wrote 0b01010101 (0x55)
[00:24:53][VV][uart.arduino_esp32:121]:     Wrote 0b10101010 (0xAA)
[00:24:53][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[00:24:53][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[00:24:53][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[00:24:53][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[00:24:53][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[00:24:53][VV][uart.arduino_esp32:142]:     Flushing...
[00:24:53][VV][uart.arduino_esp32:135]:     Read 0b01010101 (0x55)
[00:24:53][VV][uart.arduino_esp32:135]:     Read 0b10101010 (0xAA)
[00:24:53][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[00:24:53][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[00:24:53][VV][uart.arduino_esp32:135]:     Read 0b00000000 (0x00)
[00:24:53][VV][uart.arduino_esp32:135]:     Read 0b00000000 (0x00)
[00:24:53][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)

If this is because of the WT32-ETH01 board I'm using, I am able to try a ESP32 devkit v1 and place a wifi AP in the container to test. Would the pins RX2 (16) and TX2 (17) along with one of the GND pins be suitable on this board?

@syssi
Copy link
Owner Author

syssi commented Nov 6, 2021

Yes. Should work!

@syssi
Copy link
Owner Author

syssi commented Nov 6, 2021

Which GPIOs do you use at the moment at your WT32-ETH01?

@bobwho69
Copy link

bobwho69 commented Nov 6, 2021

I use GPIO5 RXD and GPIO17 TXD and the GND pin below it. Datasheet I am not sure about the (RS)485_EN function pin and it is not on a regular ESP32 so I dont use it.
I will try the other board in the morning with this branch and report back.

@bobwho69
Copy link

bobwho69 commented Nov 6, 2021

I have connected the ESP32 Dev Kit V1 and it reports the same. I have then swapped pins around, same. I then suspected the pins I was using were not correct so I set them to your GPIO14 & 4. same result

[09:22:23][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=114209 (now=119211)
[09:22:23][VV][uart.arduino_esp32:121]:     Wrote 0b01010101 (0x55)
[09:22:23][VV][uart.arduino_esp32:121]:     Wrote 0b10101010 (0xAA)
[09:22:23][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[09:22:23][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[09:22:23][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[09:22:23][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[09:22:23][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[09:22:23][VV][uart.arduino_esp32:142]:     Flushing...
[09:22:23][V][component:186]: Component esphome.coroutine took a long time for an operation (0.09 s).
[09:22:23][V][component:187]: Components should block for at most 20-30ms.
[09:22:23][VV][uart.arduino_esp32:135]:     Read 0b01010101 (0x55)
[09:22:23][VV][uart.arduino_esp32:135]:     Read 0b10101010 (0xAA)
[09:22:23][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[09:22:23][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[09:22:23][VV][uart.arduino_esp32:135]:     Read 0b00000000 (0x00)
[09:22:23][VV][uart.arduino_esp32:135]:     Read 0b00000000 (0x00)
[09:22:23][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)

My next thought
is this jk active balancer using real rs-485 protocol this time? the connector is 3 pin with G, A/H, B/L but you mention 4 pin with GND, Tx and Rx and VBAT on the BMS
could this cause the unexpected data?

@syssi
Copy link
Owner Author

syssi commented Nov 6, 2021

Could you provide a high-res photo of the mainboard?

@bobwho69
Copy link

bobwho69 commented Nov 6, 2021

Syssi I must thank you for this effort you are putting in here! Outstanding!
JK-DZ11-B2A24S rs485 icgogogo
!

Thank you for your help!
Robbie

@bobwho69
Copy link

bobwho69 commented Nov 6, 2021

here is a zoom in on the IC i think you want to see (and was not clear) it says a VP3082

jk-dz11-b2a24s zoom in

@syssi
Copy link
Owner Author

syssi commented Nov 7, 2021

Good catch! This is a "Low-Power RS-485 Transceiver". In this case you have to add a RS485 to TTL converter module between the balancer and the ESP.

@bobwho69
Copy link

bobwho69 commented Nov 7, 2021

Yes, I thought the same, so I reconnected my RS485 module back in, and I see the TX light flash every 5 secs but there is no data received in the logs or RX light on the module.

@bobwho69
Copy link

bobwho69 commented Nov 7, 2021

SUCCESS after research into RS485 problems, by swapping A & B to correct for a polarity error.
It appears to not follow the A to A and B to B rule, but the colour code of red for positive and black for negative

[22:07:49][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=129635 (now=134637)
[22:07:49][VV][uart.arduino_esp32:121]:     Wrote 0b01010101 (0x55)
[22:07:49][VV][uart.arduino_esp32:121]:     Wrote 0b10101010 (0xAA)
[22:07:49][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[22:07:49][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[22:07:49][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:07:49][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:07:49][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[22:07:50][VV][uart.arduino_esp32:142]:     Flushing...
[22:07:50][V][component:186]: Component esphome.coroutine took a long time for an operation (0.08 s).
[22:07:50][V][component:187]: Components should block for at most 20-30ms.
[22:07:50][VV][uart.arduino_esp32:135]:     Read 0b01010101 (0x55)
[22:07:50][VV][uart.arduino_esp32:135]:     Read 0b10010101 (0x95)
[22:07:50][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[22:07:50][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:07:50][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)

@bobwho69
Copy link

bobwho69 commented Nov 7, 2021

Reverting to main branch returns the following: Still at 9600 baud rate

[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b01010111 (0x57)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00010011 (0x13)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000110 (0x06)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000011 (0x03)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b01101000 (0x68)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[22:16:03][VV][uart.arduino_esp32:121]:     Wrote 0b00101001 (0x29)
[22:16:03][VV][uart.arduino_esp32:142]:     Flushing...
[22:16:03][V][component:186]: Component esphome.coroutine took a long time for an operation (0.24 s).
[22:16:03][V][component:187]: Components should block for at most 20-30ms.
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b10101100 (0xAC)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11110101 (0xF5)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11011001 (0xD9)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11110011 (0xF3)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111001 (0xF9)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b00101111 (0x2F)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b11111101 (0xFD)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b10101101 (0xAD)
[22:16:03][VV][uart.arduino_esp32:135]:     Read 0b00000000 (0x00)

@syssi
Copy link
Owner Author

syssi commented Nov 7, 2021

You should use 115200 baud now.

@syssi
Copy link
Owner Author

syssi commented Nov 7, 2021

Please try to use the original protocol again instead of this feature branch:

external_components:
  - source: github://syssi/esphome-jk-bms@main
    refresh: 0s

@bobwho69
Copy link

bobwho69 commented Nov 7, 2021

I have received the same data response as before and the data is not correct. I believe the formatting for the balancer rs485 protocol v1.3 response is not in the code.

@syssi
Copy link
Owner Author

syssi commented Nov 7, 2021

Please provide 4-5 responses.

@bobwho69
Copy link

bobwho69 commented Nov 7, 2021

HI, thank you so much for your patientce. the response is the same every time.

Branch: add-jk-balancer-support
Baud: 115200

[07:09:39][VV][uart.arduino_esp32:121]:     Wrote 0b01010101 (0x55)
[07:09:39][VV][uart.arduino_esp32:121]:     Wrote 0b10101010 (0xAA)
[07:09:39][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[07:09:39][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[07:09:39][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:09:39][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:09:39][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[07:09:39][VV][uart.arduino_esp32:142]:     Flushing...
[07:09:39][V][component:186]: Component esphome.coroutine took a long time for an operation (0.09 s).
[07:09:39][V][component:187]: Components should block for at most 20-30ms.
[07:09:39][VV][uart.arduino_esp32:135]:     Read 0b01010101 (0x55)
[07:09:39][VV][uart.arduino_esp32:135]:     Read 0b10010101 (0x95)
[07:09:39][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[07:09:39][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:09:39][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[07:09:39][V][component:186]: Component jk_modbus took a long time for an operation (0.05 s).
[07:09:39][V][component:187]: Components should block for at most 20-30ms.
[07:09:44][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=577880 (now=582881)
[07:09:44][VV][uart.arduino_esp32:121]:     Wrote 0b01010101 (0x55)
[07:09:44][VV][uart.arduino_esp32:121]:     Wrote 0b10101010 (0xAA)
[07:09:44][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[07:09:44][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[07:09:44][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:09:44][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:09:44][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[07:09:44][VV][uart.arduino_esp32:142]:     Flushing...
[07:09:44][V][component:186]: Component esphome.coroutine took a long time for an operation (0.09 s).
[07:09:44][V][component:187]: Components should block for at most 20-30ms.
[07:09:44][VV][uart.arduino_esp32:135]:     Read 0b01010101 (0x55)
[07:09:44][VV][uart.arduino_esp32:135]:     Read 0b10010101 (0x95)
[07:09:44][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[07:09:44][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:09:44][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[07:09:44][V][component:186]: Component jk_modbus took a long time for an operation (0.06 s).
[07:09:44][V][component:187]: Components should block for at most 20-30ms.
[07:09:49][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=582880 (now=587881)
[07:09:49][VV][uart.arduino_esp32:121]:     Wrote 0b01010101 (0x55)
[07:09:49][VV][uart.arduino_esp32:121]:     Wrote 0b10101010 (0xAA)
[07:09:49][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[07:09:49][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[07:09:49][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:09:49][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:09:49][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[07:09:49][VV][uart.arduino_esp32:142]:     Flushing...
[07:09:49][V][component:186]: Component esphome.coroutine took a long time for an operation (0.09 s).
[07:09:49][V][component:187]: Components should block for at most 20-30ms.
[07:09:49][VV][uart.arduino_esp32:135]:     Read 0b01010101 (0x55)
[07:09:49][VV][uart.arduino_esp32:135]:     Read 0b10010101 (0x95)
[07:09:49][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[07:09:49][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:09:49][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[07:09:49][V][component:186]: Component jk_modbus took a long time for an operation (0.06 s).
[07:09:49][V][component:187]: Components should block for at most 20-30ms.
[07:09:54][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=587880 (now=592881)
[07:09:54][VV][uart.arduino_esp32:121]:     Wrote 0b01010101 (0x55)
[07:09:54][VV][uart.arduino_esp32:121]:     Wrote 0b10101010 (0xAA)
[07:09:54][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[07:09:54][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[07:09:54][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:09:54][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:09:54][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[07:09:54][VV][uart.arduino_esp32:142]:     Flushing...
[07:09:54][V][component:186]: Component esphome.coroutine took a long time for an operation (0.09 s).
[07:09:54][V][component:187]: Components should block for at most 20-30ms.
[07:09:54][VV][uart.arduino_esp32:135]:     Read 0b01010101 (0x55)
[07:09:54][VV][uart.arduino_esp32:135]:     Read 0b10010101 (0x95)
[07:09:54][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[07:09:54][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:09:54][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[07:09:54][V][component:186]: Component jk_modbus took a long time for an operation (0.06 s).
[07:09:54][V][component:187]: Components should block for at most 20-30ms.
[07:09:59][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=592880 (now=597881)
[07:09:59][VV][uart.arduino_esp32:121]:     Wrote 0b01010101 (0x55)
[07:09:59][VV][uart.arduino_esp32:121]:     Wrote 0b10101010 (0xAA)
[07:09:59][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[07:09:59][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[07:09:59][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:09:59][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:09:59][VV][uart.arduino_esp32:121]:     Wrote 0b11111111 (0xFF)
[07:09:59][VV][uart.arduino_esp32:142]:     Flushing...
[07:09:59][V][component:186]: Component esphome.coroutine took a long time for an operation (0.09 s).
[07:09:59][V][component:187]: Components should block for at most 20-30ms.
[07:09:59][VV][uart.arduino_esp32:135]:     Read 0b01010101 (0x55)
[07:09:59][VV][uart.arduino_esp32:135]:     Read 0b10010101 (0x95)
[07:09:59][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[07:09:59][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:09:59][VV][uart.arduino_esp32:135]:     Read 0b00000001 (0x01)
[07:09:59][V][component:186]: Component jk_modbus took a long time for an operation (0.06 s).
[07:09:59][V][component:187]: Components should block for at most 20-30ms.

Branch: main
Baud:115200

[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b01001110 (0x4E)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b01010111 (0x57)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00010011 (0x13)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000110 (0x06)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000011 (0x03)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b01101000 (0x68)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[07:13:55][VV][uart.arduino_esp32:121]:     Wrote 0b00101001 (0x29)
[07:13:55][VV][uart.arduino_esp32:142]:     Flushing...
[07:13:55][V][component:186]: Component esphome.coroutine took a long time for an operation (0.25 s).
[07:13:55][V][component:187]: Components should block for at most 20-30ms.
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b10101100 (0xAC)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11110101 (0xF5)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11011001 (0xD9)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11110011 (0xF3)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111001 (0xF9)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b00101111 (0x2F)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b11111101 (0xFD)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b10101101 (0xAD)
[07:13:55][VV][uart.arduino_esp32:135]:     Read 0b00000000 (0x00)
[07:13:55][V][component:186]: Component jk_modbus took a long time for an operation (0.24 s).
[07:13:55][V][component:187]: Components should block for at most 20-30ms.
[07:14:00][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=13499 (now=18500)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b01001110 (0x4E)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b01010111 (0x57)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00010011 (0x13)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000110 (0x06)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000011 (0x03)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b01101000 (0x68)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[07:14:00][VV][uart.arduino_esp32:121]:     Wrote 0b00101001 (0x29)
[07:14:00][VV][uart.arduino_esp32:142]:     Flushing...
[07:14:00][V][component:186]: Component esphome.coroutine took a long time for an operation (0.26 s).
[07:14:00][V][component:187]: Components should block for at most 20-30ms.
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b10101100 (0xAC)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11110101 (0xF5)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11011001 (0xD9)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11110011 (0xF3)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111001 (0xF9)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b00101111 (0x2F)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b11111101 (0xFD)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b10101101 (0xAD)
[07:14:00][VV][uart.arduino_esp32:135]:     Read 0b00000000 (0x00)
[07:14:00][V][component:186]: Component jk_modbus took a long time for an operation (0.24 s).
[07:14:00][V][component:187]: Components should block for at most 20-30ms.
[07:14:05][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=18499 (now=23499)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b01001110 (0x4E)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b01010111 (0x57)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00010011 (0x13)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000110 (0x06)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000011 (0x03)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b01101000 (0x68)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[07:14:05][VV][uart.arduino_esp32:121]:     Wrote 0b00101001 (0x29)
[07:14:05][VV][uart.arduino_esp32:142]:     Flushing...
[07:14:05][V][component:186]: Component esphome.coroutine took a long time for an operation (0.25 s).
[07:14:05][V][component:187]: Components should block for at most 20-30ms.
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b10101100 (0xAC)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11110101 (0xF5)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11011001 (0xD9)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11110011 (0xF3)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111001 (0xF9)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b00101111 (0x2F)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b11111101 (0xFD)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b10101101 (0xAD)
[07:14:05][VV][uart.arduino_esp32:135]:     Read 0b00000000 (0x00)
[07:14:05][V][component:186]: Component jk_modbus took a long time for an operation (0.24 s).
[07:14:05][V][component:187]: Components should block for at most 20-30ms.
[07:14:10][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=23499 (now=28499)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b01001110 (0x4E)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b01010111 (0x57)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00010011 (0x13)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000110 (0x06)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000011 (0x03)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b01101000 (0x68)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[07:14:10][VV][uart.arduino_esp32:121]:     Wrote 0b00101001 (0x29)
[07:14:10][VV][uart.arduino_esp32:142]:     Flushing...
[07:14:10][V][component:186]: Component esphome.coroutine took a long time for an operation (0.25 s).
[07:14:10][V][component:187]: Components should block for at most 20-30ms.
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b10101100 (0xAC)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11110101 (0xF5)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11011001 (0xD9)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11110011 (0xF3)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111001 (0xF9)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b00101111 (0x2F)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b11111101 (0xFD)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b10101101 (0xAD)
[07:14:10][VV][uart.arduino_esp32:135]:     Read 0b00000000 (0x00)
[07:14:10][V][component:186]: Component jk_modbus took a long time for an operation (0.25 s).
[07:14:10][V][component:187]: Components should block for at most 20-30ms.
[07:14:14][VV][scheduler:152]: Running interval '' with interval=60000 last_execution=4294940274 (now=32978)
[07:14:15][VV][scheduler:152]: Running interval 'update' with interval=5000 last_execution=28499 (now=33499)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b01001110 (0x4E)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b01010111 (0x57)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00010011 (0x13)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000110 (0x06)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000011 (0x03)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b01101000 (0x68)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000000 (0x00)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00000001 (0x01)
[07:14:15][VV][uart.arduino_esp32:121]:     Wrote 0b00101001 (0x29)
[07:14:15][VV][uart.arduino_esp32:142]:     Flushing...
[07:14:15][V][component:186]: Component esphome.coroutine took a long time for an operation (0.26 s).
[07:14:15][V][component:187]: Components should block for at most 20-30ms.
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b10101100 (0xAC)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11110101 (0xF5)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11011001 (0xD9)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11110011 (0xF3)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111001 (0xF9)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b00101111 (0x2F)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111111 (0xFF)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b11111101 (0xFD)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b10101101 (0xAD)
[07:14:15][VV][uart.arduino_esp32:135]:     Read 0b00000000 (0x00)
[07:14:15][V][component:186]: Component jk_modbus took a long time for an operation (0.24 s).
[07:14:15][V][component:187]: Components should block for at most 20-30ms.

@bobwho69
Copy link

bobwho69 commented Nov 7, 2021

If I move my mpp-solar Raspberry Pi from inverter cabinet into battery container, would you get the necessary data from bluetooth? or I could try the TTL-RS485 module on there?
Apologies, at this stage, I know enough to be dangerous, but not enough to be very helpful.
I am able to borrow one of these industrial RS485 - Ethernet that I could try and setup as a virtual COM port on Windows laptop (or prey the Debian drivers work for R Pi 3B) or the RPi 3b that runs mpp-solar

And in my search I found this old youtube video of issues with the arduino libraries and esp32. It is old, so I dont know if it is valid.

@syssi
Copy link
Owner Author

syssi commented Nov 7, 2021

Having a working setup to identify the root cause would be helpful. Please use mpp-solar to identify the supported protocol and baudrate. The YouTube video doesn't apply if your rs485 converter module doesn't have a "driver enable pin". If there is one we should care about. ;-)

@syssi
Copy link
Owner Author

syssi commented Mar 1, 2022

@bobwho69 Any new here? Could you do another try with 9600 baud?

@syssi syssi force-pushed the add-jk-balancer-support branch from 80469cb to 10b90ec Compare March 2, 2022 18:32
@syssi syssi force-pushed the add-jk-balancer-support branch from 33ab28a to 8703651 Compare March 28, 2022 18:33
@miracolix72
Copy link

miracolix72 commented Jan 29, 2025

let me stumbling in,

log output for 17 LiFePo cells

[19:22:12][D][uart_debug:114]: >>> 55:AA:01:FF:00:00:FF
[19:22:12][D][uart_debug:114]: <<< EB:90:01:FF:16:11:0C:FB:11:0E:00:00:01:00:03:00:00:00:0B:07:D0:01:11:0C:F9:0C:FB:0C:FB:0C:FB:0C:FB:0C:FC:0C:FB:0C:FB:0C:FB:0C:FC:0C:FB:0C:FB:0C:FB:0C:FB:0C:FC:0C:FB:0C:FB:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:A3:DB
[19:22:15][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[19:22:17][D][uart_debug:114]: >>> 55:AA:01:FF:00:00:FF
[19:22:17][D][uart_debug:114]: <<< EB:90:01:FF:16:11:0C:FB:11:01:00:00:01:00:02:00:00:00:0B:07:D0:01:11:0C:F9:0C:FB:0C:FB:0C:FB:0C:FB:0C:FC:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:A3:CB
[19:22:32][D][uart_debug:114]: >>> 55:AA:01:FF:00:00:FF
[19:22:32][D][uart_debug:114]: <<< EB:90:01:FF:16:11:0C:FB:11:02:00:00:01:00:03:00:00:00:0B:07:D0:01:11:0C:F9:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:0C:FC:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:A3:C

and log output for 20 cells:

[19:23:52][D][uart_debug:114]: >>> 55:AA:01:FF:00:00:FF
[19:23:52][D][uart_debug:114]: <<< EB:90:01:FF:19:F7:0C:FC:14:00:13:00:01:00:03:00:00:00:0B:07:D0:01:14:0C:FC:0C:FC:0C:FC:0C:FB:0C:FB:0C:FC:0C:FB:0C:FB:0C:FC:0C:FC:0C:FC:0C:FC:0C:FC:0C:FC:0C:FB:0C:FC:0C:FB:0C:FC:0C:FC:0C:F9:00:00:00:00:00:00:00:00:00:A3:EF
[19:23:57][D][uart_debug:114]: >>> 55:AA:01:FF:00:00:FF
[19:23:57][D][uart_debug:114]: <<< EB:90:01:FF:19:F7:0C:FC:14:00:13:00:01:00:03:00:00:00:0B:07:D0:01:14:0C:FC:0C:FC:0C:FC:0C:FB:0C:FC:0C:FC:0C:FC:0C:FB:0C:FC:0C:FB:0C:FB:0C:FB:0C:FB:0C:FC:0C:FC:0C:FB:0C:FC:0C:FC:0C:FB:0C:F9:00:00:00:00:00:00:00:00:00:A3:ED

increasing debug level says

[19:41:38][D][uart_debug:114]: >>> 55:AA:01:FF:00:00:FF
[19:41:39][D][uart_debug:114]: <<< EB:90:01:FF:16:10:0C:FB:11:01:00:00:01:00:02:00:00:00:0B:07:D0:01:11:0C:F9:0C:FB:0C:FA:0C:FB:0C:FB:0C:FB:0C:FA:0C:FB:0C:FB:0C:FA:0C:FB:0C:FA:0C:FB:0C:FB:0C:FB:0C:FB:0C:FB:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:9E:C0
[19:41:39][VV][jk_modbus:012]: Buffer cleared due to timeout: EB.90.01.FF.16.10.0C.FB.11.01.00.00.01.00.02.00.00.00.0B.07.D0.01.11.0C.F9.0C.FB.0C.FA.0C.FB.0C.FB.0C.FB.0C.FA.0C.FB.0C.FB.0C.FA.0C.FB.0C.FA.0C.FB.0C.FB.0C.FB.0C.FB.0C.FB.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.9E.C0 (74)
[19:41:39][VV][jk_modbus:012]: Buffer cleared due to timeout: 

increasing timeout doesn't help, maybe i change the wrong line.

@syssi
Copy link
Owner Author

syssi commented Jan 30, 2025

@miracolix72 Thanks for th raw payloads! I will have a look!

@syssi syssi force-pushed the add-jk-balancer-support branch 2 times, most recently from d38b4f1 to 04b6d38 Compare January 30, 2025 09:52
@miracolix72
Copy link

Vielen Dank, ich habe jetzt in meinem Fork ein paar Hacks gemacht, einige checks ausgeschaltet da ich noch nicht durchblicke, aber dafür jetzt schonmal die Spannungen im Homeassistant angezeigt bekommen. Da das ganze mit Modbus nichts zu tun hat stellt sich mir die Frage ob man das nicht einfacher lösen kann - aber da ich gerade hier dazugestoßen bin und keine Ahnung habe muss ich diese Frage halt weiterreichen, evtl. kommt der Einblick noch. GGf. kannst Du davon etwas weiterverwenden bzw. besser lösen.

  • Länge des Frames ist fix und nicht im Frame enthalten
  • Checksumme ist nur 1Byte und Berechnung stimmt irgendwie nicht obwohl es nur aufsummiert wird
  • if (device->address_ == address) { - schlägt natürlich auch fehl
  • Temperatur wird noch falsch ausgewertet, evtl. Offset falsch (in der Doku wird der Wert in 1°C angegeben, bei mir sinds aber 0,1°C Schritte)

Am Wochenende gehts weiter.

@syssi
Copy link
Owner Author

syssi commented Jan 30, 2025

Mit Modbus hat das Protokoll nichts zu tun. Ich habe mich damals an der Klassen-Hierarchie festgehalten, da ich die Hoffnung, dass man den Jikong-Geräten eine Adresse (Device ID) zuweisen kann und dann mehrere Geräte über einen Bus ansprechen kann. Man ist aber lange nicht in diese Richtung gegangen, so dass man hier definitiv die Komplexität reduzieren kann. Vielleicht schaffe ich morgen ein reduzierter Beispiel zu liefern. Dann könntest du es weiter versuchen zu vervollständigen.

Welche Jikong-Geräte hast du genau im Einsatz?

@miracolix72
Copy link

Ok, das mit der Adresse / Modbus macht dann wohl deswegen Sinn. Das JK-DZ11-B2A24S hat ja auch ein Addressbyte.
Ich habe ein älteres DZ08-B2A24 mit HW/SW V06, was als CAN Bus angepriesen wurde aber mit ebendiesem gar nicht so viel an Hut haben soll, das würde ich mir auf dem Wege dann auch vornehmen, weil das an meiner Lithium-Bank aus gebrauchten e-Up Akkus hängt und ich mir für das REC-BMS kein teures WLAN Teil holen wollte.
Dann zwei aktuellere DZ11 mit HW/SW 11 und RS485 was jetzt am Zuge ist, das soll dann mit 2 Stück einen 36Zellen 130V USV-Akku balancen und auf dem Weg möchte ich die Daten auswerten und mir gleich eine BMS Funktionalität mit der Überwachung der minimalen und maximalen Zellspannung realisieren um den Strompfad bei Bedarf einfach auftrennen zu können, das reicht für eine USV locker aus. Da die 20Ah Zellen mittlerweile so günstig sind macht das eher Sinn als laufend Blei-Akkus zu wechseln.
Und zum Schluss soll auch noch was mit einem B2S25SRP BMS (also die mit den externen Relais) passieren um für den Lithium Block langsam einen ungefährlicheren Ersatz aus LiFePo4 bereitzustellen, aber alles nach und nach, die Hardware ordentlich aufzubauen braucht halt auch seine Zeit - und die Software dann noch viel länger. Und da ich nicht mehr 30 bin dauert es sowieso viel länger. ;-)
Für die DZ11 habe ich natürlich schon die BLE Funktion ausprobiert, ja das geht, ich hatte hier Erfolg mit dem für die SW11 verwendeten Protokoll aber für die Stabilität nehme ich dann doch lieber die Kabelverbindung. Zudem hatte sich der ESP32 etwas zickig wenn er mit den beiden Balancern zusammen arbeiten sollte, da ist er immer wieder aus dem WLAN raus. Aber wie gesagt, ich bin da erst seit wenigen Tagen dran, bislang hatte ich etwas scheu vor HA aber nun soll es halt mal so sein.

@syssi
Copy link
Owner Author

syssi commented Jan 31, 2025

ESPHome ist nicht auf Home Assistant angewiesen. Neue Nodes compilieren und flashen geht auch über die Kommandozeile / außerhalb von ESPHome und die Messdaten kann man per MQTT oder Web-Interfacs zur Verfügung stellen. So ist ESPHome also nahezu mit allem kompatibel. Die nahtlose und automatische Integration in Home Assistant begeistert trotzdem schnell! ;-)

@syssi syssi force-pushed the add-jk-balancer-support branch 3 times, most recently from 5e3ca02 to 53a9f7e Compare January 31, 2025 14:46
@syssi syssi force-pushed the add-jk-balancer-support branch from f31cd92 to 8e2d0e8 Compare January 31, 2025 17:17
@syssi
Copy link
Owner Author

syssi commented Jan 31, 2025

@miracolix72 Schau mal, ob du deinen Force rebasen magst. Ich habe heute folgendes getan:

  1. Eine neue Komponente eingeführt namens jk_balancer und jk_balancer_modbus
  2. Frame werden nun sauber erkannt und auf ihre Checksumme geprüft
  3. Frames werden an die jeweilige jk_balancer-Instanz wietergereicht, wenn die Device-Adresse (idR 0x01) passt. Man kann nun also mehrere Geräte an den gleichen Bus hängen.

Ich übergebe außerdem das gesamte Frame an den Parser, weil ich mit der Zeit gelernt habe, dass dies das Testing erleichtert, wenn man Rohdaten von fremden Nutzern einspielen möchte. Deshalb wundere dich nicht. Die Preamble und der CRC werden nun auch in den Decoder gereicht.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add JK balancer support
3 participants