Litmus Access Processors for Apache Nifi
This section will provide instructions on how to add the Litmus Access Processors to Apache Nifi.
The Litmus Edge Processors are provided via a compressed zip file.
This guide will provide instructions on how to import the Litmus Access Processors. This guide will not provide instructions on how to install and configure Apache Nifi.
Step 1: Unzip the which includes the three nar files which make the Litmus Access Processors. Note: As Apache Nifi can be deployed on several different systems (Linux, macOS, Windows) and through different deployment mechanism (data center, cloud, container), it is up to the user to identify the right place for this operation.
Step 2: Stop Apache Nifi.
Step 3: Copy the files: - datahub-nifi-processors-nar-1.0.nar - datahub-nifi-service-nar-1.0.nar - datahub-nifi-service-api-nar-1.0.nar into the lib folder of your Apache Nifi installation. Example using Ubuntu Desktop:
Step 4: Start Apache Nifi.
Step 5: To access the Apache Nifi canvas, open your browser and provide the respective URL. By default it will follows this convention https://< Host-IP / URL >:8443/nifi
Example: https://localhost:8443/nifi
Step 6: The username and password has to be set and provided by the admin. Apache Nifi does not come with a default user or password such as applications like Grafana.
Steps to create users are provided by the Apache Nifi documentation.
Step 7: The user is now able to select the DataHubSubscribe and/or DataHubPublish processors
This section will provide instructions on how to prepare Litmus Edge to communicate with Apache Nifi using Litmus Access.
To allow Litmus Edge to communicate through Apache Nifi using Litmus Access, two requirements have to be met beforehand.
- Port 9094 needs to be opened for outbound system
- An Access Account with configured read and/write topics has to be created
This guide will provide instructions on how to open port 9094.
At this point, the below steps have to be executed by a Litmus SME who is able to ssh into the Litmus Edge device in question.
Step | Description |
1 | Use ssh to access the Litmus Edge device. |
2 | Run the command. |
3 | Insert into the file the following entry above the COMMIT statement at the end. |
4 | Run the command. |
This guide will provide instructions on how to create and configure an Access Account.
Step | Description |
---|---|
1 | Log on to the Litmus Edge system which is to communicate with Apache Nifi. |
2 | To , follow the steps described by the Litmus Edge Documentation. |
3 | to be able to be read and/or written to by the Access Account. |
4 | and copy it to be used later in Apache Nifi. To not loose the key, paste it into Notepad or Notepad++. |
This section will provide instructions on how to setup the DataHubSubscribe processor for Apache Nifi to read data from Litmus Edge.
To allow that data can be ingested from Litmus Edge by Apache Nifi using Litmus Access, three requirements have to be met beforehand.
- The Litmus Access Processors for Apache Nifi have to be imported
- Port 9094 needs to be opened
- An Access Account with configured read and optional write topics has to be created
- How to add topics to an Litmus Access Account is described in the Litmus
This guide will provide instructions on how to create a DataHubSubscribe Processor in Apache Nifi to ingest data from Litmus Edge using Litmus Access. This chapter will not provide instructions on how to build an Apache Nifi flow, as is it expected that user are familiar with this process. Also does Apache Nifi provide well documented instruction onto this aspect.
Step 1: Log on to Apache Nifi to be able to create a new Nifi Flow.
Step 2: Add a new processor, by dragging the Add Processor icon from the components toolbar onto the canvas.
Step 3: Select the DataHubSubscribe processor and press the Add button.
Step 4: Double click the DataHubSubscribe processor from the canvas.
Step 5: Select the Properties tab.
Step 6: The first step is to setup the Topic Name which the DataHubSubscribe processor will listen too.
Copy the topic to be used from the Tags UI of Litmus Edge as described by the Litmus Edge user guide.
Select the Value field for the Topic Name property to bring up the value editor.
Paste the topic into the text field and press the OK button.
The topic is now set.
Topics can be
- Either for a single tag Example: devicehub.alias.PLC_RC1_CCS.HTR_HTG_RmpDowTim_SP
- All tags for a specific device Example: devicehub.alias.PLC_RC1_CCS.>
- All tags colelcted by devicehub Example: devicehub.alias.>
- To be able to read data from Litmus Edge through the processor, the topic has to be allowed for the Access Account being used. How to setup topics for the Access Account is described by the chapter "Step by Step guide to create and configure an Access Account".
Step 7: The second step is to add an Access Service, which is the configuration for connecting to the Litmus Edge device.
Select the Value field for the Access Service property to bring up the value editor.
If no Access Service is shown by the drop down, select the Create new service option. If an Access Account does exist, please continue at step 21.
Step 8: To add a new AccessService, press the CREATE button.
Step 9: Now press the arrow icon at the far right side to configure the new Access Service.
Step 10: Confirm the prompt with the YES button.
Step 11: Press the gear icon at the far right to provide the required settings for the AccessService.
Step 12: Select the Properties tab.
Step 13: The first step is to setup the Access URl which is the IP address and port used for connecting to Litmus Edge.
Select the Value field for the Access URl property to bring up the value editor.
Replace the word "localhost" with the IP-address of the Litmus Edge device. Keep the port as 9094. Press the OK button.
The Access URl is now set.
Step 14: The second step is to setup the Access API Key which is used for authentication of the Access Account.
Copy the API key to be used from the Access Account UI of Litmus Edge as described by the Litmus Edge documentation.
Select the Value field for the Access API Key property to bring up the value editor.
Paste the API key into the text field and press the OK button.
The Access API Key is now set.
Step 15: Press the Apply button to accept the settings for the Access Service.
Step 16: Enable the Access Service through the lightning icon on the far right side.
Step 17: Confirm the enabling through the ENABLE button.
Step 18: Wait for the green tick and close the window through the CLOSE button.
Step 19: Wait for the Status to change from Enabling.
to Enabled.
The window may need to be refreshed manually through the Update button at the left lower corner.
Note: If a document icon appears next to the book icon on the left side, an error occurred when trying to connect.
The error text is show when hovering over the document icon.
Step 20: Close the the configuration window.
The focus will now return to the Nifi flow.
Please continue at Step 24.
Step 21: If an Access Service already does exist, that Access Service can be selected from the drop down.
Step 22: Press the OK button.
Step 23: Press the APPLY button.
Step 24: The processor is now ready and can be used to build the rest of the flow.
In Apache Nifi, processors are linked via a connection. How to setup and configure these connections can be found in the Apache Nifi documentation.
The DataHub Subscribe processor will usually be at the start of the flow as it does read data to then be processed.
If part of a flow, the triangle icon will change to a red square. Example flow:
The processor can now be enabled using the Run icon.
The run state is shown by a green sideways triangle.
This section will provide instructions on how to setup the DataHubPublish processor for Apache Nifi to send data to Litmus Edge.
To allow that data can be published to Litmus Edge from Apache Nifi using Litmus Access, three requirements have to be met beforehand.
- The Litmus Access Processors for Apache Nifi have to be imported
- Port 9094 needs to be opened
- An Access Account with configured read and write topics has to be created
How to add topics to an Litmus Access Account is described in the Litmus Documentation for Access.
This guide will provide instructions on how to create a DataHubPublish Processor in Apache Nifi to publish data to Litmus Edge using Litmus Access. This chapter will not provide instructions on how to build an Apache Nifi flow, as is it expected that user are familiar with this process. Also does Apache Nifi provide well documented instruction onto this aspect.
Step 1: Log on to Apache Nifi to be able to create a new Nifi Flow.
Step 2: Add a new processor, by dragging the Add Processor icon from the components toolbar onto the canvas.
Step 3: Select the DataHubPublish processor and press the Add button.
Step 4: Double click the DataHubPublish processor from the canvas.
Step 5: Select the Properties tab.
Step 6: The first step is to setup the Topic Name which the DataHubPublish processor will write too.
To be able to write to Litmus Edge, the topic to be used for writing has to be configured for the Access Account as described by the Litmus Edge user guide.
Select the Value field for the Topic Name property to bring up the value editor.
Enter the topic used for writing into the text field and press the OK button.
The topic is now set.
To be able to write data to Litmus Edge through the processor, the topic has to be allowed for the Access Account being used. How to setup topics for the Access Account is described by the chapter "Step by Step guide to create and configure an Access Account". Step 7: The second step is to add an Access Service, which is the configuration for connecting to the Litmus Edge device.
Select the Value field for the Access Service property to bring up the value editor.
If no Access Service is shown by the drop down, select the Create new service option.
If an Access Account does exist, please continue at step 21. Step 8: To add a new AccessService, press the CREATE button.
Step 9: Now press the arrow icon at the far right side to configure the new Access Service.
Step 10: Confirm the prompt with the YES button.
Step 11: Press the gear icon at the far right to provide the required settings for the AccessService.
Step 12: Select the Properties tab.
Step 13: The first step is to setup the Access URl which is the IP address and port used for connecting to Litmus Edge.
Select the Value field for the Access URl property to bring up the value editor.
Replace the word "localhost" with the IP-address of the Litmus Edge device. Keep the port as 9094. Press the OK button.
The Access URl is now set.
Step 14: The second step is to setup the Access API Key which is used for authentication of the Access Account.
Copy the API key to be used from the Access Account UI of Litmus Edge as described by the Litmus Edge documentation.
Select the Value field for the Access API Key property to bring up the value editor.
Paste the API key into the text field and press the OK button. The Access API Key is now set.
Step 15: Press the Apply button to accept the settings for the Access Service.
Step 16: Enable the Access Service through the lightning icon on the far right side.
Step 17: Confirm the enabling through the ENABLE button.
Step 18: Wait for the green tick and close the window through the CLOSE button.
Step 19: Wait for the Status to change from Enabling.
to Enabled.
The window may need to be refreshed manually through the Update button at the left lower corner.
Note: If a document icon appears next to the book icon on the left side, an error occurred when trying to connect.
The error text is show when hovering over the document icon.
Step 20: Close the the configuration window.
The focus will now return to the Nifi flow.
Please continue at Step 24.
Step 21: If an Access Service already does exist, that Access Service can be selected from the drop down.
Step 22: Press the OK button.
Step 23: Press the APPLY button.
Step 24: The processor is now ready and can be used to build the rest of the flow.
In Apache Nifi, processors are linked via a connection. How to setup and configure these connections can be found in the Apache Nifi documentation.
This processor will most of the time be the last processor in a flow as it does publish data.
If part of a flow, the triangle icon will change to a red square.
The processor can now be enabled using the Run icon. The run state is shown by a green sideways triangle.
Step 25: To verify that data are received by LE, a flow can be used using the Access node and listening to the topic used for writing.
After saving the flow, the Debug window will show the data received from Apache Nifi.
NOTE: In case Apache Nifi is unable to reconnect by itself after a connected LE is rebooted, either restart Apache Nifi or disable and reenable the AccessService.