Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel Daly BMS #78

Closed
wants to merge 9 commits into from
2 changes: 1 addition & 1 deletion etc/dbus-serialbattery/bms/daly.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ def read_sentence(self, ser, expected_reply, timeout=0.5):

# logger.info(f"reply: {bytearray_to_string(reply)}") # debug

if id != 1 or length != 8 or cmd != expected_reply[0]:
if (63 + id) != self.address[0] or length != 8 or cmd != expected_reply[0]:
logger.debug(
f"read_sentence {bytearray_to_string(expected_reply)}: wrong header"
)
Expand Down
3 changes: 3 additions & 0 deletions etc/dbus-serialbattery/config.default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ TIME_TO_SOC_INC_FROM = False
; Daly, Daren485, Ecs, EG4_Lifepower, EG4_LL, HeltecModbus, HLPdataBMS4S, Jkbms, Jkbms_pb, LltJbd, Renogy, Seplos, Seplosv3
; Available BMS, but disabled by default (just enter one or more below and it will be enabled):
; ANT, MNB, Sinowealth
; Note: When using multiple Daly in parallel, via RS-485 bus or multiple "UART" ports, specify all the BMS board addresses via MODBUS_ADDRESSES (0x40 = board 0, 0x41 = board 1, ... 0x4F = board 16)
; BMSTYPE = Daly
; MODBUS_ADDRESSES = 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F
BMS_TYPE =

; Exclude this serial devices from the driver startup
Expand Down
4 changes: 4 additions & 0 deletions etc/dbus-serialbattery/dbus-serialbattery.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
from bms.sinowealth import Sinowealth

supported_bms_types = [
# For multiple boards (1-16) in parallel, specify board addresses (0x40-0x4F) via MODBUS_ADDRESSES in config.ini
# (see "BMSTYPE = Daly" in config.default.ini), and enable the following line... optionally disable
# the 2 Daly lines following.
# {"bms": Daly, "baud": 9600},
{"bms": Daly, "baud": 9600, "address": b"\x40"},
{"bms": Daly, "baud": 9600, "address": b"\x80"},
{"bms": Daren485, "baud": 19200, "address": b"\x01"},
Expand Down