Which Plugins to load (appsettings.xml)

appsettings.xml overview

Open the appsettings.xml file with a text editor of your choice. Preferably, you can use a dedicated XML editor, as the Senseforce Edge XML files are supported by a rich set of XML schemas, allowing configuration validation inside the editor.

A minimum appsettings.xml is illustrated below.

<?xml version="1.0" encoding="utf-8"?>
<AgentConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="https://senseforce.io/ configurations/Schemas/appsettings.xsd" >
  <EgressPlugins>
    <!--Add your output plugins here-->
  </EgressPlugins>
  <IngressPlugins>
    <!--Add your input plugins here-->
  </IngressPlugins>
  
  <!-- Mode: Live or offline -->
  <Mode>Live</Mode>
  
  <!-- Where to find the data routing definition file -->
  <Mappings>
    <FilePath>$(LunaAppDataPath)configurations</FilePath>
    <FileName>EventDefinition.xml</FileName>
  </Mappings>
  
  <!-- Where to put the log file and which log level to set -->
  <Logger>
    <FilePath>$(LunaAppDataPath)Logs</FilePath>
    <FileName>agent.log</FileName>
    <!--LogLevel: Debug,Information,Warning,Error,Critical,None-->
    <LogLevel>Information</LogLevel>
  </Logger>
</AgentConfiguration>

Define which Input Plugins to load

To define which plugin to load, add one or more of the following configuration sections inside the "IngressPlugins"-section (Line 7 to 9)

<IngressPlugin name="S7Net">
    <FilePath>$(RuntimePath)Plugins/Ingress/S7Net/S7Net.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.S7Net.S7NetHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/S7Net/S7Settings.xml</ConfigurationFile>
</IngressPlugin>
<IngressPlugin name="Tcp">
    <FilePath>$(RuntimePath)Plugins/Ingress/TcpSocketRead/TcpSocketRead.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.TcpSocketRead.TcpSocketReadHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/TcpSocketRead/TcpSocketSettings.xml</ConfigurationFile>
</IngressPlugin>

The plugin attribute "name" is reserved for future use and does not provide any further service.

It is possible to load more than one Input Plugin. Simply add several of the above configuration sections (5 lines per plugin) to appsettings.xml, one below each other.

Define which Output Plugins to load

To define which output plugin to load, add one or more of the following configuration sections inside the "EgressPlugins"-section (Line 4 to 6)

<EgressPlugin name="Mqtt_senseforce">
    <FilePath>$(RuntimePath)Plugins/Egress/MqttNet/MqttNetPlugin.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Egress.Plugins.MqttNet.MqttHandlerTpl</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/OutputPlugins/MqttNet/MqttSettings.xml</ConfigurationFile>
</EgressPlugin>

The plugin attribute "name" is used for data routing. Make sure it is unique throughout all plugins (which unique name you choose is up to you). Remember this name for the data routing process.

It is possible to load more than one Output Plugin. Simply add several of the above configuration sections (5 lines per plugin) to appsettings.xml, one below each other.

Defining Data Routing Definition and Logging file path

Using the FileName and FilePath settings on line 16/17 as well as 22/23 it is possible to change the location where the Edge Solution expects the Data Routing Definition as well as the Logging output path. For most cases, it is best to leave these settings on default.

Change Log-Level

Using the setting LogLevel on line 25 allows setting how much information is written to the log files. All plugins integrate their own log files with their own logging configuration. The setting in appsettings.xml only changes the log-level for the Edge core application.

Please check the edge-logging page for more information:

https://manual.senseforce.io/manual/senseforce-edge/edge-configuration/edge-logging

Application Mode

Using the "Mode"-setting allows disabling the live date transmission.

Mode

Consequence

Live

The Edge solution connects with the remote servers and transmits data from input to output.

Offline

The Edge solution connects with the remote servers but only reads the data and transmits them to the output - but does not deliver it past the output plugin. Use this setting to commission your Edge software as well as for troubleshooting. Best combined with LogLevel Trace

Example appsettings.xml file

Last updated