FLECS
HomeMarketplaceRessourcesGet started
General
General
  • Introduction
    • 👋Welcome to FLECS
    • 💡What we do
    • ✨Our Features
  • 🧠Our Principles
  • FLECS Core
    • 💡Overview
    • 💾Installing FLECS Core
    • 🎟️License activation
    • 🖱️App Management
      • Install an App from the FLECS Marketplace
      • Updating an App in FLECS Core
      • Using your App with FLECS Core
      • Using the Import/Export Feature in FLECS Core
      • Sideload an App
    • 📯Exchanging data between apps
      • Connect Node-RED via Mosquitto MQTT to the Service Mesh
  • WebApp Whitelabeling
  • FLECS Marketplace
    • 💡Overview
    • 🏋️My Account on FLECS Marketplace
      • 🎫How to Request a Quotation in the FLECS Marketplace
      • ❓How to Submit a Support Request for Marketplace Products
    • 🎬Device Onboarding Service (D-O-S)
    • ®️Whitelabel the FLECS Marketplace
    • 📈Vendor Dashboard
      • How to Create or Edit a Product on the FLECS Vendor Dashboard
      • Adding Staff Members to the FLECS Vendor Dashboard
      • Managing Your Orders on the FLECS Vendor Dashboard
      • Managing Support Tickets via FLECS Vendor Dashboard
      • How To Handle Quotation Requests in the FLECS Marketplace
  • Fundamentals
    • 🛠️First Steps with FLECS
      • Installing Linux Ubuntu on a Virtual Machine
      • Installing FLECS Core on a Windows PC using Docker Desktop
    • 🏷️FLECS Whitelabeling Subscription
  • 📚Glossary
  • Engineering
    • API Docs
    • App Publishing Guide
Powered by GitBook
On this page
  • Prerequisites
  • Example Setup
  • Install Mosquitto MQTT Broker
  • Install Node-RED
  • Configure Node-RED for MQTT
  • Testing and verification
  • Troubleshooting Tips

Was this helpful?

  1. FLECS Core
  2. Exchanging data between apps

Connect Node-RED via Mosquitto MQTT to the Service Mesh

PreviousExchanging data between appsNextWebApp Whitelabeling

Last updated 11 months ago

Was this helpful?

This practical example demonstrates how to integrate Node-RED, a popular flow-based programming tool, with the FLECS Service Mesh using the Mosquitto MQTT Broker. This setup allows for efficient data exchange between Node-RED and other applications within the FLECS ecosystem.

Prerequisites

  • Ensure FLECS Core is installed on your system. Refer to the installation guide if necessary:Installing FLECS Core

  • FLECS Service Mesh and FLECS MQTT Bridge should be installed and operational.

Example Setup

Install Mosquitto MQTT Broker

  1. Navigate to the Marketplace on your device.

  2. Search for 'Mosquitto MQTT Broker' and click 'Install'.

Install Node-RED

  1. Search for 'Node-RED' in the Marketplace and click 'Install'.

Configure Node-RED for MQTT

  1. Go to 'Apps' and select 'OPEN APP' under Node-RED.

  1. Drag and drop an 'Inject Node' and an 'MQTT out Node' to your flow and connect them.

  1. Double-click the timestamp node to set payload, topic, and interval. Click 'Done'.

  1. Double-click the MQTT node, add the server 'flecs-mqtt' with port 1883. Confirm with 'Edit' and 'Done'.

  1. Click 'Deploy' to activate your Node-RED flow.

Testing and verification

  1. Ensure your Node-RED flow is actively sending/receiving messages via the MQTT node.

  2. In the FLECS UI, check the Service Mesh section to verify the FLECS MQTT Bridge's communication with the Mosquitto Broker.

  3. Look for a timestamp from Node-RED every 5 seconds as an indication of successful data exchange.

Troubleshooting Tips

  • If connection issues arise, review the Mosquitto Broker and Node-RED logs for diagnostics.

  • Confirm that network settings, like firewalls, are not obstructing MQTT traffic on port 1883.

  • If you are experiencing connection issues, it may be necessary to restart the relevant app instances. Follow these steps in the specified order for a systematic reset:

    1. Stop the App Instances:

      • First, stop the instances of FLECS Service Mesh, FLECS MQTT Bridge, and Mosquitto MQTT Broker Apps on your device.

    2. Restart in Sequence:

      • Begin by restarting the FLECS Service Mesh.

      • Next, restart the FLECS MQTT Bridge.

      • Finally, restart the Mosquitto MQTT Broker.

    By stopping and then sequentially restarting these components, you can often resolve connectivity issues and ensure a smooth data exchange within the FLECS ecosystem.

By following these steps, Node-RED is effectively integrated into the FLECS Service Mesh, providing a dynamic and versatile environment for data exchange within your industrial automation system.

📯
Open Node-RED Editor
Add inject and mqtt out node to Node-RED flow
Setup inject node for Service Mesh MQTT connection
Click on edit
Setup Node-RED MQTT Broker to connect to the FLECS MQTT Bridge
Random timesstamp from Node-RED via MQTT to the Service Mesh