MTConnect Agent provides an MQTT egress plugin to stream data from the agent to any MQTT server.
Devices = _metaagent_.xml
Port = 7979
Adapters
{
Mazak
{
Host = demo.metalogi.io
Port = 7879
}
}
Sinks
{
Mqtt2Service {
# MQTT server connection info
MqttHost = MQTTServer
MqttPort = 1883
MqttUserName = demo
MqttPassword = testing
MqttClientId = myDemo
# Secured connection info
# MqttCert = client.crt
# MqttPrivateKey = client.key
# MqttCaCert = ca-root-cert.crt
# MqttTls = true
# Topics
# AssetTopic = <Topic for asset data> Default is MTConnect/Asset/[device]
# ProbeTopic = <Topic for device model data> Default is MTConnect/Probe/[device]
# CurrentTopic = <Topic for current data>. Default is MTConnect/Current/[device]
# SampleTopic = <Topic for new updates>. Default is MTConnect/Sample/[device]
# MqttLastWillTopic = <Topic for tracking agent's status>. Default is MTConnect/Probe/[device]/Availability
# Publish Rates
# MqttSampleInterval = <Sample public rate in ms> Default is 500
# MqttCurrentInterval = <Current public rate in ms> Default is 10000
# MqttSampleCount = <Sample's buffer size> Default is 1000
}
}
MqttHost
: MQTT server's hostnameMqttPort
: MQTT server's port numberMqttClientId
: Client ID used in the connectionMqttUserName/MqttPassword
: User/Password login for the MQTT server.MqttPrivateKey/MqttCert
: Client certificate and its key file for the secured connection.MqttCACert
: CA certificate for the secured connection.AssetTopic
- Prefix for the Assets. Default: MTConnect/Asset/[device]
CurrentTopic
- Prefix for the Current. Default: MTConnect/Current/[device]
ProbeTopic
- Prefix for the Device Model topic. Default: MTConnect/Probe/[device]
Note: The
[device]
will be replace with the uuid of each device. Other patterns can be created, for example:MTConnect/[device]/Probe
will group by device instead of operation.
SampleTopic
- Prefix for the Sample. Default: MTConnect/Current/[device]
LastWillTopic
- The topic used for the last will and testament for an agent. Default: MTConnect/Probe/[device]/Availability
Note: The value will be
AVAILABLE
when the Agent is publishing and connected and will publishUNAVAILABLE
when the agent disconnects from the broker.
MqttCurrentInterval
- The frequency of publishing currents. Acts like a keyframe in a video stream. Default: 10000msMqttSampleInterval
- The frequency of publishing samples. Works the same way as interval
in the rest call. Group observations up and publish with the minimum interval given. If nothing is available, will wait until an observation arrives to publish. Default: 500msMqttSampleCount
- The maximum number of observations to publish at one time. Default: 1000