Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

...

  1. Using ACE, Open the default configuration you used in the "Getting Started Guide".
  2. Download and open Elecsys-GenericMQTT-Demo.xml from the http://redigate.elecsyscorp.com site, so you have both configurations open within the same ACE window.
  3. In your default configuration, enable the DNS Client object by setting its Enabled checkbox.


  4. Disable Virtual Unit 3 by clearing its Enabled checkbox.


  5. Copy and paste the following objects from the Elecsys-GenericMQTT-Demo.xml config into your default configuration. 
    1. TLS Tunnels  (paste under Networks).


    2. FieldUnitInternalMast2 (paste under NullCircuit)


    3. VirtualRW Unit 4 (paste under NullCircuit)


    4. Data Simulator (paste under Internal Channel 15)



    5. MQTT_Client (paste under Clients)



    Include Page
    Renaming Nodes
    Renaming Nodes


  6. Copy Table data from the Elecsys-GenericMQTT-Demo.xml Internal Channel 15 → Scan Table into your RediGate Configuration (in Internal Channel, open Scan Table, right-click and select Paste, over-write data). 
     




    Info
    titleScan Table Info

    The "Scan Period" object tells the RediGate which RTU (Unit 2, labeled as FieldUnitInternalMast2) to run at an interval (Scan Period) which is set to every 30 seconds. This is how frequently the data will be published to MQTT.

    Warning: Data charges may result from excessive usage of MQTT publishing and/or cellular data plan, depending on your network setup.



  7. Update your MQClient properties to match the parameters of your MQTT server. This will depend on your server settings. For instance:
    a. Set the Client ID, if your server has requirements for it. This must be a unique identifier on the MQTT server. You can leave it blank to use a random identifier, or use   ${GATEWAY}   for the RediGate name, or   ${SERIAL}   for the RediGate serial number.

    b. Set the URL_List table with the IP address or URL name of your server. If you are using TLS to connect to the server, set this address to:  127.0.0.1

    c. Set the Connection Port with the TCP port of your server. Typically this will be 1883 for unsecure connections, or 8883 for TLS connections.

    d. If your server uses username/password authentication, enter the User Name and Password.



  8. If you are using TLS authentication, you need to:
    a. Set the MQTT Client broker address (above, in URL_List table) to 127.0.0.1

    b. Set the MQTT Client Connection Port to 8883.

    c. In the TLS Tunnels configuration, make the following settings:
    Update the STUNNEL Parameters to point to your server name.

    For instance, the Connect To address should be similar to:   your.mqtt-server.com:8883      OR      10.20.30.40:8883



  9. Edit the MQTT Client → JSON_RBE → Topic Rules table, so that the table entries comply with the device publish topics that you expect to receive from the RediGate. 
    The following is given as an example in this configuration:
    (the "${GATEWAY}" is a variable that will substitute the RediGate Unit Name, and "${DEV}" will substitute the FieldUnit device name in the MQTT topics)

    GATEWAY PUBLISH topic:      RBE/Test/${GATEWAY}
    DEVICE PUBLISH topic:       RBE/Test/${GATEWAY}/${DEV}
    GATEWAY SUBSCRIPTION topic: CMD/Test/${GATEWAY}
    DEVICE SUBSCRIPTION topic:  CMD/Test/${GATEWAY}/${DEV}



  10. Upload configuration to the RediGate.

  11. Upon connection to the MQTT server, there should be a gateway message published on the GATEWAY PUBLISH topic string. Data should be being sent from the SimData RTU every 30 seconds, using the DEVICE PUBLISH topic string.


Example 2 (TBD): Sending Data from MQTT to Field Device

Once your device is successfully publishing data to MQTT, the next step is to subscribe to commands sent from MQTT to the field devices connected to the RediGate. Details on the JSON structure that the RediGate expects to receive can be found in the JSON-RBE MQTT Payload Format document. The steps below outline how to write data to an integer tag under a virtual field unit:

...