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

Fix cell numbers for daly #168

Merged
merged 1 commit into from
Aug 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions etc/dbus-serialbattery/daly.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,11 @@ def read_cells_volts(self, ser):
if b1 == 0xA5 and b2 == 0x01 and b3 == 0x95 and b4 == 0x08:
frame, frameCell[0], frameCell[1], frameCell[2] = unpack_from('>Bhhh', cells_volts_data, bufIdx + 4)
for idx in range(3):
cellnum = (idx + 1) * frame
cellnum = ((frame - 1) * 3) + idx # daly is 1 based, driver 0 based
if cellnum >= self.cell_count:
break
cellVoltage = frameCell[idx] / 1000
self.cells[cellnum].voltage = None if cellVoltage < lowMin else cellVoltage
cellnum += 1
bufIdx += 10 # BBBBBhhh -> 11 byte
bufIdx += 1

Expand Down