You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Prerequisites:

Overview:

This tutorial shows how to configure MQTT Transmission to generate custom records and send them as MQTT messages via MQTT Distributor to be stored in a database. The topology of this example shows MQTT Distributor, MQTT Engine, Record Store, and MQTT Transmission all running in the same Ignition instance.  This is done for simplicity of the tutorial.  But, this isn't required or even intended to be a real use case.  In a more realistic scenario MQTT Transmission and MQTT Engine would be located on separate machines.


Loading Cirrus Link Modules:

The first step is to load four Cirrus Link modules specified in the 'Prerequisites' section of this document. To load the modules, launch the Ignition Gateway and open HTTP connection to it.  If Ignition Gateway is running on your development machine, use http://localhost:8088 to connect.  You should see a screen shown below:

Click the "CONFIGURE" tab to go to the 'Configuration Section'. Ignition will ask you to sign in; use the admin/password as your credentials.

After signing in, you will see the screen below. Go to 'SYSTEM' on the left hand side of the screen and select 'Modules'. 

At this point, the following module configuration page will appear:

Scroll down and click the 'Install or Upgrade a Module' link to install four modules listed above. Here is what you should see at the end:

These modules can be configured by clicking 'Settings' on the left hand side below each module. Note that the 'MQTT Distributor' and MQTT Engine modules should not be touched; they will use default configuration. The 'Record Store' module should be configured to point for the datasource used for storage, but this needs be done after configuring database connections. Finally, the 'MQTT Transmission' module needs to be configured to define custom records to be published. This will be described in subsequent sections of this document.


Configure Database Connections:

Before configuring Database Connections in Ignition, make sure that MySQL is installed and a test database is setup. If not, please install the following version of MySQL:

$ mysql --version
mysql  Ver 14.14 Distrib 5.7.12, for osx10.11 (x86_64) using  EditLine wrapper

Then configure user and setup a database as shown below:

$ mysql -u root -p

Enter password: 

mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';

Query OK, 0 rows affected (0.01 sec)

mysql> CREATE DATABASE testdb;

Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON testdb.* TO 'user'@'localhost';

Query OK, 0 rows affected (0.01 sec)

When database is created, login as a user and switch to this database as shown below.

$ mysql -u user -p

Enter password: 

mysql> USE testdb;

Database changed

The database is now ready, and the next step is to configure Database Connection in Ignition. To do this, go to Ignition 'Configuration Section' as was shown above and click 'Connections' under 'DATABASES' on the left hand side of the screen.  This will bring you to the 'Database Connections' setup page:


Now, click the "Create new Database Connection..." link and the following 'Choose Driver' screen will appear:


Select the 'MySQL ConnectorJ' option and click 'Next' to configure new database connection as shown below:


On the 'New Database Connection' configuration page shown above, configure the following fields:

  • Name - database connection name to be set in the 'Record Store' module.
  • Description - description of this database connection
  • Connect URL - connect URL to the 'testdb' database that was created earlier
  • Username and password - MySQL user credentials

The second step is to configure the Tag Provider in Ignition in a way that MQTT Transmission understands. The Tag Provider needs to be set up in Ignition via the Ignition Designer.  Here is how to do this...

  • Near the upper right corner, click 'Launch Designer'.  This will open the following window after downloading the JNLP file and executing it.  Note the default username/password is admin/password.  Type those into the appropriate fields and click 'Login'.


  • This will bring you to a new Window where you can select an Ignition Project or create a new one.  Create a new project by giving it a name and clicking 'Create New Project'.

  • In this example we're going to use the "default" tag provider within Ignition Enterprise.  Expand 'All Providers' in the Tag Browser and select 'default' as shown below:
  • asdas


  • No labels