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

JBD_BLE 2 batteries with same shared VRM Instance #970

Closed
AlexdeKairos opened this issue Feb 12, 2024 · 6 comments
Closed

JBD_BLE 2 batteries with same shared VRM Instance #970

AlexdeKairos opened this issue Feb 12, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@AlexdeKairos
Copy link

AlexdeKairos commented Feb 12, 2024

Describe the bug

Im testing 1.1.20240211dev and found that my both batteries share the same VRM Instace so only one can be seen in VRM and both must share same name. If any of the battery names are changed on cerbo, both get the same name.

How to reproduce

Just get to BLE KBD batteries and check under "Device" the VRM version. Both batteries share the same instance number.

Expected behavior

Each battery must have a unique VRM instance. ie 2 and 3 (that behaviour was correct up to version 1.0.20231117dev)

Driver version

1.1.20240211dev

Venus OS device type

Cerbo GX

Venus OS version

3.14

BMS type

Smart BMS (LLT, JBD, Overkill Solar)

Cell count

4

Battery count

2

Connection type

Bluetooth

Config file

; --------- Charge Voltage limitation (affecting CVL) ---------
; Description: Limit max charging voltage (MAX_CELL_VOLTAGE * cell count), switch from max voltage to float
;              voltage (FLOAT_CELL_VOLTAGE * cell count) and back
;     False: Max charging voltage is always kept
;     True: Max charging voltage is reduced based on charge mode
;         Step mode: After max voltage is reached for MAX_VOLTAGE_TIME_SEC it switches to float voltage. After
;                    SoC is below SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT it switches back to max voltage.
;         Linear mode: After max voltage is reachend and cell voltage difference is smaller or equal to
;                      CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL it switches to float voltage after 300 (fixed)
;                      additional seconds.
;                      After cell voltage difference is greater or equal to CELL_VOLTAGE_DIFF_TO_RESET_VOLTAGE_LIMIT
;                      OR
;                      SoC is below SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT
;                      it switches back to max voltage.
; Example: The battery reached max voltage of 55.2V and hold it for 900 seconds, the the CVL is switched to
;          float voltage of 53.6V to don't stress the batteries. Allow max voltage of 55.2V again, if SoC is
;          once below 80%
;          OR
;          The battery reached max voltage of 55.2V and the max cell difference is 0.010V, then switch to float
;          voltage of 53.6V after 300 additional seconds to don't stress the batteries. Allow max voltage of
;          55.2V again if max cell difference is above 0.080V or SoC below 80%.
; Charge voltage control management enable (True/False).
CVCM_ENABLE = False


; Charge current control management referring to cell-voltage enable (True/False).
CCCM_CV_ENABLE = False
; Discharge current control management referring to cell-voltage enable (True/False).
DCCM_CV_ENABLE = False

; --------- Temperature limitation (affecting CCL/DCL) ---------
; Description: Maximal charge / discharge current will be in-/decreased depending on temperature
; Example: The temperature limit will be monitored to control the currents. If there are two temperature senors,
;          then the worst case will be calculated and the more secure lower current will be set.
; Charge current control management referring to temperature enable (True/False).
CCCM_T_ENABLE = False
; Charge current control management referring to temperature enable (True/False).
DCCM_T_ENABLE = False

; Set steps to reduce battery current
; Valores exactos obtenidos de CATL. The current will be changed linear between those steps if LINEAR_LIMITATION_ENABLE is set to True
TEMPERATURE_LIMITS_WHILE_CHARGING = 0,   2,     5,    10,    15,20, 35, 40,  55,  60,  65
MAX_CHARGE_CURRENT_T_FRACTION     = 0, 0.116, 0.116, 0.372, 0.5, 1, 1, 0.8, 0,5, 0.279, 0

TEMPERATURE_LIMITS_WHILE_DISCHARGING = -20,   0,   5,  10, 15, 45, 55
MAX_DISCHARGE_CURRENT_T_FRACTION     =   0, 0.2, 0.3, 0.4,  1,  1,  0

; --------- SOC limitation (affecting CCL/DCL) ---------
; Description: Maximal charge / discharge current will be increased / decreased depending on State of Charge,
;              see CC_SOC_LIMIT1 etc.
; Example: The SoC limit will be monitored to control the currents.
; Charge current control management enable (True/False).
CCCM_SOC_ENABLE = False
; Discharge current control management enable (True/False).
DCCM_SOC_ENABLE = False

; Charge current SoC limits
CC_SOC_LIMIT1 = 98
CC_SOC_LIMIT2 = 95
CC_SOC_LIMIT3 = 91

; Charge current limits
CC_CURRENT_LIMIT1_FRACTION = 0.1
CC_CURRENT_LIMIT2_FRACTION = 0.3
CC_CURRENT_LIMIT3_FRACTION = 0.5

; Discharge current SoC limits
DC_SOC_LIMIT1 = 10
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

; --------- Time-To-Go ---------
; Description: Calculates the time to go shown in the GUI
;              Recalculation is done based on TIME_TO_SOC_RECALCULATE_EVERY
TIME_TO_GO_ENABLE = Enable

; --------- Time-To-Soc ---------
; Description: Calculates the time to a specific SoC
; Example: TIME_TO_SOC_POINTS = 50, 25, 15, 0
;          6h 24m remaining until 50% SoC
;          17h 36m remaining until 25% SoC
;          22h 5m remaining until 15% SoC
;          28h 48m remaining until 0% SoC
; Set of SoC percentages to report on dbus and MQTT. The more you specify the more it will impact system performance.
; [Valid values 0-100, comma separated list. More that 20 intervals are not recommended]
; Example: TIME_TO_SOC_POINTS = 100, 95, 90, 85, 75, 50, 25, 20, 10, 0
; Leave empty to disable
TIME_TO_SOC_POINTS = 30, 20, 0
; Specify TimeToSoc value type [Valid values 1, 2, 3]
; 1 Seconds
; 2 Time string <days>d <hours>h <minutes>m <seconds>s
; 3 Both seconds and time string "<seconds> [<days>d <hours>h <minutes>m <seconds>s]"
TIME_TO_SOC_VALUE_TYPE = 2
; Specify in seconds how often the TimeToSoc should be recalculated
; Minimum are 5 seconds to prevent CPU overload
TIME_TO_SOC_RECALCULATE_EVERY = 180
; Include TimeToSoC points when moving away from the SoC point [Valid values True, False]
; These will be as negative time. Disabling this improves performance slightly
TIME_TO_SOC_INC_FROM = False

; Battery temperature
; Specify how the battery temperature is assembled
; 0 Get mean of temperature sensor 1 to sensor 4
; 1 Get only temperature from temperature sensor 1
; 2 Get only temperature from temperature sensor 2
; 3 Get only temperature from temperature sensor 3
; 4 Get only temperature from temperature sensor 4
TEMP_BATTERY = 0

; Temperature sensor 1 name
TEMP_1_NAME = T Celdas

; Select the format of cell data presented on dbus [Valid values 0,1,2,3]
; 0 Do not publish all the cells (only the min/max cell data as used by the default GX)
; 1 Format: /Voltages/Cell (also available for display on Remote Console)
; 2 Format: /Cell/#/Volts
; 3 Both formats 1 and 2
BATTERY_CELL_DATA_FORMAT = 1


; Publish the config settings to the dbus path "/Info/Config/"
PUBLISH_CONFIG_VALUES = True


; --------- BMS specific settings ---------

; -- LltJbd settings
; SoC low levels
; NOTE: SOC_LOW_WARNING is also used to calculate the Time-To-Go even if you are not using a LltJbd BMS
SOC_LOW_WARNING = 25
SOC_LOW_ALARM   = 20

Relevant log output

root@einstein:~# tail -F -n 100 /data/log/dbus-blebattery.*/current | tai64nlocal
==> /data/log/dbus-blebattery.0/current <==
2024-02-12 10:26:21.979357500 INFO:SerialBattery:> CVCM:     False
2024-02-12 10:26:21.979366500 INFO:SerialBattery:> MIN CELL VOLTAGE: 3.0V | MAX CELL VOLTAGE: 3.6V
2024-02-12 10:26:21.979370500 INFO:SerialBattery:> CCCM CV:  False | DCCM CV:  False
2024-02-12 10:26:21.979372500 INFO:SerialBattery:> CCCM T:   False | DCCM T:   False
2024-02-12 10:26:21.979375500 INFO:SerialBattery:> CCCM SOC: False | DCCM SOC: False
2024-02-12 10:26:21.979821500 INFO:SerialBattery:Serial Number/Unique Identifier: 28_460.0Ah
2024-02-12 10:26:24.918760500 INFO:SerialBattery:Found existing battery with DeviceInstance = 1
2024-02-12 10:26:25.223542500 INFO:SerialBattery:DeviceInstance = 1
2024-02-12 10:26:25.224484500 INFO:SerialBattery:Used device instances: ['1']
2024-02-12 10:26:25.225345500 INFO:SerialBattery:com.victronenergy.battery.blea5c23705959e
2024-02-12 10:26:26.882707500 INFO:SerialBattery:publish config values = True
2024-02-12 10:26:28.805030500 ERROR:SerialBattery:Exception occurred: KeyError('/CurrentAvg') of type <class 'KeyError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #973
2024-02-12 10:26:29.159128500 INFO:SerialBattery:Saved AllowMaxVoltage. Before False, after False
2024-02-12 10:27:43.433408500 ERROR:SerialBattery:>>> ERROR: BMS send insufficient data. Received 40 expected 41

==> /data/log/dbus-blebattery.1/current <==
2024-02-12 10:09:19.775887500 Attempting to disconnect from A5:C2:37:05:95:B6
2024-02-12 10:09:19.775897500 [CHG] Device 74:69:60:0E:5F:D2 RSSI is nil
2024-02-12 10:09:19.775900500 [CHG] Device 04:52:C7:B8:5F:6D TxPower is nil
2024-02-12 10:09:19.775903500 [CHG] Device 04:52:C7:B8:5F:6D RSSI is nil
2024-02-12 10:09:19.775906500 [CHG] Device E9:CC:15:95:BA:68 RSSI is nil
2024-02-12 10:09:19.775908500 [CHG] Device A5:C2:37:05:95:B6 RSSI is nil
2024-02-12 10:09:19.775911500 [CHG] Device A5:C2:37:05:95:9E RSSI is nil
2024-02-12 10:09:19.776147500 [CHG] Device FC:97:F8:5D:A2:EC RSSI is nil
2024-02-12 10:09:19.776151500 [CHG] Device 7A:64:A3:3F:AA:AF RSSI is nil
2024-02-12 10:09:19.776154500 [CHG] Controller 08:BF:B8:56:B7:50 Discovering: no
2024-02-12 10:09:19.776157500 Successful disconnected
2024-02-12 10:09:24.898740500 Device A5:C2:37:05:95:B6 (public)
2024-02-12 10:09:24.898750500   Alias: Bateria Serv 2
2024-02-12 10:09:24.898752500   Paired: no
2024-02-12 10:09:24.898753500   Trusted: no
2024-02-12 10:09:24.898755500   Blocked: no
2024-02-12 10:09:24.898756500   Connected: no
2024-02-12 10:09:24.898757500   LegacyPairing: no
2024-02-12 10:09:24.898759500   UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
2024-02-12 10:09:24.898762500   RSSI: -60
2024-02-12 10:09:24.900931500
2024-02-12 10:09:25.994662500 ERROR:SerialBattery:>>> ERROR: Maximum value of CELL_VOLTAGES_WHILE_CHARGING is set to a value lower than MAX_CELL_VOLTAGE. Please check the configuration.
2024-02-12 10:09:26.261122500 INFO:SerialBattery:
2024-02-12 10:09:26.261821500 INFO:SerialBattery:Starting dbus-serialbattery
2024-02-12 10:09:26.263861500 INFO:SerialBattery:Venus OS v3.14
2024-02-12 10:09:26.264494500 INFO:SerialBattery:dbus-serialbattery v1.1.20240211dev
2024-02-12 10:09:26.813430500 INFO:SerialBattery:Init of LltJbd_Ble at A5:C2:37:05:95:B6
2024-02-12 10:09:26.814238500 INFO:SerialBattery:Test of LltJbd_Ble at A5:C2:37:05:95:B6
2024-02-12 10:09:34.189495500 INFO:SerialBattery:Connection established to LltJbd_Ble
2024-02-12 10:09:34.190276500 INFO:SerialBattery:Battery LltJbd_Ble connected to dbus from blea5c2370595b6
2024-02-12 10:09:34.190885500 INFO:SerialBattery:========== Settings ==========
2024-02-12 10:09:34.191606500 INFO:SerialBattery:> Connection voltage: 13.28V | Current: -1.63A | SoC: None%
2024-02-12 10:09:34.192197500 INFO:SerialBattery:> Cell count: 4 | Cells populated: 4
2024-02-12 10:09:34.192779500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: False
2024-02-12 10:09:34.193409500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 150.0A | MAX BATTERY DISCHARGE CURRENT: 150.0A
2024-02-12 10:09:34.194095500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 160.0A | MAX BATTERY DISCHARGE CURRENT: 160.0A (read from BMS)
2024-02-12 10:09:34.194696500 INFO:SerialBattery:> CVCM:     False
2024-02-12 10:09:34.195562500 INFO:SerialBattery:> MIN CELL VOLTAGE: 3.0V | MAX CELL VOLTAGE: 3.6V
2024-02-12 10:09:34.196150500 INFO:SerialBattery:> CCCM CV:  False | DCCM CV:  False
2024-02-12 10:09:34.197144500 INFO:SerialBattery:> CCCM T:   False | DCCM T:   False
2024-02-12 10:09:34.197942500 INFO:SerialBattery:> CCCM SOC: False | DCCM SOC: False
2024-02-12 10:09:34.198871500 INFO:SerialBattery:Serial Number/Unique Identifier: 28_460.0Ah
2024-02-12 10:09:39.697993500 INFO:SerialBattery:Found existing battery with DeviceInstance = 1
2024-02-12 10:09:39.959747500 INFO:SerialBattery:DeviceInstance = 1
2024-02-12 10:09:39.960568500 INFO:SerialBattery:Used device instances: ['1']
2024-02-12 10:09:39.961428500 INFO:SerialBattery:com.victronenergy.battery.blea5c2370595b6
2024-02-12 10:09:41.641660500 INFO:SerialBattery:publish config values = True
2024-02-12 10:09:43.883375500 ERROR:SerialBattery:Exception occurred: KeyError('/CurrentAvg') of type <class 'KeyError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #973
2024-02-12 10:09:44.478121500 INFO:SerialBattery:Saved AllowMaxVoltage. Before False, after False
2024-02-12 10:09:51.365489500 [CHG] Device A5:C2:37:05:95:B6 RSSI: -60
2024-02-12 10:09:51.365498500 [CHG] Device A5:C2:37:05:95:B6 RSSI: -60
2024-02-12 10:12:43.374851500 ERROR:SerialBattery:Exception occurred: KeyError('/CurrentAvg') of type <class 'KeyError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #973
2024-02-12 10:15:43.651986500 ERROR:SerialBattery:Exception occurred: KeyError('/CurrentAvg') of type <class 'KeyError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #973
2024-02-12 10:17:46.509548500 ERROR:SerialBattery:>>> ERROR: BMS send insufficient data. Received 40 expected 41
2024-02-12 10:18:43.817317500 ERROR:SerialBattery:Exception occurred: KeyError('/CurrentAvg') of type <class 'KeyError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #973
2024-02-12 10:21:31.763142500 ERROR:SerialBattery:>>> ERROR: BMS send insufficient data. Received 40 expected 41
2024-02-12 10:21:43.047781500 ERROR:SerialBattery:Exception occurred: KeyError('/CurrentAvg') of type <class 'KeyError'> in /opt/victronenergy/dbus-serialbattery/dbushelper.py line #973
2024-02-12 10:24:03.042772500 *** CCGX booted (0) ***

Any other information that may be helpful

No response

@AlexdeKairos AlexdeKairos added the bug Something isn't working label Feb 12, 2024
mr-manuel added a commit to mr-manuel/venus-os_dbus-serialbattery that referenced this issue Feb 12, 2024
@mr-manuel
Copy link
Collaborator

Please test the latest dev version of my repository.

@AlexdeKairos
Copy link
Author

I can confirm v1.1.20240212dev fixes de issue.
Thanks!

@mr-manuel
Copy link
Collaborator

You're welcome.

@AlexdeKairos
Copy link
Author

Actually, your version is giving me a reallly hard time to connect to the JBD-BLE batteries.After the initial reset all was working fine, but I did an additional reset and is not able to mantain the connection with the batteries.

may connect briefly, but disconnects quickly.

Should I open a new bug report?

@AlexdeKairos
Copy link
Author

2024-02-13 15:04:26.877957500 [CHG] Device A5:C2:37:05:95:9E RSSI is nil
2024-02-13 15:04:26.877959500 [CHG] Device 66:62:EE:FF:AB:AE TxPower is nil
2024-02-13 15:04:26.877962500 [CHG] Device 66:62:EE:FF:AB:AE RSSI is nil
2024-02-13 15:04:26.878086500 [CHG] Device FC:97:F8:5D:A2:EC RSSI is nil
2024-02-13 15:04:26.878090500 [CHG] Device E9:CC:15:95:BA:68 RSSI is nil
2024-02-13 15:04:26.878093500 [CHG] Controller 08:BF:B8:56:B7:50 Discovering: no
2024-02-13 15:04:26.878096500 Successful disconnected
2024-02-13 15:04:32.033506500 Device A5:C2:37:05:95:B6 (public)
2024-02-13 15:04:32.033516500 Alias: Bateria Serv 2
2024-02-13 15:04:32.033519500 Paired: no
2024-02-13 15:04:32.033520500 Trusted: no
2024-02-13 15:04:32.033521500 Blocked: no
2024-02-13 15:04:32.033523500 Connected: no
2024-02-13 15:04:32.033524500 LegacyPairing: no
2024-02-13 15:04:32.033525500 UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
2024-02-13 15:04:32.033528500 RSSI: -60
2024-02-13 15:04:32.034522500
2024-02-13 15:04:33.410003500 INFO:SerialBattery:
2024-02-13 15:04:33.411058500 INFO:SerialBattery:Starting dbus-serialbattery
2024-02-13 15:04:33.413115500 INFO:SerialBattery:Venus OS v3.14
2024-02-13 15:04:33.413765500 INFO:SerialBattery:dbus-serialbattery v1.1.20240212dev
2024-02-13 15:04:33.923307500 INFO:SerialBattery:Init of LltJbd_Ble at A5:C2:37:05:95:B6
2024-02-13 15:04:33.924182500 INFO:SerialBattery:Test of LltJbd_Ble at A5:C2:37:05:95:B6
2024-02-13 15:04:38.935206500 ERROR:SerialBattery:>>> ERROR: Unable to connect with BLE device
2024-02-13 15:04:38.938399500 ERROR:SerialBattery:No BMS found at A5:C2:37:05:95:B6
2024-02-13 15:04:38.939093500 ERROR:SerialBattery:ERROR >>> No battery connection at LltJbd_Ble
2024-02-13 15:04:39.993888500 [CHG] Device A5:C2:37:05:95:B6 RSSI: -64
2024-02-13 15:04:39.993899500 [CHG] Device A5:C2:37:05:95:B6 RSSI: -60
2024-02-13 15:04:45.628097500 INFO:SerialBattery:BLE client disconnected
2024-02-13 15:04:45.966756500
2024-02-13 15:04:45.967154500 INFO:Bluetooth details
2024-02-13 15:04:46.191036500 Attempting to disconnect from A5:C2:37:05:95:B6
2024-02-13 15:04:46.191046500 [CHG] Device 5C:49:7D:77:F8:23 RSSI is nil
2024-02-13 15:04:46.191049500 [DEL] Device 5C:49:7D:77:F8:23 5C-49-7D-77-F8-23
2024-02-13 15:04:46.191052500 [CHG] Device A5:C2:37:05:95:9E RSSI is nil
2024-02-13 15:04:46.191055500 [CHG] Device 5A:72:A0:F5:72:92 RSSI is nil
2024-02-13 15:04:46.191057500 [CHG] Device 4A:D5:08:87:60:83 TxPower is nil
2024-02-13 15:04:46.191060500 [CHG] Device 4A:D5:08:87:60:83 RSSI is nil
2024-02-13 15:04:46.191178500 [CHG] Device 04:52:C7:B8:5F:6D TxPower is nil
2024-02-13 15:04:46.191182500 [CHG] Device 04:52:C7:B8:5F:6D RSSI is nil
2024-02-13 15:04:46.191185500 [CHG] Device FC:97:F8:5D:A2:EC RSSI is nil
2024-02-13 15:04:46.191188500 [CHG] Device 74:0A:67:AC:47:40 RSSI is nil
2024-02-13 15:04:46.191191500 [CHG] Device A5:C2:37:05:95:B6 RSSI is nil
2024-02-13 15:04:46.191193500 [CHG] Device 76:C9:2B:87:C5:26 TxPower is nil
2024-02-13 15:04:46.191220500 [CHG] Device 76:C9:2B:87:C5:26 RSSI is nil
2024-02-13 15:04:46.191223500 [CHG] Device E9:CC:15:95:BA:68 RSSI is nil
2024-02-13 15:04:46.191226500 [CHG] Controller 08:BF:B8:56:B7:50 Discovering: no
2024-02-13 15:04:46.191229500 Successful disconnected
2024-02-13 15:04:51.321739500 Device A5:C2:37:05:95:B6 (public)
2024-02-13 15:04:51.321748500 Alias: Bateria Serv 2
2024-02-13 15:04:51.321750500 Paired: no
2024-02-13 15:04:51.321751500 Trusted: no
2024-02-13 15:04:51.321753500 Blocked: no
2024-02-13 15:04:51.321754500 Connected: no
2024-02-13 15:04:51.321755500 LegacyPairing: no
2024-02-13 15:04:51.321757500 UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
2024-02-13 15:04:51.321760500 RSSI: -64
2024-02-13 15:04:51.323920500
2024-02-13 15:04:52.865894500 [CHG] Device A5:C2:37:05:95:B6 RSSI: -64
2024-02-13 15:04:52.874160500 INFO:SerialBattery:
2024-02-13 15:04:52.875254500 INFO:SerialBattery:Starting dbus-serialbattery
2024-02-13 15:04:52.879972500 INFO:SerialBattery:Venus OS v3.14
2024-02-13 15:04:52.881121500 INFO:SerialBattery:dbus-serialbattery v1.1.20240212dev
2024-02-13 15:04:53.476428500 INFO:SerialBattery:Init of LltJbd_Ble at A5:C2:37:05:95:B6
2024-02-13 15:04:53.477336500 INFO:SerialBattery:Test of LltJbd_Ble at A5:C2:37:05:95:B6
2024-02-13 15:04:58.491714500 ERROR:SerialBattery:>>> ERROR: Unable to connect with BLE device
2024-02-13 15:04:58.496369500 ERROR:SerialBattery:No BMS found at A5:C2:37:05:95:B6
2024-02-13 15:04:58.497444500 ERROR:SerialBattery:ERROR >>> No battery connection at LltJbd_Ble
2024-02-13 15:05:00.183950500 ERROR:SerialBattery:BleakClient(): Exception occurred: BleakDBusError('org.bluez.Error.Failed', 'Software caused connection abort') of type <class 'bleak.exc.BleakDBusError'> in /opt/victronenergy/dbus-serialbattery/bms/lltjbd_ble.py line #100
2024-02-13 15:05:00.574527500
2024-02-13 15:05:00.575003500 INFO:Bluetooth details
2024-02-13 15:05:00.767249500 Attempting to disconnect from A5:C2:37:05:95:B6
2024-02-13 15:05:00.767259500 [CHG] Device 04:52:C7:B8:5F:6D TxPower is nil
2024-02-13 15:05:00.767262500 [CHG] Device 04:52:C7:B8:5F:6D RSSI is nil
2024-02-13 15:05:00.767265500 [CHG] Device A5:C2:37:05:95:9E RSSI is nil
2024-02-13 15:05:00.767268500 [CHG] Device A5:C2:37:05:95:B6 RSSI is nil
2024-02-13 15:05:00.767271500 [CHG] Device FC:97:F8:5D:A2:EC RSSI is nil
2024-02-13 15:05:00.767274500 [CHG] Device E9:CC:15:95:BA:68 RSSI is nil
2024-02-13 15:05:00.767388500 [CHG] Controller 08:BF:B8:56:B7:50 Discovering: no
2024-02-13 15:05:00.767391500 Successful disconnected
2024-02-13 15:05:05.886244500 Device A5:C2:37:05:95:B6 (public)
2024-02-13 15:05:05.886253500 Alias: Bateria Serv 2
2024-02-13 15:05:05.886255500 Paired: no
2024-02-13 15:05:05.886256500 Trusted: no
2024-02-13 15:05:05.886257500 Blocked: no
2024-02-13 15:05:05.886259500 Connected: no
2024-02-13 15:05:05.886260500 LegacyPairing: no
2024-02-13 15:05:05.886262500 UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
2024-02-13 15:05:05.886265500 RSSI: -60
2024-02-13 15:05:05.888171500
2024-02-13 15:05:07.219088500 INFO:SerialBattery:
2024-02-13 15:05:07.220433500 INFO:SerialBattery:Starting dbus-serialbattery
2024-02-13 15:05:07.224392500 INFO:SerialBattery:Venus OS v3.14
2024-02-13 15:05:07.225713500 INFO:SerialBattery:dbus-serialbattery v1.1.20240212dev
2024-02-13 15:05:07.758246500 INFO:SerialBattery:Init of LltJbd_Ble at A5:C2:37:05:95:B6
2024-02-13 15:05:07.759060500 INFO:SerialBattery:Test of LltJbd_Ble at A5:C2:37:05:95:B6
2024-02-13 15:05:10.649833500 [CHG] Device A5:C2:37:05:95:B6 RSSI: -60
2024-02-13 15:05:12.773650500 ERROR:SerialBattery:>>> ERROR: Unable to connect with BLE device
2024-02-13 15:05:12.777306500 ERROR:SerialBattery:No BMS found at A5:C2:37:05:95:B6
2024-02-13 15:05:12.778098500 ERROR:SerialBattery:ERROR >>> No battery connection at LltJbd_Ble
2024-02-13 15:05:19.214927500 ERROR:SerialBattery:BleakClient(): Exception occurred: BleakDBusError('org.bluez.Error.Failed', 'Software caused connection abort') of type <class 'bleak.exc.BleakDBusError'> in /opt/victronenergy/dbus-serialbattery/bms/lltjbd_ble.py line #100
2024-02-13 15:05:19.550962500
2024-02-13 15:05:19.551982500 INFO:Bluetooth details
2024-02-13 15:05:19.685757500 Attempting to disconnect from A5:C2:37:05:95:B6
2024-02-13 15:05:19.685766500 [CHG] Device FC:97:F8:5D:A2:EC RSSI is nil
2024-02-13 15:05:19.685770500 [CHG] Device A5:C2:37:05:95:B6 RSSI is nil
2024-02-13 15:05:19.685773500 [CHG] Device E9:CC:15:95:BA:68 RSSI is nil
2024-02-13 15:05:19.685775500 [CHG] Device A5:C2:37:05:95:9E RSSI is nil
2024-02-13 15:05:19.685778500 [CHG] Controller 08:BF:B8:56:B7:50 Discovering: no
2024-02-13 15:05:19.685781500 Successful disconnected

@mr-manuel
Copy link
Collaborator

Reference #973

Louisvdw pushed a commit that referenced this issue Feb 28, 2024
* fix Sinowealth not loading
#702

* fix unique identifier function

* enable BMS over config, if disabled by default
Now you can also add more then one BMS for BMS_TYPE

* show battery port in log

* ANT BMS fixes
Fixed that other devices are recognized as ANT BMS

* Sinowealth BMS fixes
Fixed that other devices are recognized as Sinowealth BMS

* improved publish_battery error handling
switched from error count to seconds

* Improve Battery Voltage Handling in Linear Absorption Mode

* Refactor change time() to int(time()) for consistency in max_voltage_start_time and tDiff calculation
* Refactor battery voltage calculations for efficiency and clarity
* Remove penalty_buffer
* Reset max_voltage_start_time wenn we going to bulk(dynamic) mode

* updated changelog

* fix reply processing

* Reduce the big inrush current, if the CVL jumps
from Bulk/Absorbtion to Float
fix #659

* Check returned data lenght for Seplos BMS

Be stricter about the return data we accept, might fix the problem of grid meters accidently being recognized as a Seplos

* Validate current, voltage, capacity and SoC for all BMS
This prevents that a device, which is no BMS, is detected as BMS

* removed double check

* bump version

* fix validation if None

* updated changelog

* proposal to #659 formatted :)

* bugfix proposal to #659

* refactor setting float charge_mode

* fix type error, removed bluetooth cronjob

* updated changelog

* fix rs485 write communication errors by inserting sleeps, add debug print for charge mode and fix crash on write soc failures

* fix write problem on set_soc. also changed the switch charge/discharge function, just in case

* debug msg

* Bluetooth optimizations

* Fixes by @peterohman
#505 (comment)

* fix #712

* fix meaningless time to go values

* fix meaningless time to go values

* Duration of transition to float depends on number of cells

* Float transition - Voltage drop per second

* Update hlpdatabms4s.py

* Validate setting of FLOAT_CELL_VOLTAGE and avoid misconfiguration

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* cleanup

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* small refactor, introduced set_cvl_linear function to set CVL only once every LINEAR_RECALCULATION_EVERY seconds

* fix typo

* updated changelog

* remove debug msg

* remove debug msg

* undo debug change

* Daly BMS make auto reset soc configurable

* added debug and error information for CVL

* fix proposal for #733 (#735)

* Added: Tollerance to enter float voltage once the timer is triggered

* Add bulk voltage
Load to bulk voltage every x days to reset the SoC to 100% for some BMS

* JKBMS disable high voltage warning on bulk
reenable after bulk was completed

* fixed error

* disable high voltage warning for all BMS
when charging to bulk voltage

* fix error and change default value
measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept

* Added temperature names to dbus/mqtt

* Use current avg of last 300 cycles for TTG & TTS

* Calculate only positive Time-to-SoC points

* added current average of last 5 minutes

* make CCL and DCL more clear

* fix small error

* bugfix: LLTJBD BMS SOC different in Xiaoxiang app and dbus-serialbattery

* black formatting

* JDB BMS - Control FETs for charge, discharge and disable / enable balancer (#761)

* feature: Allow to control charge / discharge FET
* feature: Allow to enable / disable balancer

* bugfix: Cycle Capacity is in 10 mAh

Fixes SoC with factor 100 * 100% percentage

* JBD BMS show balancer state in GUI page IO (#763)

* Bump version

* Fix typos

* Smaller fixes
- fixes #792 (comment)

* Removed comments from utils.py
This should make more clear that there are no values to change

* Updated changelog

* possible fix for LLT/JBS connection problems
#769
#777

* bugfix: LLT/JBD BMS general packet data size check

* improved reinstall and disable script

* LLT/JBD BMS - Improved error handling and automatical driver restart
in case of error. Should fix:
- #730
- #769
- #777

* Fixed Building wheel for dbus-fast won't finish on weak systems
Fixes #785

* Support for Daly CAN Bus (#169)

* support for Daly CAN Bus
* fix constructor args
* revert port, needs fix
* add can filters
* comment logger

Some changes are still needed to work with the latest version. They will follow in a next PR.

---------

Co-authored-by: Samuel Brucksch <samuel@iternio.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>

* JKBMS BLE - Introduction of automatic SOC reset (HW Version 11) (#736)

* Introduction of automatic SOC reset for JK BMS (HW Version 11)
* Fixed value mapping
* Rework of the code to make it simpler to use without additional configuration.
Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition".
* Implementation of suggested changes
Persist initial BMS OVP and OVPR settings
Make use of max_cell_voltage to calculate trigger value for OVP alert

* Added: Daly CAN and JKBMS CAN

* added CAN bms to installation script
optimized CAN drivers

* smaller fixes

* Trigger JK BLE SOC reset when using Step Mode

* Moved trigger_soc_reset()

* fixes LLT/JBD SOC > 100%
#769

* changed VOLTAGE_DROP behaviour

* Fix JKBMS not starting if BMS manuf. date is empty

* corrected bulk, absorption and soc reset terms

* fix typo

* add JKBMS_BLE debugging data

* fix small error

* Some changes for lost bluetooth connection / hci_uart stack restart

* added logging to config

* add sleep before starting driver
prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before

* changed post install info

* fix error

* Daly BMS fixed embedded null byte
#837

* added info for SoC reset to default config file

* fix for #716
#716

* fix for #716 and JKBMS model recognition
#716

* optimized logging

* fix JKBMS recognition

* added debugging

* fixes #716
#716

* Bind device instance to unique_identifier
#718

* added data types to battery class
disabled unused variables

* save current charge state
#840

* correct file permissions

* updated changelog

* added periodic saveChargeDetails

* fix some small errors

* fix issue with ruuvi tags
When there are hundreds of unused ruuvi tags in the settings list that where added because thei where nearby the driver does not start correctly. These stale entries are disabled on the driver startup.
The issue was already filed to Victron developers

* CVL with i-controller instead of penaltysum

* cvl_controller: switch to choose PenaltySum or ICOntroller + documentation

* docu enhancement

* Add setting and install logic for usb bluetooth module

* round temperatures

* changed battery disconnect behaviour

* Fixes #891
#891

* updated changelog

* Add bluetooth device note to config.default.ini

* Fix typo in bluetooth note in config.default.ini

* fixed error in new cvl_controller

* fixed float division by zero and code optimization

* Restart MAX_VOLTAGE_TIME_SEC if cell diff > CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART

* Calculation of the SOC based on coloumb-counting (#868)

* Calculation of the SOC in the driver based on coloumb-counting

* soc_calc: add current correction before integration

* soc_calc: correction map for current

* Soc_calc: CorrectionMap, switch to turn on/off correction, selectable initial value

* soc_calc: Bugfix

* soc_calc: Bugfix

* store soc in dbus for restart

* store soc in dbus for restart (formatted)

* store soc in dbus for restart (bugfix)

* save soc_calc only after change > 1.0

* store soc in dbus for restart (bugfix)

* logger does not work this way. do not know why

* writing and reading to dbus works

* Removed options: SOC_CALC_CURRENT_CORRECTION, SOC_CALC_RESET_VALUE_ON_RESTART, SOC_CALC_INIT_VALUE
sort soc_calc alphabetically

* fixed comments

* Updated changelog, small fixes

* Changed: PUBLISH_CONFIG_VALUES from 0/1 to True/False

* Changed: Code optimizations
- Changed some variables to be more clear
- Added comments for easier code understanding

* Calculated SOC: Added two decimals, added BMS SOC for MQTT & Node-RED

* Updated changelog, small fixes

* Changed: PUBLISH_CONFIG_VALUES from 0/1 to True/False

* Changed: Code optimizations
- Changed some variables to be more clear
- Added comments for easier code understanding

* Calculated SOC: Added two decimals, added BMS SOC for MQTT & Node-RED

* Fix #898
#898

* Changed: Fix issue loading settings from dbus

* Added nightly install option
makes it easier for users to pretest fixes

* Changed: more detailed error output when an exception happens

* Possible fix for #912
#912

* Fixes #919
#919

* Changed: Exit script with error, if port excluded
else the serialstarter stops at the dbus-serialbattery

* Fixed some smaller errors

* Updated pre-release workflow

* Fix JK BMS connection restart when bluetooth fails.

This fix installs a new thread to monitor the state of the original
scraping thread.
If scraping thread dies, it verifies that it did not because the
scraping was intentionally stopped by calling stop_scrapping.
When restarting the scrapper, it first calls the bluetooth
reset lambda function that was passed in the class contructor, such that
bluetooth is ready to make a proper connection.

* Fixes #916
#916

* Added Venus OS version to logfile

* Fix #840
#840

* Small code formatting fixes

* Optimized reinstall script. Restart GUI only on changes.

* Display debugging data in GUI when DEBUG enabled

* Install script now shows repositories and version numbers

* Update daly_can.py

Fixing #950 for DalyBMS

* Update jkbms_can.py

Fixing #950 for Jk BMS

* Fix black lint check

* Fixes #970
#970

* Fixed some errors in restoring values from dbus settings

* Moved sleep on start for all BMS

* Update config description

* Reworked a part of the default config

* fix typo in stopping services when reinstalling

* Fix Time-to-SoC and Time-to-Go calculation

* Add changelog info

* Round sum and diff voltage

* Temperature limitation variables where changed

* SoC limitation variables where changed

* Added error messages

* Remove unneeded code

* Reset SoC to 0% if empty

* Add GUIv2 for dbus-serialbattery

* Check free space before installing

* Added new GUIv2 version

* Removed Python 2 compatibility

* Changelog update

* Code cleanup
- Removed: get_temperatures()
- Removed: update_last_seen()

* Bluetooth code optimizations

* Fixed some JKBMS BLE not starting
#819

* Check if packages are already installed before install

* Fixed some SOC calculation errors

* Fixed None SOC on driver start

* Do not show and allow button change when callback is missing for:
- ForceChargingOff
- ForceDischargingOff
- TurnBalancingOff

* Check if a device instance is already used by creating a PID file

* Log and execute SOC reset to 100% or 0% only once

* Update GitHub workflow and issue templates

* Fixed LLT/JBD BMS with only on temperature sensor #791
#971

* Fix warning on reinstall

* Fix missing IO control for JBDBMS #992
#992

* Prepare for removing dev branch

---------

Co-authored-by: ogurevich <50322596+ogurevich@users.noreply.github.com>
Co-authored-by: Bernd Stahlbock <6627385+transistorgit@users.noreply.github.com>
Co-authored-by: wollew <wollew@users.noreply.github.com>
Co-authored-by: Oleg Gurevich <oleg@gurevich.de>
Co-authored-by: peterohman <psub@fieber.se>
Co-authored-by: Strawder, Paul <paul@coach-ai.com>
Co-authored-by: Paul Strawder <paulidstein@gmail.com>
Co-authored-by: Samuel Brucksch <SamuelBrucksch@users.noreply.github.com>
Co-authored-by: Samuel Brucksch <samuel@iternio.com>
Co-authored-by: ArendsM <136503378+ArendsM@users.noreply.github.com>
Co-authored-by: Meik Arends <github@arends.info>
Co-authored-by: Marvo2011 <Marvin.Edeler@gmail.com>
Co-authored-by: cflenker <christian.flenker@gmx.de>
Co-authored-by: cflenker <125555670+cflenker@users.noreply.github.com>
Co-authored-by: Cupertino Miranda <cupertinomiranda@gmail.com>
Co-authored-by: Martin Polehla <p0l0us@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants