D-Bus is used as the main data exchange, to share values such as voltages, as well as settings and other data, between all the processes running on the CCGX. D-Bus is a common linux inter process communication mechanism, see google and the D-Bus page on wikipedia for more information.
Below diagram gives a good overview on the CCGX:
com.victronenergy.[product type].[interface]_di[device instance]_uc[unique-number]
dbus.Array(, signature=dbus.Signature('i'), variant_level=1).
The services below retrieve measurements from devices connected to the color control, and publish them on the D-Bus. The hyperlinks in the tables below refer to the source code of the projects on github. Services without hyperlink are not (yet) open sourced.
Below is a list of example possible and common service names.
|com.victronenergy.charger.ttyO0||Charger connected via VE.Direct at tty0|
|com.victronenergy.solarcharger.ttyO2||Solar charger connected via VE.Direct at tty2|
|com.victronenergy.solarcharger.ttyUSB2||Solar charger connected via VE.Direct via USB cable|
|com.victronenergy.vebus.socketcan_can0_di0||VE.Bus system connected via canbus 0, and configured for device instance 0|
|com.victronenergy.vebus.socketcan_can0_di1||VE.Bus system connected via canbus 0, and configured for device instance 1|
|com.victronenergy.charger.socketcan_can0_di0||Skylla-i charger connected on canbus, device instance 0|
|com.victronenergy.pvinverter.qwacs_1||Quby AC sensors on input 1|
|com.victronenergy.pvinverter.fronius_137_37823||Fronius PV inverter with type ID 176 and serial 37823|
|com.victronenergy.pvinverter.vebusacsensor_input1||Victron AC Current Sensor on input 1|
|com.victronenergy.grid.ttyUSB0_di32_mb1||Carlo Gavazzi AC sensors on USB0 with device instance 32 and Modbus address 1|
|com.victronenergy.gps||USB/serial GPS retrieval|
|com.victronenergy.battery.lg_resu||LG resu battery|
|com.victronenergy.generator.startstop0||Generator start/stop using CCGX internal relay|
|com.victronenergy.settings||interface to xml-based non-volatile settings storage (/data/conf/settings.xml)|
|com.victronenergy.gui||gui. takes care of buttons and lcd display|
|vrmlogger||Communication between CCGX and VRM Database|
|vrmpubnub||Two-communication via internet, (to be) used by mobile apps, Portal and VE Power Setup.|
|com.victronenergy.system||Computes statistics from devices (total power, consumption, power to grid…)|
|modbustcp||Modbustcp gateway, allows access to all connected products|
|com.victronenergy.fronius||Fronius device scan status|
|com.victronenergy.hub4||Hub-4 advanced control|
The device instance (object path /DeviceInstance) makes a device unique. The device instance is based on the connection method. The used rules are:
The device instance is used for several configuration items:
In logging to the VRM database (vrm.victronenergy.com) the device-instance is used, for example IV1 (input 1 voltage of device instance 0), and it (the instance) should therefore not change at random. Maximum of the instance field in the VRM database is 65535.
The ModbusTCP server, used by customers to query data from either the total system or separate devices, uses the ModbusTCP server in the addressing. The UnitID aka SlaveID in the request is mapped to the device instance.
This mapping is not one on one and has a bit of history, since we didn't realize at first that a lot of PLCs do not support a device instance above 247. Also one Customer reported that his PLC cant work with unitid 0.
The naming convention for new object paths is to write a full word. So /Ac/Voltage instead of /Ac/V and /Management instead of /Mgmt.
The list of available device type specific paths is here: https://github.com/victronenergy/venus/wiki/dbus.
|/Mgmt/ProcessName||For example vcan_dbus|
|/Mgmt/ProcessVersion||For example v1.02|
|/Mgmt/Connection||Textual description for connection method. To be used in the menu (“VE.Direct port 2”)|
As defined in products.h in velib.
GetValue should return the decimal, as uint32 (ie 516).
GetText should return this as a hex string: 0x204.
As defined in products.c in velib, probably also on VE.Can as PGN 1F014, field 4 ‘Manufacturer’s Model ID’.
GetText: A string, containing the firmware version which is formatted equal as used in change logs of the product, and/or on labels etcetera. This string is also what the Venus GUI and VRM portal will show to users.
GetValue: Numeric representation of the firmware version. To be prepared for automatic firmware updates, make sure that the numeric value is such that a newer version leads to a higher number. And also that the number is in the same format in the firmware update files (if available for this product); so that when indexed in a library, the number can be used to check up-to-dateness of the product. All downstream software will not, and may not, format this number itself for showing the user. Instead it must use the string as returned by GetText.
This should probably be similar as /FirmwareVersion, note though that this is given very little attention as its not used for Victron products.
The Device Instance, see earlier chapter.
Value 0 = not-connected, Value 1 = connected.
/Serial String, containing one serialnumber. In a system with multiple units, the one from the master is shown.
/N2KUniqueNumber Int, containing the N2K unique number. In a system with multiple units, the one from the master is shown.
/CustomName String, containing an editable name. This can be set by a user to distinguish the device from other devices. When a product name is presented to a user, /CustomName is the preferred name to present. When /CustomName is blank, /ProductName should be presented to the user. When /CustomName is changed, it will be stored in the device if the device supports this and otherwise in LocalSettings (com.victronenergy.settings).
Venus does not support Custom names for N2K/VE.Can devices. It can be added storing the custom name in a N2K Description field string; which is in PGN 0x1F016, Config info.
For VE.Direct, this is mapped to the VE_REG_DESCRIPTION1,
/Devices/… The Devices object path is only used for products that operate in parallel mode. This object-path is used to access the underlying real products. Examples of products operating in parallel mode are VE.Bus products (Inverters, Multi’s, Quattro’s), Skylla-i’s and MPPT 150/70’s. The first device will report under /Devices/0/… , the second device under /Devices/1/…. Etcetera. When relevant this numbering is kept equal to bus numbering. For example MK2-addressing.
/Interfaces/… The Interfaces object path is used when access to a certain product goes via known interfaces. For VE.Bus products for example you could find the MK2 in /Interfaces/, or the mk2-can and the mk2. The reasons to do this are:
An example of the interfaces of a VE.Bus system connected through canbus:
All D-Bus object paths have the following interfaces:
(Variant value) GetValue()
Returns the value.
(String value) GetText()
Returns the value as string, including units. For example ‘21.3 W’. When invalid, it returns an empty string.
(Int32 retval) SetValue(Variant value)
Sets the specified value. Returns 0 when success, and something else when not allowed.
(Variant value) GetMin()
Returns the limit minimum.
(Variant value) GetMax()
Returns the limit maximum.
(Int 32 retval) SetDefault()
Sets the value(s) to default value. When this is called on a group (for example object path /Settings/Logscript, all values in this group are set to default.
(Variant value) GetDefault()
Returns the default value.
(Int32 retval) AddSetting(String group, String name, Variant defaultValue, String itemType, Variant minimum, Variant maximum)
Adds a new local setting according to the specified parameters. The possible itemType's are 'i' (integer), 'f' (float) and 's' (string). The minimum and maximum can be specified when the itemType is an integer or float. Minimum and maximum are ignored when both are specified as 0 (zero).
(String data) Introspect()
Returns the introspection data in XML format. Interface org.freedesktop.DBus.Properties (Variant value) Get(String interface, String property)
Returns the value of specified interface and property. For example the interface com.victronenergy.BusItem and the property Valid.