Louisvdw / dbus-serialbattery

Battery Monitor driver for serial battery in VenusOS GX systems
MIT License
492 stars 157 forks source link

JKBMS throws alarm #31 on latest nightly v1.4.20240629dev (mr-manuel's repo) #1089

Open rver2024 opened 2 days ago

rver2024 commented 2 days ago

Describe the problem

I haven't had time to play with the dbus-serialbattery driver for a bit until recently, I installed the latest nightly v1.4.20240629dev from mr-manuel's repo, and there is a notification about JKBMS alarm #31 which I didn't see before, and I couldn't find anything about this alarm by searching the internet. The JKBMS seems to be working fine otherwise. Anyone else has this alarm?

Please help advise if you know something about this #31 alarm. Thanks a lot!

Driver version

v1.4.20240629dev

Venus OS device type

Cerbo GX

Venus OS version

v3.14

BMS type

JKBMS / Heltec BMS

Cell count

8

Battery count

8

Connection type

Bluetooth

Config file

[DEFAULT]

; If you want to add custom values/settings, then check the values/settings you want to change in "config.default.ini"
; and insert them below to persist future driver updates.

; Example (remove the semicolon ";" to uncomment and activate the value/setting):
MAX_BATTERY_CHARGE_CURRENT = 100.0
MAX_BATTERY_DISCHARGE_CURRENT = 150.0
BLUETOOTH_BMS = Jkbms_Ble C8:47:80:xx:xx:xx
BMS_TYPE = Jkbms
MIN_CELL_VOLTAGE = 2.900
MAX_CELL_VOLTAGE = 3.600
FLOAT_CELL_VOLTAGE = 3.320

; Set steps to reduce battery current
; The current will be changed linear between those steps if LINEAR_LIMITATION_ENABLE is set to True
;CELL_VOLTAGES_WHILE_CHARGING   = 3.62, 3.55, 3.50, 3.30
;MAX_CHARGE_CURRENT_CV_FRACTION =    0, 0.05,  0.5,    1

;CELL_VOLTAGES_WHILE_DISCHARGING   = 3.15, 3.20, 3.25, 3.30
;MAX_DISCHARGE_CURRENT_CV_FRACTION =    0,  0.1,  0.5,    1

;LOGGINIG = DEBUG
; Charge current SoC limits
CC_SOC_LIMIT1 = 98
CC_SOC_LIMIT2 = 95
CC_SOC_LIMIT3 = 91

; Charge current limits
CC_CURRENT_LIMIT1_FRACTION = 0.1
CC_CURRENT_LIMIT2_FRACTION = 0.5
CC_CURRENT_LIMIT3_FRACTION = 0.8

CELL_VOLTAGES_WHILE_CHARGING   = 3.62, 3.55, 3.50, 3.35
MAX_CHARGE_CURRENT_CV_FRACTION =    0, 0.05,  0.5,    1

CELL_VOLTAGES_WHILE_DISCHARGING   = 3.20, 3.22, 3.23, 3.24
MAX_DISCHARGE_CURRENT_CV_FRACTION =    0,  0.5,  0.7,    1

; Discharge current SoC limits
DC_SOC_LIMIT1 = 10
DC_SOC_LIMIT2 = 20
DC_SOC_LIMIT3 = 30

; Discharge current limits
DC_CURRENT_LIMIT1_FRACTION = 0.0
DC_CURRENT_LIMIT2_FRACTION = 0.0
DC_CURRENT_LIMIT3_FRACTION = 0.5

Relevant log output

2024-07-02 13:47:29.144884500 Starting bluetooth: bluetoothd.
2024-07-02 13:47:29.161017500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-02 13:47:31.182986500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakDBusError('org.freedesktop.DBus.Error.AccessDenied', 'Client tried to send a message other than Hello without being registered') of type <class 'bleak.exc.BleakDBusError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-07-02 13:47:31.183809500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-07-02 13:47:31.188014500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-07-02 13:47:33.271289500 Starting bluetooth: bluetoothd.
2024-07-02 13:47:33.287266500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-02 13:47:35.309461500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakDBusError('org.freedesktop.DBus.Error.AccessDenied', 'Client tried to send a message other than Hello without being registered') of type <class 'bleak.exc.BleakDBusError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-07-02 13:47:35.310782500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-07-02 13:47:35.315089500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered

Any other information that may be helpful

No response

mr-manuel commented 2 days ago

This alarm is only to report, that you should check the logs, but you did not attach the logs. Anyway, you should not see only error #31 but also config error. Therefore you have an error in your config.ini.

rver2024 commented 2 days ago

I checked the log (/data/log/dbus-blebattery.0/current) and found that the debus-serialbattery driver won't connect to JKBMS, saying no BMS found at the mac address which is correct. I think if I leave it long enough it will eventually connect. Some previous version connects quicker but will eventually drops off, some versions I tried before can keep the connection much longer than others but unfortunately I didn't keep a log of which version is the best. Anyway, here are logs:

2024-06-30 19:04:57.173805500 INFO:Bluetooth details
2024-06-30 19:04:57.195784500 No default controller available
2024-06-30 19:05:02.231423500
2024-06-30 19:05:03.522090500 INFO:SerialBattery:
2024-06-30 19:05:03.523094500 INFO:SerialBattery:Starting dbus-serialbattery
2024-06-30 19:05:03.525355500 INFO:SerialBattery:Venus OS v3.14
2024-06-30 19:05:03.526028500 INFO:SerialBattery:dbus-serialbattery v1.4.20240629dev
2024-06-30 19:05:19.964603500 INFO:SerialBattery:Init of Jkbms_Ble at C8:47:80:xx:xx:xx
2024-06-30 19:05:19.965345500 INFO:SerialBattery:Test of Jkbms_Ble at C8:47:80:xx:xx:xx
2024-06-30 19:05:20.401426500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-06-30 19:05:20.402242500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-06-30 19:05:20.406744500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-06-30 19:05:22.482389500 Starting bluetooth: bluetoothd.
2024-06-30 19:05:22.498992500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-06-30 19:05:24.536178500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-06-30 19:05:24.536952500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-06-30 19:05:24.540415500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-06-30 19:05:26.622682500 Starting bluetooth: bluetoothd.
2024-06-30 19:05:26.640278500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-06-30 19:05:28.676824500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-06-30 19:05:28.677794500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-06-30 19:05:28.681648500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-06-30 19:05:29.479828500 ERROR:SerialBattery:No BMS found at C8:47:80:xx:xx:xx
2024-06-30 19:05:29.480571500 ERROR:SerialBattery:ERROR >>> No battery connection at Jkbms_Ble
2024-06-30 19:05:30.760473500 Starting bluetooth: bluetoothd.
2024-06-30 19:05:30.776594500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
rver2024 commented 1 day ago

I'd to add that I have been using the same config.ini file for a while now but didn't experience this #31 alarm in previous driver versions.

mr-manuel commented 1 day ago

Some additional checks where implemented with the latest version to show the user, if there are issues in the background which the user don't see in the GUI. Now you write that you are using the same config.ini for a while now, but you did not provide it. Are you using a custom config.ini or not?

The logs you provided do not match the error. Additionally they do not show a correctly started driver which would be able to show the error #31. Please make sure to fetch the logs when the error is shown.

rver2024 commented 21 hours ago

Sorry about the missing information! @mr-manuel. No error in my earlier log was because the JKBMS wasn't connected to CerboGX, I left it long enough and now it is connected with the #31 alarm. I updated my original post to include my config.ini and the log output with errors, I only copied and pasted two sections of the log output which just keep repeating themselves. Thanks!

rver2024 commented 19 hours ago

I was mistaken to say that the JKBMS is connected to the CerboGX earlier, it was not even if it showed up on remote console, I think it is frozen or stalled or something since there is no reading update, and the red led on JKBMS is flashing, it should be solid red if it’s Bluetooth is connected.

mr-manuel commented 15 hours ago

Install the latest nightly from today and then make a reboot.

rver2024 commented 8 hours ago

Thanks for your quick action! @mr-manuel

Per your suggestion, I installed the lastest nightly but the JKBMS still wouldn't connect, rebooted a couple of times. Please see the log below:

root@einstein:~# tail -F -n 100 /data/log/dbus-blebattery.0/current | tai64nlocal
2024-07-03 03:05:20.710372500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-07-03 03:05:22.786620500 Starting bluetooth: bluetoothd.
2024-07-03 03:05:22.802261500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-03 03:05:24.834844500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-07-03 03:05:24.835636500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-07-03 03:05:24.838979500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-07-03 03:05:26.916064500 Starting bluetooth: bluetoothd.
2024-07-03 03:05:26.931537500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-03 03:05:28.969373500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-07-03 03:05:28.970137500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-07-03 03:05:28.973355500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-07-03 03:05:29.789343500 ERROR:SerialBattery:No BMS found at C8:47:80:xx:xx:xx
2024-07-03 03:05:29.790079500 ERROR:SerialBattery:ERROR >>> No battery connection at Jkbms_Ble
2024-07-03 03:05:31.052855500 Starting bluetooth: bluetoothd.
2024-07-03 03:05:31.070312500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-03 03:05:33.351799500
2024-07-03 03:05:33.351940500 INFO:Bluetooth details
2024-07-03 03:05:33.380503500 No default controller available
2024-07-03 03:05:38.420523500
2024-07-03 03:05:39.692644500 INFO:SerialBattery:
2024-07-03 03:05:39.693353500 INFO:SerialBattery:Starting dbus-serialbattery
2024-07-03 03:05:39.695326500 INFO:SerialBattery:Venus OS v3.14
2024-07-03 03:05:39.695950500 INFO:SerialBattery:dbus-serialbattery v1.4.20240702dev
2024-07-03 03:05:56.127730500 INFO:SerialBattery:Init of Jkbms_Ble at C8:47:80:xx:xx:xx
2024-07-03 03:05:56.128592500 INFO:SerialBattery:Test of Jkbms_Ble at C8:47:80:xx:xx:xx
2024-07-03 03:05:56.539077500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-07-03 03:05:56.539873500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-07-03 03:05:56.543587500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-07-03 03:05:58.620710500 Starting bluetooth: bluetoothd.
2024-07-03 03:05:58.636337500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-03 03:06:00.673358500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-07-03 03:06:00.674112500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-07-03 03:06:00.677324500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-07-03 03:06:02.755122500 Starting bluetooth: bluetoothd.
2024-07-03 03:06:02.771833500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-03 03:06:04.807856500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-07-03 03:06:04.808739500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-07-03 03:06:04.812292500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-07-03 03:06:05.642423500 ERROR:SerialBattery:No BMS found at C8:47:80:xx:xx:xx
2024-07-03 03:06:05.643205500 ERROR:SerialBattery:ERROR >>> No battery connection at Jkbms_Ble
2024-07-03 03:06:06.889298500 Starting bluetooth: bluetoothd.
2024-07-03 03:06:06.905177500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-03 03:06:09.189381500
2024-07-03 03:06:09.189530500 INFO:Bluetooth details
2024-07-03 03:06:09.211075500 No default controller available
2024-07-03 03:06:14.250758500
2024-07-03 03:06:15.529596500 INFO:SerialBattery:
2024-07-03 03:06:15.530295500 INFO:SerialBattery:Starting dbus-serialbattery
2024-07-03 03:06:15.532278500 INFO:SerialBattery:Venus OS v3.14
2024-07-03 03:06:15.532897500 INFO:SerialBattery:dbus-serialbattery v1.4.20240702dev
2024-07-03 03:06:31.980265500 INFO:SerialBattery:Init of Jkbms_Ble at C8:47:80:xx:xx:xx
2024-07-03 03:06:31.980982500 INFO:SerialBattery:Test of Jkbms_Ble at C8:47:80:xx:xx:xx
2024-07-03 03:06:32.419960500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-07-03 03:06:32.420773500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-07-03 03:06:32.424427500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-07-03 03:06:34.509630500 Starting bluetooth: bluetoothd.
2024-07-03 03:06:34.525289500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-03 03:06:36.560994500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-07-03 03:06:36.561753500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-07-03 03:06:36.565097500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-07-03 03:06:38.642100500 Starting bluetooth: bluetoothd.
2024-07-03 03:06:38.660569500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-03 03:06:40.695165500 INFO:SerialBattery:--> asy_connect_and_scrape(): error while connecting to bt: BleakError('No Bluetooth adapters found.') of type <class 'bleak.exc.BleakError'> in /opt/victronenergy/dbus-serialbattery/bms/jkbms_brn.py line #474
2024-07-03 03:06:40.695946500 INFO:SerialBattery:--> asy_connect_and_scrape(): Exit
2024-07-03 03:06:40.699286500 INFO:SerialBattery:Reset of system Bluetooth daemon triggered
2024-07-03 03:06:41.494447500 ERROR:SerialBattery:No BMS found at C8:47:80:xx:xx:xx
2024-07-03 03:06:41.495241500 ERROR:SerialBattery:ERROR >>> No battery connection at Jkbms_Ble
2024-07-03 03:06:42.775892500 Starting bluetooth: bluetoothd.
2024-07-03 03:06:42.791264500 INFO:SerialBattery:System Bluetooth daemon should have been restarted
2024-07-03 03:06:45.072245500
2024-07-03 03:06:45.072389500 INFO:Bluetooth details
2024-07-03 03:06:45.093390500 No default controller available
mr-manuel commented 5 hours ago

In this case the issue should be clear: No Bluetooth adapters found.

Are you using the internal one or an external?