OGOL OTIU.← All projects
INDUSTRIAL IOT / EXPLAINED

Why Modbus-to-MQTT is more than moving a number.

A practical introduction to the software decisions that make device readings useful.

ENGINEERING NOTES / OGOL OTIU

Start with the register map

Modbus presents values in registers or coils. A useful integration needs more than an address: the data type, word order where applicable, scale, device identifier and engineering units must be understood. A raw integer has little meaning without this context.

Translate the data model

MQTT transports messages through topics. A connector can read approved Modbus registers and publish structured JSON to a broker. That message should identify the measurement, its unit and the time it was observed. A downstream dashboard should not have to guess whether 231 means volts, degrees or an unscaled device value.

Example schema — fictional:
{ "device_id": "meter-01", "timestamp": "SAMPLE_TIME", "voltage_v": 231.4, "quality": "simulated" }
This is an illustrative payload, not an actual measured equipment value.

Handle failure explicitly

The interesting work begins when polling fails or data is malformed. A robust design distinguishes no value, last known value and new valid readings. It records reconnect attempts and avoids displaying old measurements as current. Logging should explain which stage failed without recording credentials.

Verify the contract

Test known register values, JSON structure, timestamp handling, missing fields and reconnect behaviour. Keep read-only permissions and let the client control any production deployment. Without these tests, a good-looking dashboard provides limited confidence.

Explore the interactive browser example ↗ or the planned gateway case study ↗.