GENESIS - MQTT Connection (Publish/Subscribe)

GENESIS - MQTT Connection (Publish/Subscribe)

Notes
The article describes how to configure data exchange using the MQTT protocol with the GENESIS software. It presents the configuration for both the publisher and the subscriber. For testing purposes, the RD55UP12-V intelligent module and the MQTT Explorer tool were used. Both components acted as clients within the system architecture.

Initial Configuration

The configuration of both the broker itself and the intelligent module is described in the articles provided below:


RD55UP12-V Configuration

If you are using the RD55UP intelligent module for testing, you need to apply certain changes as outlined below:

In the MQTT Connection Properties settings, set the Message Template to “ICONICS”, and then click on “Edit…”. A message syntax window will appear — remove the unnecessary elements, leaving only the parameters as shown in the image below ("id" and "v"):

Next, upload the modified configuration to the module.

Workbench Configuration (Subscribe)

MQTT Broker

In Workbench, under the MQTT Broker settings, you need to select the appropriate protocol and set the server address. Optionally, it is recommended to enable the MQTT Birth Message settings — this way, once the service is started, you will see a message sent by GENESIS on one of the clients (e.g., MQTT Explorer).

Custom Encoders/Decoders

Defining a custom encoder is one of the most important parts of the entire configuration, as it enables GENESIS to properly interpret the incoming data. Without a correctly configured encoder, the messages received will be in Raw format. As a result, while their values can be viewed in the Data Explorer, they cannot be used further within the system.

The plugin should be set to CustomJSON, while the Message Type can be any value — it only affects the format of the received messages.
A crucial element here is the Value Format, which has been set as follows:
{
  "id": "%PUBLISHNAME%",
  "v": "%VALUE%"
}
The point is that this encoder matches the message format sent by the RD55UP module.

Subscriber Connections

In the Subscriber Connections tab, enable the "The connection is enabled" option to activate communication, and select the encoder you previously created.
It is recommended to set both Keep Alive Timeout and Browse Timeout to 0.
The Client ID can be any name, and the MQTT Broker should be set to the one you're using.
In the Base Topic field, entering “#” will allow you to receive all messages from all topics published by clients. If you want to limit the subscription to a specific topic or message, enter the appropriate topic name.

MQTT Testing – Subscriber

Now we can start the services in Workbench — both the Publisher (even though it hasn't been configured yet) and the Subscriber.
For testing purposes, two clients were used: the RD55UP module, which cyclically publishes messages in a format adapted for GENESIS, and the MQTT Explorer tool to monitor the transmitted messages.

In MQTT Explorer, connect to the broker by entering the IP address of the device on which the broker is running.


As you can see, after connecting to the broker, we can observe the cyclically sent messages from our RD55 module (which follow the format we previously defined:
{ "timestamp": X, "values": [ { "id": Y, "v": Z, ... } ] }),
as well as the Birth Message sent by GENESIS.
This confirms that the MQTT protocol connection has been successfully established and verified.
Note: If the Birth Message does not appear after connecting to the broker, you should restart the Publisher and Subscriber services in Workbench.

While we are still in the section on configuring subscriptions in GENESIS, we can go ahead and send a message from the MQTT Explorer client to GENESIS for reading.
We define any topic (since we set “#” in the configuration, all published topics will be received by GENESIS).
The message content must follow a format that allows the encoder we created to correctly interpret it.




Now, in the Data Explorer within Workbench, refresh the Internet of Things tab. Then, under IoT Subscriber → Subscriber (as this is the name we assigned to our Subscriber Connections), two connections should be visible:
1. Messages sent by RD55UP
2. Messages sent by MQTT Explorer


InfoNote: After configuring the broker and the subscriber (even if a custom decoder has not yet been set), you should be able to see incoming messages in the Data Explorer as raw messages. These represent all raw messages received by the subscriber.
Only after applying the appropriate encoder will these messages become fully editable and usable.
If no raw messages appear in the Data Explorer despite proper broker and subscriber configuration, carefully review the security settings — incorrect configuration may block even raw message reception.

Workbench Configuration (Publish)

Publish Lists

In the Publisher configuration, the first step is to add a publication list, which includes the variables that will be sent. In my case, the published items will be the Assets created earlier.

In the Published Real Time Points tab, select the variables you want to be sent via the MQTT protocol.


Publisher Connections

Now we can add an MQTT Publisher Connection.
Select the encoder, set the Client ID and Device ID, and specify the topic under which the variables will be published.


MQTT Testing – Publisher

After completing the configuration, you need to restart the services in Workbench and refresh the IoT Subscriber tabs.
A new connection should be established with the topic specified in the Publisher configuration — for example, “ExampleTopic”.

Changes to the published register values will be sent at the frequency defined during configuration.
MQTT Explorer should also be able to receive these messages sent by GENESIS.




    • Related Articles

    • RD55UP12-V - QuickStart of IoT Gatway

      Summary: This manual describes the necessary steps to put the module RD55UP12-V into operation and to parameterise the corresponding functions. It also shows how to properly control the registers/bits of the controller using the MQTT protocol. ...
    • Iconics Genesis V11 - Installation guide

      This article will guide you how to prepare your operating system and database to install Iconics Genesis Version 11. If you need help with installation of an older version of Iconics, please follow this article instead: ...
    • Genesis V11 - list of built-in GraphWorX displays

      This article lists all the built-in GraphWorX displays available in the PubDisplay folder after GENESIS V11 installation. The display files are also attached as a backup for users. GENESIS V11 has multiple built-in GraphWorX displays already present ...
    • Iconics Suite - Melsoft connection with iQ-R

      Detailed description how to configure connection between Iconics Suite SCADA and iQ-R PLC controller using Melsoft Connection Remember that your PC has to have the static IP address in the same subnet as PLC. iQ-R PLC default address is 192.168.3.39 ...
    • Connecting MX OPC Server UA to FX5 via Melsoft Connection

      This article show how to configure connection between MX OPC Server UA and FX5 via Melsoft Connection. FX5 side configuration Open your FX5 project in GX Works3 to add new/additional Melsoft Connection. Go to the Navigation tree -> Parameter -> ...