Coreflux MQTT Broker
Real-time vibration severity monitoring using LoT scripting + Python
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
Revolution Pi (ARM64) or any edge device with Ethernet. Learn abou the hardware requirement here: https://docs.coreflux.org/quick-start/installation
Network connection between your dev PC and RevPi
Vibration sensor with IO-Link (or simulated data)
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
Install the Coreflux MQTT Broker
The installation instructions are given on this page: https://docs.coreflux.org/quick-start/installation#raspberry-pi
Start 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.
Install VS Code
Install the open source code editor i.e., VS Code, on your computer: https://code.visualstudio.com/
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.

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
Configure VS Code Connection
In your LoT project folder, create or edit the .broker file with credentials embedded in the URL:
Authentication Required
Without 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.
3. Troubleshooting
3.1 Python Version Compatibility
Use Python 3.11 Only
Coreflux 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 Incompatible
The 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.
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:
4.2 The LOT Action
Create a new .lotnb file in VS Code with this LOT action code:
4.3 Deploy from VS Code
Open the .lotnb file in VS Code
Confirm the status bar shows 'MQTT: Connected to mqtt://<RevPi-IP>:1883.'
Enter your user credentials:
Username: root
Password: coreflux
Click the ▶ play button on the LOT action cell to deploy
Check the COREFLUX ENTITIES panel — the action should appear
Publish test messages to X_VRMS, Y_VRMS, Z_VRMS topics
Subscribe to output/vibration_severity to see results

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.


4.5 ISO 10816 Severity Classification Table
Zone
RMS (mm/s)
Classification
Action
A
0 – 0.7
Excellent
New or recently serviced machine
B
0.7 – 1.8
Acceptable
Normal long-term operation
C
1.8 – 4.5
Monitor
Tolerable short-term, investigate
D
> 4.5
Danger
Shutdown 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
Quick Reference
Item
Value / Command
Broker port
1883
Default credentials
root / coreflux
.broker file format
mqtt://root:coreflux@<IP>:1883
Python version (required)
3.11.x — do NOT use 3.12+
python_runtime location (Linux)
/home/pi/coreflux/python_runtime/
python_runtime location (Windows)
CorefluxMQTTBroker_win-x64_1.10.0\python_runtime\
Key apt package
python3.11-dev
Check broker port
sudo lsof -i :1883
View broker logs
sudo ./CorefluxMQTTBroker 2>&1 | tee coreflux.log
Deploy action from VS Code
Click ▶ play button on .lotnb cell
Output topic
output/vibration_severity
Last updated