Skip to main content

Overview

This guide walks you through setting up the Coreflux MQTT Broker on a Revolution Pi (ARM64) industrial edge device, deploying LOT (Language of Things) actions from VS Code, and running Python-based vibration severity calculations directly inside the MQTT broker with no cloud dependency.

Data flow

Prerequisites

Hardware

Software (Development PC)

  • Visual Studio Code
  • LoT Language Support by Coreflux extension (VS Code marketplace)
  • Python 3.11.9 from python.org (Not Microsoft Store version, see troubleshooting)

Software (Revolution Pi)

  • Coreflux MQTT Broker for Linux ARM64
  • Python 3.11.x (installed via apt)
  • python3.11-dev package
  • Node-RED (optional, for visualization)

1. Installing Coreflux on Revolution Pi

1

Download and Extract

Download the Linux ARM64 build of Coreflux MQTT Broker from coreflux.org. Transfer it to your RevPi via SCP or download directly:
2

Install the Coreflux MQTT Broker

The installation instructions are given on this page: https://docs.coreflux.org/quick-start/installation#raspberry-piStart the broker to verify it works:
You should see the broker start and listen on port 1883. Press Ctrl+C to stop after confirming startup.
Default CredentialsThe default Coreflux broker credentials are username: root, password: coreflux. These are required when connecting from VS Code or MQTT clients.
3

Install VS Code

Install the open source code editor i.e., VS Code, on your computer: https://code.visualstudio.com/
4

Install LoT extension in VS Code

LoT (Language of Things) is a human-readable language for IoT automation. It uses near-English syntax to define logic, data structures, and integrations—all executed directly within the Coreflux MQTT broker.

The LoT extension lets you interact with the Coreflux MQTT broker from VS Code. To install LoT, go to the extension in VS Code and search for LoT.
Coreflux MQTT Broker
5

Learning LoT

To learn how LoT interacts with Coreflux MQTT Broker, check this repository, which has many sample codes and exercises: https://github.com/CorefluxCommunity/Language-Of-Things-Training/tree/main
6

Configure VS Code Connection

In your LoT project folder, create or edit the .broker file with credentials embedded in the URL:
Authentication RequiredWithout credentials in the .broker file, the VS Code extension will connect but receive PermissionDenied errors when trying to subscribe to $SYS/Coreflux/ system topics. This causes the ‘Entity not found on broker’ error in the LOT notebook.

2. Setting Up Python Runtime on Revolution Pi

Coreflux uses an embedded Python runtime located in ~/coreflux/python_runtime/. On Linux ARM64, this requires manually copying the system Python shared libraries into this folder.
1

Install Required Python Packages

Why python3.11-dev?The -dev package installs the shared library files (libpython3.11.so) that embedded runtimes need to load Python via the C API. Without it, the broker finds the python_runtime folder but cannot initialize Python.
2

Find the Shared Library Files

3

Copy Files to python_runtime

4

Confirm Python Loads at Broker Startup

Start the broker and look for these lines in the output:
Python WorkingWhen you see ‘Python runtime initialized successfully’ instead of ‘Python runtime not available, scripts disabled’, the Python integration is ready.

3. Troubleshooting

3.1 Python Version Compatibility

Use Python 3.11 OnlyCoreflux 1.10.0 is only compatible with Python 3.11. Using Python 3.12, 3.13, or 3.14 will cause ‘Python runtime not available’ even if all files are correctly copied. Always verify with: python3 —version

3.2 Windows — Microsoft Store Python

On Windows, if Python is installed via the Microsoft Store, the where Python command returns:
Microsoft Store Python IncompatibleThe Microsoft Store Python is a stub launcher — it does not contain python311.dll or the Lib/ folder that Coreflux needs. Always install Python from python.org using the Windows installer (64-bit). Download: https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe

3.3 Windows- Copying Python to python_runtime

After installing Python 3.11.9 from python.org, copy the full installation into the broker folder. This is in case you are running Coreflux Broker on Windows

3.4 Port 1883 Already in Use (Linux)

If you see ‘MQTT Port 1883 is in use by unknown process’, another instance of Coreflux is already running (possibly managed by pm2 or systemd):

3.5 ‘Entity Not Found on Broker’ Error

This error appears in the LoT notebook when clicking the play button, but the action has never been deployed, or the broker has restarted and lost the action. The play button in a .lotnb file deploys the action to the broker; it does not auto-persist between broker restarts unless the action file is saved in the broker’s persistent storage location.
Deployment TipAfter restarting the broker, re-run all cells in your .lotnb file using ‘Run All’ to redeploy all actions.

4. Vibration Severity Example

4.1 The Python Script- VibrationCalc.py

Create this file in your VS Code project. It will be deployed to the broker’s python_scripts folder:
ISO 10816 ReferenceThe output of this function is vibration severity in mm/s RMS. According to ISO 10816: Zone A (0-0.7 mm/s) = excellent, Zone B (0.7-1.8) = acceptable, Zone C (1.8-4.5) = monitor, Zone D (>4.5) = danger.

4.2 The LOT Action

Create a new .lotnb file in VS Code with this LOT action code:

4.3 Deploy from VS Code

  1. Open the .lotnb file in VS Code
  2. Confirm the status bar shows ‘MQTT: Connected to mqtt://<RevPi-IP>:1883.’
  3. Enter your user credentials:
    1. Username: root
    2. Password: coreflux
  4. Click the ▶ play button on the LOT action cell to deploy
  5. Check the COREFLUX ENTITIES panel — the action should appear
  6. Publish test messages to X_VRMS, Y_VRMS, Z_VRMS topics
  7. Subscribe to output/vibration_severity to see results
Coreflux MQTT Broker

4.4 Test with MQTT Client

In the following example, we are reading actual vibration data via OPC UA. You can just replace the vibration data source in the flow for your use-case. The source code for this flow is shared in the resource section.
Coreflux MQTT Broker
Coreflux MQTT Broker

4.5 ISO 10816 Severity Classification Table

ZoneRMS (mm/s)ClassificationAction
ZoneRMS (mm/s)ClassificationAction
A0 – 0.7ExcellentNew or recently serviced machine
B0.7 – 1.8AcceptableNormal long-term operation
C1.8 – 4.5MonitorTolerable short-term, investigate
D> 4.5DangerShutdown recommended immediately

5. Network Configuration on Revolution Pi

5.1 Check Current IPs

5.1 Assign Static IP to eth1

If you need to assign a static IP to the second Ethernet port (e.g. for direct connection to a PLC or IO-Link master):

6. Managing the Coreflux Broker

6.1 Start with Visible Logs

6.2 Run in Background (pm2)

6.3 Run in Background (pm2)

Resources:

Node-RED flow

coreflux_flow.txt

Quick Reference