Deploying Node-RED with Modbus Support

Node-RED is a powerful, open-source tool designed for integrating hardware devices, APIs, and online services. This guide provides step-by-step instructions for deploying Node-RED on the ALPON X4 via Sixfab Connect. For advanced customization, refer to the official Node-RED documentation.

Prerequisites

Ensure the nodered/node-red container is available in your Sixfab registry. If it is not, follow these steps to add it:

  1. Open a terminal on your personal computer and pull the Node-RED container:

    docker pull --platform linux/arm64 nodered/node-red:latest
    
  2. In Sixfab Connect, navigate to the Applications tab of your asset.
  3. Click on + Add Container and follow the prompts to push container to Sixfab registry.

    📘

    Manage and Deploy Applications

    Visit the Manage & Deploy Applications page for all the necessary details on pushing your container image to the Sixfab Registry.

Alternative Deployment Option:

If you prefer not to use the Sixfab registry, select the I would like to use my own container path option during deployment and enter: nodered/node-red:latest

This will deploy the container directly from Docker Hub.



Deployment Configuration

  1. Go to the Application section of your asset on Sixfab Connect.
  2. Click the + Deploy button to configure and deploy the container.
  3. In the Deploy Container window, use the following settings:

    • Container Name: node-red
    • Image: Select the Node-RED image and tag pushed to the Sixfab Registry, or follow the steps mentioned in the 'Alternative Deployment Option'.
    • Enable Host Network: Enable this option to allow Node-RED to communicate with other devices on your local network.


Check Deployment

Once deployment is complete:

  1. Locate the device’s IP address in the device interface on Sixfab Connect.
  2. Open a web browser and navigate to: http://<DEVICE_IP_ADDRESS>:1880

    📘

    Device IP Address

    The device's IP address can be viewed under Assets Details → Network tab → Interface Monitoring — Details.

  3. The Node-RED dashboard should now be accessible.


Modbus Configuration in Node-RED

After deploying Node-RED, follow these steps to configure Modbus:

Access Node-RED Dashboard

  1. Navigate to: http://<DEVICE_IP_ADDRESS>:1880

  2. Install Modbus Support

    • In the Node-RED dashboard, click on the menu (top-right corner) and select Manage Palette.

    • Go to the Install tab and search for node-red-contrib-modbus.

    • Click Install to add Modbus functionality.

Example: Configuring a Read Flow

  1. Prepare a flow like the one below by dragging and dropping from the palette on the left.
  1. Double click to Modbus Server node and configure it like below and click 'Done', Use 10502 (or another port, as required).
  1. The Modbus Read node must then be configured by double-clicking it.

The example uses 'FC 3: Read Holding Registers' though a different structure can be selected based on specific requirements.

Once the configurations are completed, a server should be added by clicking the '+' button to define the server to be read.

After entering the required fields, first click the 'Add' button and then the 'Done' button to complete the configuration.

  1. Click the 'Deploy' button in the top-right corner of the Node-RED interface.
  2. Check the debug screen. If everything is configured correctly, you should see data being read every 15 seconds.


This guide provides the essential steps to deploy and configure Node-RED with Modbus support on the ALPON X4. For further customization, explore the additional features and nodes available in Node-RED.