-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
JBD BMS: Balancing indicator not showing on correct cells #359
Comments
Have others with a JBD BMS the same issue? |
@iLeeeZi can you organize the protocol documentation so we can fix this? Please ask your seller or the manufacturer. |
Did some testing and looks like that it is not a protocol issue. I added logging after L123 in lltjbd.py
And the data seems correct, but with data showing only two of the cells balancing, the UI indicated after a few seconds that three of the cells are constantly balancing
|
So the log data is correct, but the displayed data not? |
Yes. The bms seems to send correct data, and the driver reads it correctly but dbus and gui is incorrect. |
Could you write me on Discord? |
Could you try to replace dbus-serialbattery/etc/dbus-serialbattery/bms/lltjbd.py Lines 118 to 130 in 88e5eea
with def to_cell_bits(self, byte_data, byte_data_high):
try:
# get up to the first 16 cells
tmp = bin(byte_data)[2:].rjust(min(self.cell_count, 16), utils.zero_char)
logger.info("tmp: type: " + type(tmp) + " - value: " + tmp)
# tmp = 0101
tmp_reversed = reversed(tmp)
# tmp_reversed = 1010
logger.info("tmp_reversed: type: " + type(tmp_reversed) + " - value: " + tmp_reversed)
test = tmp_reversed + reversed(tmp)
logger.info("test: type: " + type(test) + " - value: " + test)
if self.cell_count > 16:
tmp2 = bin(byte_data_high)[2:].rjust(self.cell_count - 16, utils.zero_char)
logger.info("tmp2: type: " + type(tmp2) + " - value: " + tmp2)
tmp_reversed = tmp_reversed + reversed(tmp2)
logger.info("tmp_reversed: type: " + type(tmp_reversed) + " - value: " + tmp_reversed)
# tmp = 1010
for c in range(self.cell_count):
if is_bit_set(tmp_reversed[c]):
logger.info("balancing cell " + c)
self.cells[c].balance = True
else:
self.cells[c].balance = False
except Exception as err:
logger.error(f"Unexpected {err=}, {type(err)=}") ? It could be that nothing works, since I'm not sure about the var types and I have no JBD BMS to test. But the driver shouldn't crash. |
I got errors on reversed() so changed it to [::-1]: def to_cell_bits(self, byte_data, byte_data_high):
try:
# get up to the first 16 cells
tmp = bin(byte_data)[2:].rjust(min(self.cell_count, 16), utils.zero_char)
logger.info("tmp: type: " + str(type(tmp)) + " - value: " + tmp)
tmp_reversed = tmp[::-1]
logger.info("tmp_reversed: type: " + str(type(tmp_reversed)) + " - value: " + tmp_reversed)
test = tmp_reversed + tmp[::-1]
logger.info("test: type: " + str(type(test)) + " - value: " + str(test))
if self.cell_count > 16:
tmp2 = bin(byte_data_high)[2:].rjust(self.cell_count - 16, utils.zero_char)
logger.info("tmp2: type: " + str(type(tmp2)) + " - value: " + tmp2)
tmp_reversed = tmp_reversed + tmp2[::-1]
logger.info("tmp_reversed: type: " + str(type(tmp_reversed)) + " - value: " + tmp_reversed)
for c in range(self.cell_count):
if is_bit_set(tmp_reversed[c]):
logger.info("balancing cell " + str(c+1))
#self.cells.append(Cell(True))
self.cells[c].balance = True
else:
#self.cells.append(Cell(False))
self.cells[c].balance = False
except Exception as err:
logger.error(f"Unexpected {err=}, {type(err)=}") But without self.cells.append(Cell()) I get
In some other function |
Will be fixed with the next (pre)release. |
Thank you @mr-manuel for fixing this. I have a JBD-AP20S003S BMS with 18 cells. I suspected that the red balancing indicators in SerialBattery were wrong ever since cell voltages became available but never had a chance to compare them to the xiaoxiang app. Saw this note in the changelog, upgraded to v1.0.20230531 and now they look much more normal! Thank you. |
Balancing indicators on Cell Voltages page are not showing on correct cells. The red indicators jump between cells showing 1-3 cells balancing and after a while it shows all cells balancing:
Checked with dbus-spy and it shows the same:
Switched to bluetooth adapter and xiaoxiang app is showing only two cells balancing as it should:
I have a JBD-SP04S034 4S 200A BMS
with three temperature sensors, so there might be an issue with unusual message length. I need to check if disabling one temperature sensor in xiaoxiang app makes any difference.Edit: Disabled one temp sensor and still the same issue.
The text was updated successfully, but these errors were encountered: