All Collections
Connect your Devices
Connect Crimson 3.1 to Ubidots over MQTT
Connect Crimson 3.1 to Ubidots over MQTT

This guide has been deprecated

S
Written by Sergio M
Updated over a week ago

IMPORTANT NOTE
THIS GUIDE WAS DEPRECATED ON MAY, 2021.


Crimson 3.1 is Red Lion's powerful next-generation programming software for CR1000, CR3000 HMIs, Graphite® HMIs & Graphite Controllers, and E3 I/O™ modules

This software provides an intuitive, drag-and-drop graphical user interface that supports over 300 protocol drivers, including Modbus RTU and TCP/IP, EtherNet/IP, Emerson ROC, and both DNP3 serial and Ethernet communications allowing the connection of a variety of hardware offerings.

The objective of this guide is to explain how to set up Crimson 3.1 devices to stream data to Ubidots over MQTT.

Requirements

Table of contents

  1. Crimson 3.1 - Edge Controller Setup 

    1.1. Data Tags
    1.2. Communication
    1.3. Web Server

2. Ubidots Setup


    2.1. Device visualization
    2.2. Dashboard Setup

3. Summary

1. Crimson 3.1 -  Edge Controller Setup 

1.1. Data Tags

To start transmitting data, in Crimson 3.1, you must set up the data items that exist in the remote device by creating data tags. The connector supports numeric data tags. The following video shows how easy it is to work with data tags in Crimson 3.1. We highly recommend watching it to ensure you're handling the right configurations to manage data tags.  

  1. For this demo, we have set up  4 numeric data tags:

1) officeTemp:  Value coming from a GMUIN400 Graphite(R) Universal Input Module

2) upDown: Simulated value that increases and decreases over time.

3) changeValue: Integer tag that controls the status of the "upDown" and "testValue" tags.

4) testValue: Looks once a second which is the value of "upDown".

The behavior expected for these configurations in case that "changeValue" changed its value to 0, "upDown" would set its value to zero and “testValue” would keep the last non zero “upDown” value handled. Otherwise, the "upDown" and “testValue” would keep changing every second.

1.2. Communications

To enable the connection with your Ubidots account you must set up an MQTT Generic Connector with the Ubidots MQTT Broker configurations.

1. To set up an MQTT Generic connector, click on "Communications → Connector → Generic MQTT"

2) Under the "Service" tab assign the following configurations for the Generic MQTT connector:

Control

  • Enable Agent: Yes

Operations

  • Update Mode: Send All If Any

  • Reconnection: Send All Data

  • Data Buffering: Disabled

MQTT Server

  • Host Name 1: industrial.api.ubidots.com

  • Client ID: Identifier for the connection. The one used for this example is: helloWorld

Data Topics

Presentation

  • Force into Root: Enabled

  • Data Encoding: Numeric Only

Authentication

Site Details

  • Site Name: Leave it blank

Diagnostics

  • Status:  Assign "connectionInteger". At this point, you'll receive a warning message saying “the identifier could not be found”, to create it click on "Yes". Once the "connectionInteger" is created, the status of the diagnostic will change from "General" to " Tag".

  • This connectionInteger will help you determine the status of the device connected to the Ubidots platform.  

To write data from Ubidots to tags, you must create a second connector using the previous configurations and replacing the following ones:

Operations

  • Update Mode: Send Changes

Data Topics

  • Subscription Topic: /v1.6/devices/helloedge/+/lv

3) Under the "Network" tab, apply only the changes mentioned below and leave the rest as default:

Diagnostic

  • Debug Output: Enabled

Doing this enables a user to see the JSON data that is being transmitted from the Crimson device from within the Debug window in the Crimson web server.  Later in this document we will explore how to enable the debug options in the Web Server.

4) Back in the connector editing pane, under the "Device Data" tab, we will disable sending device data by selecting “Disable” in the control section.

5) At this point, you should set the tags you want  to send. To do this, go to the "Tag Set 1" tab and assign the Data Tags desired to handle into the "Contents" section. For this example, we're handling officeTemp, upDown, changeValue, and testValue.

If you want to change the update rate, you can do it in the "Control" configurations. For testing purposes, we left all the configurations as default; with an update rate of 1 second.

If you want to send data tags at different update rates (for example, some you will send every second, but others are every 4 hours), you can create a second set of tags and send those every 14,400 seconds.

6) Make sure you have a Gateway address assigned to the network configurations. To do this, go to "Communications → Network" and verify if the "Gateway" field located in "Port Settings" has an address assigned.

7) In "Communications → Network", assign "Manual" for the  "DNS Settings" and enter Name Server 1 and Name Server 2. In most cases, the default values should be fine.

1.3. Web Server

1. To be able to visualize the packets sent to Ubidots, you must activate the debug console for the Web Server. To do this, go to “Web Server", refer to the "Features" tab and in "System Pages" set the "Debug Console" as "Enabled with Commands".

2) To finish with the integration, you have to send the database you just configured to the device. To do this, click the "update" button; you can find it easily at the main menu of Crimson 3.1.

To make sure everything is running properly, open the virtual HMI for the Edge controller in the web browser of your preference using the IP address assigned. At this point, you should be able to see how everything is running in Remote View.

To verify the packets that are being handled with Ubidots, open the "Debug Console" from the remote view. To do this, click on "System", then just select "Debug Console".

2. Ubidots Setup

2.1. Device visualization

Once you are able to visualize the logs in the debug console, you must be able to see a new device automatically created in your Ubidots account.

  1. Go to the "Devices" section of your Ubidots account and see how a new device is listed on it, identified as "helloedge".

2) Click on the device "helloedge", and see how the different tags configured are updating data every second.

Optional Steps: Rename the Device and Variables

The names of the variables created are the same as the API labels, which are the IDs used by the API. This doesn't mean their names can't be changed, in fact, we actually recommend changing the names of your devices and variables to make them friendlier to your nomenclature. To learn how to rename your variables names, take a look at the article below:

2.2. Dashboard Setup

To present devices' data and insights derived from the data we suggest exploring Ubidots Dashboard, where you’ll be able to create widgets to display the data as charts, indicators, controls, tables, graphs, and more.

To create your first dashboard, go to the Dashboard tab (Data →  Dashboards). Then, select the plus (+) icon in the top-right, then select the desired widget type. You should be able to create dashboards like the one below:

If you're looking for a dashboard with even more customization, see the guide below:

3. Summary

Now with the power of the Red Lion Crimson 3.1 and Ubidots together, you'll be able to model any sensor, robot, PLC, or production line in a friendly and intuitive web environment with only a few clicks.

In just a few minutes you've integrated the Crimson 3.1 with Ubidots, sent some sample data using the generic MQTT connector, and reported your work to Ubidots for data retention, visualization, and transformation. You’re now ready to launch industrial applications in a matter of days instead of months.

Other readers have also found useful…

Did this answer your question?