hotloop
GitHub
English
Modbus to MQTT

Modbus to MQTT, without a license per connection

HotLoop polls Modbus TCP and RTU devices and publishes them to an MQTT broker as plain topics or as Sparkplug B. Put the headless Edge Relay on any low-cost box next to the machine, and the readings queue to disk when the uplink dies and replay when it comes back.

Eighteen native drivers, each listed with what it was tested against. Free to use, no license keys.

A Modbus to MQTT gateway for the line you already run

Move Modbus to MQTT in one hop and keep the tags in a namespace you own.

Try HotLoop free.

Three ways to get Modbus onto MQTT

PathUse it when
Edge RelayYou want a headless box at the machine that polls and forwards as Sparkplug B, with no database and no screen. About 15 MB, for amd64, arm64, and arm/v7.
Gateway, Edge, or IoTYou want screens, alarms, and a historian beside the polling. The embedded MQTT broker listens on port 1883.
FlowYou want to wire it yourself, with transforms between the register and the topic.

A Modbus TCP gateway for the registers you already have

Call it a converter, a bridge, or a gateway: the job is the same. Read the registers, name them, and publish them where the rest of the plant can use them. The Modbus TCP gateway driver covers TCP and RTU, and the Gateway can keep the history too.

Registers the way the manual prints them

A float across two registers is a plausible number even when the word order is wrong, and that is the Modbus mistake that costs people days. HotLoop names every order the vendor manuals print, sets a device default, and lets each tag override it. Addressing is raw and zero-based, with a switch for the 40001 style, so the numbers in your drawings go straight in. Adjacent registers merge into one request, so a device with sixty tags is a handful of reads, not sixty.

holding:100:float32:CDAB    a float across registers 100-101, word-swapped
holding:40:bit3             bit 3 of register 40
input:12:int16              a signed input register
coil:5                      a single coil

It keeps working when the uplink does not

The Edge Relay forwards as a Sparkplug B edge node, with births, sequence numbers, and deaths the way the spec says. When the link drops, readings queue to disk and replay in order, so the historian upstream ends up with the outage backfilled and not a hole. Delivery is at least once.

Questions people ask

What is a Modbus to MQTT gateway?

A Modbus to MQTT gateway polls Modbus devices and publishes every reading to an MQTT broker. Call it a converter or a bridge if you like: HotLoop does the job with its native Modbus driver, as plain topics or as Sparkplug B.

How do I send Modbus TCP to MQTT?

Add the device with its protocol set to modbus and its address as host and port, such as 10.0.1.50:502, list the registers you want, and the HotLoop Edge Relay publishes them. Modbus RTU to MQTT is covered by the same Modbus driver.

What happens to the data when the network is down?

Readings queue to a file on disk, capped at 64 MiB by default. When the broker returns, the queue drains oldest first before live readings go out, each marked as historical so the host upstream does not mistake a replay for a current value.

How do I convert Modbus to MQTT?

Describe the device and its registers in one JSON file, start the HotLoop Edge Relay, and point it at your broker. It polls the device and publishes every reading as a Sparkplug B edge node. The step-by-step guide is in the HotLoop docs.

Does it support Modbus RTU as well as Modbus TCP?

The Modbus driver covers both, with all four word orders (ABCD, CDAB, BADC, DCBA) and an option for the traditional 40001-style numbering.

Do I need my own MQTT broker?

HotLoop can run an MQTT broker in the same process, on by default, so a small install has nothing extra to deploy. For many sites or heavy fan-out, point it at Mosquitto, EMQX, or another dedicated broker.

Can I do Modbus to MQTT in Node-RED style?

HotLoop Flow reads Node-RED flow files and has Modbus read and write nodes and MQTT 5 nodes, so a Modbus-to-MQTT flow is two nodes and a wire.

Keep reading

HotLoop is eight products for the plant floor: four that grow with a site (IoT, Edge, Gateway, and Edge Relay), plus Flow for wiring, Cascade for workflows, HotLoop for CODESYS for the PLC's own screen, and Transmitter for putting a PLC's values on the wire. See every product. Home and lab use is free, and so is use by schools, nonprofits, and government bodies. Read which license applies to you.