Communicating Between Two Red Lion Devices via Generic MQTT using Mosquitto MQTT broker

06 Jun 2025

Abstract

This document describes setting up a connection that allows two Red Lion devices to communicate via Generic MQTT

Products

DA10, DA30, FlexEdge(DA50D, DA70D, DA50A and DA70A) and CR3000 or Graphite HMI/Graphite Edge Controller

Use Case

Establishing Communication between two Red Lion devices via Generic MQTT using Mosquitto Broker.

Required Software

Crimson 3.1 and Crimson 3.2

Introduction

There are four different methods to get two Red Lion devices to communicate. They are Modbus TCP/IP, OPC Proxy TCP/IP Master, OPC UA and Generic MQTT . This tech note will talk about how to use Generic MQTT to get two Red Lion devices to communicate.

Two Red Lion devices used in this example are DA50A and CR3000 HMI

IP Address of DA50A : 192.168.0.22

IP Address of CR3000 HMI : 192.168.0.181

IP Address of Mosquitto Broker running on Laptop: 192.168.0.85

Crimson 3.1 CR3000 Configuration:

1. Go to Communications -> Network -> Ethernet 1 and set up the IP Address of CR3000 HMI as shown in Figure 1.

mceclip1.png

                                                                               Figure 1

2. Go to Connectors -> Generic MQTT -> service tab and set it up as shown in Figure 2. 

mceclip2.png

                                                                      Figure 2

3.  Create two internal tags - Tag1 and Tag2 as shown in Figure 3.

 mceclip4.png

                                                                              Figure 3

4.  Set up Tag set 1 as seen in Figure 4.

mceclip5.png

                                                                           Figure 4

5. Set up Tag set 2 as seen in Figure 5.

mceclip6.png

                                                                                  Figure 5

Crimson 3.2 DA50A Configuration:

1. Go to Device Configuration -> system configuration -> Network -> Interfaces -> Ethernet 1 and set up the IP Address as shown in Figure 6.

mceclip7.png

                                                                             Figure 6

2. Go to communications-> Connector -> Generic MQTT -> service tab and set it up as seen in Figure 7.

mceclip8.png

                                                                          Figure 7

3.  Create two internal tags - Tag1 and Tag2 as shown in Figure 8.

mceclip4.png

                                                                                       Figure 8

4.  Set up Tag set 1 as seen in Figure 9.

mceclip9.png

                                                                                    Figure 9

5. Set up Tag set 2 as seen in Figure 10.

mceclip11.png

                                                                                     Figure 10

6.  Go to display pages -> Pages -> Global actions -> On Tick and enter Tag2++ to get Tag 2 to increment every second as shown in Figure 11

mceclip12.png

 

Using Mosquitto

Install Mosquitto

Download and install Mosquitto from http://mosquitto.org/download/

Running Mosquitto

1. Start the broker, referring to Figure 12, open a command prompt and make sure you run as administrator.
Note: You absolutely need to make sure you run CMD as administrator and make sure you don’t have more than one instance of CMD open.

mceclip0.png

Figure 12

2. Navigate to the Mosquitto root folder, such as C:\Program Files (x86)\mosquito by doing CD C:\Program Files (x86)\mosquitto

3. Start the Mosquitto service by running the command: net start mosquitto, refer to Figure 13.

mceclip1.png

Figure 13

You should get the message The Mosquitto Broker service was started successfully.

 

Notes:

Data Transfer from DA50A to CR3000 HMI:

Tag 2 is updating once a second in DA50A unit. This is done via display pages -> Pages -> Global Actions -  > On Tick and by doing Tag 2++. This data is being published by setting up publication topic dev1 under Tag set 1 in Crimson 3.2 database while CR3000 is subscribing to topic via subscription topic dev1 in order to receive this data in Tag 2 under Tag set 2 in Crimson 3.1 database.

Data Transfer from DA50A to CR3000 HMI:

Data from Tag 1 on the CR3000 HMI  is manually entered from touch screen which is then published via publication Topic dev2 under Tag set 1 in Crimson 3.1 database. Flexedge DA50A is subscribed to this topic  via subscription topic dev2 in order to receive this data in Tag 1 under Tag set 2 in Crimson 3.2 database.

 

Monitoring Values:

    Figure 14. showing DA50A sending data via Tag 2 and Receiving data via Tag 1

  mceclip16.png

                                                                              Figure 14

 

Figure 15. showing CR3000 HMI sending data via Tag1 and receiving data via Tag2

mceclip15.png

                                                                                        Figure 15

 

Update:

Starting with the release of Mosquitto version 2.0.0 the default config will only bind to localhost as a move to a more secure default posture.

If you want to be able to access the broker from other machines you will need to explicitly edit the config files to either add a new listener that binds to the external IP address (or 0.0.0.0) or add a bind entry for the default listener.

By default, it will also only allow anonymous connections (without username/password) from localhost, to allow anonymous from remote add:

allow_anonymous true
listener 1883

Disclaimer

It is the customer's responsibility to review the advice provided herein and its applicability to the system. Red Lion makes no representation about specific knowledge of the customer's system or the specific performance of the system. Red Lion is not responsible for any damage to equipment or connected systems. The use of this document is at your own risk. Red Lion standard product warranty applies.

Red Lion Technical Support

If you have any questions or trouble contact Red Lion Technical Support by clicking here or calling 1-877-432-9908.

For more information: http://www.redlion.net/support/policies-statements/warranty-statement