Skip to content

Commit

Permalink
Merge pull request #796 from mr-manuel/dev
Browse files Browse the repository at this point in the history
Changes 2023.09.04
  • Loading branch information
mr-manuel committed Sep 4, 2023
2 parents f07d953 + 54055b1 commit 251dcc3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 174 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
* Added: Bluetooth: Show signal strength of BMS in log by @mr-manuel
* Added: Create unique identifier, if not provided from BMS by @mr-manuel
* Added: Current average of the last 5 minutes by @mr-manuel
* Added: Daly BMS: Auto reset SoC when changing to float (can be turned off in the config file) by @transistorgit
* Added: Daly BMS - Auto reset SoC when changing to float (can be turned off in the config file) by @transistorgit
* Added: Exclude a device from beeing used by the dbus-serialbattery driver by @mr-manuel
* Added: Implement callback function for update by @seidler2547
* Added: JKBMS BLE - Show last five characters from the MAC address in the custom name (which is displayed in the device list) by @mr-manuel
* Added: LLT/JBD BMS - Discharge / Charge Mosfet and disable / enable balancer switching over remote console/GUI with https://github.com/Louisvdw/dbus-serialbattery/pull/761 by @idstein
* Added: LLT/JBD BMS - Show balancer state in GUI under the IO page with https://github.com/Louisvdw/dbus-serialbattery/pull/763 by @idstein
* Added: Load to bulk voltage every x days to reset the SoC to 100% for some BMS by @mr-manuel
* Added: Save custom name and make it restart persistant by @mr-manuel
* Added: Temperature names to dbus and mqtt by @mr-manuel
Expand All @@ -24,6 +26,8 @@
* Changed: Improved battery voltage handling in linear absorption mode by @ogurevich
* Changed: Improved driver reinstall when multiple Bluetooth BMS are enabled by @mr-manuel
* Changed: Improved Jkbms_Ble driver by @seidler2547 & @mr-manuel
* Changed: LLT/JBD - Fix cycle capacity with https://github.com/Louisvdw/dbus-serialbattery/pull/762 by @idstein
* Changed: LLT/JBD BMS - SOC different in Xiaoxiang app and dbus-serialbattery with https://github.com/Louisvdw/dbus-serialbattery/pull/760 by @idstein
* Changed: Make CCL and DCL limiting messages more clear by @mr-manuel
* Changed: Reduce the big inrush current if the CVL jumps from Bulk/Absorbtion to Float https://github.com/Louisvdw/dbus-serialbattery/issues/659 by @Rikkert-RS & @ogurevich
* Changed: Time-to-Go and Time-to-SoC use the current average of the last 5 minutes for calculation by @mr-manuel
Expand Down
13 changes: 9 additions & 4 deletions etc/dbus-serialbattery/bms/lltjbd_ble.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import atexit
import functools
import threading
import sys
from asyncio import CancelledError
from typing import Union, Optional
from utils import logger
Expand Down Expand Up @@ -55,8 +56,14 @@ async def bt_main_loop(self):
self.device = await BleakScanner.find_device_by_address(
self.address, cb=dict(use_bdaddr=True)
)
except Exception as e:
logger.error(">>> ERROR: Bluetooth stack failed.", e)

except Exception:
exception_type, exception_object, exception_traceback = sys.exc_info()
file = exception_traceback.tb_frame.f_code.co_filename
line = exception_traceback.tb_lineno
logger.error(
f"Exception occurred: {repr(exception_object)} of type {exception_type} in {file} line #{line}"
)
self.device = None
await asyncio.sleep(0.5)

Expand Down Expand Up @@ -173,8 +180,6 @@ def read_serial_data_llt(self, command):


if __name__ == "__main__":
import sys

bat = LltJbd_Ble("Foo", -1, sys.argv[1])
if not bat.test_connection():
logger.error(">>> ERROR: Unable to connect")
Expand Down
5 changes: 5 additions & 0 deletions etc/dbus-serialbattery/reinstall-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ if [ "$length" -gt 0 ]; then
opkg update
opkg install python3-misc python3-pip
pip3 install bleak
# pip3 install bleak==0.20.2
# pip3 install bleak==0.21.0
pip3 install dbus-fast==1.87.0
# pip3 install dbus-fast==1.87.3
# pip3 install dbus-fast==1.87.4

echo "done."
echo
Expand Down

0 comments on commit 251dcc3

Please sign in to comment.