Louisvdw / dbus-serialbattery

Battery Monitor driver for serial battery in VenusOS GX systems
MIT License
541 stars 165 forks source link

JKBMS BLE - Not reporting the right values #811

Closed sstolk90 closed 1 year ago

sstolk90 commented 1 year ago

Describe the bug

I have a Victron GX MP-II 48/5000/70 with two JKBMS'ses 304 Ah so around ~29 kWh. The version of the Venus OS is 2.92 and I'm using the latest dev nighly build of the driver

One of my JKBMS'es reports false number/stats and settings. the BMS shows the right values when connected to the phone app but the driver does not report the correct values.

The only thing that has changed but I do not think what can cause an issue is I installed 4 BLE transmitters and a ESPresence in the same shed where my batteries are.

JK above JK below

How to reproduce

Steps to reproduce the behavior: Rebooting the JKBMS by hand, removing the cables, disconnecting the battery, rebooting the MultiPlus by button or software or disconnecting the battery.

Expected behavior

Getting the correct values

Driver version

1.0.20230919dev

Venus OS device type

Venus_GX

Venus OS version

2.92

BMS type

JKBMS / Heltec BMS

Cell count

16

Connection type

Bluetooth

Config file

[DEFAULT]

; If you want to add custom values/settings, then check the values/settings you want to change in "config.default.ini"
; and insert them below to persist future driver updates.

; Example (remove the semicolon ";" to uncomment and activate the value/setting):
; Jkbms_Ble C8:47:8C:E5:01:1B
MAX_BATTERY_CHARGE_CURRENT = 100.0
MAX_BATTERY_DISCHARGE_CURRENT = 100.0

BLUETOOTH_BMS = Jkbms_Ble C8:47:8C:EC:C0:B5, Jkbms_Ble C8:47:8C:E5:01:1B
BLOCK_ON_DISCONNECT = False
TIME_TO_GO_ENABLE = True

BMS_TYPE = Jkbms

; CUSTOM_BATTERY_NAMES = C8:47:8C:E5:01:1B:Batterij Onder,C8:47:8C:EC:C0:B5:Batterij Boven

; Max voltage can seen as absorption voltage
MAX_CELL_VOLTAGE   = 3.555
FLOAT_CELL_VOLTAGE = 3.535

; Set steps to reduce battery current
; The current will be changed linear between those steps if LINEAR_LIMITATION_ENABLE is set to True
CELL_VOLTAGES_WHILE_CHARGING   = 3.56, 3.50, 3.45, 3.30
MAX_CHARGE_CURRENT_CV_FRACTION =    0, 0.05,  0.5,    1

CCCM_CV_ENABLE = False
DCCM_CV_ENABLE = False

CELL_VOLTAGES_WHILE_DISCHARGING   = 2.70, 2.80, 2.90, 3.10
MAX_DISCHARGE_CURRENT_CV_FRACTION =    0,  0.1,  0.5,    1

; Discharge current soc limits
DC_SOC_LIMIT1 = 5
DC_SOC_LIMIT2 = 20
DC_SOC_LIMIT3 = 30

; Discharge current limits
DC_CURRENT_LIMIT1_FRACTION = 0.1
DC_CURRENT_LIMIT2_FRACTION = 0.3
DC_CURRENT_LIMIT3_FRACTION = 0.5

; !!!!!Added after new version
AUTO_RESET_SOC = True
CCCM_SOC_ENABLE = False
DCCM_SOC_ENABLE = False
; Limitation on SOC when BMS is not working
LINEAR_LIMITATION_ENABLE = False
; !!!Temp restricting charge
CCCM_T_ENABLE = False
DCCM_T_ENABLE = False

Relevant log output

`root@nanopi:~# tail -F -n 50 /var/log/dbus-blebattery.*/current | tai64nlocal
==> /var/log/dbus-blebattery.0/current <==
2023-09-19 11:06:54.503437500
2023-09-19 11:06:56.236364500 INFO:SerialBattery:
2023-09-19 11:06:56.236919500 INFO:SerialBattery:Starting dbus-serialbattery
2023-09-19 11:06:56.238062500 INFO:SerialBattery:dbus-serialbattery v1.0.20230919dev
2023-09-19 11:06:56.642506500 INFO:SerialBattery:Init of Jkbms_Ble at C8:47:8C:EC:C0:B5
2023-09-19 11:06:56.643140500 INFO:SerialBattery:Test of Jkbms_Ble at C8:47:8C:EC:C0:B5
2023-09-19 11:07:01.157689500 INFO:SerialBattery:BAT: JKBMS 11.XW 16 cells (20230504)
2023-09-19 11:07:01.158826500 INFO:SerialBattery:Connection established to Jkbms_Ble
2023-09-19 11:07:01.159381500 INFO:SerialBattery:Battery Jkbms_Ble connected to dbus from c8478cecc0b5
2023-09-19 11:07:01.159815500 INFO:SerialBattery:========== Settings ==========
2023-09-19 11:07:01.160280500 INFO:SerialBattery:> Connection voltage: 0.0V | Current: 0.0A | SoC: 0%
2023-09-19 11:07:01.160661500 INFO:SerialBattery:> Cell count: 16 | Cells populated: 16
2023-09-19 11:07:01.161059500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: False
2023-09-19 11:07:01.161461500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 100.0A | MAX BATTERY DISCHARGE CURRENT: 100.0A
2023-09-19 11:07:01.161832500 INFO:SerialBattery:> CVCM:     True
2023-09-19 11:07:01.162343500 INFO:SerialBattery:> MIN CELL VOLTAGE: 2.9V | MAX CELL VOLTAGE: 3.555V
2023-09-19 11:07:01.162762500 INFO:SerialBattery:> CCCM CV:  False | DCCM CV:  False
2023-09-19 11:07:01.163143500 INFO:SerialBattery:> CCCM T:   False | DCCM T:   False
2023-09-19 11:07:01.163515500 INFO:SerialBattery:> CCCM SOC: False | DCCM SOC: False
2023-09-19 11:07:01.163895500 INFO:SerialBattery:Serial Number/Unique Identifier: 2120146523
2023-09-19 11:07:01.238868500 INFO:SerialBattery:DeviceInstance = 4
2023-09-19 11:07:01.239429500 INFO:SerialBattery:com.victronenergy.battery.c8478cecc0b5
2023-09-19 11:07:01.240158500 INFO:SerialBattery:BAT: JKBMS 11.XW 16 cells (20230504)
2023-09-19 11:07:01.274547500 INFO:SerialBattery:publish config values = 1
2023-09-19 11:07:01.719312500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634
2023-09-19 11:08:01.537445500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634
2023-09-19 11:09:01.446071500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634
2023-09-19 11:10:01.343411500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634
2023-09-19 11:11:01.219060500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634
2023-09-19 11:12:01.137467500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634
2023-09-19 11:13:01.543668500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634
2023-09-19 11:14:01.416879500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634
2023-09-19 11:15:01.316038500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634
2023-09-19 11:16:01.208867500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634
2023-09-19 11:17:01.069069500 ERROR:SerialBattery:Exception occurred: ZeroDivisionError('float division by zero') of type <class 'ZeroDivisionError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #634

==> /var/log/dbus-blebattery.1/current <==
2023-09-19 11:02:05.601796500 INFO:SerialBattery:> CVCM:     True
2023-09-19 11:02:05.602238500 INFO:SerialBattery:> MIN CELL VOLTAGE: 2.9V | MAX CELL VOLTAGE: 3.555V
2023-09-19 11:02:05.602783500 INFO:SerialBattery:> CCCM CV:  False | DCCM CV:  False
2023-09-19 11:02:05.603570500 INFO:SerialBattery:> CCCM T:   False | DCCM T:   False
2023-09-19 11:02:05.605039500 INFO:SerialBattery:> CCCM SOC: True  | DCCM SOC: True
2023-09-19 11:02:05.605481500 INFO:SerialBattery:Serial Number/Unique Identifier: 2052302250
2023-09-19 11:02:05.707573500 INFO:SerialBattery:DeviceInstance = 5
2023-09-19 11:02:05.708805500 INFO:SerialBattery:com.victronenergy.battery.c8478ce5011b
2023-09-19 11:02:05.710332500 INFO:SerialBattery:BAT: JKBMS 10.XW 16 cells (20221223)
2023-09-19 11:02:05.753851500 INFO:SerialBattery:publish config values = 1
2023-09-19 11:05:54.762186500 *** CCGX booted (0) ***
2023-09-19 11:06:49.168224500
2023-09-19 11:06:49.168230500 INFO:Bluetooth details
2023-09-19 11:06:49.311559500 Attempting to disconnect from C8:47:8C:E5:01:1B
2023-09-19 11:06:49.311570500 Successful disconnected
2023-09-19 11:06:54.380620500 Device C8:47:8C:E5:01:1B (public)
2023-09-19 11:06:54.380631500   Alias: Batterij onde
2023-09-19 11:06:54.380633500   Paired: no
2023-09-19 11:06:54.380635500   Trusted: yes
2023-09-19 11:06:54.380636500   Blocked: no
2023-09-19 11:06:54.380637500   Connected: no
2023-09-19 11:06:54.380639500   LegacyPairing: no
2023-09-19 11:06:54.380640500   UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
2023-09-19 11:06:54.380643500   RSSI: -74
2023-09-19 11:06:54.381032500
2023-09-19 11:06:56.225900500 INFO:SerialBattery:
2023-09-19 11:06:56.226666500 INFO:SerialBattery:Starting dbus-serialbattery
2023-09-19 11:06:56.228123500 INFO:SerialBattery:dbus-serialbattery v1.0.20230919dev
2023-09-19 11:06:56.642561500 INFO:SerialBattery:Init of Jkbms_Ble at C8:47:8C:E5:01:1B
2023-09-19 11:06:56.643140500 INFO:SerialBattery:Test of Jkbms_Ble at C8:47:8C:E5:01:1B
2023-09-19 11:07:01.658784500 INFO:SerialBattery:BAT: JKBMS 10.XW 16 cells (20221223)
2023-09-19 11:07:01.660014500 INFO:SerialBattery:Connection established to Jkbms_Ble
2023-09-19 11:07:01.661479500 INFO:SerialBattery:Battery Jkbms_Ble connected to dbus from c8478ce5011b
2023-09-19 11:07:01.664933500 INFO:SerialBattery:========== Settings ==========
2023-09-19 11:07:01.666687500 INFO:SerialBattery:> Connection voltage: 53.19V | Current: 31.0A | SoC: 99%
2023-09-19 11:07:01.668166500 INFO:SerialBattery:> Cell count: 16 | Cells populated: 16
2023-09-19 11:07:01.669912500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: False
2023-09-19 11:07:01.673566500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 100.0A | MAX BATTERY DISCHARGE CURRENT: 100.0A
2023-09-19 11:07:01.677865500 INFO:SerialBattery:> CVCM:     True
2023-09-19 11:07:01.689804500 INFO:SerialBattery:> MIN CELL VOLTAGE: 2.9V | MAX CELL VOLTAGE: 3.555V
2023-09-19 11:07:01.691208500 INFO:SerialBattery:> CCCM CV:  False | DCCM CV:  False
2023-09-19 11:07:01.693125500 INFO:SerialBattery:> CCCM T:   False | DCCM T:   False
2023-09-19 11:07:01.694772500 INFO:SerialBattery:> CCCM SOC: False | DCCM SOC: False
2023-09-19 11:07:01.696421500 INFO:SerialBattery:Serial Number/Unique Identifier: 2052302250
2023-09-19 11:07:02.173584500 INFO:SerialBattery:DeviceInstance = 5
2023-09-19 11:07:02.174578500 INFO:SerialBattery:com.victronenergy.battery.c8478ce5011b
2023-09-19 11:07:02.175711500 INFO:SerialBattery:BAT: JKBMS 10.XW 16 cells (20221223)
2023-09-19 11:07:02.265307500 INFO:SerialBattery:publish config values = 1
2023-09-19 11:11:49.567075500 [CHG] Device C8:47:8C:E5:01:1B RSSI: -74
2023-09-19 11:11:49.567088500 [CHG] Device C8:47:8C:E5:01:1B RSSI: -68
`

Any other information that may be helpful

No response

mr-manuel commented 1 year ago

Sorry I did no fully understand.

  1. Which values exactly are not correctly displayed?
  2. Which value do you see in the app and which in the driver?
sstolk90 commented 1 year ago

2023-09-19 14_15_37-Remote Console on LAN 2023-09-19 14_16_03-Remote Console on LAN

Those are the values in the VRM/ Remote Console where the driver acts on. So when the values are 0 C or soc is 0 the battery is not drained or charged. In the log you can see the same values which are displayed in the log above.

sstolk90 commented 1 year ago

Not quite sure if my BMS is corrupt but I checked my logs and it happend aroun 23:02:31 last night image When I set Grafana 1 second later this is the output: image

The cycles are reporting the voltage in some what way. Everything else like amps, soc and temp go haywire. I did not reboot or changed anything at this time since I was asleep. the victron was set on Grid 0 mode so just maintaining the basic house load.

sstolk90 commented 1 year ago

The values in this Grafana / Influx DB are coming from the MQTT queries against the Victron. So the Victron is "feeding" the database. When I disconnect the Victron BLE towards my BMS which is at fault the app displays the correct information. I already installed the new driver as mentioned above but this does not resolve the problem.

mr-manuel commented 1 year ago

Can you try an older build? https://github.com/mr-manuel/venus-os_dbus-serialbattery/releases/

mr-manuel commented 1 year ago

Please try the nightly of the dev branch from today. There are some fixes included for the correct JKBMS BLE recognition.

lyl-freeman commented 1 year ago

Had the same problem. I can confirm it's fixed on dev

mr-manuel commented 1 year ago

Thanks for the feedback.

sstolk90 commented 1 year ago

Confirmed that it working also! All the values are showing the right things! Thanks for this fix!