Node-RED Installer

From Open Source Controls Wiki
Revision as of 13:03, 29 November 2022 by Rhg (talk | contribs)
Jump to navigation Jump to search

The controls architecture is built around Node-RED and Docker, and the Node-RED Installer is the method used to set everything up.

The concept is as follows:

  1. A startup flow is loaded into Node-RED and deployed.
  2. This flow pulls the latest files from the GitHub repository, and creates a Docker container running Node-RED on port 5099, on which it installs a Node-RED Setup flow, with access to all credentials.
  3. The setup flow provides a menu system to select the required Application (Node-RED flows) and Mods (additional Node-RED flows to be added to the application).
  4. As items are selected, they are installed with credentials onto the original Node-RED on port 1880.
  5. Additional Node-RED containers, on ports 5001+, are started to implement isolated services such as data management, that may need separate access rights or updating.
  6. The setup container is closed.


This method has a number of advantages:

  • Entirely handled by Node-RED. Other systems are used by Node-RED, but using the same platform to orchestrate everything makes things more user friendly.
  • A standard simple Node-RED flow can be used as a starting point to install any system. https://github.com/heatweb/plumbing-controller/blob/main/flows/flows_install_installer.json
  • Node-RED provides a powerful method to manage containers, with the ability to spin up temporary containers based on logic, running any services needed to boost the systems abilities.
  • Credentials for both Node-RED elements and Docker containers can all be managed by the single setup container, that is killed once the system is up.
  • Better updating control, with the ability to build (and rebuild) custom Node-RED flows from scratch, from a large selection of flow pages that each provide a specific function.
  • Updating is performed live, without closing down existing flows. Variables are kept in memory during updates. The system can then be rebooted (if required) to clear out old variables in memory, but is generally not needed for minor updates or adding functions.
  • Manufacturers can develop their own flows adapted for different functions, place them into the GitHub repository, and make available to controllers at setup.
  • Improved reliability, with services isolated in separate containers. Redundancy can be built into the architecture.
  • Complicated setup procedures, including systems scripts, can be maintained in a Node-RED flow (stored on GitHub), deployed as needed in privileged containers, and removed.

Prerequisites:

  • Node-RED on port 1880 (with Dashboard nodes installed)
  • Docker