Skip to main content

MQTT Endpoints

ReferenceAudience: API consumerUse: look up the members, types, defaults, and limits of a configuration object

These objects are sent with config_endpoint and config_events, and returned by get_endpoint_config. Default is the value the reader uses when you omit the member. The operating-mode and post-filter objects are documented on set_operating_mode and set_post_filter.

Endpoint Configuration​

cfgEndpointPayload​

The epConfig object of config_endpoint.

FieldTypeRequiredDefaultLimitsMeaning
operationendpointOperation enumYesadd, update, or delete
configurationobject (endpointConfiguration)YesThe endpoint configuration

The contract requires the same seven configuration members for every operation: endpointName, epType, protocol, activate, url, verificationType and port. Its own delete example sends only endpointName and epType, and its update example omits verificationType and port, so a validator built strictly from the contract rejects both. See config_endpoint.

endpointConfiguration​

The configuration object, as config_endpoint sends it.

FieldTypeRequiredDefaultLimitsMeaning
endpointNamestringYes15 charactersName of the endpoint. With epType, it selects the endpoint that an update or delete changes.
epTypeepTypeYesThe class of traffic the endpoint carries. DATA2 is currently not supported.
protocolendpointProtocolYesMQTT for plaintext, or MQTT_TLS for TLS
activatebooleanYesfalseWhether the reader connects for this endpoint
urlstringYesBroker host name or IP address, without a scheme or port
verificationTypeverificationTypeYesHow far the reader verifies the broker's TLS certificate
portintegerYesBroker TCP port
qosCommoninteger (mqttQoS)NoQoS level for the endpoint
tenantIdstringNomax length 48, per its descriptionFirst segment of every topic on this endpoint. An overlong value returns code 27.
mqttParamsobject (mqttParams)NoThe reader's MQTT client settings and topics for this endpoint
securityParamsobject (endpointSecurityParams)NoNames of the installed certificates and key used for TLS
eventConfigurationobject (cfgEventPayload)NoEvent settings for this endpoint, in the same shape as the config_events payload
batchingobject (endpointBatching)NoBatching of tag-data reports

In a get_endpoint_config read-back, the same object requires epType, protocol, activate, url, verificationType and port, but not endpointName, and its securityParams can also carry algorithm. The reader does not check that protocol and port agree.

mqttParams​

FieldTypeRequiredDefaultLimitsMeaning
keepAliveintegerNomax 65535Keep-alive interval, in seconds, while the client is idle
cleanSessionbooleanNotrueWhether the broker discards the reader's previous session when it connects
reconnectDelayMinintegerNoShortest wait, in seconds, before reconnecting. Must not exceed reconnectDelayMax.
reconnectDelayMaxintegerNoLongest wait, in seconds, before reconnecting
clientIdstringNoClient identifier in the reader's CONNECT packet
usernamestringNoUser name in the reader's CONNECT packet, when the broker requires one
passwordstringNoPassword in the reader's CONNECT packet, when the broker requires one. A secret: mask it.
publishTopicsarray of mqttPublishTopicBindingNoTopics the reader publishes to. The array position selects the traffic. At most 3 (code 25).
subscribeTopicsarray of mqttSubscribeTopicBindingNoThe topic the reader subscribes to for commands. At most 1 (code 26).
  • reconnectDelayMin must be less than or equal to reconnectDelayMax. The schema can't express this.
  • The position of each publishTopics entry decides what the reader publishes on it. See Topic Slots.
  • Send one subscribeTopics entry. The schema does not limit the array, and some published read-backs report three entries.

mqttPublishTopicBinding​

One entry of publishTopics.

FieldTypeRequiredDefaultLimitsMeaning
topicstringYesBase topic. The reader adds the tenant ID before it and its serial number after it.
qosinteger (mqttQoS)YesQoS the reader publishes at on this topic
retainbooleanYesWhether the broker retains messages published on this topic

In a get_endpoint_config read-back, topic is not required.

mqttSubscribeTopicBinding​

One entry of subscribeTopics.

FieldTypeRequiredDefaultLimitsMeaning
topicstringYesBase topic filter. The reader adds the tenant ID before it and its serial number after it.
qosinteger (mqttQoS)YesRequested QoS for the subscription. The broker may grant less.
retainbooleanYesRequired by the contract, although an MQTT 3.1.1 subscription has no retain flag. The contract's own examples omit it.

endpointSecurityParams​

The securityParams object. Each file member names a certificate or key already installed with install_certificate; none carries content.

FieldTypeRequiredDefaultLimitsMeaning
formatcertificateFormatYesCertificate format. Only PEM is currently supported.
algorithmcertificateAlgorithmNoReported in read-backs only
caCertificateFilestringNoName of the installed CA certificate used to verify the broker
clientCertstringNoName of the installed client certificate for mutual TLS
clientKeystringNoName of the installed private key that matches clientCert

endpointBatching​

The batching object, which controls how tag-data reports are grouped.

FieldTypeRequiredDefaultLimitsMeaning
reportingIntervalintegerNo1000–60000Reporting interval in milliseconds. 0 selects the minimum, 1000.
maxPayloadSizePerReportintegerNo1024–5120Maximum report size in bytes. 0 selects the minimum, 1024.
  • 0 selects the minimum. It does not turn batching off.
  • Defaults. The contract declares no default. The reader's default data endpoints use a reportingInterval of 1000 and a maxPayloadSizePerReport of 1024.
  • Send the members together. What happens when only one member is set is not specified in the available sources, and neither is which limit applies first when both are reached.
Was this helpful?