Louisvdw / dbus-serialbattery

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

#8 internal calculation error -> battery.py line #710 #1110

Closed Approved-OK closed 2 weeks ago

Approved-OK commented 4 weeks ago

Describe the problem

Hallo, using 2 DIY Batteries in Parallel , connected via rs485 (tty0 and tty1) to victron cerbo. Battery Agreggator

image

System is working fine for a few days, but sometimes it brakes. tail command shows error in battery.py line 573 which refers to battery-temperature. Battery temp is about 26degrees first battery (tty0) works fine at this time.

restarting the driver resolves for some time ( sometime days, sometime only a few ours )

image

image

Driver version

v1.3.20240705

Venus OS device type

Cerbo GX

Venus OS version

v3.41

BMS type

Daly Smart BMS

Cell count

16

Battery count

2

Connection type

Serial USB adapter to RS485

Config file

[DEFAULT]

;After Change in Putty:
;bash /data/etc/dbus-serialbattery/reinstall-local.sh
;bash /data/etc/dbus-serialbattery/restart-driver.sh

; tail -F -n 100 /data/log/dbus-serialbattery.ttyUSB0/current | tai64nlocal
; tail -F -n 100 /data/log/dbus-serialbattery.ttyUSB1/current | tai64nlocal

;https://github.com/mr-manuel/venus-os_dbus-serialbattery/tree/dev/gui-v2
;https://github.com/mr-manuel/venus-os_dbus-serialbattery/releases

; --------- Set logging level ---------
; ERROR: Only errors are logged
; WARNING: Errors and warnings are logged
; INFO: Errors, warnings and info messages are logged
; DEBUG: Errors, warnings, info and debug messages are logged
LOGGING = INFO

; --------- Battery Current limits ---------
MAX_BATTERY_CHARGE_CURRENT    = 40.0
MAX_BATTERY_DISCHARGE_CURRENT = 40.0

; --------- Cell Voltages ---------
; Description: Cell min/max voltages which are used to calculate the min/max battery voltage
; Example: 16 cells * 3.45V/cell = 55.2V max charge voltage. 16 cells * 2.90V = 46.4V min discharge voltage
;vorher 3.00
MIN_CELL_VOLTAGE   = 2.950
;47,2V
; Max voltage can seen as absorption voltage
MAX_CELL_VOLTAGE   = 3.45
;3,45 alt
; Float voltage (can be seen as resting voltage)
FLOAT_CELL_VOLTAGE = 3.39
; MAX 55,4
;Float 54,7

; --------- SOC reset voltage (needs to match BMS settings) ---------
; +++ This has nothing to do with "SOC calculation" in a section below +++
; This is one of the possibilities to reset the SoC to 100%, because of SoC drift.
; Description:
;     May be needed to reset the SoC to 100% once in a while for some BMS, because of SoC drift.
;     Some BMS may needed to reset the SoC to 100% once in a while, because of SoC drift. Some
;     devices, like JKBMS, will reset their internal SOC value, if they reach the upper voltage level.
;     Using this method, the charging voltage can be raised regularly to achieve that.
;     (other BMS like Daly need an active overwriting of the SOC parameter. This happens each time when
;     the charging mode changes from Bulk/Absorption to float (and the cells are equalised). They do
;     not need this feature here.)
;     Specify the cell voltage where the SoC should be reset to 100% by the BMS.
;       - JKBMS: SoC is reset to 100% if one cell reaches OVP (over voltage protection) voltage
;     As you have to adopt this value to your system, I recommend to start with
;     OVP voltage - 0.030 (see Example).
;       - Try to increase (add) by 0.005 in steps, if the system does not switch to float mode, even if
;         the target voltage SOC_RESET_VOLTAGE * CELL_COUNT is reached.
;       - Try to decrease (lower) by 0.005 in steps, if the system hits the OVP too fast, before all
;         cells could be balanced and the system goes into protection mode multiple times.
; Example:
;     If OVP is 3.650, then start with 3.620 and increase/decrease by 0.005
; Note:
;     The value has to be higher as the MAX_CELL_VOLTAGE
;     You also have to set CELL_VOLTAGES_WHILE_CHARGING accordingly, if you set CCCM_CV_ENABLE to true
;         else the charging current will be reduced to 0 before the target voltage is reached and the
;         battery will never switch to float
; Original SOC_RESET_VOLTAGE  = 3.650; alt 3.55
SOC_RESET_VOLTAGE  = 3.55
; Specify after how many days the soc reset voltage should be reached again
; The timer is reset when the soc reset voltage is reached
; Leave empty if you don't want to use this
; Example: Value is set to 15
; day 1: soc reset reached once
; day 16: soc reset reached twice
; day 31: soc reset not reached since it's very cloudy
; day 34: soc reset reached since the sun came out
; day 49: soc reset reached again, since last time it took 3 days to reach soc reset voltage
SOC_RESET_AFTER_DAYS = 4

; --------- BMS disconnect behaviour ---------
; Description: Block charge and discharge when the communication to the BMS is lost. If you are removing the
;              BMS on purpose, then you have to restart the driver/system to reset the block.
; False: Charge and discharge is not blocked on BMS communication loss
; True: Charge and discharge is blocked on BMS communication loss, it's unblocked when connection is established
;       again or the driver/system is restarted
BLOCK_ON_DISCONNECT = False

; --------- Charge mode ---------
; Choose the mode for voltage / current limitations (True / False)
; False is a step mode: This is the default with limitations on hard boundary steps
; True is a linear mode:
;     For CCL and DCL the values between the steps are calculated for smoother values (by WaldemarFech)
;     For CVL max battery voltage is calculated dynamically in order that the max cell voltage is not exceeded
LINEAR_LIMITATION_ENABLE = True

; Specify in seconds how often the linear values should be recalculated
LINEAR_RECALCULATION_EVERY = 60
; Specify in percent when the linear values should be recalculated immediately
; Example: 5 for a immediate change, when the value changes by more than 5%
LINEAR_RECALCULATION_ON_PERC_CHANGE = 10

; --------- 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 90%
;          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 90%.
; Charge voltage control management enable (True/False).
CVCM_ENABLE = True

; -- CVL reset based on cell voltage diff (linear mode)
; Specify cell voltage diff where CVL limit is kept until diff is equal or lower
;CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL = 0.010
CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL = 0.100
; Specify cell voltage diff where MAX_VOLTAGE_TIME_SEC restarts if diff is bigger
;CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART = 0.013
CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART = 0.130

; Specify cell voltage diff where CVL limit is reset to max voltage, if value get above
; the cells are considered as imbalanced, if the cell diff exceeds 5% of the nominal cell voltage
; e.g. 3.2 V * 5 / 100 = 0.160 V
CELL_VOLTAGE_DIFF_TO_RESET_VOLTAGE_LIMIT = 0.160

; -- CVL reset based on SoC option (step mode & linear mode)
; Specify how long the max voltage should be kept
;     Step mode: If reached then switch to float voltage
;     Linear mode: If cells are balanced keep max voltage for further MAX_VOLTAGE_TIME_SEC seconds
MAX_VOLTAGE_TIME_SEC = 900
; Specify SoC where CVL limit is reset to max voltage
;     Step mode: If SoC gets below
;     Linear mode: If cells are unbalanced or if SoC gets below
SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT = 95

; --------- SOC calculation ---------
; Description:
;     Calculate the SOC in the driver. Do not use the SOC reported by the BMS
; SOC_CALCULATION:
;     True: Calc SOC in the driver, do not use SOC reported from BMS
;         - The SOC is calculated by integration of the current reported by the BMS
;         - The current reported from the BMS can be corrected by
;           the map (SOC_CALC_CURRENT_REPORTED_BY_BMS, SOC_CALC_CURRENT_MEASURED_BY_USER)
;         - The SOC is set to 100% if the following conditions apply for at least SOC_RESET_TIME seconds:
;             * Current is lower than SOC_RESET_CURRENT amps
;             * Sum of cell voltages >= self.max_battery_voltage - VOLTAGE_DROP
;         - The calculated SOC is stored in dbus to persist a driver restart
;     False: Use SOC reported from BMS (none of the other parameters apply)
; More info: https://github.com/Louisvdw/dbus-serialbattery/pull/868
SOC_CALCULATION   = False
SOC_RESET_CURRENT = 7
SOC_RESET_TIME    = 120
SOC_CALC_CURRENT_REPORTED_BY_BMS  = -300, -0.5, 0.5, 300
SOC_CALC_CURRENT_MEASURED_BY_USER = -300,    0,   0, 300
; Example to set small currents to zero
;     SOC_CALC_CURRENT_REPORTED_BY_BMS  = -300, -0.5, 0.5, 300
;     SOC_CALC_CURRENT_MEASURED_BY_USER = -300,    0,   0, 300

; --------- Cell Voltage Current limitation (affecting CCL/DCL) ---------
; Description: Maximal charge / discharge current will be in-/decreased depending on min and max cell voltages
; Example: 18 cells * 3.55V/cell = 63.9V max charge voltage
;          18 cells * 2.70V/cell = 48.6V min discharge voltage
;          But in reality not all cells reach the same voltage at the same time. The (dis)charge current
;          will be (in-/)decreased, if even ONE SINGLE BATTERY CELL reaches the limits

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

; 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.55, 3.48, 3.45, 3.40
MAX_CHARGE_CURRENT_CV_FRACTION =    0, 0.70,  0.9 , 1

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

; --------- Cell Voltage limitation (affecting CVL) ---------
; This function prevents a bad balanced battery to overcharge the cell with the highest voltage and the bms to
; switch off because of overvoltage of this cell.
;
; Example:
;     15 cells are at 3.4v, 1 cell is at 3.6v. Total voltage of battery is 54.6v and the Victron System sees no reason to
;     lower the charging current as the control_voltage (Absorbtion Voltage) ist 55.2v
;     In this case the Cell Voltage limitation kicks in and lowers the control_voltage to keep it close to the MAX_CELL_VOLTAGE.
;
; In theory this can also be done with CCL, but doing it with CVL has 2 advantages:
;     - In a well balanced system the current can be kept quite high till the end of charge by using MAX_CELL_VOLTAGE for charging.
;     - In systems with MPPTs and DC-feed-in activated the victron systems do not respect CCL, so CVL is the only way to prevent the
;       highest cell in a bad balanced system from overcharging.
;
; There are 2 methods implemented to calculate CVL:
;   1. penalty_sum-Method (CVL_ICONTROLLER_MODE = False)
;      The voltage-overshoot of all cells that exceed MAX_CELL_VOLTAGE is summed up and the control voltage is lowered by this "penalty_sum".
;      This is calculated every LINEAR_RECALCULATION_EVERY seconds.
;      In fact, this is a P-Controller.
;   2. I-Controller (CVL_ICONTROLLER_MODE = True)
;      An I-Controller tries to control the voltage of the highest cell to MAX_CELL_VOLTAGE + CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL.
;      (for example 3.45V+0.01V =3.46V). If the voltage of the highest cell is above this level, CVL is reduced. If the voltage is below, CVL is
;      increased until cellcount*MAX_CELL_VOLTAGE.
;      An I-Part of 0.2 V/Vs (CVL_ICONTROLLER_FACTOR) has proved to be a stable and fast controlling-behaviour.
;      This method is not as fast as the penalty_sum-Method but usually smoother and more stable against toggeling and has no stationary deviation.
; More info: https://github.com/Louisvdw/dbus-serialbattery/pull/882
CVL_ICONTROLLER_MODE   = True
CVL_ICONTROLLER_FACTOR = 0.2

; --------- 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 = True
; Charge current control management referring to temperature enable (True/False).
DCCM_T_ENABLE = True

; Set steps to reduce battery current
; 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
TEMPERATURES_WHILE_CHARGING     =    0,    2,    5,   10,   15,    20,    25,   30,    40
MAX_CHARGE_CURRENT_T_FRACTION   = 0.00, 0.10, 0.20, 1.00, 1.00,  1.00,  1.00, 0.80,  0.00

;TEMPERATURE_LIMITS_WHILE_DISCHARGING = -20,   0,   5,  10, 15, 45, 55
TEMPERATURES_WHILE_DISCHARGING      =    -20,    0,    5,   10,    15,    45,    55
MAX_DISCHARGE_CURRENT_T_FRACTION    =   0.00, 0.00, 0.40, 0.80,  1.00,  1.00,  0.00

; --------- 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 = True
; Discharge current control management enable (True/False).
DCCM_SOC_ENABLE = True

; Set steps to reduce battery current
; The current will be changed linear between those steps if LINEAR_LIMITATION_ENABLE is set to True
SOC_WHILE_CHARGING                 =   99,   95,   90,   85
MAX_CHARGE_CURRENT_SOC_FRACTION    = 0.10, 0.70, 1.00, 1.00

SOC_WHILE_DISCHARGING              =    5,   10,   15,   20
MAX_DISCHARGE_CURRENT_SOC_FRACTION = 0.10, 0.30, 1.00, 1.00

; --------- 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 = True

; --------- 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 = 100, 90, 80, 75, 50, 25, 10, 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 = 3
; Specify in seconds how often the TimeToSoc should be recalculated
; Minimum are 5 seconds to prevent CPU overload
TIME_TO_SOC_RECALCULATE_EVERY = 90
; 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

; --------- Additional settings ---------
; Specify only one BMS type to load else leave empty to try to load all available
; -- Available BMS:
; Daly, Ecs, HeltecModbus, HLPdataBMS4S, Jkbms, Lifepower, LltJbd, Renogy, Seplos
; -- Available BMS, but disabled by default:
; https://louisvdw.github.io/dbus-serialbattery/general/install#how-to-enable-a-disabled-bms
; Ant, MNB, Sinowealth
BMS_TYPE = Daly

; Enter custom battery names here or change it over the GUI
; Example:
;     /dev/ttyUSB0:My first battery
;     /dev/ttyUSB0:My first battery,/dev/ttyUSB1:My second battery
CUSTOM_BATTERY_NAMES = /dev/ttyUSB0:SerialBAT2022 ,/dev/ttyUSB1:SerialBAT2023

; BMS poll interval in seconds
; If the driver consumes to much CPU, you can increase this value to reduce refresh rate
; and CPU usage
; Default for most BMS is 1 second, some BMS may have a higher value
; Leave empty to use the BMS default value, decimal values are allowed
POLL_INTERVAL = 3

; Auto reset SoC
; If on, then SoC is reset to 100%, if the value switches from absorption to float voltage
; Currently only working for Daly BMS and JK BMS BLE
AUTO_RESET_SOC = True

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

; 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 = 3

; Simulate Midpoint graph (True/False).
MIDPOINT_ENABLE = 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 = BAT2022 1

; Temperature sensor 2 name
TEMP_2_NAME = BAT2023 2

; Temperature sensor 2 name
TEMP_3_NAME = Temp 3

; Temperature sensor 2 name
TEMP_4_NAME = Temp 4

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

; -- Daly settings
; Battery capacity (amps), if the BMS does not support reading it
BATTERY_CAPACITY = 560
; Invert Battery Current. Default non-inverted. Set to -1 to invert
INVERT_CURRENT_MEASUREMENT = -1

; Show additional info in GUI -> Serialbattery -> Parameters
; This will show additional information to better understand how the driver works
; and what values are currently set which are not shown elsewhere in the GUI
; You have to scroll down to see the additional information
GUI_PARAMETERS_SHOW_ADDITIONAL_INFO = True

; --------- Battery monitor specific settings ---------
; If you are using a SmartShunt or something else as a battery monitor, the battery voltage reported
; from the BMS and SmartShunt could differ. This causes, that the driver never goapplies the float voltage,
; since max voltage is never reached.
; Example:
;     cell count: 16
;     MAX_CELL_VOLTAGE = 3.45
;     max voltage calculated = 16 * 3.45 = 55.20
;     CVL is set to 55.20 and the battery is now charged until the SmartShunt measures 55.20 V. The BMS
;     now measures 55.05 V since there is a voltage drop of 0.15 V. Since the dbus-serialbattery measures
;     55.05 V the max voltage is never reached for the driver and max voltage is kept forever.
;     Set VOLTAGE_DROP to 0.15
VOLTAGE_DROP = 1.00

Relevant log output

2024-08-16 17:01:59.369238500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #573
2024-08-16 17:02:02.397676500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #573
2024-08-16 17:02:05.372380500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #573
2024-08-16 17:02:08.404271500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #573
2024-08-16 17:02:11.347366500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #573
2024-08-16 17:02:14.358324500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #573

After restart driver:
--------------------------------------------------------------
2024-08-16 17:02:53.400716500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #573
2024-08-16 17:03:12.781176500 INFO:SerialBattery:
2024-08-16 17:03:12.781868500 INFO:SerialBattery:Starting dbus-serialbattery
2024-08-16 17:03:12.784020500 INFO:SerialBattery:Venus OS v3.41
2024-08-16 17:03:12.784674500 INFO:SerialBattery:dbus-serialbattery v1.3.20240705
2024-08-16 17:03:28.798783500 INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds
2024-08-16 17:03:28.798792500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-08-16 17:03:29.238751500 INFO:SerialBattery:Connection established to Daly
2024-08-16 17:03:34.210942500 INFO:SerialBattery:Found existing battery with DeviceInstance = 1
2024-08-16 17:03:35.787560500 INFO:SerialBattery:DeviceInstance = 1
2024-08-16 17:03:35.789553500 INFO:SerialBattery:PID file created successfully: /var/tmp/dbus-serialbattery_1.pid
2024-08-16 17:03:35.790514500 INFO:SerialBattery:Used DeviceInstances = ['6', '1']
2024-08-16 17:03:35.791608500 INFO:SerialBattery:com.victronenergy.battery.ttyUSB1
2024-08-16 17:03:36.018264500 INFO:SerialBattery:publish config values = True
2024-08-16 17:03:36.070032500 INFO:SerialBattery:Battery Daly connected to dbus from /dev/ttyUSB1
2024-08-16 17:03:36.070726500 INFO:SerialBattery:========== Settings ==========
2024-08-16 17:03:36.071440500 INFO:SerialBattery:> Connection voltage: 53.1 V | Current: 0.0 A | SoC: 80.7%
2024-08-16 17:03:36.072165500 INFO:SerialBattery:> Cell count: 16 | Cells populated: 0
2024-08-16 17:03:36.072806500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: True
2024-08-16 17:03:36.073467500 INFO:SerialBattery:> MIN CELL VOLTAGE: 2.950 V | MAX CELL VOLTAGE: 3.450 V| FLOAT CELL VOLTAGE: 3.390 V
2024-08-16 17:03:36.074102500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 40.0 A | MAX BATTERY DISCHARGE CURRENT: 40.0 A
2024-08-16 17:03:36.074736500 INFO:SerialBattery:> CVCM:     True
2024-08-16 17:03:36.075299500 INFO:SerialBattery:> CCCM CV:  True  | DCCM CV:  True
2024-08-16 17:03:36.076086500 INFO:SerialBattery:> CCCM T:   True  | DCCM T:   True
2024-08-16 17:03:36.076811500 INFO:SerialBattery:> CCCM SOC: True  | DCCM SOC: True
2024-08-16 17:03:36.077488500 INFO:SerialBattery:> CHARGE FET: None | DISCHARGE FET: None | BALANCE FET: None
2024-08-16 17:03:36.078167500 INFO:SerialBattery:Serial Number/Unique Identifier: 20221229
2024-08-16 19:43:19.757229500 INFO:SerialBattery:refresh_data: result: False. If you don't see this warning very often, you can ignore it.
2024-08-16 20:45:31.283490500 WARNING:SerialBattery:No data received in read_alarm_data()
2024-08-16 20:45:31.627255500 INFO:SerialBattery:refresh_data: result: False. If you don't see this warning very often, you can ignore it.

Any other information that may be helpful

image image image image image image

mr-manuel commented 4 weeks ago

Hello,

thanks for providing all relevant informations! Please install the latest nightly, since the error handling is different now.

Approved-OK commented 4 weeks ago

i installed nightly build - due to weekend i've time to look at behavior ;-) thx

Approved-OK commented 4 weeks ago

Startup - look good

2024-08-17 07:44:46.410850500 INFO:SerialBattery:
2024-08-17 07:44:46.412694500 INFO:SerialBattery:Starting dbus-serialbattery
2024-08-17 07:44:46.437535500 INFO:SerialBattery:Venus OS v3.41
2024-08-17 07:44:46.438297500 INFO:SerialBattery:dbus-serialbattery v1.4.20240806dev
2024-08-17 07:45:02.448620500 INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds
2024-08-17 07:45:02.449759500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-08-17 07:45:02.904288500 INFO:SerialBattery:Connection established to Daly
2024-08-17 07:45:08.271834500 INFO:SerialBattery:Found existing battery with DeviceInstance = 1
2024-08-17 07:45:08.936904500 INFO:SerialBattery:DeviceInstance = 1
2024-08-17 07:45:08.940149500 INFO:SerialBattery:PID file created successfully: /var/tmp/dbus-serialbattery_1.pid
2024-08-17 07:45:08.940960500 INFO:SerialBattery:Used DeviceInstances = ['6', '1']
2024-08-17 07:45:08.941997500 INFO:SerialBattery:com.victronenergy.battery.ttyUSB1__0
2024-08-17 07:45:08.992286500 INFO:SerialBattery:publish config values = True
2024-08-17 07:45:09.116605500 INFO:SerialBattery:Polling data every 3.000 s
2024-08-17 07:45:09.123546500 INFO:SerialBattery:Battery Daly connected to dbus from /dev/ttyUSB1
2024-08-17 07:45:09.124641500 INFO:SerialBattery:========== Settings ==========
2024-08-17 07:45:09.130156500 INFO:SerialBattery:> Connection voltage: 52.7 V | Current: 1.1900000000000002 A | SoC: 38.8%
2024-08-17 07:45:09.139241500 INFO:SerialBattery:> Cell count: 16 | Cells populated: 0
2024-08-17 07:45:09.140426500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: True
2024-08-17 07:45:09.142214500 INFO:SerialBattery:> MIN CELL VOLTAGE: 2.950 V | MAX CELL VOLTAGE: 3.450 V| FLOAT CELL VOLTAGE: 3.390 V
2024-08-17 07:45:09.148608500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 40.0 A | MAX BATTERY DISCHARGE CURRENT: 40.0 A
2024-08-17 07:45:09.151997500 INFO:SerialBattery:> CVCM:     True
2024-08-17 07:45:09.154656500 INFO:SerialBattery:> CCCM CV:  True  | DCCM CV:  True
2024-08-17 07:45:09.155728500 INFO:SerialBattery:> CCCM T:   True  | DCCM T:   True
2024-08-17 07:45:09.156783500 INFO:SerialBattery:> CCCM SOC: True  | DCCM SOC: True
2024-08-17 07:45:09.157971500 INFO:SerialBattery:> CHARGE FET: None | DISCHARGE FET: None | BALANCE FET: None
2024-08-17 07:45:09.159564500 INFO:SerialBattery:Serial Number/Unique Identifier: 20221229
2024-08-17 07:46:26.160933500 *** CCGX booted (0) ***
2024-08-17 07:46:45.934958500 Traceback (most recent call last):
2024-08-17 07:46:45.934968500   File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 16, in <module>
2024-08-17 07:46:45.934972500     from dbushelper import DbusHelper
2024-08-17 07:46:45.934975500 ModuleNotFoundError: No module named 'dbushelper'
2024-08-17 07:47:26.729421500 INFO:SerialBattery:
2024-08-17 07:47:26.736971500 INFO:SerialBattery:Starting dbus-serialbattery
2024-08-17 07:47:26.748078500 INFO:SerialBattery:Venus OS v3.41
2024-08-17 07:47:26.749046500 INFO:SerialBattery:dbus-serialbattery v1.4.20240806dev
2024-08-17 07:47:42.766423500 INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds
2024-08-17 07:47:42.767703500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-08-17 07:47:43.235930500 INFO:SerialBattery:Connection established to Daly
2024-08-17 07:47:52.084911500 INFO:SerialBattery:Found existing battery with DeviceInstance = 1
2024-08-17 07:47:53.149214500 INFO:SerialBattery:DeviceInstance = 1
2024-08-17 07:47:53.160038500 INFO:SerialBattery:PID file created successfully: /var/tmp/dbus-serialbattery_1.pid
2024-08-17 07:47:53.163597500 INFO:SerialBattery:Used DeviceInstances = ['6', '1']
2024-08-17 07:47:53.168755500 INFO:SerialBattery:com.victronenergy.battery.ttyUSB1__0
2024-08-17 07:47:53.340198500 INFO:SerialBattery:publish config values = True
2024-08-17 07:47:53.438629500 INFO:SerialBattery:Polling data every 3.000 s
2024-08-17 07:47:53.440833500 INFO:SerialBattery:Battery Daly connected to dbus from /dev/ttyUSB1
2024-08-17 07:47:53.441692500 INFO:SerialBattery:========== Settings ==========
2024-08-17 07:47:53.442719500 INFO:SerialBattery:> Connection voltage: 52.6 V | Current: -1.1199999999999999 A | SoC: 38.8%
2024-08-17 07:47:53.467183500 INFO:SerialBattery:> Cell count: 16 | Cells populated: 0
2024-08-17 07:47:53.467192500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: True
2024-08-17 07:47:53.467342500 INFO:SerialBattery:> MIN CELL VOLTAGE: 2.950 V | MAX CELL VOLTAGE: 3.450 V| FLOAT CELL VOLTAGE: 3.390 V
2024-08-17 07:47:53.468340500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 40.0 A | MAX BATTERY DISCHARGE CURRENT: 40.0 A
2024-08-17 07:47:53.471735500 INFO:SerialBattery:> CVCM:     True
2024-08-17 07:47:53.471743500 INFO:SerialBattery:> CCCM CV:  True  | DCCM CV:  True
2024-08-17 07:47:53.471746500 INFO:SerialBattery:> CCCM T:   True  | DCCM T:   True
2024-08-17 07:47:53.471749500 INFO:SerialBattery:> CCCM SOC: True  | DCCM SOC: True
2024-08-17 07:47:53.472574500 INFO:SerialBattery:> CHARGE FET: None | DISCHARGE FET: None | BALANCE FET: None
2024-08-17 07:47:53.473446500 INFO:SerialBattery:Serial Number/Unique Identifier: 20221229

Update: over hole night the driver works well...

2024-08-17 13:22:12.530650500 INFO:SerialBattery:Serial Number/Unique Identifier: 20221229
2024-08-17 18:28:45.066998500 WARNING:SerialBattery:No data received in read_alarm_data()
2024-08-17 18:28:45.418292500 INFO:SerialBattery:refresh_data: result: False. If you don't see this warning very often, you can ignore it.
2024-08-17 20:27:33.564874500 INFO:SerialBattery:refresh_data: result: False. If you don't see this warning very often, you can ignore it.
2024-08-18 03:22:09.642119500 WARNING:SerialBattery:No data received in read_alarm_data()
2024-08-18 03:22:09.978814500 INFO:SerialBattery:refresh_data: result: False. If you don't see this warning very often, you can ignore it.

I although controlled the connectors for Communcation ( USB, RS485, )

Approved-OK commented 4 weeks ago

severel crashes

image

2024-08-17 10:16:20.304341500 DEBUG:SerialBattery:current: 10.8219 - current_external: None
2024-08-17 10:16:20.331153500 DEBUG:SerialBattery:logged to dbus [48.9]
2024-08-17 10:16:20.332873500 DEBUG:SerialBattery:Cells:[1]3.358V [2]3.364V [3]3.358V [4]3.364V [5]3.363V [6]3.357V [7]3.364V [8]3.359V [9]3.37V [10]3.361V [11]3.356V [12]3.36V [13]3.361V [14]3.361V [15]3.359V [16]3.361V
2024-08-17 10:16:20.334216500 DEBUG:SerialBattery:Polling data took 0.797 seconds
2024-08-17 10:16:22.629124500 WARNING:SerialBattery:read_soc_data - triesValid 1
2024-08-17 10:16:22.708639500 WARNING:SerialBattery:read_soc_data - triesValid 0
2024-08-17 10:16:23.254556500 INFO:SerialBattery:refresh_data: result: False. If you don't see this warning very often, you can ignore it.
2024-08-17 10:16:23.261876500 DEBUG:SerialBattery:current: 10.8219 - current_external: None
2024-08-17 10:16:23.261885500 DEBUG:SerialBattery:current: 10.8219 - current_external: None
2024-08-17 10:16:23.274399500 DEBUG:SerialBattery:current: 10.8219 - current_external: None
2024-08-17 10:16:23.274408500 DEBUG:SerialBattery:current: 10.8219 - current_external: None
2024-08-17 10:16:23.274411500 DEBUG:SerialBattery:current: 10.8219 - current_external: None
2024-08-17 10:16:23.386353500 DEBUG:SerialBattery:current: 10.8219 - current_external: None
2024-08-17 10:16:23.387297500 DEBUG:SerialBattery:current: 10.8219 - current_external: None
2024-08-17 10:16:23.400859500 DEBUG:SerialBattery:logged to dbus [48.9]
2024-08-17 10:16:23.402257500 DEBUG:SerialBattery:Cells:[1]3.358V [2]3.365V [3]3.358V [4]3.365V [5]3.363V [6]3.358V [7]3.364V [8]3.36V [9]3.37V [10]3.361V [11]3.357V [12]3.361V [13]3.361V [14]3.361V [15]3.359V [16]3.362V
2024-08-17 10:16:23.403380500 DEBUG:SerialBattery:Polling data took 0.863 seconds
2024-08-17 10:16:25.632514500 WARNING:SerialBattery:read_soc_data - triesValid 1
2024-08-17 10:16:25.708609500 WARNING:SerialBattery:read_soc_data - triesValid 0
2024-08-17 10:16:26.243966500 INFO:SerialBattery:refresh_data: result: False. If you don't see this warning very often, you can ignore it.
2024-08-17 10:16:26.247177500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #710
2024-08-17 10:16:26.249453500 WARNING:root:calcMaxChargeCurrentReferringToTemperature(): get_max_temp() is None or get_min_temp() is None, using default current instead. If you don't see this warning very often, you can ignore it.
2024-08-17 10:16:26.251469500 WARNING:root:calcMaxDischargeCurrentReferringToTemperature(): get_max_temp() is None or get_min_temp() is None, using default current instead. If you don't see this warning very often, you can ignore it.**
2024-08-17 10:16:26.275210500 DEBUG:SerialBattery:current: None - current_external: None
2024-08-17 10:16:26.276943500 DEBUG:SerialBattery:current: None - current_external: None
2024-08-17 10:16:26.449980500 DEBUG:SerialBattery:current: None - current_external: None
2024-08-17 10:16:26.455853500 DEBUG:SerialBattery:logged to dbus [48.9]
2024-08-17 10:16:26.457338500 DEBUG:SerialBattery:Cells:
2024-08-17 10:16:26.462760500 DEBUG:SerialBattery:Polling data took 0.919 seconds
2024-08-17 10:16:28.618740500 WARNING:SerialBattery:read_soc_data - triesValid 1
2024-08-17 10:16:28.691011500 WARNING:SerialBattery:read_soc_data - triesValid 0
2024-08-17 10:16:29.282308500 INFO:SerialBattery:refresh_data: result: False. If you don't see this warning very often, you can ignore it.
2024-08-17 10:16:29.286321500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #710
2024-08-17 10:16:29.287551500 DEBUG:SerialBattery:current: None - current_external: None
2024-08-17 10:16:29.290471500 DEBUG:SerialBattery:current: None - current_external: None
2024-08-17 10:16:29.355270500 DEBUG:SerialBattery:current: None - current_external: None
2024-08-17 10:16:29.356333500 DEBUG:SerialBattery:logged to dbus [48.9]
2024-08-17 10:16:29.362206500 DEBUG:SerialBattery:Cells:[1]3.359V [2]3.365V [3]3.359V [4]3.365V [5]3.364V [6]3.358V [7]3.365V [8]3.36V [9]3.37V [10]3.362V [11]3.357V [12]3.361V [13]3.361V [14]3.362V [15]3.359V [16]3.362V
2024-08-17 10:16:29.366064500 DEBUG:SerialBattery:Polling data took 0.820 seconds
2024-08-17 10:16:31.629226500 WARNING:SerialBattery:read_soc_data - triesValid 1
2024-08-17 10:16:31.709951500 WARNING:SerialBattery:read_soc_data - triesValid 0
2024-08-17 10:16:32.241534500 INFO:SerialBattery:refresh_data: result: False. If you don't see this warning very often, you can ignore it.
2024-08-17 10:16:32.243823500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #710
Approved-OK commented 4 weeks ago

So it seems, when loading the batteries the failure happens

2024-08-18 09:24:40.674158500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #710
2024-08-18 09:24:43.645287500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #710
2024-08-18 09:24:46.636793500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #710
2024-08-18 09:24:49.648909500 ERROR:SerialBattery:Non blocking exception occurred: TypeError("'>' not supported between instances of 'NoneType' and 'float'") of type <class 'TypeError'> in /opt/victronenergy/dbus-serialbattery/battery.py line #710

image

image

image

Enrico126 commented 3 weeks ago

Hey,

similar error for me: image

The error only occurs when the battery is being charged. I also installed the latest nightly.

Driver version v1.4.2024.08.06dev

Venus OS device type Cerbo GX

Venus OS version v3.41

BMS type Daly Smart BMS

Cell count 22

Battery count 1

Connection type Serial USB adapter to RS485

seamaster101 commented 3 weeks ago

Any solution to this problem?

mr-manuel commented 3 weeks ago

Daly BMS are not very stable in communication. Until now the tons of errors were supressed and the user never got notified, even if 80% of the BMS readings failed. Seems like there is no other way to continue this way for Daly BMS and ignore the lots of faulty readings.

Approved-OK commented 3 weeks ago

Good Morning. at least no solution. I deactivated CVL calculation Mode to False CVL_ICONTROLLER_MODE = False CVL_ICONTROLLER_FACTOR = 0.2

it seems to be better, but today i saw this image

this is something irritating ? But the driver ( nightly build ) seam to work better.

Looking today, weather seams to be very good today in Salzburg..

mr-manuel commented 3 weeks ago

v1.3.20240705 reports every error that occurs with internal error. v1.4.20240806dev reports after 100 occurred errors in 1 hour. I will change this so that it could set by every individual BMS class.

mr-manuel commented 3 weeks ago

Please install v1.4.20240824dev, I added some error handling for Daly BMS.

seamaster101 commented 3 weeks ago

For me this happens with JK BMS but I will try to install the version you recommended and will report. JordanOn Aug 24, 2024, at 04:29, Manuel @.***> wrote: Please install v1.4.20240824dev, I added some error handling for Daly BMS.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

mr-manuel commented 3 weeks ago

@seamaster101 then you have a different issue. Please open a new issue for it.