Node-RED provides a low cost option for controlling the CTR2 HMI. In addition to providing local control it also provides remote control capabilities via almost any web browser. When coupled with SonoBus to handle two-way audio transport, you have a pretty complete remote station control system. Node-RED allows you to add additional functionality to your remote station by simply adding addition flows created by other users.

Node-RED can be run from almost any PC, from the latest Windows PC to the Raspberry PI 4. I installed it on my old Mac-Mini running Linux. The only requirement is the PC must have a serial port. This is usually provided by a USB serial adapter.

To install Node-RED, download and install if from the Node-RED web site. I highly suggest going through their tutorials on what Node-RED is and how to work with it.

Once you have Node-RED running, add the following Nodes from the Palette Manager (the node-red node is already installed):

Required Nodes for CTR2 Flows

Once you have the required nodes installed, download, unzip, and import the CTR2 flows from my download page. There are a lot of tabs. I split the flows up for the individual pages to make it easier to manage. The upcoming version of Node-RED (v2.1) lets you hide tabs, so that helps.

I’m still pretty new to the Node-RED ecosystem, so forgive me if I didn’t do everything “by the book”. I learn by doing and I’m sure I’ll be changing things around in the future as I learn more.

The first item of business is to edit the serial port assigned to the Serial In and Serial Out nodes. Double click on the Serial In node in the upper left corner of the Comm Rx tab and select the serial port assigned to your USB serial adapter. Leave the settings at 115.2 kB, 8 bits, no parity, 1 stop bit.

Once you have everything installed, deploy the flows and point your browser to {pc IP address}:1880/ui to open the CTR2 dashboard.

Once the web page opens, click on CTR2 in the upper-left corner and select Start Up. On this page, select RESET HMI. This will initialize the global variables in the flows.

You can play with the dashboard without the HMI connected to get a feel for the interface. This allows you to test drive the system before building the boards. Be forewarned that if you don’t have it connected to a CTR2 HMI many of the options won’t show up properly.

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Cookie Plugin by Real Cookie Banner