Run FlowFuse on Siemens IoT2050

Siemens announced the IoT2000 series in March of 2020. With this tool many have been using it to function as a gateway between their plant operations and cloud infrastructure. Onboard it came with Node-RED pre-installed. To manage Node-RED as an organization the FlowFuse agent is recommended, this documentation shows you how to do so.

Warning: Later in the documentation we will be updating Node.js. This will break MRAA library. This will prevent communication to the GPIO of the device.

Goal

The goal of this documentation is to guide the user through the installation process of getting FlowFuse Device agent installed on an IoT2050. The IoT2050 comes pre-installed with version 12.22.x Node.js on the IOT2050_Example_Image_V1.3.1 image. A requirement to install FlowFuse Device Agent, Node.js needs to be upgraded to version 18 minimum. We will be going through that process.

Prerequisites

We will be working with the IoT2050 Advanced, 6ES7 647-0BA00-1YA2. The device has been upgraded to the latest firmware at the time of writing this article of v1.3.1. We will be leveraging the IOT2050_Example_Image_V1.3.1.zip image which is a Debian base OS. To complete this guide, knowledge of Linux-based cli is necessary. Documentation to complete these requirements can be found here.

Step by Step Guide

  1. First we need to run the standard updates.
apt-get update
apt-get upgrade
  1. If you need to migrate your existing Node-RED follow these instructions to backup your existing progress. From there we will need to remove the existing service that autostarts Node-RED by running the following command and rebooting:
systemctl disable node-red.service
reboot -h now
  1. Confirm that your Node-RED instance is no longer running.
systemctl status node-red

In the output look for the text that signifies the service has been stopped.

iot2050-debian systemd[1]: Stopped Node-RED.

  1. Now it is time to upgrade your Node.js version. To check the version before we get started run node -v.

You should see an output like this:

v12.22.5

Warning: updating Node.js will break the MRAA library. This will prevent communication to the GPIO of the device. Details can be found here.

Then, install a tool called n that will allow you to change your versions of Node.js with the following command.

npm install n -g
  1. Next we will install the version 18.17.x (LTS) of Node.js.
n v18.17

Now run node -v again to confirm the installation. You should see the latest version now installed.

v18.17.1

  1. Now that we have Node.js installed, we can proceed with the standard installation process. First install the FlowFuse Device agent. Then, to connect your FlowFuse Device Agent, follow these instructions.

  2. Lastly, if you want your device to run on boot. Follow these instructions.

Switching between versions of Node.js

Switching between versions of Node.js can now be completed by leveraging n command that was installed in step 4. To do so simply run the following to switch back.

n v12.22.5

More on MRAA

The MRAA library is a "Low Level Skeleton Library for Communication on GNU/Linux platform." It has been key for various solutions to communicate to hardware boards GPIO, General Purpose Input Output. The MRAA library only supports version 6.x.x of Node.js, but Siemens put in the effort to patch their deployment up to version 12.22.x of Node.js.