Closed Honusnap closed 7 months ago
First of all, did you try the nightly? We wrote a big note for this when you open an issue.
What is your system load?
As stated, it's not a bug... no need to try nightly which i just get rid of for stable release.
I'm just asking what are the action that can be taken to reduce CPU load.
7% python /opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py Jkbms_Ble C8:47:8C:E9:0C:E6 7% seems pretty high already for me.
When connected via Bluetooth the driver is using an active callback from the BMS, in your case the data is received probably every half a second.
You could change
to (pay attention at the line indentation that changed also)
# try using active callback on this battery
# if not battery.use_callback(lambda: poll_battery(mainloop)):
# if not possible, poll the battery every poll_interval milliseconds
gobject.timeout_add(battery.poll_interval, lambda: poll_battery(mainloop))
and then increase
but this will not be supported and you will have problems at least once a day where the driver crashes.
It works under 2 possibles modes : 1 - Callback from the BMS 2 - Active call from the driver
If i remove the callback mode, the driver will crash every day .. right ?
Now .... maybe i can alter the publish_battery() function to NOT act if within the same poll_interval. If (Time-Poltime) > poll_interval then Existing Code Poltime = Time() End
Dunno if i'm clear .. :D
Describe the problem
Hello All,
What are the options to reduce CPU Load of the serialbattery driver ?
7% python /opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py Jkbms_Ble C8:47:8C:E9:0C:E6 3% {dbus_mqtt.py} /usr/bin/python3 -u /opt/victronenergy/dbus-mqtt/dbus_mqtt.py --init-broker 3% {dbus_systemcalc} /usr/bin/python3 -u /opt/victronenergy/dbus-systemcalc-py/dbus_systemcalc.py
I've reduced the SOC calculus every 120s, is there any other options that can be changed, maybe the frequency at chich the serialbattery driver is calculating datas can be changed ?
Thanks a lot,
Driver version
1.020230531 (Last stable)
Venus OS device type
Cerbo GX
Venus OS version
3.13
BMS type
JKBMS / Heltec BMS
Cell count
16
Battery count
1
Connection type
Bluetooth
Config file
Relevant log output
Any other information that may be helpful
No response