With the Sparkplug subscriber connection, the IoTWorX can collect Sparkplug-B encoded data from MQTT brokers. It can also send commands back to the devices.
Sparkplug B provides a standardized format for MQTT messages and standardized topic structures. Sparkplug-compliant devices can publish to an MQTT broker, then ICONICS clients can subscribe to that MQTT broker and receive the data in a known format. No custom decoder needed.
1. Set up an MQTT Broker and configure it appropriately for your desired broker.
2. Right-click on the Subscriber Connections folder and select Add Sparkplug Subscriber Connection.
3. In the Sparkplug Settings section, choose your MQTT Broker from step 1.
4. Configure the rest of the subscriber connection settings appropriate for your system.
General Settings
The connection is enabled – Click this checkbox in order to keep the Subscriber Connection enabled.
Keep Alive Timeout – Enter the keep alive timeout in the text entry field and then set the units [Second(s), Minute(s), Hour(s), Day(s)] in the nearby pulldown menu. Entering '0' indicates no timeout.
Pending Command Timeout – Enter an amount of time for a pending command timeout in the text entry field and then set the units [Second(s), Minute(s), Hour(s), Day(s)] in the nearby pulldown menu.
Sparkplugs Settings
ClientID – Enter a client ID in the text entry field. Make sure that the Client ID is unique for all MQTT publishers in order to avoid conflicts when publishing the data.
MQTT Broker – Use the pulldown menu to select a MQTT broker. Click on the button to refresh the list of brokers. Click on the button for further configuration.
Base Topic – Enter a base topic in the text entry field. Sparkplug-B topic structure is defined as “spBv1.0/group_id/message_type/edge_node_id/[device_id]”. MQTT topic wildcards might be used, where ‘+’ single-level wildcard replaces one topic level, and ‘#’ is multi-level wildcard and must be placed as the last character in the topic. Example of the topic is “spBv1.0/MyGroup/+/MyEdgeNode/#”, which is a topic receiving all messages and all node and device metrics from ‘MyEdgeNode’ under ‘MyGroup’.
Quality of Service – Use the pulldown menu to select from At Most Once, At Least Once, or Exactly Once.
Rebirth Settings
Enable Rebirth – Click this checkbox to enable sending rebirth requests to the Sparkplug devices. Sparkplug devices should send the BIRTH message that describes the whole data address space of the given device, then the device can send the data updates. In case the BIRTH message is not received by Sparkplug Subscriber Connector, and it already receives the data updates from the given device, the rebirth request is sent to the device to resend its BIRTH message.
Birth Wait Period – This is the period in seconds before the rebirth request is sent to the Sparkplug device.
Rebirth Repeat Period – This is the period between two consecutive rebirth request messages sent to the given Sparkplug device if the device is not sending its BIRTH message.
Retry Count – this is the number of repeats of the rebirth requests to the given Sparkplug device.