Bring Modbus RTU / Modbus TCP devices into Virtuino Cloud — no native Modbus support needed, thanks to MQTT-to-Modbus gateways.
Most Modbus RTU devices live on an isolated RS-485 serial bus, and most Modbus TCP gateways sit behind your local router's firewall with no public IP — our cloud servers can't simply "dial in" to reach them. An MQTT-to-Modbus gateway solves this the other way around: it makes an outbound connection from your network to our broker, so no port-forwarding or exposing your equipment to the internet is required.
Configure your MQTT-to-Modbus gateway's MQTT client / MQTT publisher settings exactly as you would for any device connecting to Virtuino Cloud — see the full MQTT Connection Guide for details on every field. The essentials:
| Parameter | Value | Notes |
|---|---|---|
| *Broker Host | cloud.virtuino.com | Same host for both plain and TLS connections |
| *Port | 8883 TLS / SSL | Recommended — most gateways support TLS out of the box. Use 1883 only for local testing. |
| *Username | vr-abcd1234 |
Your Sub-account Key — found in Console → API & Connections |
| *Password | your MQTT password | Found in Console → API & Connections → MQTT Credentials |
| Client ID | vr-abcd1234_gateway |
Must begin with your Sub-account Key as prefix; the suffix is arbitrary |
* Required field
Most MQTT-Modbus gateways let you define, per register, which MQTT topic to publish to. Map each register to a topic under your namespace using the same /in/ (device → cloud) and /out/ (cloud → device) convention used everywhere else on the platform — see Topic Structure for the full reference.
| Modbus Register | Register Type | Topic to Publish |
|---|---|---|
| Holding Register 30001 (temperature) | Read (device → cloud) | vr-abcd1234/in/device/plc1/temperature |
| Holding Register 30002 (humidity) | Read (device → cloud) | vr-abcd1234/in/device/plc1/humidity |
| Coil 00001 (relay) | Write (cloud → device) | vr-abcd1234/out/device/plc1/relay1 |
For coils/registers the gateway should write to (e.g. a relay controlled from your dashboard), subscribe to the corresponding /out/ topic instead of publishing to it — the gateway receives the value from Virtuino Cloud and writes it to the Modbus register.
{sub_account_key}/in/device/{device_name}/{sensor_name}) when bridging Modbus — it keeps every PLC/gateway's registers grouped under its own device name, which scales much better than the flat format once you have more than a handful of registers.
Any MQTT-to-Modbus gateway works, as long as it can publish/subscribe to a standard MQTT broker over TLS with username/password authentication. Common options:
node-red-contrib-modbus) with the built-in MQTT-out node to build a fully custom polling/mapping flow on a Raspberry Pi or similar.pymodbus) alongside an MQTT client library is straightforward to run on a Raspberry Pi or industrial PC if you need full control over polling logic.Whichever option you choose, the connection to Virtuino Cloud is always the same: standard MQTT, TLS on port 8883, authenticated with your Sub-account Key and MQTT password, publishing/subscribing to topics under your own namespace.