Node-Red & Dashboards
Node-Red is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.
The DAQAstra application provides a service called FlowGen
, which generates Node-Red flows for the user-defined firmware. These flows will provide an out-of-the box dashboard interface to view realtime data and send commands to a DAQAstra. For most use cases, the shipped flows are sufficient, giving the user a zero-code interface to the services on the DAQAstra.
However, Node-Red, is an open-source tool that gives the user the power to extend the service interfaces to their needs. Whether a DAQAstra's control output must be made to react to another LAN connected machine's data, automation is desired, or emergency cut-offs need to be implemented, Node-Red coupled with FlowGen
makes accomplishing these requirements easier than ever.
To get a glimpse of the possibilities available, take a look at the sheer number of nodes that are available in the Node-Red ecosystem.
Using FlowGen
Once a firmware has been defined in the DAQAstra interface, one can generate and deploy a control panel for that firmware using the button highlighed in the image below.
This button deploys a set of Node-Red nodes that allow the user to interface with the defined services on the DAQAstra.
Note that every click of the button deploys a new control panel! So once it has been generated, navigate to it, instead, using the 'Run' page (Play button on the left sidebar).
However, the user will want to generate a new control panel once a firmware has its services changed.
In the Flow Diagram
page accessed via the sidepanel button directly below the Run
button, the user gets access to the Node-Red flows associated with their various control panels. This page provides a visual programming interface to add any number of functionalities to the DAQAstra's existing services and generated interfaces.
An example of such an additional functionality is demonstrated in the above example. Here, a function is added that takes messages from the DAQAstra containing measurements from analog-input on pin AIN0. The function checks if that measurement exceeds a threshold, then outputs a command for the DAQAstra's analog-output based on that threshold comparison result. This could be used for a very simple application like controlling a DC motor's speed based on some sensor measurement. Node-Red also ships nodes that handle scheduling, state-machines, complex mathematics and even LLM intergrations. It also provides a very large number of interface nodes for every kind of communication protocol imaginable, allowing other devices on your network to plug into the DAQAstra's services.
Here's another example flow used in the lab at TransAstra. Here, a DAQAstra is connected to a few soil moisture sensors and the measurements are compared against a minimum threshold. When the moisture drops too low, the flow triggers a rate-limited message to the company MatterMost, reminding employees to water the plants.
While these examples are relatively simple, they act to demonstrate the capability of Node-Red and the value that DAQAstra's tight integration with Node-Red brings to the table. At TransAstra, we use Node-Red and DAQAstra to rapidly get a project up and running. At that point, the need for more production-ready code may be necessary depending on the circumstance, however, this is no issue because fundamental design of this software has already be done in Node-Red and the API for the DAQAstra's services are documented for the convenience of any user.