1.4 Add device process data to Node-RED

After ensuring that your device is properly connected, you can add the device specific node to Node-RED.

Node-RED is an open-source visual programming tool used for wiring together hardware devices, APIs, and online services. It provides a browser-based flow editor, which allows users to create flows using nodes (blocks) and connect them together to define the logic of their application or automation task. Each node represents a function or service, and they can be dragged and dropped onto the editor canvas and connected together to create a flow. Node-RED is pre-installed on the pine.box.

Export the node data from the web interface

To integrate the IO-Link device data in Node-RED, a device specific node needs to be exported from the web interface and later imported into Node-RED. In this example, we are using the process data from our distance sensor.

In the “Process Data” section of the port sub-page of the web interface, select the lower link (red background) labeled “[R/W] “. The upper (grey background) link is used for raw JSON access.

A new tab in your browser will open. The box contains the text description of the node. No worries: You do not need to understand this section.

Click on the “Copy to clipboard” button to copy the content of the box (you will need it in the Node-RED environment).

Import the node data into Node-RED

Now switch to the Node-RED Flows page by clicking on “Node-RED Flows” menu item:

The Node-RED Flow editor opens in a new tab of your browser. The Node-RED environment is available under the same IP-Address as the web interface, only on port 1880:

Import the flow from the clipboard by selecting “Import” from the top-right menu:

Select the tab “Flow1” and paste the text from the clipboard and press “Import”:

Place the blocks on the canvas. The dimensions of the blocks are adjusted after placing.

Done! You created a device specific node for the connected IO-Link device in Node-RED.