fledge-power / fledge-south-iec61850

A south plugin for collecting data via the IEC 61850 protocol
3 stars 5 forks source link

IEC61850 C/C++ South plugin

A simple asynchronous IEC61850 plugin that pulls data from a server and sends it to Fledge.

To build this plugin, you will need the lib61850 library installed on your environment as described below.

You also need to have Fledge installed from the source code, not from the package repository.

Building lib61850

To install the dependencies you can run the requirements.sh script.

If you want to install them manually :

To build IEC61850 C/C++ Southth plugin, you need to download lib61850 at: https://github.com/mz-automation/libiec61850

$ git clone https://github.com/mz-automation/libiec61850.git
$ cd libiec61850
$ export LIB_IEC61850=`pwd`

As shown above, you need a $LIB_IEC61850 env var set to the source tree of the library.

Then, you can build libiec61850 with (note mbedtls installation):

$ cd libiec61850
$ cd third-party/mbedtls
$ wget -c https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v2.28.3.tar.gz -O - | tar -xz
$ mv mbedtls-2.28.3 mbedtls-2.28
$ cd ../../
$ cmake -DBUILD_TESTS=NO -DBUILD_EXAMPLES=NO ..
$ make
$ sudo make install
$ sudo ldconfig

Build

To build the iec61850 plugin, once you are in the plugin source tree you need to run:

To build a release:

$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make

To build with unit tests and code coverage:

$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Coverage ..
$ make

You may also pass one or more of the following options to cmake to override this default behaviour:

NOTE:

Examples:

Using the plugin

As described in the Fledge documentation, you can use the plugin by adding a service from a terminal, or from the web API.C

1 - Add the service from a terminal:

.. code-block:: console

$ curl -sX POST http://localhost:8081/fledge/scheduled/task -d '{"name": "iec61850","plugin": "iec61850","type": "south","schedule_type": 3,"schedule_day": 0,"schedule_time": 0,"schedule_repeat": 30,"schedule_enabled": true}' ; echo

Or

2) Add the service from the web GUI: