-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
JKBMS 11.XW over Bluetooth no MOSFET Temp #716
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
The same here. In serial-battery the MOSFET temperatures of my two JKBMS' (4S, FW 11.XW, connected via BT) are shown as 0° independently from the real temperature. In the JKBMS app the values are correct. |
I see all the temperatures, in both JK BMS I own, via BT. Version 3.01 is used. JKBMS : Other JK BMS the same but other HW |
The problem resides only with the 11.XW hardware version. Someone with such a BMS can contact me on Discrod, so I can take a look? |
@mr-manuel I have two running JKBMS 11.XW. Let me know if you need access for troubleshooting purposes. As I don‘t use discord, just drop me an e-mail to tempuno… as last time. |
Does the Temp 1 is In the logs you see Logs
jkbms_brn.py with more debug infofrom struct import unpack_from, calcsize
from bleak import BleakScanner, BleakClient
from time import sleep, time
import asyncio
import logging
import threading
logging.basicConfig(level=logging.INFO)
# zero means parse all incoming data (every second)
CELL_INFO_REFRESH_S = 0
CHAR_HANDLE = "0000ffe1-0000-1000-8000-00805f9b34fb"
MODEL_NBR_UUID = "00002a24-0000-1000-8000-00805f9b34fb"
COMMAND_CELL_INFO = 0x96
COMMAND_DEVICE_INFO = 0x97
FRAME_VERSION_JK04 = 0x01
FRAME_VERSION_JK02 = 0x02
FRAME_VERSION_JK02_32S = 0x03
PROTOCOL_VERSION_JK02 = 0x02
protocol_version = PROTOCOL_VERSION_JK02
# MIN_RESPONSE_SIZE = 300
MIN_RESPONSE_SIZE = 300
# MAX_RESPONSE_SIZE = 320
MAX_RESPONSE_SIZE = 340
TRANSLATE_DEVICE_INFO = [
[["device_info", "hw_rev"], 22, "8s"],
[["device_info", "sw_rev"], 30, "8s"],
[["device_info", "uptime"], 38, "<L"],
[["device_info", "vendor_id"], 6, "16s"],
[["device_info", "manufacturing_date"], 78, "8s"],
[["device_info", "serial_number"], 86, "10s"],
[["device_info", "production"], 102, "8s"],
]
TRANSLATE_SETTINGS = [
[["settings", "cell_uvp"], 10, "<L", 0.001],
[["settings", "cell_uvpr"], 14, "<L", 0.001],
[["settings", "cell_ovp"], 18, "<L", 0.001],
[["settings", "cell_ovpr"], 22, "<L", 0.001],
[["settings", "balance_trigger_voltage"], 26, "<L", 0.001],
[["settings", "power_off_voltage"], 46, "<L", 0.001],
[["settings", "max_charge_current"], 50, "<L", 0.001],
[["settings", "max_discharge_current"], 62, "<L", 0.001],
[["settings", "max_balance_current"], 50, "<L", 0.001],
[["settings", "cell_count"], 114, "<L"],
[["settings", "charging_switch"], 118, "4?"],
[["settings", "discharging_switch"], 122, "4?"],
[["settings", "balancing_switch"], 126, "4?"],
]
TRANSLATE_CELL_INFO = [
[["cell_info", "voltages", 32], 6, "<H", 0.001],
[["cell_info", "average_cell_voltage"], 58, "<H", 0.001],
[["cell_info", "delta_cell_voltage"], 60, "<H", 0.001],
[["cell_info", "max_voltage_cell"], 62, "<B"],
[["cell_info", "min_voltage_cell"], 63, "<B"],
[["cell_info", "resistances", 32], 64, "<H", 0.001],
[["cell_info", "total_voltage"], 118, "<H", 0.001],
[["cell_info", "current"], 126, "<l", 0.001],
[["cell_info", "temperature_sensor_1"], 130, "<H", 0.1],
[["cell_info", "temperature_sensor_2"], 132, "<H", 0.1],
[["cell_info", "temperature_mos"], 134, "<H", 0.1],
[["cell_info", "balancing_current"], 138, "<H", 0.001],
[["cell_info", "balancing_action"], 140, "<B", 0.001],
[["cell_info", "battery_soc"], 141, "B"],
[["cell_info", "capacity_remain"], 142, "<L", 0.001],
[["cell_info", "capacity_nominal"], 146, "<L", 0.001],
[["cell_info", "cycle_count"], 150, "<L"],
[["cell_info", "cycle_capacity"], 154, "<L", 0.001],
[["cell_info", "charging_switch_enabled"], 166, "1?"],
[["cell_info", "discharging_switch_enabled"], 167, "1?"],
[["cell_info", "balancing_active"], 191, "1?"],
]
class Jkbms_Brn:
# entries for translating the bytearray to py-object via unpack
# [[py dict entry as list, each entry ] ]
frame_buffer = bytearray()
bms_status = {}
waiting_for_response = ""
last_cell_info = 0
_new_data_callback = None
def __init__(self, addr):
self.address = addr
self.bt_thread = threading.Thread(target=self.connect_and_scrape)
async def scanForDevices(self):
devices = await BleakScanner.discover()
for d in devices:
logging.debug(d)
# iterative implementation maybe later due to referencing
def translate(self, fb, translation, o, f32s=False, i=0):
if i == len(translation[0]) - 1:
# keep things universal by using an n=1 list
kees = (
range(0, translation[0][i])
if isinstance(translation[0][i], int)
else [translation[0][i]]
)
offset = 0
if f32s:
if translation[1] >= 112:
offset = 32
elif translation[1] >= 54:
offset = 16
i = 0
for j in kees:
if isinstance(translation[2], int):
# handle raw bytes without unpack_from;
# 3. param gives no format but number of bytes
val = bytearray(
fb[
translation[1]
+ i
+ offset : translation[1]
+ i
+ translation[2]
+ offset
]
)
i += translation[2]
else:
val = unpack_from(
translation[2], bytearray(fb), translation[1] + i + offset
)[0]
# calculate stepping in case of array
i = i + calcsize(translation[2])
if isinstance(val, bytes):
try:
val = val.decode("utf-8").rstrip(" \t\n\r\0")
except UnicodeDecodeError:
val = ""
elif isinstance(val, int) and len(translation) == 4:
val = val * translation[3]
o[j] = val
else:
if translation[0][i] not in o:
if len(translation[0]) == i + 2 and isinstance(
translation[0][i + 1], int
):
o[translation[0][i]] = [None] * translation[0][i + 1]
else:
o[translation[0][i]] = {}
self.translate(fb, translation, o[translation[0][i]], f32s=f32s, i=i + 1)
def decode_warnings(self, fb):
val = unpack_from("<H", bytearray(fb), 136)[0]
self.bms_status["cell_info"]["error_bitmask_16"] = hex(val)
self.bms_status["cell_info"]["error_bitmask_2"] = format(val, "016b")
if "warnings" not in self.bms_status:
self.bms_status["warnings"] = {}
self.bms_status["warnings"]["resistance_too_high"] = bool(val & (1 << 0))
self.bms_status["warnings"]["cell_count_wrong"] = bool(val & (1 << 2)) # ?
self.bms_status["warnings"]["charge_overtemp"] = bool(val & (1 << 8))
self.bms_status["warnings"]["charge_undertemp"] = bool(val & (1 << 9))
self.bms_status["warnings"]["discharge_overtemp"] = bool(val & (1 << 15))
self.bms_status["warnings"]["cell_overvoltage"] = bool(val & (1 << 4))
self.bms_status["warnings"]["cell_undervoltage"] = bool(val & (1 << 11))
self.bms_status["warnings"]["charge_overcurrent"] = bool(val & (1 << 6))
self.bms_status["warnings"]["discharge_overcurrent"] = bool(val & (1 << 13))
# bis hierhin verifiziert, rest zu testen
def decode_device_info_jk02(self):
fb = self.frame_buffer
for t in TRANSLATE_DEVICE_INFO:
self.translate(fb, t, self.bms_status)
def decode_cellinfo_jk02(self):
fb = self.frame_buffer
has32s = fb[189] == 0x00 and fb[189 + 32] > 0
for t in TRANSLATE_CELL_INFO:
self.translate(fb, t, self.bms_status, f32s=has32s)
self.decode_warnings(fb)
logging.error("decode_cellinfo_jk02(): self.frame_buffer")
logging.error(self.frame_buffer)
logging.debug(self.bms_status)
def decode_settings_jk02(self):
fb = self.frame_buffer
for t in TRANSLATE_SETTINGS:
self.translate(fb, t, self.bms_status)
logging.debug(self.bms_status)
def decode(self):
# check what kind of info the frame contains
info_type = self.frame_buffer[4]
if info_type == 0x01:
logging.info("Processing frame with settings info")
if protocol_version == PROTOCOL_VERSION_JK02:
self.decode_settings_jk02()
# adapt translation table for cell array lengths
ccount = self.bms_status["settings"]["cell_count"]
for i, t in enumerate(TRANSLATE_CELL_INFO):
if t[0][-2] == "voltages" or t[0][-2] == "voltages":
TRANSLATE_CELL_INFO[i][0][-1] = ccount
self.bms_status["last_update"] = time()
elif info_type == 0x02:
if (
CELL_INFO_REFRESH_S == 0
or time() - self.last_cell_info > CELL_INFO_REFRESH_S
):
self.last_cell_info = time()
logging.info("processing frame with battery cell info")
if protocol_version == PROTOCOL_VERSION_JK02:
self.decode_cellinfo_jk02()
self.bms_status["last_update"] = time()
# power is calculated from voltage x current as
# register 122 contains unsigned power-value
self.bms_status["cell_info"]["power"] = (
self.bms_status["cell_info"]["current"]
* self.bms_status["cell_info"]["total_voltage"]
)
if self.waiting_for_response == "cell_info":
self.waiting_for_response = ""
elif info_type == 0x03:
logging.info("processing frame with device info")
if protocol_version == PROTOCOL_VERSION_JK02:
self.decode_device_info_jk02()
self.bms_status["last_update"] = time()
else:
return
if self.waiting_for_response == "device_info":
self.waiting_for_response = ""
def set_callback(self, callback):
self._new_data_callback = callback
def assemble_frame(self, data: bytearray):
logging.error(
f"--> assemble_frame() -> self.frame_buffer (before extend) -> lenght: {len(self.frame_buffer)}"
)
logging.error(self.frame_buffer)
if len(self.frame_buffer) > MAX_RESPONSE_SIZE:
logging.info(
"data dropped because it alone was longer than max frame length"
)
self.frame_buffer = []
if data[0] == 0x55 and data[1] == 0xAA and data[2] == 0xEB and data[3] == 0x90:
# beginning of new frame, clear buffer
self.frame_buffer = []
self.frame_buffer.extend(data)
logging.error(
f"--> assemble_frame() -> self.frame_buffer (after extend) -> lenght: {len(self.frame_buffer)}"
)
logging.error(self.frame_buffer)
if len(self.frame_buffer) >= MIN_RESPONSE_SIZE:
# check crc; always at position 300, independent of
# actual frame-lentgh, so crc up to 299
ccrc = self.crc(self.frame_buffer, 300 - 1)
rcrc = self.frame_buffer[300 - 1]
logging.debug(f"compair recvd. crc: {rcrc} vs calc. crc: {ccrc}")
if ccrc == rcrc:
logging.debug("great success! frame complete and sane, lets decode")
self.decode()
self.frame_buffer = []
if self._new_data_callback is not None:
self._new_data_callback()
def ncallback(self, sender: int, data: bytearray):
logging.error(f"--> NEW PACKAGE! lenght: {len(data)}")
logging.error("ncallback(): data")
logging.error(data)
self.assemble_frame(data)
def crc(self, arr: bytearray, length: int) -> int:
crc = 0
for a in arr[:length]:
crc = crc + a
return crc.to_bytes(2, "little")[0]
async def write_register(
self, address, vals: bytearray, length: int, bleakC: BleakClient
):
frame = bytearray(20)
frame[0] = 0xAA # start sequence
frame[1] = 0x55 # start sequence
frame[2] = 0x90 # start sequence
frame[3] = 0xEB # start sequence
frame[4] = address # holding register
frame[5] = length # size of the value in byte
frame[6] = vals[0]
frame[7] = vals[1]
frame[8] = vals[2]
frame[9] = vals[3]
frame[10] = 0x00
frame[11] = 0x00
frame[12] = 0x00
frame[13] = 0x00
frame[14] = 0x00
frame[15] = 0x00
frame[16] = 0x00
frame[17] = 0x00
frame[18] = 0x00
frame[19] = self.crc(frame, len(frame) - 1)
logging.debug("Write register: ", frame)
await bleakC.write_gatt_char(CHAR_HANDLE, frame, False)
async def request_bt(self, rtype: str, client):
timeout = time()
while self.waiting_for_response != "" and time() - timeout < 10:
await asyncio.sleep(1)
logging.debug(self.waiting_for_response)
if rtype == "cell_info":
cmd = COMMAND_CELL_INFO
self.waiting_for_response = "cell_info"
elif rtype == "device_info":
cmd = COMMAND_DEVICE_INFO
self.waiting_for_response = "device_info"
else:
return
await self.write_register(cmd, b"\0\0\0\0", 0x00, client)
def get_status(self):
if "settings" in self.bms_status and "cell_info" in self.bms_status:
return self.bms_status
else:
return None
def connect_and_scrape(self):
asyncio.run(self.asy_connect_and_scrape())
# self.bt_thread
async def asy_connect_and_scrape(self):
logging.debug(
"--> asy_connect_and_scrape(): Connect and scrape on address: "
+ self.address
)
self.run = True
while self.run and self.main_thread.is_alive(): # autoreconnect
client = BleakClient(self.address)
logging.debug("--> asy_connect_and_scrape(): btloop")
try:
logging.debug("--> asy_connect_and_scrape(): reconnect")
await client.connect()
self.bms_status["model_nbr"] = (
await client.read_gatt_char(MODEL_NBR_UUID)
).decode("utf-8")
await client.start_notify(CHAR_HANDLE, self.ncallback)
await self.request_bt("device_info", client)
await self.request_bt("cell_info", client)
# await self.enable_charging(client)
# last_dev_info = time()
while client.is_connected and self.run and self.main_thread.is_alive():
await asyncio.sleep(0.01)
except Exception as err:
self.run = False
logging.info(
f"--> asy_connect_and_scrape(): error while connecting to bt: {err}"
)
finally:
self.run = False
if client.is_connected:
try:
await client.disconnect()
except Exception as err:
logging.info(
f"--> asy_connect_and_scrape(): error while disconnecting: {err}"
)
logging.info("--> asy_connect_and_scrape(): Exit")
def start_scraping(self):
self.main_thread = threading.current_thread()
if self.is_running():
logging.info("screaping thread already running")
return
self.bt_thread.start()
logging.info(
"scraping thread started -> main thread id: "
+ str(self.main_thread.ident)
+ " scraping thread: "
+ str(self.bt_thread.ident)
)
def stop_scraping(self):
self.run = False
stop = time()
while self.is_running():
sleep(0.1)
if time() - stop > 10:
return False
return True
def is_running(self):
return self.bt_thread.is_alive()
async def enable_charging(self, c):
# these are the registers for the control-buttons:
# data is 01 00 00 00 for on 00 00 00 00 for off;
# the following bytes up to 19 are unclear and changing
# dynamically -> auth-mechanism?
await self.write_register(0x1D, b"\x01\x00\x00\x00", 4, c)
await self.write_register(0x1E, b"\x01\x00\x00\x00", 4, c)
await self.write_register(0x1F, b"\x01\x00\x00\x00", 4, c)
await self.write_register(0x40, b"\x01\x00\x00\x00", 4, c)
if __name__ == "__main__":
import sys
jk = Jkbms_Brn(sys.argv[1])
if not jk.test_connection():
logging.error(">>> ERROR: Unable to connect")
else:
jk.start_scraping()
while True:
logging.debug(jk.get_status())
sleep(5) |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Unfortunately the pictures were not attached to GitHub via mail. |
I searched for temperature values from |
Any progress on fixing this issue? I am putting a battery system together for a RV build and just found out this awesome project, installed it on the Cerbo GX and everything seems to be working, but I have a jk-b2a8s20p 11.XW BMS which has this MOSFET temperature reading 0 issue. Coding is not really my forte since I am a hardware guy, but I know my way around the Linux, I can help troubleshooting if needed, just need the direction. Thanks! |
Hi, just found following: |
Changed to 112 instead of 134 for temperature_mos… |
Thank you! @jensbehrens I followed your lead, changed 134 to 112 in jkbms_brn.py, and voila, the MOSFET temperature shows up. |
Would be interesting of this works also for hardware version 10. I will add this in the meanwhile for version 11. |
In https://github.com/syssi/esphome-jk-bms/blob/main/components/jk_bms_ble/jk_bms_ble.cpp#LL555C1-L555C119 they do a check for 32S frame (line 554) and use 112, in other cases (line 587) 134 is used for the mos temp. If I understand the code correctly… |
Could you please try with this file? https://github.com/mr-manuel/venus-os_dbus-serialbattery/blob/dev/etc/dbus-serialbattery/bms/jkbms_brn.py |
Yes, seems to work fine for me 👍 |
I found another bug in the code where for some 11.* JKBMS no values were shown. Since I have to change the check if the data structure is 16s or 32s I need someone with a 10.* JKBMS connected over Bluetooth. Can someone with this requisite contact me on Discord? |
Made the change per your instruction and it seems the problem is fixed. Thank you very much! |
My hardware version is JKBMS 11.XW 8 Cells (20221225) |
Can this dbus driver be used to turn the JKBMS’s charge and discharge on and off, through the remote console or the config.ini file? Or I will have to do it on JKBMS’ app? Sorry I understand this is more of a support question and I am hijacking the thread here, but I would be very much appreciated if someone knowledgeable can answer it quickly. Thanks! |
Tecnically it's possible over Bluetooth but not implemented yet. |
Sorry that i couldn't be helpful in this issue - I'm too busy at the moment. But it's very nice to see that you got this fixed! @mr-manuel your enhancements of the bluetooth-functionality and the dbus-serialbattery brought great progress! From this perspective i'm now quite happy, that i killed the wired interface of my jkbms not even a year ago :D |
Yeah, all started with your defective serial port. Great that it happened :-D |
Hi @mr-manuel, is this issue considered fixed and closed? Or you will further improve it to accommodate different versions of JKBMS, 8 cells, 16 cells, etc. As you know, the v1.0.20231102dev nightly doesn’t work on my 8 cells JK-B2A8S20P BMS without the fix in jkbms_brn.py. Thank you very much! |
The fix for your BMS will be included in the next merge. |
@mr-manuel I also tested the latest nightly build v1.0.20231103dev with my JKBMS 11.XW 4 cells (20230527). Line 168 in jkbms_brn.py is changed to
|
Please set the logging to debug and post the logs again. Add |
@mr-manuel Here are the first 10 seconds after driver start: Log
|
Today I had the same Problem that all main Parameters are Zeros. So I installed the Nightly Build and this fixed my problem too. What I also observed (before the update), the cycles count was very high (54000) and not stable it goes up and down all the time. I think the bug will happened, because my Battery is in the garage and now the temperatures outside going down. So this will happen by other JK-BMS Bluetooth users as well. @mr-manuel thank you very much for fixing this issue 😃 |
The reason why you cycles count was high because it is displaying the
voltage there.
I had the same issue if you look at my screenshots.
Op za 11 nov. 2023 12:39 schreef Bjoern ***@***.***>:
… Today I had the same Problem that all main Parameters are Zeros.
[image: Screenshot 2023-11-11 at 10 23 16]
<https://user-images.githubusercontent.com/506641/282239176-49a75e4c-d096-439b-8a2f-c1b58c8dc19d.png>
So I installed the Nightly Build and this fixed my problem too.
[image: Screenshot 2023-11-11 at 12 28 33]
<https://user-images.githubusercontent.com/506641/282239100-59606a1a-306c-4c07-983e-aed24b9343c6.png>
What I also observed (before the update), the cycles count was very high
(54000) and not stable it goes up and down all the time.
I think the bug will happened, because my Battery is in the garage and now
the temperatures outside going down. So this will happen by other JK-BMS
Bluetooth users as well.
@mr-manuel <https://github.com/mr-manuel> thank you very much for fixing
this issue 😃
—
Reply to this email directly, view it on GitHub
<#716 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APTUHJKS535ECMYI44UWSTLYD5PV5AVCNFSM6AAAAAAZJK7N36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWG44TGMBWGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@mr-manuel Could you find anything in my log? |
@drago-more sorry I'm pretty busy at the moment. In the meanwhile could you try to change
to if 1 == 1: then check, if now all data is shown correctly, After change it to if 1 != 1: Please report back which one works for you. You have to run |
@mr-manuel Easy, no stress! 😉 What works for me is
It shows all values incl. the MOSFET temperature. Thus the issue seems to be with the |
Could you all please test the latest nightly and check, if it works for you? |
Works for JKBMS 11.XW, 4 cells. 👍 |
What is the proper way to update to the latest nightly? I installed the latest nightly on my Cerbo GX without uninstalling the existing driver first, it didn’t work, I had to uninstall the existing driver then install the new one to make it work, is it the correct procedure? |
You can just execute the |
Hi @mr-manuel, I had to reboot twice for my jkbms to display all the parameters in my case, the first reboot only shows the voltage I remember. I have since done an uninstall first and then the install, then everything seems to work fine. One additional question, is there option to set balancing start voltage in this driver? Say, I want the jkbms to balance cells only above certain voltage. Thanks! |
No, you can only set the balancing voltage through the JKBMS app, since this is not something you need at a daily base. You set it once and forget about it, until you optimized your system. |
Got it. Thank you! @mr-manuel |
* Update reinstall-local.sh: Fixed charge current parameter Update reinstall-local.sh: Corrected charge current parameter for initial config.ini * Exclude devices from driver startup This prevents blocking the serial port * implement callback function for update * fix comments to reflect new logic * update changelog * set soc=100% when charge mode changes to float, apply exponential smoothing on current readout * remove scan for devices the scan for devices and check if the BMS to test is present doesn't add value if the device is not within range (or the MAC is wrong), then the subsequent start_scraping call will either fail or fail to produce usable data * JKBMS_BLE driver fixes * added Bluetooth signal strenght, increased debug * Optimized reinstallation procedure - Changed: Optimized restart sequence for the bluetooth installation - Changed: Run serial part first and then bluetooth part. This allows the serial driver to get operative faster - Removed: $DRIVERNAME variable for clearer paths - Removed: Bluetooth system driver restart, since the devices get disconnected by the service before starting the dbus-serialbatterydriver * Improved Jkbms_Ble error handling * optimized disable procedure * small fixes * save custom name and make it restart persistant #100 * changed unique identifier from string to function function can be overridden by BMS battery class * fix typo * fix Sinowealth not loading #702 * fix unique identifier function * enable BMS over config, if disabled by default Now you can also add more then one BMS for BMS_TYPE * show battery port in log * ANT BMS fixes Fixed that other devices are recognized as ANT BMS * Sinowealth BMS fixes Fixed that other devices are recognized as Sinowealth BMS * improved publish_battery error handling switched from error count to seconds * Improve Battery Voltage Handling in Linear Absorption Mode * Refactor change time() to int(time()) for consistency in max_voltage_start_time and tDiff calculation * Refactor battery voltage calculations for efficiency and clarity * Remove penalty_buffer * Reset max_voltage_start_time wenn we going to bulk(dynamic) mode * updated changelog * fix reply processing * Reduce the big inrush current, if the CVL jumps from Bulk/Absorbtion to Float fix #659 * Check returned data lenght for Seplos BMS Be stricter about the return data we accept, might fix the problem of grid meters accidently being recognized as a Seplos * Validate current, voltage, capacity and SoC for all BMS This prevents that a device, which is no BMS, is detected as BMS * removed double check * bump version * fix validation if None * updated changelog * proposal to #659 formatted :) * bugfix proposal to #659 * refactor setting float charge_mode * fix type error, removed bluetooth cronjob * updated changelog * fix rs485 write communication errors by inserting sleeps, add debug print for charge mode and fix crash on write soc failures * fix write problem on set_soc. also changed the switch charge/discharge function, just in case * debug msg * Bluetooth optimizations * Fixes by @peterohman #505 (comment) * fix #712 * fix meaningless time to go values * fix meaningless time to go values * Duration of transition to float depends on number of cells * Float transition - Voltage drop per second * Update hlpdatabms4s.py * Validate setting of FLOAT_CELL_VOLTAGE and avoid misconfiguration * consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL * cleanup * consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL * small refactor, introduced set_cvl_linear function to set CVL only once every LINEAR_RECALCULATION_EVERY seconds * fix typo * updated changelog * remove debug msg * remove debug msg * undo debug change * Daly BMS make auto reset soc configurable * added debug and error information for CVL * fix proposal for #733 (#735) * Added: Tollerance to enter float voltage once the timer is triggered * Add bulk voltage Load to bulk voltage every x days to reset the SoC to 100% for some BMS * JKBMS disable high voltage warning on bulk reenable after bulk was completed * fixed error * disable high voltage warning for all BMS when charging to bulk voltage * fix error and change default value measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept * Added temperature names to dbus/mqtt * Use current avg of last 300 cycles for TTG & TTS * Calculate only positive Time-to-SoC points * added current average of last 5 minutes * make CCL and DCL more clear * fix small error * bugfix: LLTJBD BMS SOC different in Xiaoxiang app and dbus-serialbattery * black formatting * JDB BMS - Control FETs for charge, discharge and disable / enable balancer (#761) * feature: Allow to control charge / discharge FET * feature: Allow to enable / disable balancer * bugfix: Cycle Capacity is in 10 mAh Fixes SoC with factor 100 * 100% percentage * JBD BMS show balancer state in GUI page IO (#763) * Bump version * Fix typos * Smaller fixes - fixes #792 (comment) * Removed comments from utils.py This should make more clear that there are no values to change * Updated changelog * possible fix for LLT/JBS connection problems #769 #777 * bugfix: LLT/JBD BMS general packet data size check * improved reinstall and disable script * LLT/JBD BMS - Improved error handling and automatical driver restart in case of error. Should fix: - #730 - #769 - #777 * Fixed Building wheel for dbus-fast won't finish on weak systems Fixes #785 * Support for Daly CAN Bus (#169) * support for Daly CAN Bus * fix constructor args * revert port, needs fix * add can filters * comment logger Some changes are still needed to work with the latest version. They will follow in a next PR. --------- Co-authored-by: Samuel Brucksch <[email protected]> Co-authored-by: Manuel <[email protected]> * JKBMS BLE - Introduction of automatic SOC reset (HW Version 11) (#736) * Introduction of automatic SOC reset for JK BMS (HW Version 11) * Fixed value mapping * Rework of the code to make it simpler to use without additional configuration. Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition". * Implementation of suggested changes Persist initial BMS OVP and OVPR settings Make use of max_cell_voltage to calculate trigger value for OVP alert * Added: Daly CAN and JKBMS CAN * added CAN bms to installation script optimized CAN drivers * smaller fixes * Trigger JK BLE SOC reset when using Step Mode * Moved trigger_soc_reset() * fixes LLT/JBD SOC > 100% #769 * changed VOLTAGE_DROP behaviour * Fix JKBMS not starting if BMS manuf. date is empty * corrected bulk, absorption and soc reset terms * fix typo * add JKBMS_BLE debugging data * fix small error * added logging to config * add sleep before starting driver prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before * changed post install info * fix error * Daly BMS fixed embedded null byte #837 * added info for SoC reset to default config file * fix for #716 #716 * fix for #716 and JKBMS model recognition #716 * optimized logging * fix JKBMS recognition * added debugging * fixes #716 #716 --------- Co-authored-by: Holger Schultheiß <[email protected]> Co-authored-by: Stefan Seidel <[email protected]> Co-authored-by: Bernd Stahlbock <[email protected]> Co-authored-by: seidler2547 <[email protected]> Co-authored-by: ogurevich <[email protected]> Co-authored-by: wollew <[email protected]> Co-authored-by: Oleg Gurevich <[email protected]> Co-authored-by: peterohman <[email protected]> Co-authored-by: Strawder, Paul <[email protected]> Co-authored-by: Paul Strawder <[email protected]> Co-authored-by: Samuel Brucksch <[email protected]> Co-authored-by: Samuel Brucksch <[email protected]> Co-authored-by: ArendsM <[email protected]> Co-authored-by: Meik Arends <[email protected]>
Hi @mr-manuel, has this fix been committed to the latest release in the main branch? I lost track of it since I accidentally damage my JKBMS, I since bought a new one, exactly the same one from JK, installed the latest driver by selecting option 1, but the “MOSFET temperature” is still showing 0. I tried to modify the jkbms_brn.py the way you told me before, but I couldn’t find the line with code “ if fb[70] == 255 and fb[71] == 255: ” anymore. Any inside on how the fix the issue? My new JKBMS is also a 8-cell with 11.XW hardware version, exactly the same as my old BMS. Thank you very much! |
Install the latest |
Yep, the latest dev version of the nightly works. Thanks! |
* fix Sinowealth not loading #702 * fix unique identifier function * enable BMS over config, if disabled by default Now you can also add more then one BMS for BMS_TYPE * show battery port in log * ANT BMS fixes Fixed that other devices are recognized as ANT BMS * Sinowealth BMS fixes Fixed that other devices are recognized as Sinowealth BMS * improved publish_battery error handling switched from error count to seconds * Improve Battery Voltage Handling in Linear Absorption Mode * Refactor change time() to int(time()) for consistency in max_voltage_start_time and tDiff calculation * Refactor battery voltage calculations for efficiency and clarity * Remove penalty_buffer * Reset max_voltage_start_time wenn we going to bulk(dynamic) mode * updated changelog * fix reply processing * Reduce the big inrush current, if the CVL jumps from Bulk/Absorbtion to Float fix #659 * Check returned data lenght for Seplos BMS Be stricter about the return data we accept, might fix the problem of grid meters accidently being recognized as a Seplos * Validate current, voltage, capacity and SoC for all BMS This prevents that a device, which is no BMS, is detected as BMS * removed double check * bump version * fix validation if None * updated changelog * proposal to #659 formatted :) * bugfix proposal to #659 * refactor setting float charge_mode * fix type error, removed bluetooth cronjob * updated changelog * fix rs485 write communication errors by inserting sleeps, add debug print for charge mode and fix crash on write soc failures * fix write problem on set_soc. also changed the switch charge/discharge function, just in case * debug msg * Bluetooth optimizations * Fixes by @peterohman #505 (comment) * fix #712 * fix meaningless time to go values * fix meaningless time to go values * Duration of transition to float depends on number of cells * Float transition - Voltage drop per second * Update hlpdatabms4s.py * Validate setting of FLOAT_CELL_VOLTAGE and avoid misconfiguration * consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL * cleanup * consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL * small refactor, introduced set_cvl_linear function to set CVL only once every LINEAR_RECALCULATION_EVERY seconds * fix typo * updated changelog * remove debug msg * remove debug msg * undo debug change * Daly BMS make auto reset soc configurable * added debug and error information for CVL * fix proposal for #733 (#735) * Added: Tollerance to enter float voltage once the timer is triggered * Add bulk voltage Load to bulk voltage every x days to reset the SoC to 100% for some BMS * JKBMS disable high voltage warning on bulk reenable after bulk was completed * fixed error * disable high voltage warning for all BMS when charging to bulk voltage * fix error and change default value measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept * Added temperature names to dbus/mqtt * Use current avg of last 300 cycles for TTG & TTS * Calculate only positive Time-to-SoC points * added current average of last 5 minutes * make CCL and DCL more clear * fix small error * bugfix: LLTJBD BMS SOC different in Xiaoxiang app and dbus-serialbattery * black formatting * JDB BMS - Control FETs for charge, discharge and disable / enable balancer (#761) * feature: Allow to control charge / discharge FET * feature: Allow to enable / disable balancer * bugfix: Cycle Capacity is in 10 mAh Fixes SoC with factor 100 * 100% percentage * JBD BMS show balancer state in GUI page IO (#763) * Bump version * Fix typos * Smaller fixes - fixes #792 (comment) * Removed comments from utils.py This should make more clear that there are no values to change * Updated changelog * possible fix for LLT/JBS connection problems #769 #777 * bugfix: LLT/JBD BMS general packet data size check * improved reinstall and disable script * LLT/JBD BMS - Improved error handling and automatical driver restart in case of error. Should fix: - #730 - #769 - #777 * Fixed Building wheel for dbus-fast won't finish on weak systems Fixes #785 * Support for Daly CAN Bus (#169) * support for Daly CAN Bus * fix constructor args * revert port, needs fix * add can filters * comment logger Some changes are still needed to work with the latest version. They will follow in a next PR. --------- Co-authored-by: Samuel Brucksch <[email protected]> Co-authored-by: Manuel <[email protected]> * JKBMS BLE - Introduction of automatic SOC reset (HW Version 11) (#736) * Introduction of automatic SOC reset for JK BMS (HW Version 11) * Fixed value mapping * Rework of the code to make it simpler to use without additional configuration. Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition". * Implementation of suggested changes Persist initial BMS OVP and OVPR settings Make use of max_cell_voltage to calculate trigger value for OVP alert * Added: Daly CAN and JKBMS CAN * added CAN bms to installation script optimized CAN drivers * smaller fixes * Trigger JK BLE SOC reset when using Step Mode * Moved trigger_soc_reset() * fixes LLT/JBD SOC > 100% #769 * changed VOLTAGE_DROP behaviour * Fix JKBMS not starting if BMS manuf. date is empty * corrected bulk, absorption and soc reset terms * fix typo * add JKBMS_BLE debugging data * fix small error * Some changes for lost bluetooth connection / hci_uart stack restart * added logging to config * add sleep before starting driver prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before * changed post install info * fix error * Daly BMS fixed embedded null byte #837 * added info for SoC reset to default config file * fix for #716 #716 * fix for #716 and JKBMS model recognition #716 * optimized logging * fix JKBMS recognition * added debugging * fixes #716 #716 * Bind device instance to unique_identifier #718 * added data types to battery class disabled unused variables * save current charge state #840 * correct file permissions * updated changelog * added periodic saveChargeDetails * fix some small errors * fix issue with ruuvi tags When there are hundreds of unused ruuvi tags in the settings list that where added because thei where nearby the driver does not start correctly. These stale entries are disabled on the driver startup. The issue was already filed to Victron developers * CVL with i-controller instead of penaltysum * cvl_controller: switch to choose PenaltySum or ICOntroller + documentation * docu enhancement * Add setting and install logic for usb bluetooth module * round temperatures * changed battery disconnect behaviour * Fixes #891 #891 * updated changelog * Add bluetooth device note to config.default.ini * Fix typo in bluetooth note in config.default.ini * fixed error in new cvl_controller * fixed float division by zero and code optimization * Restart MAX_VOLTAGE_TIME_SEC if cell diff > CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART * Calculation of the SOC based on coloumb-counting (#868) * Calculation of the SOC in the driver based on coloumb-counting * soc_calc: add current correction before integration * soc_calc: correction map for current * Soc_calc: CorrectionMap, switch to turn on/off correction, selectable initial value * soc_calc: Bugfix * soc_calc: Bugfix * store soc in dbus for restart * store soc in dbus for restart (formatted) * store soc in dbus for restart (bugfix) * save soc_calc only after change > 1.0 * store soc in dbus for restart (bugfix) * logger does not work this way. do not know why * writing and reading to dbus works * Removed options: SOC_CALC_CURRENT_CORRECTION, SOC_CALC_RESET_VALUE_ON_RESTART, SOC_CALC_INIT_VALUE sort soc_calc alphabetically * fixed comments * Updated changelog, small fixes * Changed: PUBLISH_CONFIG_VALUES from 0/1 to True/False * Changed: Code optimizations - Changed some variables to be more clear - Added comments for easier code understanding * Calculated SOC: Added two decimals, added BMS SOC for MQTT & Node-RED * Updated changelog, small fixes * Changed: PUBLISH_CONFIG_VALUES from 0/1 to True/False * Changed: Code optimizations - Changed some variables to be more clear - Added comments for easier code understanding * Calculated SOC: Added two decimals, added BMS SOC for MQTT & Node-RED * Fix #898 #898 * Changed: Fix issue loading settings from dbus * Added nightly install option makes it easier for users to pretest fixes * Changed: more detailed error output when an exception happens * Possible fix for #912 #912 * Fixes #919 #919 * Changed: Exit script with error, if port excluded else the serialstarter stops at the dbus-serialbattery * Fixed some smaller errors * Updated pre-release workflow * Fix JK BMS connection restart when bluetooth fails. This fix installs a new thread to monitor the state of the original scraping thread. If scraping thread dies, it verifies that it did not because the scraping was intentionally stopped by calling stop_scrapping. When restarting the scrapper, it first calls the bluetooth reset lambda function that was passed in the class contructor, such that bluetooth is ready to make a proper connection. * Fixes #916 #916 * Added Venus OS version to logfile * Fix #840 #840 * Small code formatting fixes * Optimized reinstall script. Restart GUI only on changes. * Display debugging data in GUI when DEBUG enabled * Install script now shows repositories and version numbers * Update daly_can.py Fixing #950 for DalyBMS * Update jkbms_can.py Fixing #950 for Jk BMS * Fix black lint check * Fixes #970 #970 * Fixed some errors in restoring values from dbus settings * Moved sleep on start for all BMS * Update config description * Reworked a part of the default config * fix typo in stopping services when reinstalling * Fix Time-to-SoC and Time-to-Go calculation * Add changelog info * Round sum and diff voltage * Temperature limitation variables where changed * SoC limitation variables where changed * Added error messages * Remove unneeded code * Reset SoC to 0% if empty * Add GUIv2 for dbus-serialbattery * Check free space before installing * Added new GUIv2 version * Removed Python 2 compatibility * Changelog update * Code cleanup - Removed: get_temperatures() - Removed: update_last_seen() * Bluetooth code optimizations * Fixed some JKBMS BLE not starting #819 * Check if packages are already installed before install * Fixed some SOC calculation errors * Fixed None SOC on driver start * Do not show and allow button change when callback is missing for: - ForceChargingOff - ForceDischargingOff - TurnBalancingOff * Check if a device instance is already used by creating a PID file * Log and execute SOC reset to 100% or 0% only once * Update GitHub workflow and issue templates * Fixed LLT/JBD BMS with only on temperature sensor #791 #971 * Fix warning on reinstall * Fix missing IO control for JBDBMS #992 #992 * Prepare for removing dev branch --------- Co-authored-by: ogurevich <[email protected]> Co-authored-by: Bernd Stahlbock <[email protected]> Co-authored-by: wollew <[email protected]> Co-authored-by: Oleg Gurevich <[email protected]> Co-authored-by: peterohman <[email protected]> Co-authored-by: Strawder, Paul <[email protected]> Co-authored-by: Paul Strawder <[email protected]> Co-authored-by: Samuel Brucksch <[email protected]> Co-authored-by: Samuel Brucksch <[email protected]> Co-authored-by: ArendsM <[email protected]> Co-authored-by: Meik Arends <[email protected]> Co-authored-by: Marvo2011 <[email protected]> Co-authored-by: cflenker <[email protected]> Co-authored-by: cflenker <[email protected]> Co-authored-by: Cupertino Miranda <[email protected]> Co-authored-by: Martin Polehla <[email protected]>
Describe the bug
I use the nightly build DEV branch with both JK BMS'ses on bluetooth. So far they connect good and all the values are displayed.
Exccept for the MOSFET Temp of one of the newer JK BMS'ses.
I have 1 BMS with firmware version 10.XW 16 cells and 1 with firmware version 11.XW. The one with 11.ZW does display the MOSFET temp in the JKBMS app but not in this driver. The MOSFET temp of the 10.XW is displayed in the app and also this driver.
Maybe the driver gets the information of the 11.XW on a different scheme so that the values are misplaced.
How to reproduce
Always not displayed
Expected behavior
MOSFET Temp not 0 degrees in the Remote Console / MQTT values
Driver version
1.0.20230613dev
Venus OS device type
Venus_GX
Venus OS version
2.92
BMS type
JKBMS / Heltec BMS
Cell count
16
Connection type
Bluetooth
Config file
Relevant log output
Any other information that may be helpful
No response
The text was updated successfully, but these errors were encountered: