Node-RED is a visual programming tool. Visually displays relationships and functions, and allows the user to program without having to write a line of code. Node-RED is a browser-based flow editor where you can add or remove nodes and connect them to each other in order to make them communicate with each other. It is an emerging, free and very attractive platform to integrate all kinds of radio room accessories.

This site does not pretend to explain or clarify all the possibilities that Node-Red offers, without a doubt that you will find on the Internet all kinds of information about what Node-Red is and can be done. Here we are going to see how you can control your motor control system (ARS-USB) or Stacks/Antennas controller (RemoteBox) from this platform so that it is a very interesting alternative for controlling motors and antennas.

To simplify Node-Red access to RemoteBox, we are going to use the ser2net service. This ser2net program acts as a router from serial port to TCP/IP then from Node-Red instead of using the serial port, a TCP/IP connection will be used.

Note: There is an advanced version of ser2net called ser2net+ that allows several simultaneous TCP/IP connections to the same serial port, with which we can have, for example, the RBM and Node-Red accessing the same RemoteBox

This diagram shows the diagram of the complete solution. It consists of the following modules:

  • Ser2Net: module that listens on a TCP/IP port and routes traffic to the serial port of each device (ARS-USB, RemoteBox or StackMain). Node-Red accesses this service to access the equipment to be controlled.
  • Node-Red: Visual flow programming platform that will allow controlling any of the equipment: ARS-USB, RemoteBox, StackMain.
  • EA4TX Flow: Demo flow for Node-Red, which controls any of the equipment designed by EA4TX (RemoteBox, ARS-USB, …) and provides a graphical interface for motor control.

The solution offers 2 interfaces:

  • Browser: On the one hand, Node-Red (EA4TX Flow) provides a graphical interface via WEB, with which any mobile device, tablet or computer can interact and manage the RemoteBox antenna controller
  • Native TCP/IP: so that the RBM program that is included with the RemoteBox, can coexist and interact with the RemoteBox controller.

The ideal hardware platform to manage the equipment (ARS-USB, RemoteBox, …) is undoubtedly the Raspberry Pi (aka RsPi) due to its reliability, low consumption – with which we do not worry about leaving it on 24 hours – and at its interesting price.

Since an RsPi has 4 USB ports, we can have up to 4 different computers connected by Raspberry Pi.

In a few simple steps, we are going to implement this solution, it will not be necessary to have great computer knowledge although you can always request a Raspberry Pi or the image with Node-Red and everything already installed in our store.

1.- Ser2Net service installation

The ser2net service can be installed using the command:

sudo apt-get install ser2net

Now you edit the configuration of this service, which will be in the directory:

/etc/ser2net.conf

To edit it, type:

sudo nano /etc/ser2net.conf

You go to the end of the file, remove the examples that come by default and add a line similar to:

8001:raw:600:/dev/ttyACM0:38400 8DATABITS NONE 1STOPBIT

In this example, RsPi listens on port 8001 and sends all traffic to serial port ttyACM0.

Note: If the RemoteBox is on another serial port, replace ttyACM0 with the corresponding one.

To automatically start the service, you must write:

sudo service ser2net restart

With this we have already achieved that the connections to this port of the RsPi are routed to the RemoteBox. If you are going to use Node-Red, the access will be done through TCP pointing to that port.

In case you need to route the traffic for 2 or more equipments, you must include one line per device, so that if you have 2 units (ie ARS-USB and RemoteBox) you will have to add two lines – one per device – where you will specify the different ports on which to listen (ie 6001 and 8001) and different serial ports (ie ttyACM0 and ttyACM1) to access each device.

2.- Node-Red Installation

Although Node-Red can work on any platform (Linux, Windows, Mac OSX), here we are going to limit its operation with a Raspberry Pi.

To install Node-Red, without a doubt, it is best to go to the official source:

https://nodered.org/docs/getting-started/raspberrypi

And once installed, you can access your Raspberry Pi through the browser:

http://<hostname>:1880

Note: replace <hostname> with the IP of your Raspberry Pi

3.- Import "EA4TX Flows"

To familiarize yourself at first with Node-Red, it is best to read some tutorial on the internet or watch a video, specifically to become familiar with the environment and its interface, to know what a node is, how to edit nodes, how they connect with each other and above all , load or import a Flow, since this is where you will have to go to be able to import the Flow from the ARS.

To import the Flow file for the ARS control you must go to the upper right and indicate Import

Select the file to import and import it over a new flow.

In this case, the import has added 2 Flows or flows:

  • EA4TX ARS Rotor: for rotor management
  • RemoteBox: for RemoteBox (Antennas) management

The flows group nodes that will allow the equipment to be represented graphically. In the case of the RemoteBox flow, nodes are grouped together that correspond to each of the antennas and the node that manages access to the RemoteBox, which we will call sub-flow.

In addition, 2 subflows have been incorporated:

  • EA4TX Rotor Node
  • RemoteBox Node

Sub-flows are a set of nodes that operate as a library. The EA4TX Rotor Node subflow manages everything related to motor control, while the RemoteBox Node subflow handles everything related to the RemoteBox (antenna controller).

Thus, for example, when one of these subflows is incorporated into a Flow, it is represented as one more node; This subflow has 2 properties that are:

  • IP of the equipment (for example if it is on the same machine 127.0.0.1)
  • Port: Port that it is listening on. This parameter, for example, corresponds to the port defined in the ser2net service for that device.

On the other hand, each sub-flow includes a command input, and an output for its responses.

The input of this sub-flow is used to send orders, for example to activate/select antennas and the output to know the state of the antennas.

Finally, we are going to explain the operation of the RemoteBox flow

Communication management with the RemoteBox is provided by the sub-flow that is seen at the bottom and is represented as a red node. It has an Input marked with  9 and its exit with 1 .

The output is connected to point  2  where it is processed. Since this RemoteBox is a version of 2 Radios and 6 Antennas, it is processed if the response is for Radio 1 to go to node  3  or to  4 

In each of these nodes  3  or  4 , the information for each of the antennas is analyzed and sent to the next node for visualization and processing (nodes  5  and  6 ).

If the user interacts with the buttons of the antennas (any of the nodes  6 ), its output is interpreted by the nodes  7  and directed towards the sub-flow accessed by  9 

And the aspect of the complete flow for the control of the RemoteBox, is the following:

You can download this Flow:

 

Due to an excess in the current workload, delivery times can be extended up to 2 weeks.

 

Debido a un exceso en la actual carga de trabajo, los plazos de entrega se pueden alargar hasta 2 semanas.

This will close in 8 seconds