Abstract:
This document explains how to get Crimson 3.1 to talk to MQTT explorer via MQTT Broker using the Generic MQTT Connector in Crimson. For more details on the Crimson Cloud Connectors, please consult the Crimson User Manual.
Products:
CR3000 HMIs / Data Acquisition (DA10 & DA30) / FlexEdge™ (DA50D & DA70D) / Graphite® HMI / Graphite® Controllers
Use Case: MQTT Explorer
Transfer data between CR3000 HMI and MQTT Explorer via MQTT broker(Mosquitto)
Required Software:
Crimson 3.1
Required Firmware:
Build 3106.000 or higher
Optional:
For testing purposes, an outline database can be created as described in the Crimson Cloud Connectors: Creating an Outline Database Tech Note. The outline database will be referenced when configuring the connector.
Configuring the Generic Connector in Crimson
Referring to Figure 1, perform the following:
1. Navigate to the Communications section and click on Generic MQTT under Connectors.
2. Click on the Service tab.
3. Set Enable Agent to Yes.
4. Set the Host Name 1 to the IP address of the PC running Mosquitto, 192.168.0.85 in this example.
5. Set the Subscription Topic to "dev2"
6. Set the publication Topic to "dev1"
7. Delete the User Name and Password.
8. Leave all other settings at default.
Figure 1.
Referring to Figure 2, perform the following:
9. Click on the Network tab.
10. Leave all other settings at default.
Figure 2.
Configure the Device Data and Tag Set tabs as required for the application. Figure 3 shows Tag Set 1 configured to transfer the values of Tag2 to MQTT Explorer.
Figure 3.
Figure 4 shows Tag Set 2 configured for write only meaning that MQTT explorer will write Tag1 data to CR3000 HMI.
Figure 4.
Using Mosquitto
Install Mosquitto
Download and install Mosquitto from http://mosquitto.org/download/
Running Mosquitto
1. Start the broker, referring to Figure 4, 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.
Figure 5.
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 5.
Figure 6.
You should get the message The Mosquitto Broker service was started successfully.
Using MQTT Explorer
Install MQTT Explorer
Download and install Mqtt Explorer from https://github.com/thomasnordquist/MQTT-Explorer/releases/download/0.0.0-0.4.0-beta1/MQTT-Explorer-Setup-0.4.0-beta1.exe
Running MQTT Explorer
1. Open MQTT Explorer and connect to local host as seen in Figure 7.
Figure 7.
2. Click on "connect" following which you will see topic dev 1 getting Tag2 data as seen in Figure 8.
Figure 8.
3. CR3000 HMI is subscribed to topic dev 2 which means MQTT Explorer will publish on topic dev 2 to write data to Tag1 under tag set 2 as seen in Figure 9.
Figure 9.
4. Figure 10. below shows Tag1 in CR3000 HMI successfully receiving this data
Figure 10.
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