Tutorial flecs

Building a Live Dashboard with FLECS, Node-RED, InfluxDB and Grafana.

In this tutorial, we introduce FLECS and use it to build a simple live dashboard on a Raspberry Pi.

What is FLECS?

FLECS is an application platform for embedded and edge devices. You can think of it as an app store for your device: applications are packaged as containers, and FLECS takes care of downloading, installing, starting, updating and removing them. You operate everything from a web interface in your browser, without logging in to the device shell or typing commands.

What do you get from FLECS?

  • Ready-made applications instead of building everything yourself. Instead of compiling software, resolving dependencies and writing service files, you pick an application from the FLECS marketplace and click Install.
  • Isolation. Every application runs in its own container, so applications do not interfere with each other or with the operating system.
  • Easy updates and removal. Updating or removing an application is a click, and it does not leave remnants behind in the system.
  • One place for management. Installing, configuring, starting, stopping and inspecting logs of all applications happens in a single web UI.
  • Fleet management. FLECS is not limited to a single device. It lets you manage whole fleets of devices centrally, as described below.

Fleet management: from one device to thousands

A single device is easy to look after by hand. The real challenge begins once your product is deployed many times, at different sites, possibly with different configurations and software versions. Logging into each device one by one does not scale.

FLECS fleet management addresses exactly this. From one central place, you can:

  • keep an overview of all your devices and see which applications and versions run on which of them,
  • roll out applications and updates to many devices at once instead of touching each one individually,
  • keep devices consistent, so that you know what is running in the field and can reproduce problems, and
  • operate devices remotely, even if they are located at your customers’ sites behind firewalls, without exposing additional access paths.

Combined with IGLOS, this also covers the operating system: since IGLOS devices are updated remotely through a secure A/B update mechanism, both the operating system and the applications of your whole fleet can be kept up to date from the same place, which is a key part of meeting the CRA requirement to provide security updates throughout the product lifecycle.

In this tutorial, we work with a single device so that you can get to know the basics. Everything you learn here, installing and configuring applications through the FLECS UI, is the foundation that fleet management builds on.

A practical example

Imagine you operate a small machine and want to record its temperature and display it as a live chart. On a plain Linux system, you would have to install and configure a database, a tool to collect the data and a dashboard software, and then keep all of them up to date.

With FLECS, this becomes: install Node-RED (collects and processes the data), InfluxDB (stores it as a time series) and Grafana (visualizes it) from the marketplace, and then connect them to each other. This is exactly what we will do in this tutorial. For simplicity, we replace the real sensor by a generated sine wave, but the setup is the same for real measurements. And if you later deliver not one but a hundred of these machines, fleet management lets you roll out and update this setup on all of them centrally.

Why FLECS on IGLOS?

FLECS already provides a convenient installer for Linux-based systems. However, when you deploy FLECS on a conventional Linux distribution, you remain responsible for securing and maintaining the underlying operating system. That means significant initial and ongoing effort to meet the requirements of the EU Cyber Resilience Act (CRA). From December 2027, manufacturers of products with digital elements will, with limited exceptions, need to meet the CRA’s cybersecurity requirements.

FLECS on IGLOS provides an integrated solution: a secure, CRA-compliant and purpose-built operating system and the FLECS application platform in one package. You do not need to harden or maintain the operating system yourself, and there is no console or SSH access that would have to be secured: the device is operated entirely through the FLECS UI or the FLECS fleet management.

Continuous Vulnerability Management

A key part of CRA compliance is having processes in place to identify, assess, and address vulnerabilities throughout the product lifecycle.

IGLOS is continuously monitored for vulnerabilities by Linutronix in accordance with the vulnerability-handling requirements of CRA Annex I, Part II. Linutronix brings deep expertise in the Linux and open-source ecosystem, including the maintenance of critical Linux kernel subsystems and OpenSSL in Debian. Linutronix understands CVEs not just at the advisory level, but in terms of their underlying technical details, affected components, exploitability, and actual impact on a system. The company has also contributed to the resolution of high-profile security vulnerabilities, including Meltdown and Spectre.

How IGLOS Addresses the CRA Requirements

Beyond vulnerability management, IGLOS addresses the essential cybersecurity requirements of CRA Annex I, Part I:

1. Secure Risk-Based Development

IGLOS is designed and developed according to Linutronix’s secure development lifecycle process, certified according to IEC 62443-4-1 and based on systematic cybersecurity risk management.

2a. Releases Without Known Exploitable Vulnerabilities

The release process is designed to prevent production images from being released with known exploitable vulnerabilities.

2b. Secure by Default

IGLOS is delivered with a secure-by-default configuration. No additional hardening is required for the operating system by the user. Initial setup is limited to onboarding and establishing the initial credentials.

2c. Secure Remote Updates

IGLOS includes an integrated A/B update mechanism for secure remote software updates. This avoids the need for manual updates through a local console or SSH with root-level privileges, as is commonly required with conventional Linux installations.

2d. Prevent Unauthorized Access

This update solution means there is not even a need to provide console or SSH access at all. User access is provided through the FLECS UI.

This eliminates an additional operating-system access layer that must otherwise be secured and maintained. Shared or fixed credentials for maintenance access can create significant security risks, making many products in the market today non-compliant with the CRA.

2e. Protection of Confidential Data

FLECS on IGLOS protects not only credentials, but also the intellectual property and trade secrets contained in the system. Because console and SSH access are disabled, this data cannot simply be read out through an operating-system shell. To additionally protect against offline access, for example, by removing the storage medium and connecting it to another computer, FLECS on IGLOS can store the system’s data in an encrypted partition.

Note: This feature is disabled in the trial version described below. Contact us to discuss enabling encrypted storage on a Raspberry Pi or your target hardware platform.

2f. Integrity Protection and Secure Boot

The IGLOS operating system is protected against accidental and malicious modification. This includes a complete secure-boot chain, from hardware-rooted keys through to a dm-verity-protected root filesystem.

Note: The tutorial below does not permanently provision the hardware-rooted keys, as doing so would prevent the Raspberry Pi from being reused for other purposes.

2g. Data Minimization

With FLECS on IGLOS, the responsibilities for data processing are clearly defined. As an embedded operating system, IGLOS maintains only system state and technical data required for its runtime services, while the FLECS layer is responsible for user management and application-level data. No redundant data like an additional user management on OS layer is required.

2h. Availability and Resilience

The trial version of FLECS on IGLOS includes basic denial-of-service protection. Additional measures can be discussed based on the specific availability and resilience requirements of your application.

2i. Minimized Negative Impact on Other Devices or Networks

Since the functionality of the system is strictly confined to the use of FLECS and the essential operating system functionality, no accidentally or maliciously installed processes will have a negative impact on other devices or networks.

Outbound firewall rules can be configured according to the requirements of the target application and network environment.

2j. Limited Attack Surface

The system is operated through the FLECS UI. Interfaces that would unnecessarily increase the attack surface, including the serial console and SSH, are disabled.

2k. Exploitation Mitigation

IGLOS incorporates multiple exploitation-mitigation mechanisms, including a hardened Linux kernel and mandatory access control enforced through AppArmor.

2l. Security Monitoring and Audit

IGLOS can collect audit messages and relevant system events and forward them to external Security Information and Event Management (SIEM) systems such as Wazuh.

2m. Secure Deletion

FLECS on IGLOS enables users to permanently delete their data and settings through an authenticated deletion process. The process covers user-associated data and settings so that, following deletion, they are no longer available for normal use.

Clear Responsibilities Across the Software Stack

Beyond cybersecurity, Linutronix and FLECS each take responsibility for their respective layers of the system, giving you clear ownership and expertise across the entire solution, so you can focus fully on your applications.

Linutronix takes care of the operating system layer, including porting to your specific hardware, kernel driver development, and optimization for demanding real-time performance. As a driving force behind the development and evolution of Preempt-RT, Linutronix brings unparalleled expertise in Linux real-time technology.

FLECS brings the same level of expertise to the application layer, providing the industrial application platform and taking responsibility for the integration and operation of your applications.

With Linutronix and FLECS at your side, you have trusted experts across the entire software stack working together to deliver a reliable, optimized, and application-ready system.

FLECS on IGLOS Evaluation Tutorial

To evaluate how FLECS on IGLOS works, we provide a pre-built image that can be installed on a Raspberry Pi. Images for other systems are available on request.

This tutorial builds on the previous tutorial that has demonstrated how to install an image on a microSD card for the Raspberry Pi and shares the same prerequisites.

Note: This trial version only provides a limited amount of storage for downloading and installing FLECS applications and omits a few security features as outlined above. Contact us to arrange an extended evaluation.

Step 1 – Create a FLECS account

This tutorial requires an account for FLECS as well as a license. A 30 day free trial is available.

Go to https://flecs.tech/ and create an account. Under Marketplace -> FLECS Licenses select a license and finalize the ordering process.

Step 2 – Download and Flash the IGLOS FLECS Image

For the FLECS tutorial, you need to download and flash the following image on a microSD card as described in the flashing tutorial ( https://www.iglos.com/tutorial-flashing/ ).

https://nextcloud.linutronix.de/public.php/dav/files/4wMznQdFKCitEcb/IGLOS_Tutorial_FLECS_13.7.1.img.xz

Step 3 – Open the FLECS UI

To access the FLECS web interface, you need to find out the IP address of the device. If you already determined an IP during the networking tutorial ( https://www.iglos.com/tutorial-network/ ), your DHCP server will likely have provided the same IP address. Otherwise, you will also be able to see your IP when connecting your Raspberry Pi to an HDMI monitor.

With it, open the FLECS web interface in your browser:

https://YOUR_DEVICE_IP

Your browser will now show a warning about an untrusted certificate. In the course of this tutorial, this is expected since the FLECS UI has generated a self-signed certificate that cannot be validated with a well-known certificate authority.

If you want to verify the device is really your Raspberry Pi and no man-in-the-middle, you can compare the certificate fingerprint shown by your browser with the one displayed on a monitor connected to the HDMI port of the Raspberry Pi. Depending on your browser, proceed as follows. The labels vary between browser versions and languages, so if yours differ, look for the closest equivalent.

Firefox

  1. Click on Advanced….
  2. Optional verification: click on View the site’s certificate, scroll to Fingerprints and compare the entry at SHA-256 with the value displayed on the monitor.
  3. Click on Accept the Risk and Continue.

Chrome

  1. Optional verification: click on Not secure in the address bar and open the certificate details from there. Compare the entry at SHA-256 under Fingerprints with the value displayed on the monitor (ignore the colons and capitalization).
  2. Click on Advanced.
  3. Click on Proceed to YOUR_DEVICE_IP (unsafe).

For production usage, we can support you to install a trusted certificate in the device.

Step 4 – Activate the Device

Your Raspberry Pi needs internet access for this step, because the activation is checked against the FLECS servers. It also needs internet access for the next step, because the apps are downloaded from the FLECS marketplace when you install them. The apps are only stored on the device and are not permanently connected to the internet afterwards. Connect an Ethernet cable to the Raspberry Pi and the device will automatically get an IP address via DHCP. WiFi is not supported in this evaluation version.

Two different accounts are involved in this step, so do not mix them up:

  • The initial account on the device: When you open the FLECS UI for the first time, you are asked to create an initial user. This account is stored only on your Raspberry Pi. Choose any username and password, and keep them safe: because there is no console or SSH access, this is your only way into the device. Then log in with these credentials.
  • Your FLECS account: This is the online account you created at https://flecs.tech/ in Step 1. Under System, activate your device by entering the credentials of this account. The activation binds the license from Step 1 to your device.

Step 5 – Install Node-RED, InfluxDB and Grafana via FLECS

We are going to use Node-RED, InfluxDB and Grafana to demonstrate a simple showcase of how applications can interact via FLECS.

To install them, go to Browse, search for these three apps and click on Install Now for all three.

It will take a moment until all three are installed. You can see the status in the lower right corner. Finally, respective entries will appear in the left menu.

If an app is installed, but does not appear automatically, go to Installed Apps and at the three dots right of the apps, click on Start.

Step 6 – Set up Node-RED

On the left menu of FLECS, under Editors click on Node-RED editor.

The question about the update notification is not relevant in the context of this tutorial. After you have clicked through the initial explanation, you get to an empty plane.

First, we need to install the module for InfluxDB integration. Click in the upper right corner on the symbol with three stacked lines, then Manage palette, then the Install tab. Type in node-red-contrib-influxdb and click on the install button next to that module, then Install again. Close the palette dialogue.

When you scroll down now to the very bottom on the left side, you will find an influxdb out node. Drag and drop that on the plane.

Now comes the data to fill in. For demo purposes, we will use a simple sine wave, but you can be very creative here. For a real world application, you would usually fetch some measurements from a sensor (e.g. via MQTT), but that is outside the scope of this tutorial, because you would need suitable hardware for that.

Find the function node on the left and drag-and-drop it onto the plane. Connect its right port with the left port of the influxdb out node. Double-click onto the function node and paste in the following script:

let t = msg.payload / 1000;  // timestamp in seconds
let period = 60;             // seconds

msg.payload = 50 + 50 * Math.sin(2 * Math.PI * t / period);

return msg;

Now add an inject node to the plane and connect its right port with the left port of the function node. Double-click on the inject node. As you can see it will generate messages with the milliseconds since epoch (1970-01-01). To do that repeatedly, enable the checkbox at the bottom and set Repeat to interval, then every 1 seconds. Click on Done to get back.

Finally, double-click on the influxdb out node to open its settings. For measurement type demomeasurement. At Server, click on the plus sign. At Name type flecs-on-iglos-influx-db and under Version select 2.0. In order to fill in the remaining values, we first need to set up InfluxDB. So leave the dialogue open for now, we will continue in the next step.

Step 7 – Connect Node-RED and InfluxDB

In this step, we set up InfluxDB and connect it to Node-RED. For that, you have to switch between two applications several times and pass over some values from one to the other. So please open the FLECS UI in a second browser window (by opening again https://YOUR_DEVICE_IP). In the following, we call the window with Node-RED the Node-RED window and the second one the InfluxDB window.

We need to find out the hostname of the InfluxDB container, because that is the address under which Node-RED can reach it. We do that before even opening InfluxDB. In the InfluxDB window, go to the FLECS UI, click on Installed and besides InfluxDB on the three dots, then Info & Logs. Note down the string besides Hostname (will be something like flecs-8f8b0d22).

Back in the Node-RED window, enter at URL http://HOSTNAME:8086, where HOSTNAME is to be replaced by the hostname you just looked up.

Now go to the InfluxDB window and, on the left menu of FLECS, under Editors click on InfluxDB to get to the setup wizard. Click on Get Started, then type in a username and password of your choice.

Under Initial Organization Name, type in flecs-on-iglos-org. Similar for Initial Bucket Name, with flecs-on-iglos-bucket.

Then, in the InfluxDB window, click on Configure Later, because the other wizards do not help us for the minimal configuration we are still about to make, that is creating API tokens. For that, click on Load Data (the symbol on the left with the upward arrow), then API Tokens.

Click on Generate API Token, then Custom API Token. Describe it with Node-RED Ingress and under Buckets, click at flecs-on-iglos-bucket on Write, then click on Generate.

InfluxDB now shows the resulting API token only once, and it cannot be displayed again later. So do not close the dialogue before you have pasted the token into Node-RED. We recommend not to use the Copy to Clipboard button, because in some constellations the browser does not execute it properly, and you would paste an empty or outdated clipboard content. Instead, mark the complete token with the mouse and copy it with Ctrl+C.

Now switch to the Node-RED window. In the still open dialogue of the influxdb out node, paste the token with Ctrl+V into the Token field and click on Add. Enter flecs-on-iglos-org as Organization and flecs-on-iglos-bucket as Bucket. Finally click on Done to close the settings of the influxdb out node.

Then click on Deploy at the upper right corner of Node-RED. If everything is set up right, the data will be sent to the InfluxDB already. Click on the small bug icon in the upper right corner to get to the debug console. If you see some error message there, you probably have set up the connection wrong. Go through the configuration again and check if everything is configured as described above. If you made corrections, click on Deploy again.

If you lost the token or Node-RED reports an authorization error, you can delete the token in InfluxDB and generate a new one.

Step 8 – Observe Incoming Data at InfluxDB

Open the InfluxDB UI again. Go to the Data Explorer (symbol with a graph), select flecs-on-iglos-bucket and you should see demomeasurement appearing. A first indicator that the connection is set up correctly. Click on demomeasurement, then value, then Submit. You should see a (short section of a) sine wave appearing in the graph above.

Step 9 – Set up Grafana

While you can already observe your data in the InfluxDB UI, Grafana is much more flexible when it comes to setting up custom dashboards. So we will also connect that to our stack.

Keep InfluxDB open in the InfluxDB window since we need to create another API token. In the Node-RED window, go back to the FLECS UI (e.g. by typing https://YOUR_DEVICE_IP into the address bar again) then click on Grafana OSS in the left menu. Type in admin as username and admin as password. These are the default initial credentials of every freshly installed Grafana instance. Since these are publicly known, Grafana forces you to change them right away: A dialogue will appear requesting to enter a new password of your choice.

First, we need to set up the connection to InfluxDB. On the left side, click on Connections, then Add new connection. Search for InfluxDB and click onto it. In the upper right corner click on Add new data source. Select Flux as Query language, then under URL, type in http://HOSTNAME:8086 with the same HOSTNAME you used in Node-RED. Under Organization, type flecs-on-iglos-org.

Now we need the second API token. Switch to the InfluxDB window, go to Load Data, then API Tokens, click on Generate API Token, then Custom API Token. Describe it with Grafana Egress and under Buckets click at flecs-on-iglos-bucket on Read, then click on Generate. As before, mark the token manually and copy it with Ctrl+C. Switch back to the window with Grafana, paste the token under Token and click on Save & test. We expect a message that the datasource is working and a bucket was found. Otherwise, check again what you entered.

Now, go to Dashboards, then New and New dashboard. On the right side under Add click onto the big plus under Panel, then Configure visualization. As Data source, select influxdb, then in the text field, enter the following.

from(bucket: "flecs-on-iglos-bucket")
  |> range(start: -1h)
  |> filter(fn: (r) => r._measurement == "demomeasurement" and r._field == "value")

Let us go through the query line by line: The first line selects the bucket we are reading from. The second line restricts the data to the last hour. The third line is the filter: InfluxDB stores every data point with a measurement name (here demomeasurement, which we set in Node-RED) and one or more fields (here value, which is the field name the Node-RED InfluxDB node uses for a plain number payload, as you saw in the Data Explorer).

Besides Refresh, click on the downward arrow, then select 5s. Set the time range to Last 15 minutes. Finally click on Save and give the dashboard a descriptive name.

You can now see how the data appears in the graph. Now you are ready to play around further with the setup. E.g. you could add another panel just like the first one, but then besides the Time Series label, click on change and change it into a gauge. You could also go back to Node-RED to change parameters, the function itself or even plug in other data sources.

We are curious about your ideas and are happy to support you realizing further use cases, like integrating real sensors into this setup!

What You Have Built

In this tutorial, you have:

  • installed FLECS on IGLOS on a Raspberry Pi and activated it with your FLECS account,
  • installed Node-RED, InfluxDB and Grafana OSS as containerized applications via the FLECS marketplace,
  • generated a sine wave in Node-RED and stored it in InfluxDB, and
  • visualized the stored data in a live Grafana dashboard that reads from InfluxDB.

Troubleshooting

The FLECS UI does not open in the browser

  • Check that the IP address is correct, that the Raspberry Pi is connected to the network and that your computer is in the same network.
  • Make sure you use https:// and not http://.

The activation of the device fails or apps cannot be installed

  • Check that the Raspberry Pi has internet access, see Step 4.
  • Check that the license from Step 1 has been ordered completely and is assigned to your FLECS account.
  • Check that you entered the credentials of your online FLECS account, and not the initial account of the device.
  • Remember that this trial version only provides a limited amount of storage. If the installation stops because of a lack of space, remove an app you do not need (see below) or contact us for an extended evaluation.

Node-RED shows an error in the debug console

  • Check the URL: it has to be http://HOSTNAME:8086 with the hostname of the InfluxDB container, not the IP address of the Raspberry Pi and not localhost.
  • Check that Organization and Bucket exactly match the names you configured in InfluxDB, including upper and lower case.
  • Check that you used the Node-RED Ingress token, and not the Grafana Egress token, which has no write permission.
  • If you reinstalled InfluxDB, the hostname might have changed. Look it up again as described in Step 7.
  • After every correction, click on Deploy again.

There is no demomeasurement in the InfluxDB Data Explorer

  • Check in Node-RED that the flow has been deployed and the inject node is set to repeat.
  • Check that you selected the correct bucket, and that the time range in the Data Explorer (upper right corner) includes the last minutes.

Grafana shows “No data” or an error at Save & test

  • Check the URL (same hostname as in Node-RED), the organization and that you used the Grafana Egress token.
  • Check that the bucket name in the query matches your bucket, and that the measurement and field in the filter are spelled exactly as in the Data Explorer.
  • Check that the time range of the dashboard (Last 15 minutes) includes data, i.e. that Node-RED is still running.

What’s Next?

Follow our LinkedIn channel to get informed when the next parts are online! Until then, contact us at info@linutronix.de to discuss your use case!