From 1dab38cf50695e9fe49965c316547952efbcd8df Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 22 Mar 2019 13:49:07 +0100 Subject: [PATCH] etc: some cleanup of the configuration files --- etc/example.conf | 462 ----------------------- etc/examples/example.conf | 41 ++ etc/{ => examples}/global.conf | 0 etc/examples/nodes/amqp.conf | 28 ++ etc/{ => examples/nodes}/comedi.conf | 20 +- etc/examples/nodes/ethernet.conf | 26 ++ etc/{ => examples/nodes}/infiniband.conf | 0 etc/examples/nodes/influxdb.conf | 15 + etc/examples/nodes/loopback.conf | 9 + etc/examples/nodes/mqtt.conf | 30 ++ etc/examples/nodes/nanomsg.conf | 20 + etc/examples/nodes/ngsi.conf | 20 + etc/examples/nodes/opal.conf | 36 ++ etc/{ => examples/nodes}/rtp.conf | 0 etc/examples/nodes/rtt.conf | 27 ++ etc/examples/nodes/sampled_values.conf | 29 ++ etc/examples/nodes/shmem.conf | 20 + etc/examples/nodes/signal_generator.conf | 13 + etc/examples/nodes/stats.conf | 8 + etc/examples/nodes/udp.conf | 59 +++ etc/{ => examples/nodes}/uldaq.conf | 0 etc/examples/nodes/unix_domain.conf | 14 + etc/examples/nodes/websocket.conf | 10 + etc/examples/nodes/zeromq.conf | 29 ++ etc/examples/paths.conf | 73 ++++ etc/influxdb.conf | 18 - etc/loopback2.conf | 37 -- etc/mqtt.conf | 40 -- etc/multiple_dest.conf | 20 - etc/pipe-loopback-nanomsg.conf | 13 - etc/pipe-loopback-websocket.json | 11 - etc/sampled_values.json | 58 --- etc/shmem.conf | 54 --- etc/unix_domain.conf | 14 - etc/websocket-demo2.conf | 108 ------ 35 files changed, 517 insertions(+), 845 deletions(-) delete mode 100644 etc/example.conf create mode 100644 etc/examples/example.conf rename etc/{ => examples}/global.conf (100%) create mode 100644 etc/examples/nodes/amqp.conf rename etc/{ => examples/nodes}/comedi.conf (91%) create mode 100644 etc/examples/nodes/ethernet.conf rename etc/{ => examples/nodes}/infiniband.conf (100%) create mode 100644 etc/examples/nodes/influxdb.conf create mode 100644 etc/examples/nodes/loopback.conf create mode 100644 etc/examples/nodes/mqtt.conf create mode 100644 etc/examples/nodes/nanomsg.conf create mode 100644 etc/examples/nodes/ngsi.conf create mode 100644 etc/examples/nodes/opal.conf rename etc/{ => examples/nodes}/rtp.conf (100%) create mode 100644 etc/examples/nodes/rtt.conf create mode 100644 etc/examples/nodes/sampled_values.conf create mode 100644 etc/examples/nodes/shmem.conf create mode 100644 etc/examples/nodes/signal_generator.conf create mode 100644 etc/examples/nodes/stats.conf create mode 100644 etc/examples/nodes/udp.conf rename etc/{ => examples/nodes}/uldaq.conf (100%) create mode 100644 etc/examples/nodes/unix_domain.conf create mode 100644 etc/examples/nodes/websocket.conf create mode 100644 etc/examples/nodes/zeromq.conf create mode 100644 etc/examples/paths.conf delete mode 100644 etc/influxdb.conf delete mode 100644 etc/loopback2.conf delete mode 100644 etc/mqtt.conf delete mode 100644 etc/multiple_dest.conf delete mode 100644 etc/pipe-loopback-nanomsg.conf delete mode 100644 etc/pipe-loopback-websocket.json delete mode 100644 etc/sampled_values.json delete mode 100644 etc/shmem.conf delete mode 100644 etc/unix_domain.conf delete mode 100644 etc/websocket-demo2.conf diff --git a/etc/example.conf b/etc/example.conf deleted file mode 100644 index c441e69f5..000000000 --- a/etc/example.conf +++ /dev/null @@ -1,462 +0,0 @@ -/** Example configuration file for VILLASnode. - * - * This example includes all valid configuration options for the server. - * Please note, that using all options at the same time does not really - * makes sense. The purpose of this example is to serve as a reference. - * - * The syntax of this file is similar to JSON. - * A detailed description of the format can be found here: - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files - * - * @author Steffen Vogel - * @copyright 2014-2019, Institute for Automation of Complex Power Systems, EONERC - * @license GNU General Public License (version 3) - * - * VILLASnode - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - *********************************************************************************/ - -# Some global settings are used by multiple configuration files -# and therefore defined in separate files -@include "global.conf" - -############ Dictionary of nodes ############ - -nodes = { - udp_node = { # The dictionary is indexed by the name of the node. - type = "socket", # For a list of available node-types run: 'villas-node -h' - vectorize = 30, # Receive and sent 30 samples per message (combining). - samplelen = 10 # The maximum number of samples this node can receive - - builtin = false, # By default, all nodes will have a few builtin hooks attached to them. - # When collecting statistics or measurements these are undesired. - - ### The following settings are specific to the socket node-type!! ### - - layer = "udp", # Layer can be one of: - # - udp Send / receive L4 UDP packets - # - ip Send / receive L3 IP packets - # - eth Send / receive L2 Ethernet frames (IEEE802.3) - - format = "gtnet.fake", # For a list of available node-types run: 'villas-node -h' - - in = { - address = "127.0.0.1:12001" # This node only received messages on this IP:Port pair - - verify_source = true, # Check if source address of incoming packets matches the remote address. - - multicast = { # IGMP multicast is only support for layer = (ip|udp) - enabled = true, - - group = "224.1.2.3", # The multicast group. Must be within 224.0.0.0/4 - interface = "1.2.3.4", # The IP address of the interface which should receive multicast packets. - ttl = 128, # The time to live for outgoing multicast packets. - loop = false, # Whether or not to loopback outgoing multicast packets to the local host. - }, - - hooks = ( - { - type = "stats", - - warmup = 100, # The first 100 samples are used to estimate bounds for the histograms - format = "human", # One of: human, json, matlab - bucket = 30, # The number of buckets for the histograms - verbose = true # Plot histograms during shutdown - } - ) - }, - out = { - address = "127.0.0.1:12000", # This node sents outgoing messages to this IP:Port pair - - netem = { # Network emulation settings - enabled = true, - # Those settings can be specified for each node invidually! - delay = 100000, # Additional latency in microseconds - jitter = 30000, # Jitter in uS - distribution = "normal", # Distribution of delay: uniform, normal, pareto, paretonormal - loss = 10 # Packet loss in percent - duplicate = 10, # Duplication in percent - corrupt = 10 # Corruption in percent - } - } - }, - ethernet_node = { - type = "socket", # See above. - - ### The following settings are specific to the socket node-type!! ### - - layer = "eth", - in = { - address = "12:34:56:78:90:AB%eth0:12002" - }, - out = { - address = "12:34:56:78:90:AB%eth0:12002" - } - }, - unix_domain_node = { - type = "socket", - layer = "unix", # Datagram UNIX domain sockets require two endpoints - - in = { - address = "/var/run/villas-node/node.sock" - }, - out = { - address = "/var/run/villas-node/client.sock" - } - }, - opal_node = { # The server can be started as an Asynchronous process - type = "opal", # from within an OPAL-RT model. - - ### The following settings are specific to the opal node-type!! ### - - send_id = 1, # It's possible to have multiple send / recv Icons per model - recv_id = 1, # Specify the ID here. - reply = true - }, - file_node = { - type = "file", - - ### The following settings are specific to the file node-type!! ### - - uri = "logs/input.log", # These options specify the path prefix where the the files are stored - - in = { - epoch_mode = "direct" # One of: direct (default), wait, relative, absolute - epoch = 10 # The interpretation of this value depends on epoch_mode (default is 0). - # Consult the documentation of a full explanation - - rate = 2.0 # A constant rate at which the lines of the input files should be read - # A missing or zero value will use the timestamp in the first column - # of the file to determine the pause between consecutive lines. - - buffer_size = 1000000 - - eof = "rewind" # One of: rewind, exit (default) or wait - }, - out = { - flush = true - buffer_size = 1000000 - } - }, - ngsi_node = { - type = "ngsi", - - ### The following settings are specific to the ngsi node-type!! ### - - endpoint = "http://46.101.131.212:1026",# The HTTP REST API endpoint of the FIRWARE context broker - - entity_id = "S3_ElectricalGrid", - entity_type = "ElectricalGridMonitoring", - - timeout = 5, # Timeout of HTTP request in seconds (default is 1) - verify_ssl = false, # Verification of SSL server certificates (default is true) - - mapping = [ # Format: "AttributeName(AttributeType)" - "PTotalLosses(MW)", - "QTotalLosses(Mvar)" - ] - }, - websocket_node = { - type = "websocket", - - destinations = [ - "http://example.com/node-name1", - "https://example.com/another-node" - ] - }, - nanomsg_node = { - type = "nanomsg", - - out = { - endpoints = [ - "tcp://*:12000", # TCP socket - "ipc:///tmp/test.ipc", # Interprocess communication - "inproc://test" # Inprocess communication - ], - } - in = { - endpoints = [ - "tcp://127.0.0.1:12000", - "ipc:///tmp/test.ipc", - "inproc://test" - ] - } - }, - zeromq_node = { - type = "zeromq", - - pattern = "pubsub", # The ZeroMQ pattern. One of pubsub, radiodish - ipv6 = false, # Enable IPv6 support - - curve = { # Z85 encoded Curve25519 keys - enabled = true, - public_key = "Veg+Q.V-c&1k>yVh663gQ^7fL($y47gybE-nZP1L", - secret_key = "HPY.+mFuB[jGs@(zZr6$IZ1H1dZ7Ji*j>oi@O?Pc" - } - - in = { - subscribe = "tcp://*:1234" # The subscribe endpoint. - # See http://api.zeromq.org/2-1:zmq-bind for details. - filter = "ab184", # A filter which is prefix matched for each received msg - } - - out = { - publish = [ # The publish endpoints. - "tcp://localhost:1235", # See http://api.zeromq.org/2-1:zmq-connect for details. - "tcp://localhost:12444" - ], - - filter = "ab184", # A prefix which is prepended to each send message. - } - }, - signal_node = { - type = "signal", - - signal = "sine", # One of: sine, square, ramp, counter, constant, triangle, random, mixed, constant" - values = 4, # Number of values per sample - amplitude = 2.3, # Amplitude of generated signals - frequency = 10, # Frequency of generated signals - stddev = 2, # Standard deviation of random signals (normal distributed) - rate = 10.0, # Sample rate - offset = -4.5 # DC bias / Offset - }, - loopback_node = { - type = "loopback", # A loopback node will receive exactly the same data which has been sent to it. - # The internal implementation is based on queue. - queuelen = 1024, # The queue length of the internal queue which buffers the samples. - samplelen = 64, # Each buffered sample can contain up to 64 values. - mode = "polling" # Use busy polling for synchronization of the read and write side of the queue - }, - shmem_node = { - type = "shmem", - - in = { - name = "sn1_in" - }, # Name of shared memory segment for receiving side - out = { - name = "sn1_in" # Name of shared memory segment for sending side - }, - - queuelen = 1024, # Length of the queues - mode = "pthread", # We can busy-wait or use pthread condition variables for synchronizations - - # Execute an external process when starting the node which - # then starts the other side of this shared memory channel - # Usually we also pass the shmem names as parameters. - exec = [ "villas-shmem", "sn1_in", "sn1_out" ] - }, - stats_node = { # The "stats" node-type streams statistics of a second node - type = "stats", - - node = "udp_node", - rate = "2" - }, - rtt_node = { # The "test_rtt" node-type runs a set of test cases for varying - type = "test_rtt", # sending rates, number of values and generates statistics. - cooldown = 2, # The cooldown time between each test case in seconds - - prefix = "test_rtt", # An optional prefix in the filename - output = "/tmp/results/testA", # The output directory for all results - # The results of each test case will be written to a seperate file. - format = "villas.human", # The output format of the result files. - - cases = ( # The list of test cases - # Each test case can specify a single or an array of rates and values - # If arrays are used, we will generate multiple test cases with all - # possible combinations - { - rates = 55.0, # The sending rate in Hz - values = 5, # The number of values which should be send in each sample - limit = 100 # The number of samples which should be send during this test case - }, - { - rates = [ 5, 10, 30 ], # An array of rates in Hz - values = [ 2, 10, 20 ],# An array of number of values - duration = 5 # The duration of the test case in seconds (depending on the sending rate) - } - ) - }, - influxdb_node = { - type = "influxdb", - - server = "localhost:8089", - key = "villas", - out = { - signals = ( # The signal name will be used as fields for the InfluxDB - { name = "a" }, - { name = "b" }, - { name = "c" }, - } - } - }, - amqp_node = { - type = "amqp", - format = "json", - - # Use 'amqps://' to enable SSL/TLS - uri = "amqp://guest:guest@localhost:5672//", - - # Alternatively connection settings can be specified individually - username = "guest", - password = "guest", - host = "localhost", - vhost = "/", - port = 5672, - - exchange = "mytestexchange", - routing_key = "abc", - - ssl = { - verify_hostname = true, - verify_peer = true, - - ca_cert = "/path/to/ca.crt", - client_cert = "/path/to/client.crt", - client_key = "/path/to/client.key" - } - }, - sampled_values_node = { - type = "iec61850-9-2", - - interface = "lo", - dst_address = "01:0c:cd:01:00:01", - - out = { - signals = [ - { iec_type = "float32" }, - { iec_type = "float64" }, - { iec_type = "int8" }, - { iec_type = "int32" } - ], - - svid = "test1234", - smpmod = "samples_per_second", - confrev = 55 - }, - in = { - signals = [ - { iec_type = "float32" }, - { iec_type = "float64" }, - { iec_type = "int8" }, - { iec_type = "int32" } - ] - } - }, - mqtt_node = { - type = "mqtt", - - format = "protobuf", - - username = "guest", - password = "guest", - host = "localhost", - port = 1883, - - keepalive = 5, # Send ping every 5 seconds to keep connection alive - retain = false, - qos = 0, - - out = { - publish = "test-topic" - }, - in = { - subscribe = "test-topic" - }, - ssl = { - enabled = false, - insecure = true, - cafile = "/etc/ssl/certs/ca-bundle.crt", - certfile = "/etc/ssl/certs/my.crt", - keyfile = "/etc/ssl/keys/my.key" - } - } -}; - - -############ List of paths ############ - -paths = ( - { - enabled = true, # Enable this path (default: true) - reverse = true, # Setup a path in the reverse direction as well (default: false) - - in = "acs", # Name of the node we receive messages from (see node dictionary) - out = "sintef", # Name of the node we send messages to. - - rate = 100, # Send message over this path with a fixed (constant) rate (default: 0). - # Setting this value to 0 will disable this feature. - - queuelen = 128, - - mode = "all", # When this path should be triggered - # - "all": After all masked input nodes received new data - # - "any": After any of the masked input nodes received new data - mask = [ "acs" ], # A list of input nodes which will trigger the path - rate = 10.0 # A rate at which this path will be triggered if no input node receives new data - }, - { - enabled = false, - reverse = false, - - in = [ # Multiple source nodes are multiplexed - "opal_node.data[0-4]", - "signal_node.data[0-4]" - ], - out = [ # Multiple destination nodes are supported too. - "udp_node", # All destination nodes receive the same sample - "zeromq_node" # Which gets constructed by the 'in' mapping. - ] - }, - { - in = "socket_node", - out = "file_node", # This path includes all available example hooks. - - builtin = false, # By default, all paths will have a few builtin hooks attached to them. - # When collecting statistics or measurements these are undesired. - - # A complete list of supported hooks - - hooks = ( - { - type = "print" - - output = "stdout" - priority = 0 - }, - { - type = "ts" - - priority = 1 - }, - { - type = "decimate" - - ratio = 2 # Only forward every 2nd message - }, - { - type = "skip_first" - - seconds = 10 # Skip the first 10 seconds of this path - # samples = 1000 # Skip the first 1000 samples - }, - { - type = "shift" - - mode = "origin", # Shift origin timestam of samples by +10 seconds - offset = 10 # Seconds - } - ) - } -); diff --git a/etc/examples/example.conf b/etc/examples/example.conf new file mode 100644 index 000000000..4566cb949 --- /dev/null +++ b/etc/examples/example.conf @@ -0,0 +1,41 @@ +/** Example configuration file for VILLASnode. + * + * This example includes all valid configuration options for the server. + * Please note, that using all options at the same time does not really + * makes sense. The purpose of this example is to serve as a reference. + * + * The syntax of this file is similar to JSON. + * A detailed description of the format can be found here: + * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files + * + * @author Steffen Vogel + * @copyright 2014-2019, Institute for Automation of Complex Power Systems, EONERC + * @license GNU General Public License (version 3) + * + * VILLASnode + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *********************************************************************************/ + +# Some global settings are used by multiple configuration files +# and therefore defined in separate files +@include "global.conf" + +############ Dictionary of nodes ############ + +@include "nodes/signal.conf" + +############ List of paths ############ + +@include "paths.conf" diff --git a/etc/global.conf b/etc/examples/global.conf similarity index 100% rename from etc/global.conf rename to etc/examples/global.conf diff --git a/etc/examples/nodes/amqp.conf b/etc/examples/nodes/amqp.conf new file mode 100644 index 000000000..44a1b7f5c --- /dev/null +++ b/etc/examples/nodes/amqp.conf @@ -0,0 +1,28 @@ +nodes = { + amqp_node = { + type = "amqp", + format = "json", + + # Use 'amqps://' to enable SSL/TLS + uri = "amqp://guest:guest@localhost:5672//", + + # Alternatively connection settings can be specified individually + username = "guest", + password = "guest", + host = "localhost", + vhost = "/", + port = 5672, + + exchange = "mytestexchange", + routing_key = "abc", + + ssl = { + verify_hostname = true, + verify_peer = true, + + ca_cert = "/path/to/ca.crt", + client_cert = "/path/to/client.crt", + client_key = "/path/to/client.key" + } + } +} diff --git a/etc/comedi.conf b/etc/examples/nodes/comedi.conf similarity index 91% rename from etc/comedi.conf rename to etc/examples/nodes/comedi.conf index 529c8f144..e1cb6c529 100644 --- a/etc/comedi.conf +++ b/etc/examples/nodes/comedi.conf @@ -25,11 +25,11 @@ *********************************************************************************/ nodes = { - pcie6259 = { - type = "comedi", + pcie6259 = { + type = "comedi", device = "/dev/comedi0", in = { - subdevice = 0, + subdevice = 0, rate = 1000, signals = ( # note: order in this array defines order in villas sample @@ -47,7 +47,7 @@ nodes = { # comedi write buffer in kilobytes bufsize = 24, signals = ( - # note: order in this array corresponds to order in villas sample + # note: order in this array corresponds to order in villas sample { name = "ao0", channel = 0, range = 0, aref = 0 }, { name = "ao1", channel = 1, range = 0, aref = 0 }, { name = "ao2", channel = 2, range = 0, aref = 0 }, @@ -56,8 +56,8 @@ nodes = { } }, - remote = { - type = "socket", + remote = { + type = "socket", layer = "udp" format = "protobuf", @@ -69,16 +69,16 @@ nodes = { } }, - sine1 = { - type = "signal", + sine1 = { + type = "signal", signal = "sine", values = 1, frequency = 50, rate = 10000, }, - sine2 = { - type = "signal", + sine2 = { + type = "signal", signal = "sine", values = 1, frequency = 100, diff --git a/etc/examples/nodes/ethernet.conf b/etc/examples/nodes/ethernet.conf new file mode 100644 index 000000000..7a3aaf98c --- /dev/null +++ b/etc/examples/nodes/ethernet.conf @@ -0,0 +1,26 @@ +nodes = { + ethernet_node = { + type = "socket", # See above. + + ### The following settings are specific to the socket node-type!! ### + + layer = "eth", + in = { + address = "12:34:56:78:90:AB%eth0:12002" + }, + out = { + address = "12:34:56:78:90:AB%eth0:12002" + } + }, + unix_domain_node = { + type = "socket", + layer = "unix", # Datagram UNIX domain sockets require two endpoints + + in = { + address = "/var/run/villas-node/node.sock" + }, + out = { + address = "/var/run/villas-node/client.sock" + } + } +} diff --git a/etc/infiniband.conf b/etc/examples/nodes/infiniband.conf similarity index 100% rename from etc/infiniband.conf rename to etc/examples/nodes/infiniband.conf diff --git a/etc/examples/nodes/influxdb.conf b/etc/examples/nodes/influxdb.conf new file mode 100644 index 000000000..ed17591a4 --- /dev/null +++ b/etc/examples/nodes/influxdb.conf @@ -0,0 +1,15 @@ +nodes = { + influxdb_node = { + type = "influxdb", + + server = "localhost:8089", + key = "villas", + out = { + signals = ( # The signal name will be used as fields for the InfluxDB + { name = "a" }, + { name = "b" }, + { name = "c" }, + } + } + } +} diff --git a/etc/examples/nodes/loopback.conf b/etc/examples/nodes/loopback.conf new file mode 100644 index 000000000..cefc752e1 --- /dev/null +++ b/etc/examples/nodes/loopback.conf @@ -0,0 +1,9 @@ +nodes = { + loopback_node = { + type = "loopback", # A loopback node will receive exactly the same data which has been sent to it. + # The internal implementation is based on queue. + queuelen = 1024, # The queue length of the internal queue which buffers the samples. + samplelen = 64, # Each buffered sample can contain up to 64 values. + mode = "polling" # Use busy polling for synchronization of the read and write side of the queue + } +} diff --git a/etc/examples/nodes/mqtt.conf b/etc/examples/nodes/mqtt.conf new file mode 100644 index 000000000..0ead39152 --- /dev/null +++ b/etc/examples/nodes/mqtt.conf @@ -0,0 +1,30 @@ +nodes = { + mqtt_node = { + type = "mqtt", + + format = "protobuf", + + username = "guest", + password = "guest", + host = "localhost", + port = 1883, + + keepalive = 5, # Send ping every 5 seconds to keep connection alive + retain = false, + qos = 0, + + out = { + publish = "test-topic" + }, + in = { + subscribe = "test-topic" + }, + ssl = { + enabled = false, + insecure = true, + cafile = "/etc/ssl/certs/ca-bundle.crt", + certfile = "/etc/ssl/certs/my.crt", + keyfile = "/etc/ssl/keys/my.key" + } + } +} diff --git a/etc/examples/nodes/nanomsg.conf b/etc/examples/nodes/nanomsg.conf new file mode 100644 index 000000000..f856e34d1 --- /dev/null +++ b/etc/examples/nodes/nanomsg.conf @@ -0,0 +1,20 @@ +nodes = { + nanomsg_node = { + type = "nanomsg", + + out = { + endpoints = [ + "tcp://*:12000", # TCP socket + "ipc:///tmp/test.ipc", # Interprocess communication + "inproc://test" # Inprocess communication + ], + } + in = { + endpoints = [ + "tcp://127.0.0.1:12000", + "ipc:///tmp/test.ipc", + "inproc://test" + ] + } + } +} diff --git a/etc/examples/nodes/ngsi.conf b/etc/examples/nodes/ngsi.conf new file mode 100644 index 000000000..1b075d37c --- /dev/null +++ b/etc/examples/nodes/ngsi.conf @@ -0,0 +1,20 @@ +nodes = { + ngsi_node = { + type = "ngsi", + + ### The following settings are specific to the ngsi node-type!! ### + + endpoint = "http://46.101.131.212:1026",# The HTTP REST API endpoint of the FIRWARE context broker + + entity_id = "S3_ElectricalGrid", + entity_type = "ElectricalGridMonitoring", + + timeout = 5, # Timeout of HTTP request in seconds (default is 1) + verify_ssl = false, # Verification of SSL server certificates (default is true) + + mapping = [ # Format: "AttributeName(AttributeType)" + "PTotalLosses(MW)", + "QTotalLosses(Mvar)" + ] + } +} diff --git a/etc/examples/nodes/opal.conf b/etc/examples/nodes/opal.conf new file mode 100644 index 000000000..51e76187c --- /dev/null +++ b/etc/examples/nodes/opal.conf @@ -0,0 +1,36 @@ +nodes = { + opal_node = { # The server can be started as an Asynchronous process + type = "opal", # from within an OPAL-RT model. + + ### The following settings are specific to the opal node-type!! ### + + send_id = 1, # It's possible to have multiple send / recv Icons per model + recv_id = 1, # Specify the ID here. + reply = true + }, + file_node = { + type = "file", + + ### The following settings are specific to the file node-type!! ### + + uri = "logs/input.log", # These options specify the path prefix where the the files are stored + + in = { + epoch_mode = "direct" # One of: direct (default), wait, relative, absolute + epoch = 10 # The interpretation of this value depends on epoch_mode (default is 0). + # Consult the documentation of a full explanation + + rate = 2.0 # A constant rate at which the lines of the input files should be read + # A missing or zero value will use the timestamp in the first column + # of the file to determine the pause between consecutive lines. + + buffer_size = 1000000 + + eof = "rewind" # One of: rewind, exit (default) or wait + }, + out = { + flush = true + buffer_size = 1000000 + } + } +} diff --git a/etc/rtp.conf b/etc/examples/nodes/rtp.conf similarity index 100% rename from etc/rtp.conf rename to etc/examples/nodes/rtp.conf diff --git a/etc/examples/nodes/rtt.conf b/etc/examples/nodes/rtt.conf new file mode 100644 index 000000000..83bfeb93b --- /dev/null +++ b/etc/examples/nodes/rtt.conf @@ -0,0 +1,27 @@ +nodes = { + rtt_node = { # The "test_rtt" node-type runs a set of test cases for varying + type = "test_rtt", # sending rates, number of values and generates statistics. + cooldown = 2, # The cooldown time between each test case in seconds + + prefix = "test_rtt", # An optional prefix in the filename + output = "/tmp/results/testA", # The output directory for all results + # The results of each test case will be written to a seperate file. + format = "villas.human", # The output format of the result files. + + cases = ( # The list of test cases + # Each test case can specify a single or an array of rates and values + # If arrays are used, we will generate multiple test cases with all + # possible combinations + { + rates = 55.0, # The sending rate in Hz + values = 5, # The number of values which should be send in each sample + limit = 100 # The number of samples which should be send during this test case + }, + { + rates = [ 5, 10, 30 ], # An array of rates in Hz + values = [ 2, 10, 20 ],# An array of number of values + duration = 5 # The duration of the test case in seconds (depending on the sending rate) + } + ) + } +} diff --git a/etc/examples/nodes/sampled_values.conf b/etc/examples/nodes/sampled_values.conf new file mode 100644 index 000000000..e8515c25d --- /dev/null +++ b/etc/examples/nodes/sampled_values.conf @@ -0,0 +1,29 @@ +nodes = { + sampled_values_node = { + type = "iec61850-9-2", + + interface = "lo", + dst_address = "01:0c:cd:01:00:01", + + out = { + signals = [ + { iec_type = "float32" }, + { iec_type = "float64" }, + { iec_type = "int8" }, + { iec_type = "int32" } + ], + + svid = "test1234", + smpmod = "samples_per_second", + confrev = 55 + }, + in = { + signals = [ + { iec_type = "float32" }, + { iec_type = "float64" }, + { iec_type = "int8" }, + { iec_type = "int32" } + ] + } + } +} diff --git a/etc/examples/nodes/shmem.conf b/etc/examples/nodes/shmem.conf new file mode 100644 index 000000000..5484b7864 --- /dev/null +++ b/etc/examples/nodes/shmem.conf @@ -0,0 +1,20 @@ +nodes = { + shmem_node = { + type = "shmem", + + in = { + name = "sn1_in" + }, # Name of shared memory segment for receiving side + out = { + name = "sn1_in" # Name of shared memory segment for sending side + }, + + queuelen = 1024, # Length of the queues + mode = "pthread", # We can busy-wait or use pthread condition variables for synchronizations + + # Execute an external process when starting the node which + # then starts the other side of this shared memory channel + # Usually we also pass the shmem names as parameters. + exec = [ "villas-shmem", "sn1_in", "sn1_out" ] + } +} diff --git a/etc/examples/nodes/signal_generator.conf b/etc/examples/nodes/signal_generator.conf new file mode 100644 index 000000000..0e9dde1cf --- /dev/null +++ b/etc/examples/nodes/signal_generator.conf @@ -0,0 +1,13 @@ +nodes = { + signal_node = { + type = "signal", + + signal = "sine", # One of: sine, square, ramp, counter, constant, triangle, random, mixed, constant" + values = 4, # Number of values per sample + amplitude = 2.3, # Amplitude of generated signals + frequency = 10, # Frequency of generated signals + stddev = 2, # Standard deviation of random signals (normal distributed) + rate = 10.0, # Sample rate + offset = -4.5 # DC bias / Offset + } +} diff --git a/etc/examples/nodes/stats.conf b/etc/examples/nodes/stats.conf new file mode 100644 index 000000000..a2e4fee2e --- /dev/null +++ b/etc/examples/nodes/stats.conf @@ -0,0 +1,8 @@ +nodes = { + stats_node = { # The "stats" node-type streams statistics of a second node + type = "stats", + + node = "udp_node", + rate = "2" + } +} diff --git a/etc/examples/nodes/udp.conf b/etc/examples/nodes/udp.conf new file mode 100644 index 000000000..ee176c656 --- /dev/null +++ b/etc/examples/nodes/udp.conf @@ -0,0 +1,59 @@ +nodes = { + udp_node = { # The dictionary is indexed by the name of the node. + type = "socket", # For a list of available node-types run: 'villas-node -h' + vectorize = 30, # Receive and sent 30 samples per message (combining). + samplelen = 10 # The maximum number of samples this node can receive + + builtin = false, # By default, all nodes will have a few builtin hooks attached to them. + # When collecting statistics or measurements these are undesired. + + ### The following settings are specific to the socket node-type!! ### + + layer = "udp", # Layer can be one of: + # - udp Send / receive L4 UDP packets + # - ip Send / receive L3 IP packets + # - eth Send / receive L2 Ethernet frames (IEEE802.3) + + format = "gtnet.fake", # For a list of available node-types run: 'villas-node -h' + + in = { + address = "127.0.0.1:12001" # This node only received messages on this IP:Port pair + + verify_source = true, # Check if source address of incoming packets matches the remote address. + + multicast = { # IGMP multicast is only support for layer = (ip|udp) + enabled = true, + + group = "224.1.2.3", # The multicast group. Must be within 224.0.0.0/4 + interface = "1.2.3.4", # The IP address of the interface which should receive multicast packets. + ttl = 128, # The time to live for outgoing multicast packets. + loop = false, # Whether or not to loopback outgoing multicast packets to the local host. + }, + + hooks = ( + { + type = "stats", + + warmup = 100, # The first 100 samples are used to estimate bounds for the histograms + format = "human", # One of: human, json, matlab + bucket = 30, # The number of buckets for the histograms + verbose = true # Plot histograms during shutdown + } + ) + }, + out = { + address = "127.0.0.1:12000", # This node sents outgoing messages to this IP:Port pair + + netem = { # Network emulation settings + enabled = true, + # Those settings can be specified for each node invidually! + delay = 100000, # Additional latency in microseconds + jitter = 30000, # Jitter in uS + distribution = "normal", # Distribution of delay: uniform, normal, pareto, paretonormal + loss = 10 # Packet loss in percent + duplicate = 10, # Duplication in percent + corrupt = 10 # Corruption in percent + } + } + } +} diff --git a/etc/uldaq.conf b/etc/examples/nodes/uldaq.conf similarity index 100% rename from etc/uldaq.conf rename to etc/examples/nodes/uldaq.conf diff --git a/etc/examples/nodes/unix_domain.conf b/etc/examples/nodes/unix_domain.conf new file mode 100644 index 000000000..a0352b6ad --- /dev/null +++ b/etc/examples/nodes/unix_domain.conf @@ -0,0 +1,14 @@ +nodes = { + unix_domain_node = { + type = "socket", + layer = "unix", + format = "protobuf", + + in = { + address = "/var/run/villas-node.server.sock" + }, + out = { + remote = "/var/run/villas-node.client.sock" + } + } +} diff --git a/etc/examples/nodes/websocket.conf b/etc/examples/nodes/websocket.conf new file mode 100644 index 000000000..ac69dd448 --- /dev/null +++ b/etc/examples/nodes/websocket.conf @@ -0,0 +1,10 @@ +nodes = { + websocket_node = { + type = "websocket", + + destinations = [ + "http://example.com/node-name1", + "https://example.com/another-node" + ] + } +} diff --git a/etc/examples/nodes/zeromq.conf b/etc/examples/nodes/zeromq.conf new file mode 100644 index 000000000..60e911102 --- /dev/null +++ b/etc/examples/nodes/zeromq.conf @@ -0,0 +1,29 @@ +nodes = { + zeromq_node = { + type = "zeromq", + + pattern = "pubsub", # The ZeroMQ pattern. One of pubsub, radiodish + ipv6 = false, # Enable IPv6 support + + curve = { # Z85 encoded Curve25519 keys + enabled = true, + public_key = "Veg+Q.V-c&1k>yVh663gQ^7fL($y47gybE-nZP1L", + secret_key = "HPY.+mFuB[jGs@(zZr6$IZ1H1dZ7Ji*j>oi@O?Pc" + } + + in = { + subscribe = "tcp://*:1234" # The subscribe endpoint. + # See http://api.zeromq.org/2-1:zmq-bind for details. + filter = "ab184", # A filter which is prefix matched for each received msg + } + + out = { + publish = [ # The publish endpoints. + "tcp://localhost:1235", # See http://api.zeromq.org/2-1:zmq-connect for details. + "tcp://localhost:12444" + ], + + filter = "ab184", # A prefix which is prepended to each send message. + } + } +} diff --git a/etc/examples/paths.conf b/etc/examples/paths.conf new file mode 100644 index 000000000..1580f0fd2 --- /dev/null +++ b/etc/examples/paths.conf @@ -0,0 +1,73 @@ +paths = ( + { + enabled = true, # Enable this path (default: true) + reverse = true, # Setup a path in the reverse direction as well (default: false) + + in = "acs", # Name of the node we receive messages from (see node dictionary) + out = "sintef", # Name of the node we send messages to. + + rate = 100, # Send message over this path with a fixed (constant) rate (default: 0). + # Setting this value to 0 will disable this feature. + + queuelen = 128, + + mode = "all", # When this path should be triggered + # - "all": After all masked input nodes received new data + # - "any": After any of the masked input nodes received new data + mask = [ "acs" ], # A list of input nodes which will trigger the path + rate = 10.0 # A rate at which this path will be triggered if no input node receives new data + }, + { + enabled = false, + reverse = false, + + in = [ # Multiple source nodes are multiplexed + "opal_node.data[0-4]", + "signal_node.data[0-4]" + ], + out = [ # Multiple destination nodes are supported too. + "udp_node", # All destination nodes receive the same sample + "zeromq_node" # Which gets constructed by the 'in' mapping. + ] + }, + { + in = "socket_node", + out = "file_node", # This path includes all available example hooks. + + builtin = false, # By default, all paths will have a few builtin hooks attached to them. + # When collecting statistics or measurements these are undesired. + + # A complete list of supported hooks + + hooks = ( + { + type = "print" + + output = "stdout" + priority = 0 + }, + { + type = "ts" + + priority = 1 + }, + { + type = "decimate" + + ratio = 2 # Only forward every 2nd message + }, + { + type = "skip_first" + + seconds = 10 # Skip the first 10 seconds of this path + # samples = 1000 # Skip the first 1000 samples + }, + { + type = "shift" + + mode = "origin", # Shift origin timestam of samples by +10 seconds + offset = 10 # Seconds + } + ) + } +) diff --git a/etc/influxdb.conf b/etc/influxdb.conf deleted file mode 100644 index b44287062..000000000 --- a/etc/influxdb.conf +++ /dev/null @@ -1,18 +0,0 @@ -hugepages = 100 - -logging = { - level = 10 -} - -nodes = { - influxdb_node = { - type = "influxdb", - signals = 3, - - server = "relaxed_colden:8089", - key = "villas", - fields = [ - "a", "b", "c" - ] - } -} diff --git a/etc/loopback2.conf b/etc/loopback2.conf deleted file mode 100644 index f4f2436a4..000000000 --- a/etc/loopback2.conf +++ /dev/null @@ -1,37 +0,0 @@ -stats = 1 - -nodes = { - socket_node1 = { - type = "socket", - - local = "*:12000", - remote = "127.0.0.1:12000" - }, - socket_node2 = { - type = "socket", - - local = "*:12001", - remote = "127.0.0.1:12001" - } - - socket_node2a = { - type = "socket", - - local = "*:12003", - remote = "127.0.0.1:12001" - } -} - -paths = ( - { - in = [ - "socket_node1.data[0-3]", - "socket_node2.data[0-3]" - ] - hooks = ( - { - type = "print" - } - ) - } -) diff --git a/etc/mqtt.conf b/etc/mqtt.conf deleted file mode 100644 index 232879fb3..000000000 --- a/etc/mqtt.conf +++ /dev/null @@ -1,40 +0,0 @@ -logging = { - level = "debug" -} - -nodes = { - mqtt_node = { - type = "mqtt", - format = "json", - username = "villas", - password = "s3c0sim4!", - host = "137.226.248.91", - in = { - subscribe = "villas-dpsim1" - } - out = { - publish = "dpsim1-villas" - } - }, - signal_node = { - type = "signal", - signal = "mixed", - values = 5 - } -} -paths = ( - { - in = [ - "signal_node" - ], - out = [ - "mqtt_node" - ], - reverse = false, - hooks = ( - { - type = "print" - } - ) - } -) diff --git a/etc/multiple_dest.conf b/etc/multiple_dest.conf deleted file mode 100644 index 9da738117..000000000 --- a/etc/multiple_dest.conf +++ /dev/null @@ -1,20 +0,0 @@ -nodes = { - node_a = { - type = "signal" - signal = "sine" - } - - results-ss2 = { - type = "file", - uri = "asdasrtsuperlab/ss1ss2_inl-csu_%Y%m%d_%H-%M-%S.csv", - flush = false, - mode = "w+" - } -} - -paths = ( - { - in = "node_a" - out = [ "results-ss2" ] - } -) diff --git a/etc/pipe-loopback-nanomsg.conf b/etc/pipe-loopback-nanomsg.conf deleted file mode 100644 index 11a91cc71..000000000 --- a/etc/pipe-loopback-nanomsg.conf +++ /dev/null @@ -1,13 +0,0 @@ -log = { - level = 15 -} - -http = { - port = 8081 -} - -nodes = { - node1 = { - type = "loopback"; - } -} diff --git a/etc/pipe-loopback-websocket.json b/etc/pipe-loopback-websocket.json deleted file mode 100644 index 9ed9e4b92..000000000 --- a/etc/pipe-loopback-websocket.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "nodes" : { - "node1" : { - "type" : "websocket", - - "destinations" : [ - "ws://localhost/node1" - ] - } - } -} \ No newline at end of file diff --git a/etc/sampled_values.json b/etc/sampled_values.json deleted file mode 100644 index 283d80308..000000000 --- a/etc/sampled_values.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "nodes" : { - "node1" : { - "type" : "iec61850-9-2", - - "interface" : "lo", - "dst_address" : "01:0c:cd:01:00:01", - - "out" : { - "signals" : [ - { "name" : "sig1", "type" : "float", "iec_type" : "float32" }, - { "name" : "sig1", "type" : "float", "iec_type" : "float64" }, - { "name" : "sig1", "type" : "integer", "iec_type" : "int8" }, - { "name" : "sig1", "type" : "integer", "iec_type" : "int32" } - ], - - "svid" : "test1234", - "datset" : "test", - "smpmod" : "samples_per_second", - "confrev" : 55 - }, - "int" : { - "signals" : [ - { "name" : "sig1", "type" : "float", "iec_type" : "float32" }, - { "name" : "sig1", "type" : "float", "iec_type" : "float64" }, - { "name" : "sig1", "type" : "integer", "iec_type" : "int8" }, - { "name" : "sig1", "type" : "integer", "iec_type" : "int32" } - ] - } - }, - - "node2" : { - "type" : "iec61850-9-2", - - "interface" : "lo", - - "out" : { - "svid" : "testSV", - "datset" : "abc", - "signals" : [ - { "name" : "sig1", "type" : "float", "iec_type" : "float32" }, - { "name" : "sig1", "type" : "float", "iec_type" : "float64" }, - { "name" : "sig1", "type" : "integer", "iec_type" : "int8" }, - { "name" : "sig1", "type" : "integer", "iec_type" : "int32" } - ] - }, - "in" : { - "signals" : [ - { "name" : "sig1", "type" : "float", "iec_type" : "float32" }, - { "name" : "sig1", "type" : "float", "iec_type" : "float64" }, - { "name" : "sig1", "type" : "integer", "iec_type" : "int8" }, - { "name" : "sig1", "type" : "integer", "iec_type" : "int32" } - ] - } - } - - } -} diff --git a/etc/shmem.conf b/etc/shmem.conf deleted file mode 100644 index 9d5bda8eb..000000000 --- a/etc/shmem.conf +++ /dev/null @@ -1,54 +0,0 @@ -# Example configuration for testing the shared memory node. -# Samples are read from a file, passed to the external program -# via shared memory, and written back to an output file. - -stats = 1; - -logging = { - level = "info" -} - -nodes = { - sig = { - type = "signal" - }, - shmem = { - type = "shmem", - out = { - name = "/villas1", - } - in = { - name = "/villas1", - signals = { - count = 1, - type = "float" - } - } - }, - lo = { - type = "loopback", - - format = "json" - uri = "-" - - out = { - hooks = ( { type = "print", format = "json" }) - } - } -} - -# -# sig -> shmem -> lo -# - -paths = ( - { - in = "sig", - out = "shmem" - }, - { - in = "shmem", - out = "lo", - } - -) diff --git a/etc/unix_domain.conf b/etc/unix_domain.conf deleted file mode 100644 index d3bea0b39..000000000 --- a/etc/unix_domain.conf +++ /dev/null @@ -1,14 +0,0 @@ -nodes = { - unix_domain_node = { - type = "socket", - layer = "udp", -# layer = "unix", - format = "protobuf", - - local = "*:12000"; - remote = "127.0.0.1:12001" - -# local = "/var/run/villas-node.server.sock", -# remote = "/var/run/villas-node.client.sock", - } -} diff --git a/etc/websocket-demo2.conf b/etc/websocket-demo2.conf deleted file mode 100644 index cbf280bd1..000000000 --- a/etc/websocket-demo2.conf +++ /dev/null @@ -1,108 +0,0 @@ -/** Example configuration file for VILLASnode. - * - * The syntax of this file is similar to JSON. - * A detailed description of the format can be found here: - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files - * - * @author Steffen Vogel - * @copyright 2014-2019, Institute for Automation of Complex Power Systems, EONERC - * @license GNU General Public License (version 3) - * - * VILLASnode - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - *********************************************************************************/ - -stats = 1; - -logging = { - level = 1 -} - -nodes = { - sig = { - type = "signal", - vectorize = 1, - - signal = "mixed", - values = 5, - rate = 40, - amplitude = 2000000, - hooks = ( - { type = "stats" } - ) - }, - sig2 = { - type = "signal", - vectorize = 1, - - signal = "mixed", - values = 5, - rate = 40, - hooks = ( - { type = "stats" } - ) - }, - stats = { - type = "stats", - - node = "sig", - rate = 40 - }, - ws_stats = { - type = "websocket" - vectorize = 40, - - }, - ws_sig = { - type = "websocket", - vectorize = 40, - - description = "Demo Channel", - series = ( - { label = "Random walk", unit = "V", yaxis = 2 }, - { label = "Sine", unit = "A" }, - { label = "Square", unit = "Var"}, - { label = "Triangle", unit = "°C" }, - { label = "Ramp", unit = "°C" } - ), - hooks = ( - { type = "stats" } - ) - }, - ws_sig2 = { - type = "websocket", - vectorize = 40, - - description = "Demo Channel", - series = ( - { label = "Random walk", unit = "V", yaxis = 2 }, - { label = "Sine", unit = "A" }, - { label = "Square", unit = "Var"}, - { label = "Triangle", unit = "°C" }, - { label = "Ramp", unit = "°C" } - ), - hooks = ( - { type = "stats" } - ) - }, -}; - -############ List of paths ############ - -paths = ( - { in = "sig", out = "ws_sig" }, - { in = "sig2", out = "ws_sig2" }, - { in = "stats", out = "ws_stats" } -);