Solutions
Litmus Access Processors for Apache Nifi
38min
overview how to import the litmus access processors into apache nifi this section will provide instructions on how to add the litmus access processors to apache nifi requirements the litmus edge processors are provided via a compressed zip file step by step guide to import the litmus access processors 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 how to prepare litmus edge to communicate with apache nifi this section will provide instructions on how to prepare litmus edge to communicate with apache nifi using litmus access requirements 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 step by step guide to open port 9094 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 vi /etc/iptables/iptables rules 3 insert into the file the following entry above the commit statement at the end \#access a loopedge p tcp m tcp dport 9094 j accept 4 run the command systemctl restart iptables step by step guide to create and configure an access account 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++ how to ingest data from litmus edge using apache nifi this section will provide instructions on how to setup the datahubsubscribe processor for apache nifi to read data from litmus edge requirements 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 step by step guide to ingest data from litmus edge via apache nifi 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 how to send data from apache nifi to litmus edge this section will provide instructions on how to setup the datahubpublish processor for apache nifi to send data to litmus edge requirements 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 step by step guide to publish data to litmus edge via apache nifi 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