Tutorial
A step-by-step guide to turning unused MQTT data into actionable AI intelligence, without writing code or sending anything to the cloud.
Here's a statistic that should make every automation engineer uncomfortable: more than 90% of factory floor data goes completely unused. We collect it, we store it (maybe), and then we ignore it. Meanwhile, executives keep asking about "AI transformation" and engineers keep nodding politely while wondering how they're supposed to become machine learning experts on top of everything else.
Melvin Francis from BE Services has a different perspective. At Coreflux Cracked in January 2025, he demonstrated something genuinely useful: an Edge AI pipeline that monitors MQTT data, learns what "normal" looks like, detects anomalies in real time, and triggers emergency responses automatically. The whole thing runs locally, requires no coding, and can be replicated in about an hour.
This guide walks through exactly how to build it.
The architecture is straightforward:
When an anomaly occurs, the system can automatically stop all processes using unified namespace concepts, essentially broadcasting an emergency stop to every connected machine simultaneously.
The beautiful part? No if-else nightmare. No maintaining hundreds of threshold conditions across dozens of machines. The AI model learns what normal operation looks like and alerts you when something deviates.
Before starting, you'll need:
No AI background required. No coding required. If you can click buttons and copy configuration values, you can do this.
We'll create a simulation representing five factory processes. Each process publishes its operational data to the MQTT broker.
Open Node-RED and create a new flow. We'll build five parallel process simulations that publish to topics following this pattern:
factory/process1
factory/process2
factory/process3
factory/process4
factory/process5
Each process simulation should publish:
Use inject nodes with repeat intervals to simulate continuous operation. The exact timing depends on how quickly you want to see results during training, but intervals of 1 to 5 seconds work well for demonstrations.
Create a manual inject node that, when triggered, introduces abnormal values into all five processes simultaneously. This will be used later to test the anomaly detection.
The anomaly trigger should cause a significant deviation from normal values, something that would clearly indicate a problem in a real factory scenario.
Create an MQTT input node that subscribes to a wildcard topic for receiving stop commands:
factory/+/control
When a stop command is received, it should halt all process simulations. This demonstrates how the AI inference can trigger factory-wide responses.
Coreflux's LoT Notebook makes broker deployment remarkably simple. Open the notebook interface and connect to localhost.
Once deployed, verify that Node-RED can connect to the broker. You should see all five process topics appearing as your simulation publishes data.
Use the Coreflux interface to confirm data is flowing correctly. You should see regular updates from all five factory processes. Take a moment to watch the data, this is what "normal" looks like, and it's exactly what we'll teach the AI model.
This is where the magic happens. Coligo Lite will monitor the MQTT data stream, learn the patterns, and detect when something goes wrong.
Open the Coligo Lite UI and log in with your credentials.
Navigate to the anomaly detection section and create a new model. Give it a descriptive name (something like "Factory Floor Monitor" or, if you're feeling creative, name it after your event).
Point Coligo Lite at your Coreflux Edge Broker:
Configure Coligo to monitor all factory processes using a wildcard:
factory/+
This tells Coligo to watch all topics under the factory namespace. The plus symbol acts as a single-level wildcard, capturing process1 through process5 (and any future processes you add).
This is crucial: tell Coligo where to publish its anomaly scores. Set the output topic to something like:
coligo/lite/anomaly
Your Node-RED flow will subscribe to this topic to receive anomaly scores and trigger appropriate responses.
Now we teach the AI what "normal" looks like.
With your factory simulation running normally (no anomalies), click the "Learn" button in Coligo Lite.
You'll see a training loss metric that starts relatively high and decreases as the model learns. This represents how well the model understands the current data patterns.
As the model sees more "normal" data, the training loss approaches zero. This means the model is confident it understands the baseline behavior.
Training is complete when:
For a simple demonstration, this might take just a few minutes. For a real factory deployment, you'd want to train over hours or days to capture all normal operational variations (shift changes, different product runs, environmental fluctuations).
Once training is complete, stop the learning phase and switch to inference mode. Now the model will actively monitor for deviations from what it learned.
Time to break something (safely).
In Node-RED, click the anomaly trigger button you created earlier. This injects abnormal values into all five processes.
In the Coligo dashboard, you'll see the anomaly score spike dramatically. The model has detected that current behavior doesn't match what it learned during training.
If you've configured your Node-RED flow correctly, the anomaly score being published to the coligo/lite/anomaly topic should trigger your emergency stop logic.
Using Coreflux's LoT functionality with unified namespace concepts, you can broadcast a stop command to all processes simultaneously:
factory/+/control → STOP
All five processes should halt.
Once the anomaly is cleared (reset your simulation to normal values), the anomaly score will gradually decrease as the model sees normal data again. Processes can be restarted, and normal operation resumes.
The factory simulation is deliberately simple, but the same principles apply to genuine industrial scenarios:
Temperature and Humidity MonitoringWarehouse and logistics operations can monitor environmental conditions. Unlike our rapid demonstration, real humidity changes happen over hours. The AI model detects gradual drifts that might indicate HVAC failures or door seal problems.
Robotic Process MonitoringMonitor torque values from palletizing robots. If a robot picks up an unexpectedly light (empty) or heavy (double-stacked) box, the torque deviation triggers an alert before mechanical damage occurs.
Process Efficiency TrackingTrack production line efficiency across multiple stations. When one station begins underperforming (perhaps due to worn tooling or material variations), the model detects the deviation before it cascades into quality issues.
Predictive Maintenance IndicatorsVibration, current draw, and cycle time data can reveal equipment degradation long before failure. The model learns healthy baselines and alerts when patterns shift toward concerning territory.
Everything in this pipeline runs locally. Your data never leaves your network. This matters for several reasons:
Latency: Cloud round-trips add delay. Edge inference happens in milliseconds.
Bandwidth: Streaming all your MQTT data to the cloud costs money and consumes network resources.
Security: Factory data stays on the factory floor. No external exposure.
Reliability: Cloud connectivity issues don't affect your anomaly detection. The system keeps working even if your internet goes down.
The demonstration uses five processes. Real factories have hundreds or thousands of data points. The good news: the architecture scales.
Coligo Lite can monitor multiple topics and learn complex multi-dimensional patterns. Coreflux's broker handles high-throughput MQTT traffic efficiently. The LoT commands can address any topology your unified namespace supports.
Start with a pilot: pick one production line or one critical process. Deploy this pipeline, tune it, validate the anomaly detection. Then expand.
The gap between "interesting demo" and "production deployment" is smaller than you think. Melvin's promise holds: you can have this running in under an hour.
This guide is based on Melvin Francis's presentation at Coreflux Cracked, January 26, 2025. Melvin is the Technical Marketing Manager at BE Services, with over 10 years of experience in industrial automation.