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
405 stars 134 forks source link

JK-BMS : Invalid header: 0xFF 0xFF #396

Open doreks opened 7 months ago

doreks commented 7 months ago

Any idea why I am not able to get any data?

here release of bms jk:

photo_2023-11-21_19-11-34

and here error:

INFO ESPHome 2023.11.3
INFO Reading configuration /config/esphome/jk-bms.yaml...
INFO Updating https://github.com/syssi/esphome-jk-bms.git@main
INFO Generating C++ source...
INFO Compiling app...
Processing jk-bms (board: d1_mini_pro; framework: arduino; platform: platformio/espressif8266@3.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.4
RAM:   [=====     ]  50.8% (used 41604 bytes from 81920 bytes)
Flash: [=====     ]  52.7% (used 550689 bytes from 1044464 bytes)
========================= [SUCCESS] Took 3.07 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.33.140
INFO Uploading /data/build/jk-bms/.pioenvs/jk-bms/firmware.bin (554848 bytes)
INFO Compressed to 376339 bytes
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.33.140 using esphome API
INFO Successfully connected to 192.168.33.140 in 31.484s
INFO Successful handshake with 192.168.33.140 in 2.971s
[13:33:36][I][app:102]: ESPHome version 2023.11.3 compiled on Nov 23 2023, 12:33:00
[13:33:36][I][app:104]: Project syssi.esphome-jk-bms version 1.5.0
[13:33:36][C][wifi:559]: WiFi:
[13:33:36][C][wifi:391]:   Local MAC: 34:94:xx:xx:7E:C3
[13:33:36][C][wifi:396]:   SSID: [redacted]
[13:33:36][C][wifi:397]:   IP Address: 192.168.33.140 
[13:33:36][C][wifi:398]:   BSSID: [redacted]
[13:33:36][C][wifi:400]:   Hostname: 'jk-bms'
[13:33:36][C][wifi:402]:   Signal strength: -83 dB ▂▄▆█
[13:33:36][C][wifi:406]:   Channel: 3
[13:33:36][C][wifi:407]:   Subnet: 255.255.255.0
[13:33:36][C][wifi:408]:   Gateway: 192.168.33.141
[13:33:36][C][wifi:409]:   DNS1: 192.168.33.141
[13:33:36][C][wifi:410]:   DNS2: 0.0.0.0
[13:33:36][C][logger:416]: Logger:
[13:33:36][C][logger:417]:   Level: DEBUG
[13:33:36][C][logger:418]:   Log Baud Rate: 0
[13:33:36][C][logger:420]:   Hardware UART: UART0
[13:33:36][C][uart.arduino_esp8266:102]: UART Bus:
[13:33:36][C][uart.arduino_esp8266:103]:   TX Pin: GPIO1
[13:33:36][C][uart.arduino_esp8266:104]:   RX Pin: GPIO3
[13:33:36][C][uart.arduino_esp8266:106]:   RX Buffer Size: 384
[13:33:36][C][uart.arduino_esp8266:108]:   Baud Rate: 115200 baud
[13:33:36][C][uart.arduino_esp8266:109]:   Data Bits: 8
[13:33:36][C][uart.arduino_esp8266:110]:   Parity: NONE
[13:33:36][C][uart.arduino_esp8266:111]:   Stop bits: 1
[13:33:36][C][uart.arduino_esp8266:113]:   Using hardware serial interface.
[13:33:36][C][jk_modbus:113]: JkModbus:
[13:33:36][C][jk_modbus:114]:   RX timeout: 50 ms
[13:33:36][C][jk_bms:593]: JkBms:
[13:33:36][C][jk_bms:594]:   Address: 0x4E
[13:33:36][C][jk_bms:595]:   Fake traffic enabled: NO
[13:33:36][C][jk_bms:596]: Minimum Cell Voltage 'jk-bms min cell voltage'
[13:33:36][C][jk_bms:596]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:596]:   State Class: 'measurement'
[13:33:36][C][jk_bms:596]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:596]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:597]: Maximum Cell Voltage 'jk-bms max cell voltage'
[13:33:36][C][jk_bms:597]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:597]:   State Class: 'measurement'
[13:33:36][C][jk_bms:597]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:597]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:598]: Minimum Voltage Cell 'jk-bms min voltage cell'
[13:33:36][C][jk_bms:598]:   State Class: 'measurement'
[13:33:36][C][jk_bms:598]:   Unit of Measurement: ''
[13:33:36][C][jk_bms:598]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:598]:   Icon: 'mdi:battery-minus-outline'
[13:33:36][C][jk_bms:599]: Maximum Voltage Cell 'jk-bms max voltage cell'
[13:33:36][C][jk_bms:599]:   State Class: 'measurement'
[13:33:36][C][jk_bms:599]:   Unit of Measurement: ''
[13:33:36][C][jk_bms:599]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:599]:   Icon: 'mdi:battery-plus-outline'
[13:33:36][C][jk_bms:600]: Delta Cell Voltage 'jk-bms delta cell voltage'
[13:33:36][C][jk_bms:600]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:600]:   State Class: 'measurement'
[13:33:36][C][jk_bms:600]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:600]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:601]: Average Cell Voltage 'jk-bms average cell voltage'
[13:33:36][C][jk_bms:601]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:601]:   State Class: 'measurement'
[13:33:36][C][jk_bms:601]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:601]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:602]: Cell Voltage 1 'jk-bms cell voltage 1'
[13:33:36][C][jk_bms:602]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:605]:   State Class: 'measurement'
[13:33:36][C][jk_bms:605]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:605]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:606]: Cell Voltage 5 'jk-bms cell voltage 5'
[13:33:36][C][jk_bms:606]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:606]:   State Class: 'measurement'
[13:33:36][C][jk_bms:606]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:606]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:607]: Cell Voltage 6 'jk-bms cell voltage 6'
[13:33:36][C][jk_bms:607]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:607]:   State Class: 'measurement'
[13:33:36][C][jk_bms:607]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:607]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:608]: Cell Voltage 7 'jk-bms cell voltage 7'
[13:33:36][C][jk_bms:608]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:608]:   State Class: 'measurement'
[13:33:36][C][jk_bms:608]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:608]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:609]: Cell Voltage 8 'jk-bms cell voltage 8'
[13:33:36][C][jk_bms:609]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:609]:   State Class: 'measurement'
[13:33:36][C][jk_bms:609]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:609]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:610]: Cell Voltage 9 'jk-bms cell voltage 9'
[13:33:36][C][jk_bms:610]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:610]:   State Class: 'measurement'
[13:33:36][C][jk_bms:610]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:610]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:611]: Cell Voltage 10 'jk-bms cell voltage 10'
[13:33:36][C][jk_bms:611]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:611]:   State Class: 'measurement'
[13:33:36][C][jk_bms:611]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:611]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:612]: Cell Voltage 11 'jk-bms cell voltage 11'
[13:33:36][C][jk_bms:612]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:612]:   State Class: 'measurement'
[13:33:36][C][jk_bms:612]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:612]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:613]: Cell Voltage 12 'jk-bms cell voltage 12'
[13:33:36][C][jk_bms:613]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:613]:   State Class: 'measurement'
[13:33:36][C][jk_bms:613]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:613]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:614]: Cell Voltage 13 'jk-bms cell voltage 13'
[13:33:36][C][jk_bms:614]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:614]:   State Class: 'measurement'
[13:33:36][C][jk_bms:614]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:614]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:615]: Cell Voltage 14 'jk-bms cell voltage 14'
[13:33:36][C][jk_bms:615]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:615]:   State Class: 'measurement'
[13:33:36][C][jk_bms:615]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:615]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:616]: Cell Voltage 15 'jk-bms cell voltage 15'
[13:33:36][C][jk_bms:616]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:616]:   State Class: 'measurement'
[13:33:36][C][jk_bms:616]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:616]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:617]: Cell Voltage 16 'jk-bms cell voltage 16'
[13:33:36][C][jk_bms:617]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:617]:   State Class: 'measurement'
[13:33:36][C][jk_bms:617]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:617]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:618]: Cell Voltage 17 'jk-bms cell voltage 17'
[13:33:36][C][jk_bms:618]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:618]:   State Class: 'measurement'
[13:33:36][C][jk_bms:618]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:618]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:619]: Cell Voltage 18 'jk-bms cell voltage 18'
[13:33:36][C][jk_bms:619]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:619]:   State Class: 'measurement'
[13:33:36][C][jk_bms:622]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:622]:   State Class: 'measurement'
[13:33:36][C][jk_bms:622]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:622]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:623]: Cell Voltage 22 'jk-bms cell voltage 22'
[13:33:36][C][jk_bms:623]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:623]:   State Class: 'measurement'
[13:33:36][C][jk_bms:623]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:623]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:624]: Cell Voltage 23 'jk-bms cell voltage 23'
[13:33:36][C][jk_bms:624]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:624]:   State Class: 'measurement'
[13:33:36][C][jk_bms:624]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:624]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:625]: Cell Voltage 24 'jk-bms cell voltage 24'
[13:33:36][C][jk_bms:625]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:625]:   State Class: 'measurement'
[13:33:36][C][jk_bms:625]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:625]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:626]: Power Tube Temperature 'jk-bms power tube temperature'
[13:33:36][C][jk_bms:626]:   Device Class: 'temperature'
[13:33:36][C][jk_bms:626]:   State Class: 'measurement'
[13:33:36][C][jk_bms:626]:   Unit of Measurement: '°C'
[13:33:36][C][jk_bms:626]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:627]: Temperature Sensor 1 'jk-bms temperature sensor 1'
[13:33:36][C][jk_bms:627]:   Device Class: 'temperature'
[13:33:36][C][jk_bms:627]:   State Class: 'measurement'
[13:33:36][C][jk_bms:627]:   Unit of Measurement: '°C'
[13:33:36][C][jk_bms:627]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:628]: Temperature Sensor 2 'jk-bms temperature sensor 2'
[13:33:36][C][jk_bms:628]:   Device Class: 'temperature'
[13:33:36][C][jk_bms:628]:   State Class: 'measurement'
[13:33:36][C][jk_bms:628]:   Unit of Measurement: '°C'
[13:33:36][C][jk_bms:628]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:635]:   Icon: 'mdi:battery-50'
[13:33:36][C][jk_bms:636]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:637]: Charging Cycles 'jk-bms charging cycles'
[13:33:36][C][jk_bms:637]:   State Class: 'measurement'
[13:33:36][C][jk_bms:637]:   Unit of Measurement: ''
[13:33:36][C][jk_bms:637]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:637]:   Icon: 'mdi:battery-sync'
[13:33:36][C][jk_bms:638]: Total Charging Cycle Capacity 'jk-bms total charging cycle capacity'
[13:33:36][C][jk_bms:638]:   State Class: 'measurement'
[13:33:36][C][jk_bms:638]:   Unit of Measurement: 'Ah'
[13:33:36][C][jk_bms:638]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:638]:   Icon: 'mdi:counter'
[13:33:36][C][jk_bms:639]: Battery Strings 'jk-bms battery strings'
[13:33:36][C][jk_bms:639]:   State Class: 'measurement'
[13:33:36][C][jk_bms:639]:   Unit of Measurement: ''
[13:33:36][C][jk_bms:639]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:639]:   Icon: 'mdi:car-battery'
[13:33:36][C][jk_bms:640]: Errors Bitmask 'jk-bms errors bitmask'
[13:33:36][C][jk_bms:640]:   State Class: 'measurement'
[13:33:36][C][jk_bms:640]:   Unit of Measurement: ''
[13:33:36][C][jk_bms:640]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:640]:   Icon: 'mdi:alert-circle-outline'
[13:33:36][C][jk_bms:641]: Operation Mode Bitmask 'jk-bms operation mode bitmask'
[13:33:36][C][jk_bms:641]:   State Class: 'measurement'
[13:33:36][C][jk_bms:641]:   Unit of Measurement: ''
[13:33:36][C][jk_bms:641]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:641]:   Icon: 'mdi:heart-pulse'
[13:33:36][C][jk_bms:642]: Total Voltage Overvoltage Protection 'jk-bms total voltage overvoltage protection'
[13:33:36][C][jk_bms:642]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:642]:   State Class: 'measurement'
[13:33:36][C][jk_bms:642]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:642]:   Accuracy Decimals: 2
[13:33:36][C][jk_bms:643]: Total Voltage Undervoltage Protection 'jk-bms total voltage undervoltage protection'
[13:33:36][C][jk_bms:643]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:643]:   State Class: 'measurement'
[13:33:36][C][jk_bms:647]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:647]:   State Class: 'measurement'
[13:33:36][C][jk_bms:647]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:647]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:648]: Cell Voltage Undervoltage Recovery 'jk-bms cell voltage undervoltage recovery'
[13:33:36][C][jk_bms:648]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:648]:   State Class: 'measurement'
[13:33:36][C][jk_bms:648]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:648]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:649]: Cell Voltage Undervoltage Delay 'jk-bms cell voltage undervoltage delay'
[13:33:36][C][jk_bms:649]:   State Class: 'measurement'
[13:33:36][C][jk_bms:649]:   Unit of Measurement: 's'
[13:33:36][C][jk_bms:649]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:649]:   Icon: 'mdi:timelapse'
[13:33:36][C][jk_bms:650]: Cell Pressure Difference Protection 'jk-bms cell pressure difference protection'
[13:33:36][C][jk_bms:650]:   Device Class: 'voltage'
[13:33:36][C][jk_bms:650]:   State Class: 'measurement'
[13:33:36][C][jk_bms:650]:   Unit of Measurement: 'V'
[13:33:36][C][jk_bms:650]:   Accuracy Decimals: 3
[13:33:36][C][jk_bms:651]: Discharging Overcurrent Protection 'jk-bms discharging overcurrent protection'
[13:33:36][C][jk_bms:651]:   Device Class: 'current'
[13:33:36][C][jk_bms:651]:   State Class: 'measurement'
[13:33:36][C][jk_bms:651]:   Unit of Measurement: 'A'
[13:33:36][C][jk_bms:651]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:651]:   Icon: 'mdi:current-dc'
[13:33:36][C][jk_bms:652]: Discharging Overcurrent Delay 'jk-bms discharging overcurrent delay'
[13:33:36][C][jk_bms:652]:   State Class: 'measurement'
[13:33:36][C][jk_bms:652]:   Unit of Measurement: 's'
[13:33:36][C][jk_bms:652]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:652]:   Icon: 'mdi:timelapse'
[13:33:36][C][jk_bms:653]: Charging Overcurrent Protection 'jk-bms charging overcurrent protection'
[13:33:36][C][jk_bms:653]:   Device Class: 'current'
[13:33:36][C][jk_bms:659]:   Unit of Measurement: '°C'
[13:33:36][C][jk_bms:659]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:660]: Temperature Sensor Temperature Recovery 'jk-bms temperature sensor temperature recovery'
[13:33:36][C][jk_bms:660]:   Device Class: 'temperature'
[13:33:36][C][jk_bms:660]:   State Class: 'measurement'
[13:33:36][C][jk_bms:660]:   Unit of Measurement: '°C'
[13:33:36][C][jk_bms:660]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:661]: Temperature Sensor Temperature Difference Protection 'jk-bms temperature sensor temperature difference protection'
[13:33:36][C][jk_bms:661]:   Device Class: 'temperature'
[13:33:36][C][jk_bms:661]:   State Class: 'measurement'
[13:33:36][C][jk_bms:661]:   Unit of Measurement: '°C'
[13:33:36][C][jk_bms:661]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:663]: Charging High Temperature Protection 'jk-bms charging high temperature protection'
[13:33:36][C][jk_bms:663]:   Device Class: 'temperature'
[13:33:36][C][jk_bms:663]:   State Class: 'measurement'
[13:33:36][C][jk_bms:663]:   Unit of Measurement: '°C'
[13:33:36][C][jk_bms:663]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:664]: Discharging High Temperature Protection 'jk-bms discharging high temperature protection'
[13:33:36][C][jk_bms:664]:   Device Class: 'temperature'
[13:33:36][C][jk_bms:664]:   State Class: 'measurement'
[13:33:36][C][jk_bms:664]:   Unit of Measurement: '°C'
[13:33:36][C][jk_bms:664]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:665]: Charging Low Temperature Protection 'jk-bms charging low temperature protection'
[13:33:36][C][jk_bms:665]:   Device Class: 'temperature'
[13:33:36][C][jk_bms:665]:   State Class: 'measurement'
[13:33:36][C][jk_bms:665]:   Unit of Measurement: '°C'
[13:33:36][C][jk_bms:665]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:666]: Charging Low Temperature Recovery 'jk-bms charging low temperature recovery'
[13:33:36][C][jk_bms:666]:   Device Class: 'temperature'
[13:33:36][C][jk_bms:666]:   State Class: 'measurement'
[13:33:36][C][jk_bms:666]:   Unit of Measurement: '°C'
[13:33:36][C][jk_bms:666]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:674]:   State Class: 'measurement'
[13:33:36][C][jk_bms:674]:   Unit of Measurement: '%'
[13:33:36][C][jk_bms:674]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:674]:   Icon: 'mdi:volume-high'
[13:33:36][C][jk_bms:675]: Password 'jk-bms password'
[13:33:36][C][jk_bms:675]:   Icon: 'mdi:lock-outline'
[13:33:36][C][jk_bms:676]: Device Type 'jk-bms device type'
[13:33:36][C][jk_bms:677]: Manufacturing Date 'jk-bms manufacturing date'
[13:33:36][C][jk_bms:677]:   State Class: 'measurement'
[13:33:36][C][jk_bms:677]:   Unit of Measurement: ''
[13:33:36][C][jk_bms:677]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:678]: Total Runtime 'jk-bms total runtime'
[13:33:36][C][jk_bms:678]:   State Class: 'total_increasing'
[13:33:36][C][jk_bms:678]:   Unit of Measurement: 'h'
[13:33:36][C][jk_bms:678]:   Accuracy Decimals: 0
[13:33:36][C][jk_bms:678]:   Icon: 'mdi:timelapse'
[13:33:36][C][jk_bms:679]: Software Version 'jk-bms software version'
[13:33:36][C][jk_bms:681]: Manufacturer 'jk-bms manufacturer'
[13:33:36][C][jk_bms:683]: Balancing 'jk-bms balancing'
[13:33:36][C][jk_bms:684]: Balancing Switch 'jk-bms balancing switch'
[13:33:36][C][jk_bms:685]: Charging 'jk-bms charging'
[13:33:36][C][jk_bms:687]: Discharging 'jk-bms discharging'
[13:33:36][C][jk_bms:689]: Dedicated Charger Switch 'jk-bms dedicated charger switch'
[13:33:36][C][jk_bms:690]: Total Runtime Formatted 'jk-bms total runtime formatted'
[13:33:36][C][jk_bms:690]:   Icon: 'mdi:timelapse'
[13:33:36][C][jk_bms.switch:068]: JkBms Switch 'jk-bms charging'
[13:33:36][C][jk_bms.switch:070]:   Icon: 'mdi:battery-charging-50'
[13:33:36][C][jk_bms.switch:090]:   Restore Mode: always OFF
[13:33:36][C][jk_bms.switch:068]: JkBms Switch 'jk-bms discharging'
[13:33:36][C][jk_bms.switch:070]:   Icon: 'mdi:battery-charging-50'
[13:33:36][C][jk_bms.switch:090]:   Restore Mode: always OFF
[13:33:36][C][captive_portal:088]: Captive Portal:
[13:33:36][C][mdns:115]: mDNS:
[13:33:36][C][mdns:116]:   Hostname: jk-bms
[13:33:36][C][ota:097]: Over-The-Air Updates:
[13:33:36][C][ota:098]:   Address: 192.168.1.140:8266
[13:33:36][C][ota:101]:   Using Password.
[13:33:36][C][api:139]: API Server:
[13:33:36][C][api:140]:   Address: 192.168.1.140:6053
[13:33:36][C][api:142]:   Using noise encryption: YES
[13:33:36][D][uart_debug:114]: <<< FF:FF
[13:33:36][D][uart_debug:114]: <<< FF
[13:33:38][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:38][D][api:102]: Accepted 192.168.1.196
[13:33:38][W][component:214]: Component api took a long time for an operation (0.35 s).
[13:33:38][W][component:215]: Components should block for at most 20-30ms.
[13:33:38][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:38][D][uart_debug:114]: <<< FF:FF:FF:FF:FF
[13:33:38][D][uart_debug:114]: <<< FF
[13:33:38][D][uart_debug:114]: <<< FF
[13:33:38][D][uart_debug:114]: <<< FF
[13:33:39][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:39][D][uart_debug:114]: <<< FF:FF
[13:33:39][D][api.connection:1089]: Home Assistant 2023.11.3 (192.168.1.196): Connected successfully
[13:33:39][D][uart_debug:114]: <<< FF
[13:33:40][D][uart_debug:114]: <<< FF
[13:33:40][D][uart_debug:114]: <<< FF
[13:33:40][D][uart_debug:114]: >>> 4E:57:00:13:00:00:00:00:06:02:00:00:00:00:00:00:68:00:00:01:28
[13:33:40][W][jk_modbus:063]: Invalid header: 0x5F 0xFF
[13:33:40][W][jk_modbus:063]: Invalid header: 0xFF 0xF7
[13:33:40][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:40][W][jk_modbus:063]: Invalid header: 0xFF 0xEB
[13:33:40][W][jk_modbus:063]: Invalid header: 0xDD 0xFF
[13:33:40][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:40][W][jk_modbus:063]: Invalid header: 0xEF 0xFF
[13:33:41][D][uart_debug:114]: <<< 5F:FF:FF:F7:FF:FF:FF:EB:DD:FF:FF:FF:EF:FF:FF
[13:33:42][D][uart_debug:114]: <<< FF
[13:33:43][D][uart_debug:114]: <<< FF
[13:33:44][D][uart_debug:114]: <<< FF
[13:33:44][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:44][D][uart_debug:114]: <<< FF:FF:FF
[13:33:44][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:44][D][uart_debug:114]: <<< FF:FF
[13:33:45][D][uart_debug:114]: <<< FF
[13:33:45][D][uart_debug:114]: >>> 4E:57:00:13:00:00:00:00:06:02:00:00:00:00:00:00:68:00:00:01:28
[13:33:45][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:45][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:45][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:45][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:45][W][jk_modbus:063]: Invalid header: 0xFF 0xFF
[13:33:46][D][uart_debug:114]: <<< FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF
[13:33:47][D][uart_debug:114]: <<< FF
[13:33:47][D][uart_debug:114]: <<< FF
[13:33:47][D][uart_debug:114]: <<< FF
[13:33:48][D][uart_debug:114]: <<< FF
doreks commented 7 months ago

HI please big boss @syssi , could you give me some of your words of wisdom? :-)

syssi commented 7 months ago

Could you provide a photo of your wiring? Please make sure GND is connected properly. If all three wires are connected properly to GPIO1, GPIO3 and GND and aren't swapped (RX vs. TX) there are a few options left:

  1. Sometimes GPIO1 and GPIO3 cannot be used because the USB-to-TTL chip of the dev board interferes. Please try GPIO4 + GPIO5 (this is possible because ESPHome uses SoftwareSerial if there is no hardware UART available) instead.
  2. Please try a ESP32. I'm aware of many people without success using an ESP8266 dev board.
doreks commented 7 months ago

thanks @syssi for your words, time and and and support!

finally I could solve the problem by changing the HW to another ESP :-/ I now have a couple of questions, the first one I don't see any switch for balancing, in the photos of the caputaras of this project I see it but I don't observe in the code anything about this. The same thing happens for the value of resistance Ω, I don't see any reference so it doesn't load anything. Is there any way to get this data?

here config esp: https://pastebin.com/BJi1bV8m

Captura1 Captura2

again thank so much for support!

syssi commented 7 months ago

Bluetooth and serial communication are using different protocols. The protocol of the serial communication doesn't provide any details about the resistance and balancing current. You have to use BLE if you need the values.

The balancer switch isn't implemented yet (via serial connection). It's supported by the BLE component only at the moment.

syssi commented 7 months ago

Could you provide some details about your working setup? Which kind of dev board do you use and do you use a hardware UART or a SoftwareSerial connection.

syssi commented 7 months ago

@doreks Friendly reminder.

doreks commented 7 months ago

@doreks Friendly reminder.

So sorry, just give me this weekend I have plenty of family here.. On Monday will be ready..

doreks commented 7 months ago

rovide some details about your working setup? Which k

hi,

Thank you very much for your support. In my case, configuration I have would be:

virus100b commented 5 months ago

I can confirm that using GPIO4 + GPIO5 on ESP 8266 NodeMCU that has USB to TTL chip present on board (has micro usb port) it woks. On D1 Mini the USB to TTL chip is not present on board and probably many people that use code for D1Mini and use Node MCU boards failed to communicate with BMS.

doreks commented 5 months ago

@virus100b how is your setup?

virus100b commented 5 months ago

RX, TX from GPS port JK Bms connected to GPIO5, GPIO 4 of ESP 8266 Node MCU board. External 5V supply for Node MCU. Do not use Vcc on GPS port of JK because tis Vcc is the 16S battery voltage (48-55V)

substitutions: name: jk-bms device_description: "Monitor a JK-BMS via UART-TTL" external_components_source: github://syssi/esphome-jk-bms@main tx_pin: GPIO4 rx_pin: GPIO5

baturinivan commented 2 months ago

I have similar issue. esp32 dev kit was working fine for some months, then communication starts to break down. Change of the esp to new one solved the problem, but after a month of usage comes again. Inverter communication is ok, but bms is not. Changing of the port pins doesn't solve the problem either....

I have reflashed couple of times, seems to be working, so I will monitor it.

baturinivan commented 1 month ago

I have reflashed couple of times, seems to be working, so I will monitor it. Not for a long time. Starts to have invalid header again and then seems to gone completely. Anyone have experienced esp32 malfuntion after some usage with jk bms?