From 97a7bb9d1e243693ab6edc48fef145355def2fed Mon Sep 17 00:00:00 2001 From: Martin Polehla Date: Fri, 9 Feb 2024 18:22:31 +0100 Subject: [PATCH] Update jkbms_can.py Fixing https://github.com/Louisvdw/dbus-serialbattery/issues/950 for Jk BMS --- etc/dbus-serialbattery/bms/jkbms_can.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/etc/dbus-serialbattery/bms/jkbms_can.py b/etc/dbus-serialbattery/bms/jkbms_can.py index 2021771d..d926fa6b 100644 --- a/etc/dbus-serialbattery/bms/jkbms_can.py +++ b/etc/dbus-serialbattery/bms/jkbms_can.py @@ -48,12 +48,13 @@ def __del__(self): ALM_INFO = "ALM_INFO" MESSAGES_TO_READ = 100 - + + # Changed from 0x0XF4 to 0x0XF5. See https://github.com/Louisvdw/dbus-serialbattery/issues/950 CAN_FRAMES = { - BATT_STAT: 0x02F4, - CELL_VOLT: 0x04F4, - CELL_TEMP: 0x05F4, - ALM_INFO: 0x07F4, + BATT_STAT: 0x02F5, + CELL_VOLT: 0x04F5, + CELL_TEMP: 0x05F5, + ALM_INFO: 0x07F5, } def test_connection(self): @@ -66,7 +67,7 @@ def get_settings(self): # After successful connection get_settings will be call to set up the battery. # Set the current limits, populate cell count, etc # Return True if success, False for failure - self.max_battery_current = MAX_BATTERY_CHARGE_CURRENT + self.max_battery_charge_current = MAX_BATTERY_CHARGE_CURRENT self.max_battery_discharge_current = MAX_BATTERY_DISCHARGE_CURRENT self.max_battery_voltage = MAX_CELL_VOLTAGE * self.cell_count self.min_battery_voltage = MIN_CELL_VOLTAGE * self.cell_count