Sparkplug Troubleshooting
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.
Introduction
A Sparkplug system typically consists of an MQTT broker, Sparkplug edge nodes, and one or more Sparkplug host applications. Various kinds of issues can arise in a Sparkplug system. Since the Sparkplug edge nodes and host applications commonly connect to the MQTT broker, one group of issues is related to such MQTT connections. Then, there are issues specific to Sparkplug edge nodes, and issues specific to Sparkplug host applications. Also, even if the Sparkplug edge node and the host application successfully communicate with the MQTT broker, they may not "understand" themselves properly.
For troubleshooting discussions related specifically to Sparkplug edge nodes or host applications, see
Troubleshooting Tools
Other Sparkplug components
As in similar cases where two or more communication parties are involved, if you have a situation in which your Sparkplug host application does not receive data from your Sparkplug edge node (or cannot send commands to it), you can get insight into the situation by replacing one or both these Sparkplug components with a different one. For example, if your host application cannot receive data from your edge node, but it can receive data from other edge nodes, the problem is likely in your edge node, and not in the host application.
Similar procedure can be used for problems related to MQTT communication with the broker (try a different Sparkplug component, or a different broker).
SparkplugCmd Utility
The SparkplugCmd Utility can be easily used for the purpose described above - i.e. to serve as "known good" replacement Sparkplug host application or edge node.
For more information, see
- Using SparkplugCmd Utility as Sparkplug host application
- Using SparkplugCmd Utility as Sparkplug Edge Node
MQTT Explorer
MQTT Explorer is a free tool that as a client to your MQTT broker, and can be used (among other tasks) to view the topics in the MQTT broker, and the data that is being published.
One typical use of MQTT Explorer is to figure out whether your Sparkplug edge node is actually publishing data to the broker, and whether it is using the proper topic name.
Other tools similar to MQTT Explorer exist too, possibly with somewhat different features.
Wireshark
Wireshark is a free network protocol analyzer. It can be used to analyze the communication between the Sparkplug edge node and the MQTT broker, or between the MQTT broker and the Sparkplug host application, on low level. Hopefully you will not need to go that "low" in your troubleshooting, but if the need arises, Wireshark is the tool can provides everything necessary.
Other tools similar to Wireshark exist too, possibly with somewhat different features.
Common Issues
Identification mismatch
Sparkplug uses various IDs and names (strings) to identify the entities that take part in the communication. The main ones are:
- Group ID
- Edge node ID
- Device ID
- Host application ID
- Metric name
Obviously, the producing side must use the same identification information as the consuming side. Get one of them wrong - and you run into problems.
If you suspect that identification mismatch can be causing your problems, check all the identification information carefully. When in doubt, use a tool like MQTT Explorer to verify inside the MQTT broker what is the actual identification information being used. The group ID, edge node ID and (optionally) device ID become parts of the MQTT topic name, and using a tool like MQTT Explorer allow you to check it easily.