Skip to content
mpvader edited this page Jun 14, 2019 · 40 revisions

Main specs & paths interface:

This is documented on Victron Live: https://www.victronenergy.com/live/open_source:ccgx:d-bus

And needs to be moved here.

The VregLink Interface

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:

  • add it to the vedirect-interface driver (done in v2.31 or before already)
  • add it do the dbus-vecan driver.
  • add it to the vebus interface driver (mk2-dbus)

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.

Setting and getting

  • [VREG] is always an unsigned 16-bit integer. Its the VREG number
  • [DATA] is variable length; its length must match the definition of that VREG. Some are two bytes, some 4, some longer, such as a serial number.
Send a VREG
dbus -y com.victronenergy.vecan.can1 /Devices/x/VregLink SetVreg [VREG] [DATA]
Request a VREG
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]
Return value

For both SetVreg and GetVreg calls an error value and a byte array with the requested data will be returned.

Error codes

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.
Clone this wiki locally