I’ve built a virtual battery D-Bus service (com.victronenergy.Virtualbattery
) that aggregates data from multiple serial-connected batteries.
It works, but updates freeze for long periods and then burst-update all values suddenly.
This makes real-time monitoring and system responsiveness very inconsistent.
What I’m Building:
I have multiple batteries connected via serial (USB) to the Cerbo GX.
Each battery registers its own D-Bus service (e.g., /com.victronenergy.battery/ttyUSB0_*
, /ttyUSB1_*
, etc.).
I aggregate key metrics — Voltage, Current, SoC, etc. — based on physical configuration:
- Example: 4 batteries in Parallel etc.
The aggregated values are published to a custom virtual battery D-Bus service:
com.victronenergy.Virtualbattery
I then set this as the system Battery Monitor via:
Settings > System setup > Battery monitor
The Problem:
The virtual battery works and eventually shows the correct values, but:
- Values freeze for long periods
- Then suddenly update all at once
- Then freeze again — the cycle repeats
This makes the system feel unresponsive or delayed, especially for real-time monitoring and control.
Setup Details:
-
Cerbo GX + Venus OS
-
Multiple serial-connected batteries (ttyUSBx)
-
Each battery exposes its own D-Bus service
-
Aggregation logic uses
dbusmonitor
to read battery values -
Aggregated data is pushed to
com.victronenergy.Virtualbattery
//----------------//
-
Has anyone experienced this freeze-and-burst pattern with dbusmonitor?
-
Is
dbusmonitor
known to behave like this under load? -
Are there better D-Bus listeners or approaches for aggregating high-frequency battery data?
-
Any tuning advice or tools to make this more real-time and reliable?
Any thoughts, experiences, or alternate approaches would be much appreciated!