Louisvdw / dbus-serialbattery

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

VRM instance id not unique with multiple Seplos BMS on separate USB->485 adapters #923

Closed johndparker closed 8 months ago

johndparker commented 8 months ago

Describe the bug

I have installed and configured this driver together with dbus-aggregate-batteries and all is working very well so far except both individual batteries have the same VRM id of 1 instead of having separate ids. (The virtual combined battery has an id of 0) I see other discussion around this issue, but not for Seplos.

How to reproduce

Connect 2 Seplos BMS on separate USB to 485 adaptors

Expected behavior

Each serialbattery instance should have a separate VRM id.

Driver version

v1.0.20240102beta

Venus OS device type

Cerbo GX

Venus OS version

v3.13

BMS type

Seplos

Cell count

16

Battery count

2

Connection type

Serial USB adapter to RS485

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):
MAX_BATTERY_CHARGE_CURRENT = 140.0
MAX_BATTERY_DISCHARGE_CURRENT = 100.0

Relevant log output

from /data/log/dbus-serialbattery.ttyUSB1/current

2024-01-17 18:07:06.361820500 *** CCGX booted (0) ***
2024-01-17 18:07:54.414990500 INFO:SerialBattery:
2024-01-17 18:07:54.415829500 INFO:SerialBattery:Starting dbus-serialbattery
2024-01-17 18:07:54.479641500 INFO:SerialBattery:dbus-serialbattery v1.0.20240102beta
2024-01-17 18:08:10.490165500 INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds
2024-01-17 18:08:10.491349500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-01-17 18:08:10.629890500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:08:10.629900500 INFO:SerialBattery:Testing Daly at address "\x80"
2024-01-17 18:08:10.777539500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:08:10.777549500 INFO:SerialBattery:Testing Ecs
2024-01-17 18:08:10.880558500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:08:10.881481500 INFO:SerialBattery:Testing HeltecModbus
2024-01-17 18:08:14.756922500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:08:14.758058500 INFO:SerialBattery:Testing HLPdataBMS4S
2024-01-17 18:08:15.578766500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:08:15.579619500 INFO:SerialBattery:Testing Jkbms
2024-01-17 18:08:15.866362500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:08:15.871594500 INFO:SerialBattery:Testing Lifepower
2024-01-17 18:08:16.165437500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:08:16.171144500 INFO:SerialBattery:Testing LltJbd
2024-01-17 18:08:16.474838500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:08:16.487630500 INFO:SerialBattery:Testing Renogy at address "\x30"
2024-01-17 18:08:16.778920500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:08:16.797813500 INFO:SerialBattery:Testing Renogy at address "\xf7"
2024-01-17 18:08:17.099777500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:08:17.106438500 INFO:SerialBattery:Testing Seplos
2024-01-17 18:08:18.327518500 INFO:SerialBattery:Connection established to Seplos
2024-01-17 18:08:18.327528500 INFO:SerialBattery:Battery Seplos connected to dbus from /dev/ttyUSB1
2024-01-17 18:08:18.327532500 INFO:SerialBattery:========== Settings ==========
2024-01-17 18:08:18.327534500 INFO:SerialBattery:> Connection voltage: 53.24V | Current: 0.0A | SoC: None%
2024-01-17 18:08:18.327538500 INFO:SerialBattery:> Cell count: 16 | Cells populated: 0
2024-01-17 18:08:18.327540500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: True
2024-01-17 18:08:18.327683500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 140.0A | MAX BATTERY DISCHARGE CURRENT: 100.0A
2024-01-17 18:08:18.327688500 INFO:SerialBattery:> CVCM:     True
2024-01-17 18:08:18.327690500 INFO:SerialBattery:> MIN CELL VOLTAGE: 2.9V | MAX CELL VOLTAGE: 3.45V
2024-01-17 18:08:18.327693500 INFO:SerialBattery:> CCCM CV:  True  | DCCM CV:  True
2024-01-17 18:08:18.327696500 INFO:SerialBattery:> CCCM T:   True  | DCCM T:   True
2024-01-17 18:08:18.354005500 INFO:SerialBattery:> CCCM SOC: True  | DCCM SOC: True
2024-01-17 18:08:18.357439500 INFO:SerialBattery:Serial Number/Unique Identifier: SeplosBMS16cells_280.0Ah
2024-01-17 18:08:26.053413500 INFO:SerialBattery:Found existing battery with DeviceInstance = 1
2024-01-17 18:08:26.525817500 INFO:SerialBattery:DeviceInstance = 1
2024-01-17 18:08:26.527418500 INFO:SerialBattery:Used device instances: ['1']
2024-01-17 18:08:26.531410500 INFO:SerialBattery:com.victronenergy.battery.ttyUSB1
2024-01-17 18:08:26.628182500 INFO:SerialBattery:publish config values = True
2024-01-17 18:08:42.851958500 Traceback (most recent call last):
2024-01-17 18:08:42.851967500   File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 626, in publish_battery
2024-01-17 18:08:42.851971500     result = self.battery.refresh_data()
2024-01-17 18:08:42.851973500   File "/opt/victronenergy/dbus-serialbattery/bms/seplos.py", line 117, in refresh_data
2024-01-17 18:08:42.851977500     result_status = self.read_status_data()
2024-01-17 18:08:42.851979500   File "/opt/victronenergy/dbus-serialbattery/bms/seplos.py", line 199, in read_status_data
2024-01-17 18:08:42.852123500     data = self.read_serial_data_seplos(
2024-01-17 18:08:42.852125500   File "/opt/victronenergy/dbus-serialbattery/bms/seplos.py", line 302, in read_serial_data_seplos
2024-01-17 18:08:42.852130500     if not Seplos.is_valid_frame(data):
2024-01-17 18:08:42.852132500   File "/opt/victronenergy/dbus-serialbattery/bms/seplos.py", line 276, in is_valid_frame
2024-01-17 18:08:42.852135500     if chksum != Seplos.int_from_2byte_hex_ascii(data, -5):
2024-01-17 18:08:42.852163500   File "/opt/victronenergy/dbus-serialbattery/bms/seplos.py", line 32, in int_from_2byte_hex_ascii
2024-01-17 18:08:42.852167500     bytes.fromhex(data[offset : offset + 4].decode("ascii")),
2024-01-17 18:08:42.852170500 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc9 in position 1: ordinal not in range(128)
2024-01-17 18:08:42.852562500 Setted setting /Settings/Devices/serialbattery_SeplosBMS16cells_280_0Ah/LastSeen to 1705514906
2024-01-17 18:08:42.852570500 Setted setting /Settings/Devices/serialbattery_SeplosBMS16cells_280_0Ah/SocCalc to 90.8
2024-01-17 18:08:48.135745500 INFO:SerialBattery:
2024-01-17 18:08:48.136912500 INFO:SerialBattery:Starting dbus-serialbattery
2024-01-17 18:08:48.139974500 INFO:SerialBattery:dbus-serialbattery v1.0.20240102beta
2024-01-17 18:09:04.157869500 INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds
2024-01-17 18:09:04.157879500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-01-17 18:09:04.291945500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:04.292259500 INFO:SerialBattery:Testing Daly at address "\x80"
2024-01-17 18:09:04.424663500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:04.425234500 INFO:SerialBattery:Testing Ecs
2024-01-17 18:09:04.522848500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:04.522859500 INFO:SerialBattery:Testing HeltecModbus
2024-01-17 18:09:08.330495500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:08.330505500 INFO:SerialBattery:Testing HLPdataBMS4S
2024-01-17 18:09:09.147898500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:09.148968500 INFO:SerialBattery:Testing Jkbms
2024-01-17 18:09:09.473311500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:09.478588500 INFO:SerialBattery:Testing Lifepower
2024-01-17 18:09:09.783504500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:09.793139500 INFO:SerialBattery:Testing LltJbd
2024-01-17 18:09:10.099243500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:10.109425500 INFO:SerialBattery:Testing Renogy at address "\x30"
2024-01-17 18:09:10.407607500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:10.417508500 INFO:SerialBattery:Testing Renogy at address "\xf7"
2024-01-17 18:09:10.716285500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:10.724019500 INFO:SerialBattery:Testing Seplos
2024-01-17 18:09:11.881709500 INFO:SerialBattery:Connection established to Seplos
2024-01-17 18:09:11.883999500 INFO:SerialBattery:Battery Seplos connected to dbus from /dev/ttyUSB1
2024-01-17 18:09:11.884009500 INFO:SerialBattery:========== Settings ==========
2024-01-17 18:09:11.884305500 INFO:SerialBattery:> Connection voltage: 53.24V | Current: 0.0A | SoC: None%
2024-01-17 18:09:11.885196500 INFO:SerialBattery:> Cell count: 16 | Cells populated: 0
2024-01-17 18:09:11.886343500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: True
2024-01-17 18:09:11.887060500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 140.0A | MAX BATTERY DISCHARGE CURRENT: 100.0A
2024-01-17 18:09:11.931622500 INFO:SerialBattery:> CVCM:     True
2024-01-17 18:09:11.939917500 INFO:SerialBattery:> MIN CELL VOLTAGE: 2.9V | MAX CELL VOLTAGE: 3.45V
2024-01-17 18:09:11.972983500 INFO:SerialBattery:> CCCM CV:  True  | DCCM CV:  True
2024-01-17 18:09:11.980194500 INFO:SerialBattery:> CCCM T:   True  | DCCM T:   True
2024-01-17 18:09:11.996605500 INFO:SerialBattery:> CCCM SOC: True  | DCCM SOC: True
2024-01-17 18:09:12.013487500 INFO:SerialBattery:Serial Number/Unique Identifier: SeplosBMS16cells_280.0Ah
2024-01-17 18:09:25.159464500 INFO:SerialBattery:Found existing battery with DeviceInstance = 1
2024-01-17 18:09:25.940356500 INFO:SerialBattery:DeviceInstance = 1
2024-01-17 18:09:25.941775500 INFO:SerialBattery:Used device instances: ['1']
2024-01-17 18:09:25.943427500 INFO:SerialBattery:com.victronenergy.battery.ttyUSB1
2024-01-17 18:09:26.075803500 INFO:SerialBattery:publish config values = True
2024-01-17 18:29:02.040623500 INFO:SerialBattery:Changed CustomName = Battery 1
2024-01-17 18:29:36.100331500 INFO:SerialBattery:Changed CustomName = Battery 0

from /data/log/dbus-serialbattery.ttyUSB2/current
2024-01-17 19:57:58.397107500 WARNING:SerialBattery:Error reading settings from BMS, retry (2/10): Slave reported illegal data address
2024-01-17 19:57:58.830757500 WARNING:SerialBattery:Error reading settings from BMS, retry (3/10): Slave reported illegal data address
2024-01-17 19:57:59.244600500 WARNING:SerialBattery:Error reading settings from BMS, retry (4/10): Slave reported illegal data address
2024-01-17 19:57:59.661672500 WARNING:SerialBattery:Error reading settings from BMS, retry (5/10): Slave reported illegal data address
2024-01-17 19:58:00.076473500 WARNING:SerialBattery:Error reading settings from BMS, retry (6/10): Slave reported illegal data address
2024-01-17 19:58:00.489922500 WARNING:SerialBattery:Error reading settings from BMS, retry (7/10): Slave reported illegal data address
2024-01-17 19:58:00.913109500 WARNING:SerialBattery:Error reading settings from BMS, retry (8/10): Slave reported illegal data address
2024-01-17 19:58:01.365148500 WARNING:SerialBattery:Error reading settings from BMS, retry (9/10): Slave reported illegal data address
2024-01-17 19:58:01.786810500 WARNING:SerialBattery:Error reading settings from BMS, retry (10/10): Slave reported illegal data address
2024-01-17 19:58:01.819189500 INFO:SerialBattery:Testing HLPdataBMS4S
2024-01-17 19:58:02.643171500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:02.643963500 INFO:SerialBattery:Testing Jkbms
2024-01-17 19:58:02.936977500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:02.948309500 INFO:SerialBattery:Testing Lifepower
2024-01-17 19:58:03.265331500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:03.274333500 INFO:SerialBattery:Testing LltJbd
2024-01-17 19:58:03.575756500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:03.584590500 INFO:SerialBattery:Testing Renogy at address "\x30"
2024-01-17 19:58:03.926129500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:03.931405500 INFO:SerialBattery:Testing Renogy at address "\xf7"
2024-01-17 19:58:04.227826500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:04.231998500 INFO:SerialBattery:Testing Seplos
2024-01-17 19:58:05.245877500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:05.747661500 INFO:SerialBattery:-- Testing BMS: 3 of 3 rounds
2024-01-17 19:58:05.748705500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-01-17 19:58:05.878863500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:05.879930500 INFO:SerialBattery:Testing Daly at address "\x80"
2024-01-17 19:58:06.024016500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:06.024026500 INFO:SerialBattery:Testing Ecs
2024-01-17 19:58:06.081530500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:06.081540500 INFO:SerialBattery:Testing HeltecModbus
2024-01-17 19:58:06.629780500 WARNING:SerialBattery:Error reading settings from BMS, retry (1/10): Slave reported illegal data address
2024-01-17 19:58:07.049579500 WARNING:SerialBattery:Error reading settings from BMS, retry (2/10): Slave reported illegal data address
2024-01-17 19:58:07.463848500 WARNING:SerialBattery:Error reading settings from BMS, retry (3/10): Slave reported illegal data address
2024-01-17 19:58:07.881508500 WARNING:SerialBattery:Error reading settings from BMS, retry (4/10): Slave reported illegal data address
2024-01-17 19:58:08.307810500 WARNING:SerialBattery:Error reading settings from BMS, retry (5/10): Slave reported illegal data address
2024-01-17 19:58:08.746498500 WARNING:SerialBattery:Error reading settings from BMS, retry (6/10): Slave reported illegal data address
2024-01-17 19:58:09.163299500 WARNING:SerialBattery:Error reading settings from BMS, retry (7/10): Slave reported illegal data address
2024-01-17 19:58:09.589797500 WARNING:SerialBattery:Error reading settings from BMS, retry (8/10): Slave reported illegal data address
2024-01-17 19:58:10.026363500 WARNING:SerialBattery:Error reading settings from BMS, retry (9/10): Slave reported illegal data address
2024-01-17 19:58:10.457389500 WARNING:SerialBattery:Error reading settings from BMS, retry (10/10): Slave reported illegal data address
2024-01-17 19:58:10.458812500 INFO:SerialBattery:Testing HLPdataBMS4S
2024-01-17 19:58:11.278496500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:11.278506500 INFO:SerialBattery:Testing Jkbms
2024-01-17 19:58:11.630404500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:11.638540500 INFO:SerialBattery:Testing Lifepower
2024-01-17 19:58:11.940157500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:11.948782500 INFO:SerialBattery:Testing LltJbd
2024-01-17 19:58:12.274994500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:12.283640500 INFO:SerialBattery:Testing Renogy at address "\x30"
2024-01-17 19:58:12.596421500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:12.603859500 INFO:SerialBattery:Testing Renogy at address "\xf7"
2024-01-17 19:58:12.923070500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:12.928504500 INFO:SerialBattery:Testing Seplos
2024-01-17 19:58:13.943696500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 19:58:14.447473500 ERROR:SerialBattery:ERROR >>> No battery connection at /dev/ttyUSB2
2024-01-17 20:04:42.860591500 INFO:SerialBattery:
2024-01-17 20:04:42.861763500 INFO:SerialBattery:Starting dbus-serialbattery
2024-01-17 20:04:42.863514500 INFO:SerialBattery:dbus-serialbattery v1.0.20240102beta
2024-01-17 20:04:58.880885500 INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds
2024-01-17 20:04:58.880896500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-01-17 20:04:59.018761500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:04:59.019788500 INFO:SerialBattery:Testing Daly at address "\x80"
2024-01-17 20:04:59.154856500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:04:59.154865500 INFO:SerialBattery:Testing Ecs
2024-01-17 20:04:59.231098500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:04:59.231108500 INFO:SerialBattery:Testing HeltecModbus
2024-01-17 20:04:59.779552500 WARNING:SerialBattery:Error reading settings from BMS, retry (1/10): Slave reported illegal data address
2024-01-17 20:05:00.205235500 WARNING:SerialBattery:Error reading settings from BMS, retry (2/10): Slave reported illegal data address
2024-01-17 20:05:00.622142500 WARNING:SerialBattery:Error reading settings from BMS, retry (3/10): Slave reported illegal data address
2024-01-17 20:05:01.038738500 WARNING:SerialBattery:Error reading settings from BMS, retry (4/10): Slave reported illegal data address
2024-01-17 20:05:01.455339500 WARNING:SerialBattery:Error reading settings from BMS, retry (5/10): Slave reported illegal data address
2024-01-17 20:05:01.870122500 WARNING:SerialBattery:Error reading settings from BMS, retry (6/10): Slave reported illegal data address
2024-01-17 20:05:02.290009500 WARNING:SerialBattery:Error reading settings from BMS, retry (7/10): Slave reported illegal data address
2024-01-17 20:05:02.722506500 WARNING:SerialBattery:Error reading settings from BMS, retry (8/10): Slave reported illegal data address
2024-01-17 20:05:03.138407500 WARNING:SerialBattery:Error reading settings from BMS, retry (9/10): Slave reported illegal data address
2024-01-17 20:05:03.551728500 WARNING:SerialBattery:Error reading settings from BMS, retry (10/10): Slave reported illegal data address
2024-01-17 20:05:03.552554500 INFO:SerialBattery:Testing HLPdataBMS4S
2024-01-17 20:05:04.368828500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:04.369727500 INFO:SerialBattery:Testing Jkbms
2024-01-17 20:05:04.668252500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:04.677861500 INFO:SerialBattery:Testing Lifepower
2024-01-17 20:05:04.993433500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:04.998807500 INFO:SerialBattery:Testing LltJbd
2024-01-17 20:05:05.320206500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:05.326077500 INFO:SerialBattery:Testing Renogy at address "\x30"
2024-01-17 20:05:05.640025500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:05.649141500 INFO:SerialBattery:Testing Renogy at address "\xf7"
2024-01-17 20:05:05.938900500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:05.944103500 INFO:SerialBattery:Testing Seplos
2024-01-17 20:05:06.961973500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:07.463556500 INFO:SerialBattery:-- Testing BMS: 2 of 3 rounds
2024-01-17 20:05:07.464523500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-01-17 20:05:07.598348500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:07.599516500 INFO:SerialBattery:Testing Daly at address "\x80"
2024-01-17 20:05:07.765986500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:07.765997500 INFO:SerialBattery:Testing Ecs
2024-01-17 20:05:08.177969500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:08.179362500 INFO:SerialBattery:Testing HeltecModbus
2024-01-17 20:05:08.762035500 WARNING:SerialBattery:Error reading settings from BMS, retry (1/10): Slave reported illegal data address
2024-01-17 20:05:09.179749500 WARNING:SerialBattery:Error reading settings from BMS, retry (2/10): Slave reported illegal data address
2024-01-17 20:05:09.597412500 WARNING:SerialBattery:Error reading settings from BMS, retry (3/10): Slave reported illegal data address
2024-01-17 20:05:10.016741500 WARNING:SerialBattery:Error reading settings from BMS, retry (4/10): Slave reported illegal data address
2024-01-17 20:05:10.443284500 WARNING:SerialBattery:Error reading settings from BMS, retry (5/10): Slave reported illegal data address
2024-01-17 20:05:10.878533500 WARNING:SerialBattery:Error reading settings from BMS, retry (6/10): Slave reported illegal data address
2024-01-17 20:05:11.297409500 WARNING:SerialBattery:Error reading settings from BMS, retry (7/10): Slave reported illegal data address
2024-01-17 20:05:11.714784500 WARNING:SerialBattery:Error reading settings from BMS, retry (8/10): Slave reported illegal data address
2024-01-17 20:05:12.146776500 WARNING:SerialBattery:Error reading settings from BMS, retry (9/10): Slave reported illegal data address
2024-01-17 20:05:12.565413500 WARNING:SerialBattery:Error reading settings from BMS, retry (10/10): Slave reported illegal data address
2024-01-17 20:05:12.566298500 INFO:SerialBattery:Testing HLPdataBMS4S
2024-01-17 20:05:13.392525500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:13.393311500 INFO:SerialBattery:Testing Jkbms
2024-01-17 20:05:13.726458500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:13.735108500 INFO:SerialBattery:Testing Lifepower
2024-01-17 20:05:14.040779500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:14.051138500 INFO:SerialBattery:Testing LltJbd
2024-01-17 20:05:14.354364500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:14.362254500 INFO:SerialBattery:Testing Renogy at address "\x30"
2024-01-17 20:05:14.662856500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:14.673467500 INFO:SerialBattery:Testing Renogy at address "\xf7"
2024-01-17 20:05:14.981960500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:14.994019500 INFO:SerialBattery:Testing Seplos
2024-01-17 20:05:16.008181500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:16.509947500 INFO:SerialBattery:-- Testing BMS: 3 of 3 rounds
2024-01-17 20:05:16.511036500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-01-17 20:05:16.649466500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:16.650446500 INFO:SerialBattery:Testing Daly at address "\x80"
2024-01-17 20:05:16.820380500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:16.824225500 INFO:SerialBattery:Testing Ecs
2024-01-17 20:05:16.881733500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:16.882544500 INFO:SerialBattery:Testing HeltecModbus
2024-01-17 20:05:17.429714500 WARNING:SerialBattery:Error reading settings from BMS, retry (1/10): Slave reported illegal data address
2024-01-17 20:05:17.843310500 WARNING:SerialBattery:Error reading settings from BMS, retry (2/10): Slave reported illegal data address
2024-01-17 20:05:18.260939500 WARNING:SerialBattery:Error reading settings from BMS, retry (3/10): Slave reported illegal data address
2024-01-17 20:05:18.690029500 WARNING:SerialBattery:Error reading settings from BMS, retry (4/10): Slave reported illegal data address
2024-01-17 20:05:19.142984500 WARNING:SerialBattery:Error reading settings from BMS, retry (5/10): Slave reported illegal data address
2024-01-17 20:05:19.611627500 WARNING:SerialBattery:Error reading settings from BMS, retry (6/10): Slave reported illegal data address
2024-01-17 20:05:20.041936500 WARNING:SerialBattery:Error reading settings from BMS, retry (7/10): Slave reported illegal data address
2024-01-17 20:05:20.463464500 WARNING:SerialBattery:Error reading settings from BMS, retry (8/10): Slave reported illegal data address
2024-01-17 20:05:20.887410500 WARNING:SerialBattery:Error reading settings from BMS, retry (9/10): Slave reported illegal data address
2024-01-17 20:05:21.301547500 WARNING:SerialBattery:Error reading settings from BMS, retry (10/10): Slave reported illegal data address
2024-01-17 20:05:21.302356500 INFO:SerialBattery:Testing HLPdataBMS4S
2024-01-17 20:05:22.135408500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:22.135417500 INFO:SerialBattery:Testing Jkbms
2024-01-17 20:05:22.428769500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:22.435764500 INFO:SerialBattery:Testing Lifepower
2024-01-17 20:05:22.746449500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:22.770207500 INFO:SerialBattery:Testing LltJbd
2024-01-17 20:05:23.071061500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:23.076355500 INFO:SerialBattery:Testing Renogy at address "\x30"
2024-01-17 20:05:23.373207500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:23.380702500 INFO:SerialBattery:Testing Renogy at address "\xf7"
2024-01-17 20:05:23.685054500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:23.695154500 INFO:SerialBattery:Testing Seplos
2024-01-17 20:05:24.715638500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 20:05:25.219840500 ERROR:SerialBattery:ERROR >>> No battery connection at /dev/ttyUSB2

from /data/log/dbus-serialbattery.ttyUSB3/current

2024-01-17 18:07:06.375633500 *** CCGX booted (0) ***
2024-01-17 18:08:49.738223500 INFO:SerialBattery:
2024-01-17 18:08:49.739376500 INFO:SerialBattery:Starting dbus-serialbattery
2024-01-17 18:08:49.740981500 INFO:SerialBattery:dbus-serialbattery v1.0.20240102beta
2024-01-17 18:09:05.760873500 INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds
2024-01-17 18:09:05.760883500 INFO:SerialBattery:Testing Daly at address "\x40"
2024-01-17 18:09:05.891371500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:05.893113500 INFO:SerialBattery:Testing Daly at address "\x80"
2024-01-17 18:09:06.024469500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:06.025394500 INFO:SerialBattery:Testing Ecs
2024-01-17 18:09:06.119558500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:06.120313500 INFO:SerialBattery:Testing HeltecModbus
2024-01-17 18:09:09.929323500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:09.930281500 INFO:SerialBattery:Testing HLPdataBMS4S
2024-01-17 18:09:10.747995500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:10.748844500 INFO:SerialBattery:Testing Jkbms
2024-01-17 18:09:11.082483500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:11.107435500 INFO:SerialBattery:Testing Lifepower
2024-01-17 18:09:11.384572500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:11.393200500 INFO:SerialBattery:Testing LltJbd
2024-01-17 18:09:11.700026500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:11.706954500 INFO:SerialBattery:Testing Renogy at address "\x30"
2024-01-17 18:09:12.029618500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:12.035170500 INFO:SerialBattery:Testing Renogy at address "\xf7"
2024-01-17 18:09:12.359050500 ERROR:SerialBattery:>>> ERROR: No reply - returning
2024-01-17 18:09:12.364555500 INFO:SerialBattery:Testing Seplos
2024-01-17 18:09:13.866941500 INFO:SerialBattery:Connection established to Seplos
2024-01-17 18:09:13.870882500 INFO:SerialBattery:Battery Seplos connected to dbus from /dev/ttyUSB3
2024-01-17 18:09:13.871941500 INFO:SerialBattery:========== Settings ==========
2024-01-17 18:09:13.872966500 INFO:SerialBattery:> Connection voltage: 53.27V | Current: 0.0A | SoC: None%
2024-01-17 18:09:13.873875500 INFO:SerialBattery:> Cell count: 16 | Cells populated: 0
2024-01-17 18:09:13.874916500 INFO:SerialBattery:> LINEAR LIMITATION ENABLE: True
2024-01-17 18:09:13.875899500 INFO:SerialBattery:> MAX BATTERY CHARGE CURRENT: 140.0A | MAX BATTERY DISCHARGE CURRENT: 100.0A
2024-01-17 18:09:13.876846500 INFO:SerialBattery:> CVCM:     True
2024-01-17 18:09:13.905635500 INFO:SerialBattery:> MIN CELL VOLTAGE: 2.9V | MAX CELL VOLTAGE: 3.45V
2024-01-17 18:09:13.906650500 INFO:SerialBattery:> CCCM CV:  True  | DCCM CV:  True
2024-01-17 18:09:13.919860500 INFO:SerialBattery:> CCCM T:   True  | DCCM T:   True
2024-01-17 18:09:13.922812500 INFO:SerialBattery:> CCCM SOC: True  | DCCM SOC: True
2024-01-17 18:09:13.926762500 INFO:SerialBattery:Serial Number/Unique Identifier: SeplosBMS16cells_280.0Ah
2024-01-17 18:09:26.418013500 INFO:SerialBattery:Found existing battery with DeviceInstance = 1
2024-01-17 18:09:27.212817500 INFO:SerialBattery:DeviceInstance = 1
2024-01-17 18:09:27.214103500 INFO:SerialBattery:Used device instances: ['1']
2024-01-17 18:09:27.215541500 INFO:SerialBattery:com.victronenergy.battery.ttyUSB3
2024-01-17 18:09:27.326819500 INFO:SerialBattery:publish config values = True
2024-01-17 18:29:01.984596500 INFO:SerialBattery:Changed CustomName = Battery 1
2024-01-17 18:29:36.103516500 INFO:SerialBattery:Changed CustomName = Battery 0

Any other information that may be helpful

I did not have to configure anything for both serialbatteries to appear in the RemoteConsole, and the aggregatebattery virtual found the instances and combined them again without any specific configuration.

Note also that this driver is interfering with ttyUSB2 which is actually one of my ET112 power meters. The other ET112 is on ttyUSB0 and that does not seem to be affected.

Perhaps the Seplos driver needs to use the connection (USB1 vs USB3) to create a unique ID?

johndparker commented 8 months ago

Oh - I missed this log file

/data/log/serial-starter/current

2024-01-17 19:45:11.029505500 INFO: Start service dbus-fzsonick-48tl.ttyUSB2 once
2024-01-17 19:45:17.110954500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB2 once
2024-01-17 19:45:22.657169500 INFO: Start service dbus-modbus-client.serial.ttyUSB2 once
2024-01-17 19:45:32.494473500 INFO: Start service dbus-serialbattery.ttyUSB2 once
2024-01-17 19:46:18.096106500 INFO: Start service gps-dbus.ttyUSB2 once
2024-01-17 19:46:27.897256500 INFO: Start service vedirect-interface.ttyUSB2 once
2024-01-17 19:46:31.782333500 INFO: Start service dbus-cgwacs.ttyUSB2 once
2024-01-17 19:57:08.220142500 INFO: Start service dbus-fzsonick-48tl.ttyUSB2 once
2024-01-17 19:57:14.082369500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB2 once
2024-01-17 19:57:19.849634500 INFO: Start service dbus-modbus-client.serial.ttyUSB2 once
2024-01-17 19:57:30.004049500 INFO: Start service dbus-serialbattery.ttyUSB2 once
2024-01-17 19:58:15.171582500 INFO: Start service gps-dbus.ttyUSB2 once
2024-01-17 19:58:24.982766500 INFO: Start service vedirect-interface.ttyUSB2 once
2024-01-17 19:58:28.464374500 INFO: Start service dbus-cgwacs.ttyUSB2 once
2024-01-17 20:04:18.807548500 INFO: Start service dbus-fzsonick-48tl.ttyUSB2 once
2024-01-17 20:04:24.773427500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB2 once
2024-01-17 20:04:30.548925500 INFO: Start service dbus-modbus-client.serial.ttyUSB2 once
2024-01-17 20:04:40.274294500 INFO: Start service dbus-serialbattery.ttyUSB2 once
2024-01-17 20:05:25.892674500 INFO: Start service gps-dbus.ttyUSB2 once
2024-01-17 20:05:35.573451500 INFO: Start service vedirect-interface.ttyUSB2 once
2024-01-17 20:05:39.089072500 INFO: Start service dbus-cgwacs.ttyUSB2 once
2024-01-17 20:14:34.189821500 INFO: Start service dbus-fzsonick-48tl.ttyUSB2 once
2024-01-17 20:14:39.954296500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB2 once
2024-01-17 20:14:45.631621500 INFO: Start service dbus-modbus-client.serial.ttyUSB2 once
2024-01-17 20:14:55.629409500 INFO: Start service dbus-serialbattery.ttyUSB2 once
2024-01-17 20:15:40.881468500 INFO: Start service gps-dbus.ttyUSB2 once
2024-01-17 20:15:50.615057500 INFO: Start service vedirect-interface.ttyUSB2 once
2024-01-17 20:15:56.120442500 INFO: Start service dbus-cgwacs.ttyUSB2 once
2024-01-17 20:18:15.788605500 INFO: Start service dbus-fzsonick-48tl.ttyUSB2 once
2024-01-17 20:18:21.449173500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB2 once
2024-01-17 20:18:25.272817500 INFO: Start service dbus-modbus-client.serial.ttyUSB2 once
2024-01-17 20:18:35.222458500 INFO: Start service dbus-serialbattery.ttyUSB2 once
2024-01-17 20:19:22.903842500 INFO: Start service gps-dbus.ttyUSB2 once
2024-01-17 20:19:33.147009500 INFO: Start service vedirect-interface.ttyUSB2 once
2024-01-17 20:19:38.617022500 INFO: Start service dbus-cgwacs.ttyUSB2 once
2024-01-17 20:28:03.963116500 INFO: Start service dbus-fzsonick-48tl.ttyUSB2 once
2024-01-17 20:28:09.941473500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB2 once
2024-01-17 20:28:15.900071500 INFO: Start service dbus-modbus-client.serial.ttyUSB2 once
2024-01-17 20:28:25.808802500 INFO: Start service dbus-serialbattery.ttyUSB2 once
2024-01-17 20:29:12.951994500 INFO: Start service gps-dbus.ttyUSB2 once
2024-01-17 20:29:23.005303500 INFO: Start service vedirect-interface.ttyUSB2 once
2024-01-17 20:29:28.528030500 INFO: Start service dbus-cgwacs.ttyUSB2 once

Looks like something is struggling to do something with USB2 when it should be leaving it alone!

johndparker commented 8 months ago

I thought I had fixed the ttyUSB2 problem but alas not!

I added ttyUSB2 to the exclude list but it is still being bothered by the serial-starter every 5 minutes.

2024-01-17 21:09:52.556506500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB1 once
2024-01-17 21:09:54.264423500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB3 once
2024-01-17 21:10:00.565903500 INFO: Create daemontools service dbus-modbus-client.serial.ttyUSB1
2024-01-17 21:10:02.730805500 INFO: Create daemontools service dbus-modbus-client.serial.ttyUSB3
2024-01-17 21:10:06.765045500 INFO: Start service dbus-modbus-client.serial.ttyUSB1 once
2024-01-17 21:10:09.014974500 INFO: Start service dbus-modbus-client.serial.ttyUSB3 once
2024-01-17 21:10:19.844939500 INFO: Start service dbus-serialbattery.ttyUSB1 once
2024-01-17 21:10:23.450401500 INFO: Start service dbus-serialbattery.ttyUSB3 once
2024-01-17 21:19:06.721438500 INFO: Create daemontools service dbus-fzsonick-48tl.ttyUSB2
2024-01-17 21:19:12.889849500 INFO: Start service dbus-fzsonick-48tl.ttyUSB2 once
2024-01-17 21:19:21.882777500 INFO: Create daemontools service dbus-imt-si-rs485tc.ttyUSB2
2024-01-17 21:19:28.037792500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB2 once
2024-01-17 21:19:32.090322500 INFO: Create daemontools service dbus-modbus-client.serial.ttyUSB2
2024-01-17 21:19:38.144210500 INFO: Start service dbus-modbus-client.serial.ttyUSB2 once
2024-01-17 21:19:48.392957500 INFO: Create daemontools service dbus-serialbattery.ttyUSB2
2024-01-17 21:19:54.588415500 INFO: Start service dbus-serialbattery.ttyUSB2 once
2024-01-17 21:20:58.752736500 INFO: Create daemontools service gps-dbus.ttyUSB2
2024-01-17 21:21:04.838485500 INFO: Start service gps-dbus.ttyUSB2 once
2024-01-17 21:21:15.526938500 INFO: Create daemontools service vedirect-interface.ttyUSB2
2024-01-17 21:21:21.614435500 INFO: Start service vedirect-interface.ttyUSB2 once
2024-01-17 21:21:25.843677500 INFO: Start service dbus-cgwacs.ttyUSB2 once
2024-01-17 21:31:32.959378500 INFO: Start service dbus-fzsonick-48tl.ttyUSB2 once
2024-01-17 21:31:38.653844500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB2 once
2024-01-17 21:31:42.336021500 INFO: Start service dbus-modbus-client.serial.ttyUSB2 once
2024-01-17 21:31:49.884570500 INFO: Start service dbus-serialbattery.ttyUSB2 once
2024-01-17 21:32:54.321329500 INFO: Start service gps-dbus.ttyUSB2 once
2024-01-17 21:33:03.978018500 INFO: Start service vedirect-interface.ttyUSB2 once
2024-01-17 21:33:09.576659500 INFO: Start service dbus-cgwacs.ttyUSB2 once
2024-01-17 21:36:17.963332500 INFO: Start service dbus-fzsonick-48tl.ttyUSB2 once
2024-01-17 21:36:23.680755500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB2 once
2024-01-17 21:36:28.212978500 INFO: Start service dbus-modbus-client.serial.ttyUSB2 once
2024-01-17 21:36:39.394713500 INFO: Start service dbus-serialbattery.ttyUSB2 once
2024-01-17 21:37:47.475228500 INFO: Start service gps-dbus.ttyUSB2 once
2024-01-17 21:37:57.421021500 INFO: Start service vedirect-interface.ttyUSB2 once
2024-01-17 21:38:02.978176500 INFO: Start service dbus-cgwacs.ttyUSB2 once
2024-01-17 21:42:04.401150500 INFO: Start service dbus-fzsonick-48tl.ttyUSB2 once
2024-01-17 21:42:10.164738500 INFO: Start service dbus-imt-si-rs485tc.ttyUSB2 once
2024-01-17 21:42:16.075143500 INFO: Start service dbus-modbus-client.serial.ttyUSB2 once
2024-01-17 21:42:26.373322500 INFO: Start service dbus-serialbattery.ttyUSB2 once
2024-01-17 21:43:30.827707500 INFO: Start service gps-dbus.ttyUSB2 once
2024-01-17 21:43:40.665283500 INFO: Start service vedirect-interface.ttyUSB2 once
2024-01-17 21:43:44.317479500 INFO: Start service dbus-cgwacs.ttyUSB2 once

and the system is going into passthrough which is not acceptable.

config.ini is now

[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):
MAX_BATTERY_CHARGE_CURRENT = 140.0
MAX_BATTERY_DISCHARGE_CURRENT = 100.0

SOC_RESET_VOLTAGE = 3.450

BMS_TYPE = Seplos
EXCLUDED_DEVICES = /dev/ttyUSB2
mr-manuel commented 8 months ago

If you have two identical BMS you have to increase the capacity of one battery by one, else you don't have an unique id for the battery. E.g. change the capacity for each battery to be different 280 281 279 282 278 ...

The small difference makes no serial impact.

johndparker commented 8 months ago

Hi Mr Manuel

I'll try that but I'll also be looking for a better way to generate a unique ID - the adaptors have unique serial numbers in /dev/serial/by-id so we should be able to do that.

The problem with USB2 looks like a separate problem so I'll open a new ticket for that.

Having disabled the driver it looks like the grid meter is being left alone and the system is not going into passtrough.

Kind regards

John

mr-manuel commented 8 months ago

I'll try that but I'll also be looking for a better way to generate a unique ID - the adaptors have unique serial numbers in /dev/serial/by-id so we should be able to do that.

The unique ID has to be fetched from the BMS and not the serial adapter. What if you swap the adapters? If you build a solution for this it won't be implemented, since it's not applicable for the wide community.

mr-manuel commented 8 months ago

For your other problem try to swap the 0 with 1 in https://github.com/Louisvdw/dbus-serialbattery/blob/976ef061eca12e3fa4c8f95c6119cd4f3f9302ed/etc/dbus-serialbattery/dbus-serialbattery.py#L149

johndparker commented 8 months ago

I'll try the sys.exit change in the morning, and will consider if there is something else unique in the Seplos BMS - it just does not feel right to mess with the capacity whereas linking it to how it is connected makes some sense - at least to me. I'll sleep on it.

Thank you for all your assistance.

Kind regards John

mr-manuel commented 8 months ago

Since your batteries are for sure not exactly 280 Ah but have a deviation of +/- 2 % which are 5,6 Ah on a 280 Ah battery it's no big deal.