Rela AIRela AI Docs
Integrations

Configure an industrial gateway

General guide for choosing, installing, and configuring an IoT gateway that connects your PLCs with Rela-ai via MQTT.

What is a gateway

A gateway is a mini computer installed at the plant, next to the PLCs. Its job is simple: read data from machines over the local network (OPC UA, Modbus, S7) and publish it over the internet via MQTT so that Rela-ai receives it in the cloud.

PLC (local network) → Gateway (translates) → MQTT Broker (internet) → Rela-ai (cloud)

Main advantage: The PLC is never exposed to the internet. The gateway is the only device that needs an internet connection. No VPN or firewall port opening is required.

Which gateway to choose

GatewayPriceIdeal forNative OPC UADifficulty
Raspberry Pi + Node-RED$50-80 USDTesting, small plantsVia pluginEasy
HiveMQ EdgeFree (software)You already have Linux hardwareYes (native bridge)Easy
Siemens IOT2050$200-300 USDDemanding industrial environmentsVia Node-REDMedium
Secomea SiteManager$400+ USDEnterprise, IEC 62443 certifiedYesMedium
Softing edgeConnectorQuote requiredMulti-protocol integrationYesAdvanced

Recommendation: To get started, use Raspberry Pi + Node-RED (step-by-step guide available). If you need a more robust environment, use HiveMQ Edge (guide available).

Prerequisites

Before configuring the gateway, you need:

  1. PLC details: IP address, port, protocol (OPC UA, Modbus, S7), and the nodes/registers to monitor. The plant automation technician provides these.
  2. MQTT Broker: Broker URL, credentials (username/password), and the topic to publish to. Rela-ai provides this information when you create the source in the dashboard.
  3. Network: The gateway must have access to the PLC's local network (ethernet cable) and internet access (WiFi or ethernet).

Configuration in Rela-ai

  1. In the dashboard, go to Alarms → Sources → Create source
  2. Select protocol OPC UA
  3. Select mode Via MQTT Gateway
  4. Fill in the fields:
    • Broker URL: the MQTT broker URL (e.g. mqtt://broker.hivemq.com:1883)
    • Topic: the topic the gateway publishes to (e.g. north-plant/gateway-line1)
    • QoS: 0 for most cases
  5. Save the source. Rela-ai starts listening to the topic automatically.

Data format (OPC UA Pub/Sub JSON)

The gateway must send data in OPC UA Pub/Sub JSON format (Part 14 of the standard). This is the format Rela-ai expects:

{
  "MessageType": "ua-data",
  "PublisherId": "PLC-Line1",
  "Messages": [
    {
      "DataSetWriterId": 1,
      "Payload": {
        "Temperature": {"Value": 75.5, "SourceTimestamp": "2026-04-03T12:00:00Z", "StatusCode": 0},
        "Pressure": {"Value": 1.2, "SourceTimestamp": "2026-04-03T12:00:00Z", "StatusCode": 0}
      }
    }
  ]
}

Each field in Payload becomes an independent event in Rela-ai.

Troubleshooting

ProblemSolution
Gateway cannot connect to PLCVerify IP and port. Ping from the gateway. Check that the local firewall allows the connection.
Gateway connects but data does not reach Rela-aiVerify broker URL and topic. Use mosquitto_sub to confirm messages are arriving at the broker.
Data arrives but Rela-ai does not process itVerify the format is valid OPC UA Pub/Sub JSON. The MessageType field must be "ua-data".
Slow reconnectionCheck that the gateway has automatic reconnection configured. Node-RED handles this automatically.

Specific guides

On this page