-
Notifications
You must be signed in to change notification settings - Fork 77
dbus api
This is documented on Victron Live: https://www.victronenergy.com/live/open_source:ccgx:d-bus
And needs to be moved here.
The purpose of this D-Bus Interface is to make settings on devices (BMVs, Solar Chargers, and-so-forth) available via Venus; in a transparent way: get and set VREGs.
It will be used by VictronConnect to allow remotely changing settings.
For a definition of the VREGs available per device, see whitepapers on our website.
Implementation in progress, it’s first being added to the vedirect-interface driver; later to the canbus driver and possibly also the vebus-interface driver to allow changing VE.Bus device settings remotely from within VictronConnect.
Also it’s implemented in mqtt-rpc (private repo), which exposes the VregLink interface on MQTT.
At the same time, VictronConnect is being modified to use these features, for remotely changing settings. See this VictronConnect issue, and the mqtt-rpc-client-qt repo.
Some notes:
- Will mqtt-rpc actively keep informing whoever is on the other side (VictronConnect) that a device as found or a device is gone?
- No.
- How to handle VREGs that have multiple responses?
- For now those are not supported.
- Can D-Bus, (and its implementations!) handle a delayed response, which can also be out of sync?
- This is not a problem because dbus already implements remote calls asynchronously and libraries can handle this in either a blocking or non-blocking manner. The caveat is the response has to be faster than the default dbus timeout of 25 seconds.
In the examples below, [VREG]
is an unsigned 16-bit integer.
dbus -y com.victronenergy.vecan.can1 /Devices/x/VregLink SetVreg [VREG] [DATA]
dbus -y com.victronenergy.vecan.can1 /Devices/x/VregLink GetVreg [VREG]
For example:
dbus -y com.victronenergy.battery.ttyO4 /Devices/0/VregLink GetVreg %0x010C
error = 0
data = [0]
For both SetVreg and GetVreg calls an error value and a byte array with the requested data will be returned.
If there is a problem fetching the Vreg the error value will be non-zero. A list of errors are:
0 = OK
0x8100 = VREG is not supported
0x8300 = Data written with SetVreg is invalid or out of range.