Skip to content

Architecture & Design

Sascha Montellese edited this page Sep 14, 2021 · 5 revisions

smartmeter-datacollector software architecture

Software Structure

The software consists of three main parts:

  • smart meter sub package
  • sinks sub package
  • collector module

smartmeter sub package

The smartmeter package contains the code for reading and parsing data from the various smart meters. Each meter might use a different type of Reader depending on their physical and data-link layer. The L+G E450 uses wired M-Bus as physical layer, therefore requires the SerialReader. Its data-link layer is HDLC with DLMS as transport layer which is handled by HdlcDlmsParser.

Common to all Meters is the asynchronously blocking start() method and a register(observer) method. The registered observer must be asynchronously notified with notify(List[MeterDataPoint]) (see abstract base class Meter).

After calling start() a meter must notify its registered observers when new measurements have been received. The data is forwarded as a list of MeterDataPoint objects which contain the following fields:

  • type of measurement (MeterDataPointType)
  • measurement as float value
  • source ID of the meter
  • timestamp

For the types use the enum MeterDataPointTypes in the meter_data module.

sinks sub package

The sink sub package contains code that exports the measurements produced by the Meters in different ways.

Common to all DataSinks are the asynchronously non-blocking start(), stop() and send(MeterDataPoint) methods (see abstract base class DataSink).

collector module

The glue between the objects of the above sub packages is the Collector which is notified by the Meters upon new data, stores them into its asynchronous queue and keeps forwarding them to the registered DataSinks.

The objects mentioned above are built by a factory module during application setup based on a .ini configuration parsed by the config module.