Skip to content
Minty Trebor edited this page May 1, 2024 · 19 revisions

About NodeDSF

NodeDSF is a set of nodes for Node-Red.

The NodeDSF Node-Red nodes (called dsfnodes) are designed to enable Node-Red to connect to either Duet compatible control boards (DCB), or the Duet Software Framework (DSF) running on a Single Board Computer (SBC).

Node-Red has hundreds of nodes available which allows you to extend the capabilities of your Printer/Machine. See the examples section to see a small collection of working Node-Red examples, including:

  • Time-Lapse Video Creation
  • Alerts to email and smart devices.
  • Colour change notifications

If you install Node-Red on the same r-pi as the DSF you will also gain access to the GPIO.

NodeDSF is intended to be used to help tinkerers to build their own event based software extensions. By using NodeDSF within node-red, a user can build simple or complex processes through an 'easy to learn' user interface. NodeDSF is not a turn-key plugin system, and whilst users can share the tools they develop (as flows), the recipient will always be required to make them work in their own specific environment.

Operating Modes

The dsfNodes have two primary modes of operation depending on how your hardware is configured - Duet Mode and DSF Mode.

Duet Mode establishes connectivity between a stand-alone Duet Control Board (DCB) and Node-Red over a http session.
DSF Mode establishes connectivity between the Duet Software Framework (DSF) running on a Single Board Computer (SBC), and Node-Red over a web-socket.

Choosing between the mode of operation is a configuration parameter set within the Node-Red interface.

How it works

DSF allows external programs to connect and receive information updates when the Machine changes its state. Duet defines anything operated by a control board a Machine, and constructs a Machine Object Model representing the current state of the entire Machine and its associated components. Duet compatible control boards also enable access to the Object Model through polling over rest API calls.

When the dsfnodes establish a connection to the DCB or the DSF, they retrieve a copy of the current Object Model, followed by patches to the Object Model each time the DSF registers a change, or the control board is polled. Patch updates are fragments of the Object Model containing only the changed or updated data. dsfnode receives these patches and updates the full Machine Model it holds in memory. This data is then made available for use by any other nodes in Node-Red.

To compliment the primary function, a set of additional nodes are included to allow the user to take full advantage of the data provided by the DCB/DSF. Refer to the Nodes wiki page to learn how each dsfnode works.

DSF vs Duet Mode

Duet mode enables a direct connection to a v2/3 Duet (or compatible) control board through a network http connection. DSF mode connects to DSF running on an SBC, which is connected to the DCB over SPI (GPIO).

Duet mode should work for any DCB (or compatible) running Wi-Fi/ethernet without an SBC (Duet mode has been tested on a Duet v2 ethernet board only). This mode retrieves a subset of the Machine Model and consumes one of the limited available http user sessions. Some third party control board Wi-Fi configurations are limited to 1 http user session and will not work with Duet mode.

IMPORTANT If you are running a non Duet board (eg lpc) with custom 8266 Wi-Fi these are normally limited to 1 user session max, so Duet Mode will not operate as expected as there are no free sessions available.