Using SparkplugCmd Utility as Sparkplug host application
For general information about the SparkplugCmd tool, see Category:SparkplugCmd Utility.
Commands, Arguments and Options
The commands described here can be entered at the SparkplugCmd> prompt, or directly on the command-line invoking the SparkplugCmd utility.
Command: consumer
The consumer command (shortened: c) contains sub-commands that allow you to consume Sparkplug data, i.e. act as a Sparkplug host application component in the Sparkplug system.
The argument that follows the consumer command is the resource descriptor for the Sparkplug broker that should be used. If omitted, it defaults to mqtt://localhost, i.e. it connects to the MQTT broker on your local machine, using unauthenticated TCP connection on port 1883.
If you simply enter the consumer command (optionally with a broker URL), the SparkplugCmd enters an interactive mode for this command, and you can continue by issuing one or more sub-commands, each on a separate line. Alternatively, you can include the sub-command directly following the consumer command (with its optional broker URL), in which case the sub-command will be performed immediately.
Examples:
consumer, or shortened c
This command will simply show the consumer> prompt, and allow you to enter further sub-commands. The sub-commands will all connect to "mqtt://localhost".
consumer mqtt://test.mosquitto.org, or shortened c //test.mosquitto.org
This command will show the consumer> prompt, and allow you to enter further sub-commands. The sub-commands will all connect to the specified MQTT broker.
Command: consumer subscribePayload
Use the subscribePayload command (shortened: sp) to subscribe to payload notifications from an edge node or device. The received payload are displayed in a table form.
Command: consumer subscribeMetric
Use the subscribeMetric command (shortened: sm) to subscribe to metric notifications from an edge node or device. Each received metric notification is displayed separately (the payloads are "unpacked").
Command: consumer publishMetric
Use the publishMetric (shortened: pm) command to publish a command metric to an edge node or device.
Command: consumer edgeNodeRebirth
Use the edgeNodeRebirth command (shortened: enr) to publish a command to rebirth an edge node.