|
1 |
| -# Databus Ping Pong implementation in Javascript |
| 1 | +# Databus Ping Pong Node.js |
| 2 | + |
| 3 | +This application example contains the source files to build a Databus Ping Pong application implemented in Node.js. |
| 4 | + |
| 5 | +- [Databus Ping Pong Node.js](#databus-ping-pong-node-js) |
| 6 | + - [Description](#description) |
| 7 | + - [Overview](#overview) |
| 8 | + - [General task](#general-task) |
| 9 | + - [Requirements](#requirements) |
| 10 | + - [Used components](#used-components) |
| 11 | + - [Further requirements](#further-requirements) |
| 12 | + - [Installation](#installation) |
| 13 | + - [Usage](#usage) |
| 14 | + - [Documentation](#documentation) |
| 15 | + - [Contribution](#contribution) |
| 16 | + - [Licence and Legal Information](#licence-and-legal-information) |
2 | 17 |
|
| 18 | +## Description |
3 | 19 |
|
| 20 | +### Overview |
4 | 21 |
|
5 |
| -- [Databus Ping Pong implementation in Javascript](#databus-ping-pong-implementation-in-javascript) |
6 |
| - * [Description](#description) |
7 |
| - + [Overview](#overview) |
8 |
| - * [Installation](#installation) |
9 |
| - * [Usage](#usage) |
10 |
| - * [Documentation](#documentation) |
11 |
| - * [Contribution](#contribution) |
12 |
| - * [Licence and Legal Information](#licence-and-legal-information) |
| 22 | +This application example shows how to connect to the IE Databus via MQTT and how to publish and subscribe data using an implementation in Node.js. |
| 23 | +The IE Flow Creator is used to exchange data between different topics within the IE Databus. |
13 | 24 |
|
14 |
| -## Description |
15 |
| -This repository contains the source files to build the Databus Ping Pong application example implemented in Javascript. Please refer to the [main repository](https://github.com/industrial-edge/pingpong-python) for more information about this application example. |
| 25 | + |
16 | 26 |
|
17 |
| -### Overview |
| 27 | +This implementation example uses the ``node:14.17.1-alpine`` image as the base layer and runs the provided script after installing all necessary dependencies. |
| 28 | + |
| 29 | +This example also shows two ways of configuring the application: |
| 30 | + |
| 31 | +- configuration via file upload (fix configuration file) |
| 32 | +- configuration via system app Configuration Service (custom configuration UI with JSON Forms) |
| 33 | + |
| 34 | +### General task |
| 35 | + |
| 36 | +The application includes a MQTT client to subscribe to one topic of the IE Databus and waits to receive data. When data arrives, it publishes a corresponding answer to a second topic of the IE Databus. If it receives the string "Ping", it will answer with "Pong" and the other way around. |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +The names of the IE Databus topics as well as the credentials used by the application can be configured via different options, otherwise environmental variables included in the docker-compose file are used. |
| 41 | + |
| 42 | +## Requirements |
18 | 43 |
|
19 |
| -This implementation of the Databus Ping Pong application example uses the ``node:10.16.3-alpine`` image as the base layer and runs the provided script after installing all necessary dependencies. |
| 44 | +### Used components |
20 | 45 |
|
| 46 | +- Industrial Edge Management (IEM) V1.2.0-36 / V1.2.14 |
| 47 | + - IE Databus Configurator V1.2.23 |
| 48 | + - IE Databus V1.2.16 |
| 49 | + - IE Flow Creator V1.1.2 |
| 50 | + - IE App Configuration Service V1.0.5 |
| 51 | +- Industrial Edge Device (IED) V1.2.0-56 |
| 52 | +- Industrial Edge App Publisher V1.2.7 |
| 53 | +- Docker Engine V20.10.3 |
| 54 | +- Docker Compose V1.28.5 |
| 55 | + |
| 56 | +### Further requirements |
| 57 | + |
| 58 | +- IED is onboarded to a IEM |
| 59 | +- IE Databus Configurator is deployed to the IEM |
| 60 | +- IE Configuration Service is deployed to the IEM |
| 61 | +- IE Databus is deployed to the IED |
| 62 | +- IE Flow Creator is deployed to the IED |
21 | 63 |
|
22 | 64 | ## Installation
|
23 | 65 |
|
24 |
| -Please refer to the [Installation](https://github.com/industrial-edge/pingpong-python/blob/main/docs/Installation.md) section of the main repository on how to build and deploy the application to a Industrial Edge Device. |
25 |
| -When creating a configuration for the application in the Industrial Edge Management System, you can use the the [mqtt-config.json](cfg-data/mqtt-config.json) file from this repository. |
| 66 | +Please refer to the [Installation](https://github.com/industrial-edge/pingpong-csharp/blob/main/docs/Installation.md#installation) section of the *Ping Pong in C#* repository on how to build and deploy the application to an IED. Just use the source files from this repository and follow the instructions. |
| 67 | + |
| 68 | +- [Build application](https://github.com/industrial-edge/pingpong-csharp/blob/main/docs/Installation.md#build-application) |
| 69 | +- [Configuring the Industrial Edge Databus](https://github.com/industrial-edge/pingpong-csharp/blob/main/docs/Installation.md#configuring-the-industrial-edge-databus) |
| 70 | +- [Create configuration for the application](https://github.com/industrial-edge/pingpong-csharp/blob/main/docs/Installation.md#create-configuration-for-the-application) |
| 71 | +- [Upload the application to the Industrial Edge Management](https://github.com/industrial-edge/pingpong-csharp/blob/main/docs/Installation.md#upload-the-application-to-the-industrial-edge-management) |
| 72 | +- [Configuring and deploying the application to a Industrial Edge Device](https://github.com/industrial-edge/pingpong-csharp/blob/main/docs/Installation.md#configuring-and-deploying-the-application-to-a-industrial-edge-device) |
26 | 73 |
|
27 | 74 | ## Usage
|
28 | 75 |
|
29 |
| -Please refer to the [Testing](https://github.com/industrial-edge/pingpong-python/blob/main/docs/Installation.md#testing-the-application-using-simatic-flow-creator) section of the main repository on how to build and deploy the application to a Industrial Edge Device. |
| 76 | +Once the application is successfully deployed to the IED, it can be tested using the IE Flow Creator. |
30 | 77 |
|
31 |
| -## Documentation |
| 78 | +On the IED restart the PingPong application, to ensure the right configuration is used. Then open the app IE Flow Creator and set it up as following: |
| 79 | + |
| 80 | +- Connect an "inject" node with a "mqtt out" node |
| 81 | +- Connect a "mqtt in" node with a "debug" node |
| 82 | +- Configure the mqtt-nodes to connect to the databus (mqtt broker, username, password) |
| 83 | +- Set the topics of the mqtt-nodes according to the configuration of the application (here: "topic1" to publish to, "topic2" to subscribe to) |
32 | 84 |
|
| 85 | +Deploy the flow and test by injecting a string payload into the mqtt in node. If the string is "Ping", the application will answer with "Pong". If the string is "Pong" the application will answer with "Ping". |
| 86 | + |
| 87 | +The finished flow is available [here](src/Flow_Pingpong_Test.json) and can be imported into the IE Flow Creator. |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +## Documentation |
33 | 92 |
|
34 |
| -You can find further documentation and help in the following links |
35 |
| - - [Industrial Edge Hub](https://iehub.eu1.edge.siemens.cloud/#/documentation) |
36 |
| - - [Industrial Edge Forum](https://www.siemens.com/industrial-edge-forum) |
37 |
| - - [Industrial Edge landing page](https://new.siemens.com/global/en/products/automation/topic-areas/industrial-edge/simatic-edge.html) |
38 |
| - - [Industrial Edge GitHub page](https://github.com/industrial-edge) |
| 93 | +You can find further documentation and help in the following links: |
| 94 | + |
| 95 | +- [Industrial Edge Hub](https://iehub.eu1.edge.siemens.cloud/#/documentation) |
| 96 | +- [Industrial Edge Forum](https://www.siemens.com/industrial-edge-forum) |
| 97 | +- [Industrial Edge landing page](https://new.siemens.com/global/en/products/automation/topic-areas/industrial-edge/simatic-edge.html) |
| 98 | +- [Industrial Edge GitHub page](https://github.com/industrial-edge) |
39 | 99 |
|
40 | 100 | ## Contribution
|
41 | 101 |
|
|
0 commit comments