Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "BaSyx / Examples / Monitoring"

(First iteration for documenting the BaSyx monitoring example)
 
Line 8: Line 8:
 
Figure 1 demonstrates the interface between an AAS and a Streamsheets-application. For this example, we assume that the sub models of the AAS provide the access of multiple sensor data, which change dynamically at run time to reflect the current production status. The task of the Streamsheets application is to display these data in real time as a dashboard, in order to provide a live-picture of the actual production conditions. The AAS is hosted on a HTTP-server. The content of the AAS and its sub models are accessible via the AAS REST API (marked as 1 in Figure 1).
 
Figure 1 demonstrates the interface between an AAS and a Streamsheets-application. For this example, we assume that the sub models of the AAS provide the access of multiple sensor data, which change dynamically at run time to reflect the current production status. The task of the Streamsheets application is to display these data in real time as a dashboard, in order to provide a live-picture of the actual production conditions. The AAS is hosted on a HTTP-server. The content of the AAS and its sub models are accessible via the AAS REST API (marked as 1 in Figure 1).
 
To create a communication with the AAS using HTTP/REST, the Streamsheets application needs a HTTP -connector and a producer. The HTTP-connector (2 in Figure 1) contains the information to connect to brokers, servers, clusters and other data spaces. The connector creates a HTTP-client that communicates with the HTTP server to access the AAS. The producer (3 in Figure 1) serves as the interface between the data points of the Streamsheets-application, which transmits information of the HTTP-requests in an “outgoing” direction, from the Streamsheets-application to the HTTP-Connector.  
 
To create a communication with the AAS using HTTP/REST, the Streamsheets application needs a HTTP -connector and a producer. The HTTP-connector (2 in Figure 1) contains the information to connect to brokers, servers, clusters and other data spaces. The connector creates a HTTP-client that communicates with the HTTP server to access the AAS. The producer (3 in Figure 1) serves as the interface between the data points of the Streamsheets-application, which transmits information of the HTTP-requests in an “outgoing” direction, from the Streamsheets-application to the HTTP-Connector.  
 +
  
 
== How to Use ==
 
== How to Use ==
Line 40: Line 41:
 
Now the automatic build process will build the project binaries and docker images necessary to run the example in accordance to the previous section.
 
Now the automatic build process will build the project binaries and docker images necessary to run the example in accordance to the previous section.
  
== Grafana ==
+
 
 +
== Applications ==
 +
 
 +
=== Grafana ===
 
[https://grafana.com/ Grafana] is an Open-Source application for creating dashboards for different types of datasources. There is already a variety of different panels and datasources available at their official repository.  
 
[https://grafana.com/ Grafana] is an Open-Source application for creating dashboards for different types of datasources. There is already a variety of different panels and datasources available at their official repository.  
  
=== Grafana Dashboard Example ===  
+
==== Grafana Dashboard Example ====  
 
[[file:BaSyx_monitoring_grafana.png|center]]
 
[[file:BaSyx_monitoring_grafana.png|center]]
  
=== Setting up a new panel ===  
+
==== Setting up a new panel ====  
 
There are two possibilities for panels that can make use of the proxy
 
There are two possibilities for panels that can make use of the proxy
 
* Use datasource plugin that comes with the example
 
* Use datasource plugin that comes with the example
 
* Use Ajax plugin => can already query any kind of JSON datasource
 
* Use Ajax plugin => can already query any kind of JSON datasource
  
== Streamsheets ==
+
=== Streamsheets ===
 
[https://cedalo.com/ Streamsheets] is an Eclipse project providing an application for monitoring streams of data from various sources.
 
[https://cedalo.com/ Streamsheets] is an Eclipse project providing an application for monitoring streams of data from various sources.
  
=== Stream Machine Example ===  
+
==== Stream Machine Example ====  
 
[[file:BaSyx_monitoring_streamsheets.png|center]]
 
[[file:BaSyx_monitoring_streamsheets.png|center]]
  
=== Setting Up a New Streamsheet ===
+
==== Setting Up a New Streamsheet ====
 
The configuration of the HTTP-connector and the producer follows the following steps:
 
The configuration of the HTTP-connector and the producer follows the following steps:
 
# Start by creating the Connector in the Connector Dashboard in the Administration Menu. Go to the side pane and select the “Administration”.
 
# Start by creating the Connector in the Connector Dashboard in the Administration Menu. Go to the side pane and select the “Administration”.
Line 65: Line 69:
 
# Go to Side-Pane -> “Streams” -> “Producers”. Click on the “+”-symbol on the top right to add a new producer. (Figure 3)
 
# Go to Side-Pane -> “Streams” -> “Producers”. Click on the “+”-symbol on the top right to add a new producer. (Figure 3)
 
At run time, the data-points of the Streamsheets-application create HTTP-Requests with the producer periodically. The HTTP-connector communicates with the AAS based on these HTTP-requests. The responses are transmitted back to the Streamsheets-application. For the real time display, HTTP-GET requests are generated cyclically and the responses are updated to the data points in the Streamsheets-application. The configuration of the data points in the Streamsheets-application follow the following steps:
 
At run time, the data-points of the Streamsheets-application create HTTP-Requests with the producer periodically. The HTTP-connector communicates with the AAS based on these HTTP-requests. The responses are transmitted back to the Streamsheets-application. For the real time display, HTTP-GET requests are generated cyclically and the responses are updated to the data points in the Streamsheets-application. The configuration of the data points in the Streamsheets-application follow the following steps:
 +
 +
 +
=== Node Red ===

Revision as of 05:05, 21 August 2020

Monitoring

Overview

BaSyx monitoring overview.png

The tool Streamsheets can be integrated into the BaSyx-middleware with the HTTP/REST protocol. This example demonstrates how to use Streamsheets to display the content of an AAS in real-time. Figure 1 demonstrates the interface between an AAS and a Streamsheets-application. For this example, we assume that the sub models of the AAS provide the access of multiple sensor data, which change dynamically at run time to reflect the current production status. The task of the Streamsheets application is to display these data in real time as a dashboard, in order to provide a live-picture of the actual production conditions. The AAS is hosted on a HTTP-server. The content of the AAS and its sub models are accessible via the AAS REST API (marked as 1 in Figure 1). To create a communication with the AAS using HTTP/REST, the Streamsheets application needs a HTTP -connector and a producer. The HTTP-connector (2 in Figure 1) contains the information to connect to brokers, servers, clusters and other data spaces. The connector creates a HTTP-client that communicates with the HTTP server to access the AAS. The producer (3 in Figure 1) serves as the interface between the data points of the Streamsheets-application, which transmits information of the HTTP-requests in an “outgoing” direction, from the Streamsheets-application to the HTTP-Connector.


How to Use

TODO: deploy the built docker images to DockerHub TODO: Push the files to BaSyx SDK

A full example for monitoring properties in Asset Administration Shells is given in the Git repository. To run this example, there exist following minimum requirements:

  • Git
  • A running Docker environment

To download the necessary files, you can check out the BaSyx repository from the command line with:

git clone https://git.eclipse.org/r/basyx/basyx

After checking out the repository, you can easily run the example:

1. Browse to /examples/monitoring
2. Run the "start.bat"-file or alternatively run "docker-compose up" in the /docker folder

If there are issues with the docker environment, make sure that the files inside of the git repository are shared with the docker containers by configuring the file sharing mechanism in the docker daemon settings.


How to Build

In addition to directly using the already provided docker images, it is also possible to build them by yourself using the BaSyx SDK and the supplementary projects in the GIT repository. For building the Java projects you will also need the Java Development Kit. In addition, it has to be ensured that the docker daemon is exposed on tcp://localhost:2375 without TLS so that the docker image can be built during the build process.

In order to build the images necessary for the monitoring example, you need to execute the following steps:

  1. Clone BaSyx from the GIT repository ( Extended instructions)
  2. Run the install.bat

Now the automatic build process will build the project binaries and docker images necessary to run the example in accordance to the previous section.


Applications

Grafana

Grafana is an Open-Source application for creating dashboards for different types of datasources. There is already a variety of different panels and datasources available at their official repository.

Grafana Dashboard Example

BaSyx monitoring grafana.png

Setting up a new panel

There are two possibilities for panels that can make use of the proxy

  • Use datasource plugin that comes with the example
  • Use Ajax plugin => can already query any kind of JSON datasource

Streamsheets

Streamsheets is an Eclipse project providing an application for monitoring streams of data from various sources.

Stream Machine Example

BaSyx monitoring streamsheets.png

Setting Up a New Streamsheet

The configuration of the HTTP-connector and the producer follows the following steps:

  1. Start by creating the Connector in the Connector Dashboard in the Administration Menu. Go to the side pane and select the “Administration”.
  2. In the side pane of the “Administration”, select “Streams” -> “Connectors”.
  3. Select the “+”-symbol on the top right to add a new connector.
  4. Enter a name for the connector. The others can be left empty (Figure 2). You can leave all fields empty to be able to utilize this Connector for any URL. If you want to create specific Connectors for every webpage, type in the Base URL.
  5. Go to Side-Pane -> “Streams” -> “Producers”. Click on the “+”-symbol on the top right to add a new producer. (Figure 3)

At run time, the data-points of the Streamsheets-application create HTTP-Requests with the producer periodically. The HTTP-connector communicates with the AAS based on these HTTP-requests. The responses are transmitted back to the Streamsheets-application. For the real time display, HTTP-GET requests are generated cyclically and the responses are updated to the data points in the Streamsheets-application. The configuration of the data points in the Streamsheets-application follow the following steps:


Node Red

Back to the top