Inductive Automation IIOT recently announced the release of Ignition Edge–a new offering of their Ignition platform as an edge of network resource. The new licensing model offers a stripped down version of Ignition for edge of network HMI applications for about $1000. Consumers can add on MQTT and Store and Forward–to integrate the edge of network gateway with a central enterprise gateway–for a few hundred dollars more. This announcement motivated me to put together a quick demo of Ignition using the Cirrus Link MQTT modules, a Raspberry Pi, and ESP8266 Arduino and Kepserver IOT Gateway.
The goal here is to help interested developers and end users quickly put together an MQTT Ignition environment to develop in… the process is easy, painless and a lot of fun.
This post is a companion to a comprehensive video we released on Wednesday 3/16/17. You can view the video here.
Demo Architecture with Raspberry Pi as Broker
- Install Mosquitto on Raspberry Pi
- Pi will be our broker in this example
- Install MQTT Spy on Windows
- MQTT Spy will be a publisher and subscriber
- Setup ESP8266 Arduino
- Arduino will read an LM35 temperature sensor and publish two topics
- Install and Setup the Cirrus Link MQTT Modules in Ignition
- Install and Setup Kepserver IOT Gateway
- Build a test window and play around
Raspberry Pi3, Adafruit Feather HUZZAH ESP8266 with LM35 Temperature Sensor
Step 1. Install Mosquitto on Raspberry Pi
The best instructions I found for installing Mosquitto were here.
- Install Mosquitto
- Stop the server
- Update Mosquitto.conf
- Restart server
- Open a new terminal and subscribe to a topic
- mosquitto_sub -d -t hello/world
- Open another terminal and publish to the topic
- mosquitto_pub -d -t hello/world -m ‘Test’
- Revel in your glory… you just set up a Raspberry Pi3 as an MQTT Broker, subscribed to and published to a topic!
Step 2. Install MQTT-Spy on Windows
Documentation for MQTT-Spy are here. MQTT-Spy will be used to publish and subscribe to topics from one of our servers. Essentially, we use it in this demo as another agent to show the versatility of MQTT-Spy.
- Download MQTT-Spy
- Run the jar
- Setup a connection with the broker (in our case, 192.168.0.33:1883)
- Use hashtag to subscribe to all topics
- Revel in your glory… you just set up MQTT-Spy to talk to your broker!
Step 3. Setup the ESP8266 Arduino with LM35 Temperature Sensor
Documentation on the ESP8266 can be found here.
- Wire up the LM35 to A0 (ADC) analog in
- Open up the Arduino IDE and use the code below (add in your SSID and Password and your broker IP address).
- Subscribe to the new topics in the Raspberry Pi
- mosquitto_sub -d -t Intellic/Pyramid/Temp
- mosquitto_sub -d -t outTopic
- Confirm that the updates are showing up in the Raspberry Pi and MQTT Spy
- Revel in your glory… you just successfully set up an ESP8266 with LM35 temperature sensor to publish to your MQTT Broker!
MQTT-Spy Testing Topics from Arduino
Step 4. Install and Setup the Cirrus Link MQTT Modules in Ignition
Download Ignition and the Cirrus Link Modules here. Documentation for the modules are here.
- Install Ignition and Modules
- Configure MQTT Engine for your broker
- Create Custom Namespace with # to subscribe to all topics
- Test tags in Ignition
- Revel in your glory… you have successfully setup Ignition to talk to your broker over MQTT!
Navigate to the Gateway Homepage and Open MQTT Engine Settings
Configure a New MQTT Server
Create a Custom NameSpace and Subscribe to # (all topics)
Launch a Designer, Check Your Tags and Build a Demo Project!
Step 5. Setup Kepserver IOT Gateway
This process is straight forward… download Kepserver and install. Create a new agent (that points to your broker) under the IOT Gateway and drop some tags in. The video link at the beginning of this post covers the details very well.
Step 6. Build Your Demo Project
Once you have tags in Ignition, building a project is the same as with traditional tags. The difference here is that as soon as new topics are published to the broker, they will just show up in the tag structure under the MQTT Engine. I like to call this Self Aware SCADA.
There you have it… a simple demo in Ignition using a Raspberry Pi 3, Arduino ESP8266, MQTT-Spy and Kepserver IOT Gateway.
For a more detailed discussion about the implications of MQTT and the future of SCADA and the Industrial Automation space, please watch the video we put together here.
Thanks for reading!