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

Compare with Current View Page History

« Previous Version 3 Current »

Prerequisites:

 

Overview:

Sparkplug is an open source project developed by Cirrus Link Solutions which shows how devices or projects can be enabled to communicate with MQTT Engine and Ignition.  This example will show how data can be published via MQTT from an emulated device running on a development machine.  In addition, it will show how devices or projects can be controlled by writing to tags in Ignition.  It will also show the caveats associated with establishing/ending an MQTT session and ensuring that the tag values in Ignition are valid.

 

Example Python Client:

This tutorial assumes:

  • Ignition is running and in active trial mode or using a purchased license.
  • MQTT Distributor is installed and running, using the default configuration, and in active trial mode or using a purchased license.
  • MQTT Engine is installed and running, using the default configuration, and in active trial mode or using a purchased license.

With the standalone Sparkplug example downloaded onto your development machine, change into the directory and install the necessary Python modules for the application to run.  In order for this to run you must have Python and pip installed.  Also, this example assumes the MQTT Server running is MQTT Distributor running with it's default configuration.  If you are using a different MQTT Server, edit the following file to reflect your MQTT Server configuration:

  • sparkplug_b/stand_alone_examples/python/example.py

The most likely candidates for change are the serverUrl, myUsername, and myPassword.  For simplicity this example does not use or support TLS over MQTT without modifications.

  • No labels