Building an Industrial IIoT Pipeline: STM32 → MQTT → Ignition SCADA Integration

Introduction

Modern industrial automation systems are rapidly evolving toward connected architectures where embedded devices, edge gateways, MQTT brokers, and SCADA systems exchange real-time telemetry continuously.

In this project, we built a complete Industrial IoT telemetry pipeline using:

  • STM32F446RE microcontroller
  • UART serial communication
  • Python edge gateway
  • Mosquitto MQTT broker
  • Ignition SCADA (Maker Edition)

The objective was to send live STM32 runtime variables into an Ignition HMI dashboard using MQTT

This architecture is highly relevant for:

  • Smart MCC systems
  • Industrial telemetry
  • Remote diagnostics
  • Edge computing
  • SCADA modernization
  • Digital twin systems
  • Industrial AI platforms

Final System Architecture

STM32 Firmware
UART
Python Edge Gateway
MQTT
Mosquitto Broker
MQTT Engine
Ignition SCADA

Live HMI Dashboard

Hardware and Software Used

ComponentDescription
STM32F446REEmbedded controller
STM32CubeIDEFirmware development
USART2UART communication
Python 3.13Edge gateway scripting
pyserialSerial communication
paho-mqttMQTT publishing
MosquittoMQTT broker
Ignition Maker EditionSCADA/HMI platform

Project Objective

The goal was to transmit two real-time STM32 va

maincount
function_count

from the embedded firmware into Ignition SCADA as live tags.

STM32 Firmware Development

We first created a simple firmware loop using STM32 HAL drivers.

Counter Variables

volatile uint32_t maincount = 0;
volatile uint32_t function_count = 0;

The volatile keyword ensures the debugger and compiler always access the latest memory value.

Function Counter

void count_function(void)
{
function_count++;
}

Main Loop

while (1)
{
maincount++;

HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
HAL_Delay(500);

HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);
HAL_Delay(2000);

count_function();

}

This loop:

  • toggles LED
  • increments counters
  • executes continuously

UART Telemetry Transmission

Next, we transmitted the variables over USART2.

UART Message Buffer

char tx_buffer[100];

UART Transmission Logic

sprintf(tx_buffer,
“maincount=%lu,function_count=%lu\r\n”,
maincount,
function_count);

HAL_UART_Transmit(&huart2,
(uint8_t*)tx_buffer,
strlen(tx_buffer),
HAL_MAX_DELAY);

The STM32 continuously streams telemetry packets like:

maincount=150,function_count=150

Verifying UART Communication

Using PuTTY serial monitor:

ParameterValue
COM PortCOM5
Baud Rate115200
Data Bits8
Stop Bits1
ParityNone

We successfully observed live telemetry output from STM32.

Python Edge Gateway

Ignition does not directly consume raw UART serial streams.
Therefore, a Python middleware gateway was created.

Installing Python Dependencies

py -3.13 -m pip install pyserial paho-mqtt

Python MQTT Gateway

import serial
import paho.mqtt.client as mqtt

ser = serial.Serial(‘COM5’, 115200, timeout=1)

client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)

client.connect(“localhost”, 1883, 60)

print(“STM32 MQTT Gateway Started”)

while True:
try:
line = ser.readline().decode().strip()

    if line:
        print("Received:", line)

        parts = line.split(',')

        for item in parts:
            key, value = item.split('=')

            topic = f"stm32/{key}"

            client.publish(topic, value)

            print(f"Published -> {topic}: {value}")

except Exception as e:
    print("Error:", e)

MQTT Broker Configuration

We used:

Eclipse Mosquitto

Mosquitto acts as the MQTT message broker between:

  • Python edge gateway
  • Ignition SCADA

Broker configuration:

  • Host: localhost
  • Port: 1883

MQTT Topics

The Python gateway publishes:

TopicExample Value
stm32/maincount1512
stm32/function_count1512

Ignition SCADA Integration

We used:

Ignition Maker Edition

because it supports:

  • MQTT Engine
  • Perspective
  • Tag Browser
  • SCADA visualization

Installing MQTT Engine Module

The MQTT Engine module was installed using:

MQTT-Engine-signed.modl

inside:

Config → Modules

Configuring MQTT Broker in Ignition

Inside Ignition:

Config
→ MQTT Engine
→ Servers

Broker settings:

ParameterValue
Server NameLocalBroker
URLtcp://localhost:1883

Automatic Tag Creation

Ignition automatically generated tags:

[MQTT Engine]stm32/maincount
[MQTT Engine]stm32/function_count

This demonstrates the power of MQTT-based SCADA integration.

Building the HMI Dashboard

Using Ignition Perspective:

  • Numeric labels
  • Live counters
  • LED indicators
  • Trend charts

were bound directly to MQTT tags.

The result was a live industrial dashboard displaying real-time STM32 telemetry.

Key Engineering Concepts Learned

This project demonstrates several important industrial engineering concepts.

TechnologyIndustrial Relevance
STM32 HALEmbedded firmware
UARTDevice communication
PythonEdge computing
MQTTIIoT messaging
MosquittoBroker infrastructure
IgnitionModern SCADA
Live TagsIndustrial telemetry
PerspectiveWeb HMI

Challenges Faced

Several practical engineering issues were encountered during implementation.

Debugger Entering HAL_GetTick()

While debugging, stepping into HAL_Delay() repeatedly entered:

HAL_GetTick()

This occurs because STM32 HAL delays internally depend on SysTick timing.

Multiple Python Installations

Conflicts occurred between:

  • MSYS2 Python
  • Official Python installation

This was solved using:

py -3.13

instead of generic python.

COM Port Access Issues

Only one application can own the UART COM port at a time.

PuTTY had to be closed before Python gateway execution.

Industrial Applications

This architecture is directly applicable to:

  • Smart Motor Control Centers (MCC)
  • Remote condition monitoring
  • Industrial dashboards
  • Edge telemetry gateways
  • Predictive maintenance systems
  • Digital twins
  • Energy monitoring
  • HIL systems

Future Improvements

The project can be extended significantly.

Recommended Enhancements

EnhancementBenefit
JSON payloadsStructured telemetry
FreeRTOSReal-time multitasking
DMA UARTNon-blocking communication
OPC UAEnterprise integration
Modbus RTU/TCPPLC interoperability
TLS MQTTSecure communication
Edge AIIntelligent analytics
Database loggingHistorical analysis

Conclusion

This project successfully demonstrated a complete Industrial IoT telemetry pipeline from STM32 embedded firmware to Ignition SCADA using MQTT.

The implementation combines:

  • embedded systems
  • edge computing
  • industrial communication
  • SCADA visualization
  • real-time telemetry

into a modern industrial architecture suitable for next-generation automation systems.

For engineers learning Industrial IoT, this project provides an excellent foundation in:

  • embedded telemetry
  • MQTT messaging
  • SCADA integration
  • edge gateway development
  • industrial software architecture

The transition from blinking LEDs to live SCADA telemetry represents a critical milestone in becoming an industrial embedded systems engineer.