Brief
After having edited the drivers' configuration file, the automation service must be configured to indicate which driver should output what data.
Configuration file location
The configuration file "serviceSettings.xml" is located in the "/system/services/device" folder of the SD card:
Units declaration
The first section of the configuration file declares what is referred to as "units". A unit is what links a driver, and hence its associated sensor, to a list of all available data the current firmware can retrieve. As a starting point, the configuration file must expose the following structure:
Then between the "units" tag, each unit declaration is identified within "unit" tags along with some settings within "settings" tags. Each setting is identified with the "add" tags.
Below is an example of the unit for the embedded barometric sensor. The unit has an attribute "name" which serves as a unique friendly name to identify that specific unit. In the example, it is given the name "baro". Then a "type" attribute specifies what unit type should be used. Unit types are hardcoded in the firmware, and are provided in a list in the default configuration file. Here, the unit to be used is "MS5607Unit_t".
The mandatory setting to add is with the "driver" key attribute. This setting specifies which driver should be linked to this unit. All drivers correctly configured in the "/drivers/driverSettings.xml" file and started after system boot are registered in Aloha under the prefix"drv/", followed by a generic driver name and an id when applicable. Here, the barometric sensor embedded in Aloha does not have an id, thus is registered as "drv/baro".
Datapoints declaration
The second section of the configuration file specifies what data a unit, hence its associated sensor, should output. Each physical measurement a sensor can output is called a "datapoint" and is declared within an "node" related to its unit. Before declaring a datapoint, the configuration file must have the following structure, based on the previous example:
Within the index labeled "main" should the nodes be declared. Nodes are a convenient way to organize datapoints in a tree architecture. Here, a parent node called "monitoring" will gather all sub-nodes declared afterwards.
As an example, the following picture shows how the datapoints for the barometric sensor can be declared. First a node called "baro" is added with two sub-nodes. Each sub-node declares a datapoint to retrieve data. Such datapoint has two mandatory attributes: a key and a value. The key is a short friendly name to identify the datapoint. The value is formed with the scheme "unit_name/unit_datapoint", where "unit_name" matches the friendly name given in the above unit declaration, and unit_datapoint is a hardcoded text in the firmware associated with one of the physical measurement available on the current sensor. Here, the two known measurements for the barometric sensor are "TEMP" and "PRES" for temperature and pressure respectively. Since the unit is called "baro", the datapoints to be retrieved are "baro/TEMP" and "baro/PRES". Optionally, a display name can be specified when the IHM is used:
With this configuration, the barometric sensor will output pressure and temperature data. The sampling period should already be configured in the driver configuration file.
The automation configuration file provided by default has a complete list of all known unit types and associated datapoints.
Comments
0 comments
Please sign in to leave a comment.