Broker connection in SparkplugCmd utility

From OPC Labs Knowledge Base
Revision as of 14:23, 25 August 2025 by User (talk | contribs)

Sparkplug is a trademark of Eclipse Foundation, Inc. "MQTT" is a trademark of the OASIS Open standards consortium. Other related terms are trademarks of their respective owners. Any use of these terms on this site is for descriptive purposes only and does not imply any sponsorship, endorsement or affiliation.

The primary means of specifying the broker connection in the SparkplugCmd is the resourceDescriptor arguments to commands such as consumer or edgeNode. The resourceDescriptor is an URL of the broker, and it defaults to "mqtt://localhost", which specifies a non-authenticated TCP connection to the MQTT broker residing on the local machine, using port 1883. For further information on the URL syntax in resourceDescriptor, and the configurable parameters of the MQTT channel, see OpcLabs.MqttNet communication package.

Authentication

The username and password can be specified in the MQTT broker URL. Note that the username and password are transferred in plain text on the wire, unless encryption is used (e.g., using TLS or WSS).

Examples

Example URL: mqtt://admin:password@localhost

MQTT 5

The MQTT protocol version can be specified in the broker URL using the "version" query parameter. Possible values are 310, 311, and 500, which correspond to MQTT 3.1, MQTT 3.1.1, and MQTT 5.0, respectively. The default is MQTT 3.1.1.

Examples

Example URL: mqtt://localhost?version=500

TLS

The TLS protocol can be specified in the broker URL using the "mqtts", "ssl" or "tls" scheme, as below (the schemes are equivalent). Default port is 8883.

Examples

Example URL: mqtts://localhost


See also