Modbus-to-MQTT Factory Gateway
Reference design for an industrial gateway that polls Modbus RTU devices over RS485 and publishes normalised telemetry to an MQTT broker.
This is a demonstration reference design, not a client engagement. No customer names or measured results are claimed.

Problem statement
Legacy factory equipment exposes data only over Modbus RTU, which cloud dashboards cannot consume directly.
Engineering requirements
- Poll up to 32 Modbus slaves on a shared RS485 bus
- Buffer data during network outages
- Encrypted uplink to an MQTT broker
- Remote configuration of register maps
System architecture
- Sensors and PLCs
- RS485 bus
- STM32H7 gateway running FreeRTOS
- Ethernet / LTE uplink
- MQTT broker
- Monitoring dashboard
Hardware & silicon selection
STM32H7 MCU, isolated RS485 transceiver, Ethernet PHY, optional LTE Cat-M module, SPI flash for store-and-forward.
Firmware & communication stack
FreeRTOS tasks for Modbus polling, buffering, MQTT client with TLS and a configuration service.
Implementation approach
Register maps are described in JSON and pushed over MQTT; the polling scheduler adapts to slave response times.
Testing & validation
Bench validation with Modbus simulators and fault injection on the RS485 bus.
Measured results
Demonstration concept — no field measurements are claimed.
Technical challenges & outcomes
Handling bus collisions and slow slaves without blocking the uplink task.
Technology
- STM32H7
- FreeRTOS
- Modbus RTU
- RS485
- MQTT
- TLS
Building something similar?
Share your requirements and we'll respond with practical next steps.