Back to Sync Connect

Industrial integration guide

Modbus TCP to MQTT Gateway

Turn raw Modbus registers into named MQTT data without pushing register addresses into every downstream application. Sync Connect keeps device polling and IT-facing topics in one version-controlled route.

Architecture.

The gateway polls only the configured registers and publishes normalized values to MQTT. Device-specific address, word order and scaling remain explicit at the integration boundary.

Modbus TCP device to MQTT broker through Sync Connect integration layer

Modbus TCP device

Sync Connect integration layer

MQTT broker

When this route fits.

Connect energy meters, drives, weighing systems and remote I/O to MQTT.

Normalize several Modbus devices behind a consistent topic and naming model.

Keep polling load away from dashboards and analytics applications.

Configuration pattern.

Register notation differs between device manuals and drivers. Use this as the route structure, then verify zero/one-based addressing, function code, data type and byte order against the device.

config.yaml
resources:
  energy-meter:
    activePower: holding:40001
    totalEnergy: holding:40003

providers:
  meter-01:
    driver: modbus
    config:
      endpoint: 192.168.10.40:502

connectors:
  production-mqtt:
    driver: mqtt
    config:
      broker: 192.168.20.15
    routes:
      factory/utilities/meter-01:
        mode: read
        provider: meter-01
        resource: energy-meter

The address strings are representative. A commissioning test must confirm register base, function, signedness, word order and engineering-unit scaling.

Technical fit.

Source protocol
Modbus TCP
Target protocol
MQTT
Mapping unit
Coils and registers defined per device map
Polling
Sized from device capacity and required freshness

Security and network.

  • Restrict TCP/502 access to the gateway and only the required devices.
  • Avoid concurrent aggressive polling by several clients; many devices have limited session capacity.
  • Document unit ID, register base, byte/word order, scale and engineering unit for every value.
  • Use authenticated and encrypted MQTT on the IT-facing connection.

Failure and recovery behaviour.

Timeout or exception

Carry communication quality alongside the value and alarm repeated protocol exceptions separately from normal process limits.

Partial register read

Treat multi-register values atomically. Do not publish half of a 32- or 64-bit value after a failed read.

Slow consumer

Keep the device polling interval independent from broker delivery pressure and define what may be coalesced during recovery.

Limitations and better alternatives.

  • Modbus carries registers, not semantics; names, units and scaling must come from reliable device documentation.
  • Some devices permit only a small number of TCP sessions or fail under large read batches.
  • Write operations require device-specific range checks and should not be enabled as a generic reverse channel.

Review your Modbus register map

Send the device manual, register list, sample rate and MQTT convention. We will identify address ambiguities and a safe polling plan.

Check technical fit