mr-manuel / venus-os_dbus-serialbattery

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

Zellspannungen bei zwei Akkupacks loggen #27

Closed RRonGit closed 3 months ago

RRonGit commented 3 months ago

Describe the problem

Hallo Zusammen,

Ich habe folgende Umgebung:

Raspi4 mit VenusOS Verion v3.30 2x Seplos Batteriepacks BMS Seplos BMS V16 (10E) Software Version: 16.6 venus-os_dbus-serialbattery von mr-manuel installiert Version: 1.1.20240121 BatteryAggregator installiert via Setup Helper Version: v3.0.20

Die Seplos BMS sind beide separat per USB to RS485 an den Rapsi angeschlossen.

Das Ganze funktioniert soweit.

Gerne möchte ich aber die einzelnen Zellspannungen loggen.

Mit einem BMS geht das via Node-RED problemlos. Bei zwei BMS werden die Werte immer abwechselnd von den beiden BMSen angezeigt.

image

image

Gibt es dazu ein Lösung?

Driver version

1.1.20240121

Venus OS device type

Raspberry Pi

Venus OS version

3.30

BMS type

Seplos

Cell count

16

Battery count

2

Connection type

Serial USB adapter to TTL

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):
; --------- Battery Current limits ---------

MAX_BATTERY_CHARGE_CURRENT = 140.0
MAX_BATTERY_DISCHARGE_CURRENT = 195.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

MIN_CELL_VOLTAGE   = 3.062
; Max voltage (can seen as absorption voltage)
MAX_CELL_VOLTAGE   = 3.531
; Float voltage (can be seen as resting voltage)
FLOAT_CELL_VOLTAGE = 3.375

; --------- 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
; 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
MAX_CHARGE_CURRENT_T_FRACTION     = 0, 0.1, 0.2, 0.4, 0.8,  1,  1, 0.4,  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 = True
; Discharge current control management enable (True/False).
DCCM_SOC_ENABLE = True

; 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

; --------- 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
;orig. CELL_VOLTAGES_WHILE_CHARGING   = 3.55, 3.50, 3.45, 3.30
;orig. MAX_CHARGE_CURRENT_CV_FRACTION =    0, 0.05,  0.5,    1
CELL_VOLTAGES_WHILE_CHARGING   = 3.55, 3.50, 3.45, 3.30
MAX_CHARGE_CURRENT_CV_FRACTION =    0, 0.05,  0.95,    1

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

; Temperature sensor 1 name
TEMP_1_NAME = Umgebungstemp

; Temperature sensor 2 name
TEMP_2_NAME = Leistungstemp

Relevant log output

2024-04-06 13:40:06.918624500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:40:06.918922500 INFO:SerialBattery:Testing Ecs
2024-04-06 13:40:06.982921500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:40:06.983192500 INFO:SerialBattery:Testing HeltecModbus
2024-04-06 13:40:10.685938500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:40:10.685943500 INFO:SerialBattery:Testing HLPdataBMS4S
2024-04-06 13:40:11.496829500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:40:11.496834500 INFO:SerialBattery:Testing Jkbms
2024-04-06 13:40:11.771207500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:40:11.772667500 INFO:SerialBattery:Testing Lifepower
2024-04-06 13:40:12.060913500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:40:12.062442500 INFO:SerialBattery:Testing LltJbd
2024-04-06 13:40:12.334759500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:40:12.336388500 INFO:SerialBattery:Testing Renogy at address "\x30"
2024-04-06 13:40:12.610061500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:40:12.611557500 INFO:SerialBattery:Testing Renogy at address "\xf7"
2024-04-06 13:40:12.891845500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:40:12.893302500 INFO:SerialBattery:Testing Seplos
2024-04-06 13:40:14.012667500 INFO:SerialBattery:Connection established to Seplos
2024-04-06 13:40:14.012988500 INFO:SerialBattery:Battery Seplos connected to dbus from /dev/ttyUSB0
2024-04-06 13:40:14.013262500 INFO:SerialBattery:========== Settings ==========
2024-04-06 13:40:14.014838500 INFO:SerialBattery:> Connection voltage: 55.27V | Current: 0.96A | SoC: None%
2024-04-06 13:40:14.015272500 INFO:SerialBattery:> Cell count: 16 | Cells populated: 0
2024-04-06 13:40:14.015628500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: True
2024-04-06 13:40:14.015991500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 140.0A | MAX BATTERY DISCHARGE CURRENT: 195.0A
2024-04-06 13:40:14.016357500 INFO:SerialBattery:> CVCM:     True
2024-04-06 13:40:14.016791500 INFO:SerialBattery:> MIN CELL VOLTAGE: 3.062V | MAX CELL VOLTAGE: 3.531V
2024-04-06 13:40:14.017152500 INFO:SerialBattery:> CCCM CV:  True  | DCCM CV:  True
2024-04-06 13:40:14.017515500 INFO:SerialBattery:> CCCM T:   False | DCCM T:   False
2024-04-06 13:40:14.017870500 INFO:SerialBattery:> CCCM SOC: True  | DCCM SOC: True
2024-04-06 13:40:14.018327500 INFO:SerialBattery:Serial Number/Unique Identifier: SeplosBMS16cells_280.0Ah
2024-04-06 13:40:14.236637500 INFO:SerialBattery:Found existing battery with DeviceInstance = 1
2024-04-06 13:40:14.394521500 INFO:SerialBattery:DeviceInstance = 1
2024-04-06 13:40:14.394848500 INFO:SerialBattery:Used device instances: ['1']
2024-04-06 13:40:14.395163500 INFO:SerialBattery:com.victronenergy.battery.ttyUSB0
2024-04-06 13:40:14.413688500 INFO:SerialBattery:publish config values = True
2024-04-06 13:40:40.589904500 Traceback (most recent call last):
2024-04-06 13:40:40.589910500   File "/usr/lib/python3.8/site-packages/serial/serialposix.py", line 265, in open
2024-04-06 13:40:40.589914500     self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
2024-04-06 13:40:40.589918500 OSError: [Errno 5] Input/output error: '/dev/ttyUSB0'
2024-04-06 13:40:40.589921500
2024-04-06 13:40:40.589923500 During handling of the above exception, another exception occurred:
2024-04-06 13:40:40.589926500
2024-04-06 13:40:40.589928500 Traceback (most recent call last):
2024-04-06 13:40:40.590072500   File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 630, in publish_battery
2024-04-06 13:40:40.590077500     result = self.battery.refresh_data()
2024-04-06 13:40:40.590080500   File "/opt/victronenergy/dbus-serialbattery/bms/seplos.py", line 128, in refresh_data
2024-04-06 13:40:40.590084500     result_alarm = self.read_alarm_data()
2024-04-06 13:40:40.590086500   File "/opt/victronenergy/dbus-serialbattery/bms/seplos.py", line 142, in read_alarm_data
2024-04-06 13:40:40.590115500     data = self.read_serial_data_seplos(
2024-04-06 13:40:40.590118500   File "/opt/victronenergy/dbus-serialbattery/bms/seplos.py", line 300, in read_serial_data_seplos
2024-04-06 13:40:40.590122500     with serial.Serial(self.port, baudrate=self.baud_rate, timeout=1) as ser:
2024-04-06 13:40:40.590125500   File "/usr/lib/python3.8/site-packages/serial/serialutil.py", line 240, in __init__
2024-04-06 13:40:40.590152500     self.open()
2024-04-06 13:40:40.590210500   File "/usr/lib/python3.8/site-packages/serial/serialposix.py", line 268, in open
2024-04-06 13:40:40.590214500     raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
2024-04-06 13:40:40.590218500 serial.serialutil.SerialException: [Errno 5] could not open port /dev/ttyUSB0: [Errno 5] Input/output error: '/dev/ttyUSB0'
2024-04-06 13:41:03.350436500 INFO:SerialBattery:
2024-04-06 13:41:03.350835500 INFO:SerialBattery:Starting dbus-serialbattery
2024-04-06 13:41:03.351439500 INFO:SerialBattery:dbus-serialbattery v1.1.20240121
2024-04-06 13:41:19.368036500 INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds
2024-04-06 13:41:19.368435500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-04-06 13:41:19.499639500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:41:19.500008500 INFO:SerialBattery:Testing Daly at address "\x80"
2024-04-06 13:41:19.633241500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:41:19.633536500 INFO:SerialBattery:Testing Ecs
2024-04-06 13:41:19.698109500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:41:19.698419500 INFO:SerialBattery:Testing HeltecModbus
2024-04-06 13:41:23.404159500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:41:23.404498500 INFO:SerialBattery:Testing HLPdataBMS4S
2024-04-06 13:41:24.215524500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:41:24.215811500 INFO:SerialBattery:Testing Jkbms
2024-04-06 13:41:24.488328500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:41:24.490176500 INFO:SerialBattery:Testing Lifepower
2024-04-06 13:41:24.771710500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:41:24.773276500 INFO:SerialBattery:Testing LltJbd
2024-04-06 13:41:25.048175500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:41:25.052404500 INFO:SerialBattery:Testing Renogy at address "\x30"
2024-04-06 13:41:25.333721500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:41:25.335307500 INFO:SerialBattery:Testing Renogy at address "\xf7"
2024-04-06 13:41:25.609043500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-04-06 13:41:25.610479500 INFO:SerialBattery:Testing Seplos
2024-04-06 13:41:26.729694500 INFO:SerialBattery:Connection established to Seplos
2024-04-06 13:41:26.730012500 INFO:SerialBattery:Battery Seplos connected to dbus from /dev/ttyUSB0
2024-04-06 13:41:26.730291500 INFO:SerialBattery:========== Settings ==========
2024-04-06 13:41:26.730615500 INFO:SerialBattery:> Connection voltage: 55.17V | Current: 0.0A | SoC: None%
2024-04-06 13:41:26.730929500 INFO:SerialBattery:> Cell count: 16 | Cells populated: 0
2024-04-06 13:41:26.731345500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: True
2024-04-06 13:41:26.731701500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 140.0A | MAX BATTERY DISCHARGE CURRENT: 195.0A
2024-04-06 13:41:26.732005500 INFO:SerialBattery:> CVCM:     True
2024-04-06 13:41:26.732320500 INFO:SerialBattery:> MIN CELL VOLTAGE: 3.062V | MAX CELL VOLTAGE: 3.531V
2024-04-06 13:41:26.732618500 INFO:SerialBattery:> CCCM CV:  True  | DCCM CV:  True
2024-04-06 13:41:26.732924500 INFO:SerialBattery:> CCCM T:   False | DCCM T:   False
2024-04-06 13:41:26.733204500 INFO:SerialBattery:> CCCM SOC: True  | DCCM SOC: True
2024-04-06 13:41:26.733557500 INFO:SerialBattery:Serial Number/Unique Identifier: SeplosBMS16cells_280.0Ah
2024-04-06 13:41:26.932515500 INFO:SerialBattery:Found existing battery with DeviceInstance = 1
2024-04-06 13:41:27.043422500 INFO:SerialBattery:DeviceInstance = 1
2024-04-06 13:41:27.043732500 INFO:SerialBattery:Used device instances: ['1']
2024-04-06 13:41:27.044031500 INFO:SerialBattery:com.victronenergy.battery.ttyUSB0
2024-04-06 13:41:27.060029500 INFO:SerialBattery:publish config values = True

Any other information that may be helpful

No response

mr-manuel commented 3 months ago

Please install the latest dev and the problem should be shown. Probably your batteries have the same VRM ID.

RRonGit commented 3 months ago

@mr-manuel, thank you very much, it worked. I have now installed version 1.2.20240404dev. Then I had to change the capacity of a battery from 280Ah to 281Ah so that the batteries got different IDs. Now I can log the two batteries separately.