-
-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The driver finds and connects via Bluetooth to both my JK B2A8S30P bms, keeps the connection for more than 8 hours (up to 14 hours), then, for some reason, it disconnects, and sometimes the Bluetooth agent freezes, and I have to restart the Rpi to recover.
Have set BLUETOOTH_FORCE_RESET_BLE_STACK = True to restart the driver, but it does not.
How to reproduce
It is random, I can not reproduce it
Expected behavior
The driver restarts, so Bluetooth reconnects.
Installation method
Install script from the documentation
Driver version of the currently installed driver
Version: v2.1.x-dev
Driver version of the last known working driver
Version: v2.1.x-dev
Venus OS device type
Raspberry Pi 3
Venus OS version
3.66
Venus OS image type
Large
BMS type
JKBMS (Heltec BMS)
Cell count
4
Battery count
2
Connection type
Bluetooth
USB hub
No, the Serial USB adapter is connected directly to the Venus OS device
Config file
[DEFAULT]
; If you want to add custom values/settings, then check the values/settings you want to change in "config.defau>
; and insert them below to persist future driver updates.
; NOTICE: Do not copy the whole file, but only the values/settings you want to change.
; Example (remove the semicolon ";" to uncomment and activate the value/setting):
MAX_BATTERY_CHARGE_CURRENT = 140.0
MAX_BATTERY_DISCHARGE_CURRENT = 150.0
; Minimum voltage (can NOT be seen as cut-off voltage)
; Used to:
; - Ensures that the charge voltage limit (CVL) does not fall below the threshold if calculated dynam>
; - Set SOC to 0%, if SOC_CALCULATION is enabled
MIN_CELL_VOLTAGE = 2.900
; Maximum voltage (can be seen as bulk/absorption voltage)
; Used to;
; - Set the maximum charge voltage limit (CVL).
; - Set SOC to 100%, if SOC_CALCULATION is enabled
MAX_CELL_VOLTAGE = 3.450
; Float voltage (can be seen as resting voltage)
; Used to:
; - Set the maximum charging voltage (CVL) after the battery is fully charged
FLOAT_CELL_VOLTAGE = 3.375
; --------- Bluetooth BMS ---------
; +++ Bluetooth connections may be unstable on some systems. +++
; +++ For a stable connection, use the serial connection. +++
; Description:
; Specify the Bluetooth BMS and its MAC address that you want to use. Leave empty to disable.
; Available Bluetooth BMS:
; Jkbms_Ble, LiTime_Ble, LltJbd_Ble
; Example for one BMS:
; BLUETOOTH_BMS = Jkbms_Ble C8:47:8C:00:00:00
; Example for multiple BMS:
; BLUETOOTH_BMS = Jkbms_Ble C8:47:8C:00:00:00, Jkbms_Ble C8:47:8C:00:00:11, Jkbms_Ble C8:47:8C:00:00:22
BLUETOOTH_BMS = Jkbms_Ble C8:47:80:3A:DC:3F, Jkbms_Ble C8:47:80:3A:C0:55
; Force to use polling instead of active callbacks.
; Setting to False/True may help with unstable Bluetooth connections.
; False: Use active callbacks, if supported by the BMS
; True: Use polling
BLUETOOTH_USE_POLLING = True
; Try to reset the BLE stack if the connection is lost or a crash is detected.
BLUETOOTH_FORCE_RESET_BLE_STACK = True
; --------- Additional settings ---------
; Specify one or more BMS types (separated by a comma) to load, or leave empty to try to load all available.
;
; Available serial BMS:
; Daly, Daren485, Ecs, EG4_Lifepower, EG4_LL, Felicity, HeltecModbus, HLPdataBMS4S, Jkbms, Jkbms_pb, KS48>
; Disabled by default (just enter one or more to enable):
; ANT, MNB, Sinowealth
;
; Available CAN BMS:
; Daly_Can, Jkbms_Can, RV_C_Can, Ubms_Can
;
; Available Bluetooth BMS:
; Jkbms_Ble, Kilovault_Ble, LiTime_Ble, LltJbd_Ble
BMS_TYPE = Jkbms_Ble
; --------- BMS specific settings ---------
; -- Unique ID settings
; If you see "DRIVER STOPPED! Another battery with the same serial number/unique identifier" in the log, enab>
; Description:
; Some BMS versions do not provide a unique ID and do not allow setting a custom one.
; In such cases, you can use the port and address as the unique ID by setting this option to True.
; Note:
; VRM IDs and custom names may not be saved or restored correctly when using this option.
USE_PORT_AS_UNIQUE_ID = TrueRelevant log output
==> /data/log/dbus-blebattery.1/current <==
2025-11-13 22:19:27.353395500 INFO:SerialBattery: |- Device info MISSING
2025-11-13 22:19:27.353401500 INFO:SerialBattery: |- Cell info MISSING
2025-11-13 22:19:27.353404500 INFO:SerialBattery: |- Settings MISSING
2025-11-13 22:19:27.353407500 ERROR:SerialBattery:>>> No battery connection at Jkbms_Ble C8:47:80:3A:C0:55
2025-11-13 22:19:27.353438500 INFO:SerialBattery:Exit signal received, exiting gracefully...
2025-11-13 22:19:27.353442500 INFO:SerialBattery:Stopped dbus-serialbattery with exit code 1
2025-11-13 22:19:30.314735500 INFO:SerialBattery:
2025-11-13 22:19:30.315313500 INFO:SerialBattery:Starting dbus-serialbattery
2025-11-13 22:19:30.317464500 INFO:SerialBattery:Venus OS v3.66 (large) running on Raspberry Pi 3 Model B Rev 1.2
2025-11-13 22:19:30.317797500 INFO:SerialBattery:dbus-serialbattery v2.1.20251107dev
2025-11-13 22:19:30.580498500 INFO:SerialBattery:Init of Jkbms_Ble at C8:47:80:3A:C0:55
2025-11-13 22:19:30.805773500 INFO:SerialBattery:|- Try to connect to Jkbms_Ble at C8:47:80:3A:C0:55
2025-11-13 22:19:30.840907500 INFO:SerialBattery:Error while connecting to BLE client: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /data/apps/dbus-serialbattery/bms/jkbms_brn.py line #457
2025-11-13 22:19:30.843402500 INFO:SerialBattery:*** Restarting BLE hardware and Bluez driver ***
2025-11-13 22:19:30.850193500 INFO:SerialBattery:hciconfig exit code: 0
2025-11-13 22:19:30.850860500 INFO:SerialBattery:hciconfig output:
2025-11-13 22:19:30.885195500 INFO:SerialBattery:bluetoothctl list exit code: 0
2025-11-13 22:19:30.885846500 INFO:SerialBattery:bluetoothctl list output:
2025-11-13 22:19:30.919157500 INFO:SerialBattery:bluetooth stop exit code: 0
2025-11-13 22:19:30.919163500 INFO:SerialBattery:bluetooth stop output: Stopping bluetooth: bluetoothd.
2025-11-13 22:19:30.919168500
2025-11-13 22:19:30.965184500 INFO:SerialBattery:pkill exit code: 1
2025-11-13 22:19:30.965487500 INFO:SerialBattery:pkill output:
2025-11-13 22:19:30.972769500 INFO:SerialBattery:rfkill block exit code: 0
2025-11-13 22:19:30.973073500 INFO:SerialBattery:rfkill block output:
2025-11-13 22:19:31.016252500 INFO:SerialBattery:pkill hciattach exit code: 1
2025-11-13 22:19:31.016573500 INFO:SerialBattery:pkill hciattach output:
2025-11-13 22:19:31.582534500 INFO:SerialBattery:rmmod hci_uart exit code: 0
2025-11-13 22:19:31.582892500 INFO:SerialBattery:rmmod hci_uart output:
2025-11-13 22:19:31.662426500 INFO:SerialBattery:rmmod btbcm exit code: 0
2025-11-13 22:19:31.662763500 INFO:SerialBattery:rmmod btbcm output:
2025-11-13 22:19:31.701218500 INFO:SerialBattery:modprobe hci_uart exit code: 0
2025-11-13 22:19:31.701560500 INFO:SerialBattery:modprobe hci_uart output:
2025-11-13 22:19:31.711898500 INFO:SerialBattery:modprobe btbcm exit code: 0
2025-11-13 22:19:31.712226500 INFO:SerialBattery:modprobe btbcm output:
2025-11-13 22:19:33.719464500 INFO:SerialBattery:rfkill unblock exit code: 0
2025-11-13 22:19:33.719871500 INFO:SerialBattery:rfkill unblock output:
2025-11-13 22:19:33.752665500 INFO:SerialBattery:bluetooth start exit code: 0
2025-11-13 22:19:33.753043500 INFO:SerialBattery:bluetooth start output: Starting bluetooth: bluetoothd.
2025-11-13 22:19:33.753049500
2025-11-13 22:19:33.753410500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2025-11-13 22:19:33.753881500 INFO:SerialBattery:Exit driver for clean restartAny other information that may be helpful
No response
Please confirm that you have completed the following steps before submitting your support request
- I have carefully read all the instructions above including the descriptions.
- I have tried the
nightlybuild first, if I was not already using it. This means the logs I provide are from thenightlybuild. - I have rebooted at least once after I saw the issue.
- I have read the complete changelog.
- I have provided the logfiles in the correct format with a HUMAN READABLE timestamp by piping it through
tai64nlocal. - I have clicked all checkboxes because I did not read the instructions.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working