SparkplugNet
SparkplugNet is a library to use the Sparkplug industrial IoT (IIoT) standard in .Net. It uses MQTTnet in the background.
Install / Use
/learn @SeppPenner/SparkplugNetREADME
SparkplugNet
SparkplugNet is a library to use the Sparkplug industrial IoT (IIoT) standard in .Net. It uses MQTTnet in the background.
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> <!-- ALL-CONTRIBUTORS-BADGE:END -->Available for
- Net 8.0
- Net 9.0
Net Core and Net Framework latest and LTS versions
- https://dotnet.microsoft.com/download/dotnet
Structure
Sparkplug distinguishes between 5 different types of logical parts:
|Part|Description| |-|-| |Primary application|The main application that needs to be always available to work with the data and store metrics.| |Applications|Other applications that work with the sent data and metrics.| |EoN nodes (Later only called nodes)|Logical devices that bundle data from end-of-network devices and publish their data.| |MQTT enabled devices|Sensors that work as a "hybrid" version of a node and a device and publish metrics and data.| |Non MQTT-enabled devices|Sensors that push data to nodes where the nodes publish their data to MQTT on their behalf.|
Basic usage
For basic usage, see the How to use file or the example project.
Requirements
- MQTT broker that implements 100% of the MQTT 3.1.1 specification
- MQTT broker with QoS 0 and 1 support
- MQTT broker with retained messages support
- MQTT broker with last will and testament support
- MQTT broker with a flexible security system
Recommended brokers
- MQTTnet.Server for simple MQTT testing.
- HiveMQ CE with the Eclipse™ Sparkplug™ Technology Compatibility Kit for Sparkplug testing, following also issue https://github.com/SeppPenner/SparkplugNet/issues/39 for more details.
Recommended clients
- MQTT.fx has a Sparkplug data decoder. The binaries for version 1.7.1 can also be taken from https://github.com/SeppPenner/mqttfx171-backup (The software is now under development by a company and requires a license for version 1.7.1+).
- mqttMultimeter for general MQTT debugging. I guess, a Sparkplug decoder could be added once this library here is up-to-date.
- MQTTExplorer for general MQTT debugging.
Supported Sparkplug standards
- Version 1.3.0 and above: Sparkplug, version 3.0, spAv1.0 (Marked as obsolete) and spBv1.0.
- Version 1.2.0 and below: Sparkplug, version 2.2, spAv1.0 and spBv1.0.
Special notes
- Version 1.3.4 renames all events from
SomethingAsynctoSomething. (BREAKING) - Version 1.1.0 introduces the async event pattern and deprecates the "old, synchronous" events, Version 1.2.0+ will remove the old events completely. (BREAKING)
- You can enable the global setting
SparkplugGlobals.UseStrictIdentifierCheckingwhich prevents users from using the following chars in identifiers:
.,\@#$%^&*()[]{}|!`~:;'"<>?
Further resources
- https://www.eclipse.org/tahu/spec/Sparkplug%20Topic%20Namespace%20and%20State%20ManagementV2.2-with%20appendix%20B%20format%20-%20Eclipse.pdf
- https://documents.opto22.com/2357_Industrial_Strength_MQTT_Sparkplug_B.pdf
- https://github.com/eclipse/tahu
- https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.core.cloud/src/main/protobuf/kurapayload.proto
- https://github.com/eclipse/tahu/blob/master/sparkplug_b/sparkplug_b_c_sharp.proto
- https://protogen.marcgravell.com/
- https://stackoverflow.com/questions/66199386/protobuf-net-how-to-use-the-any-data-type
- http://www.steves-internet-guide.com/spsparkplug-payloads-and-messages/
Change history
See the Changelog.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tbody> <tr> <td align="center" valign="top" width="14.28%"><a href="https://franzhuber23.blogspot.de/"><img src="https://avatars.githubusercontent.com/u/9639361?v=4?s=100" width="100px;" alt="HansM"/><br /><sub><b>HansM</b></sub></a><br /><a href="https://github.com/SeppPenner/SparkplugNet/commits?author=SeppPenner" title="Code">💻</a> <a href="https://github.com/SeppPenner/SparkplugNet/commits?author=SeppPenner" title="Documentation">📖</a> <a href="#example-SeppPenner" title="Examples">💡</a> <a href="#maintenance-SeppPenner" title="Maintenance">🚧</a> <a href="#projectManagement-SeppPenner" title="Project Management">📆</a> <a href="https://github.com/SeppPenner/SparkplugNet/commits?author=SeppPenner" title="Tests">⚠️</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/insightdocs"><img src="https://avatars.githubusercontent.com/u/23101485?v=4?s=100" width="100px;" alt="insightdocs"/><br /><sub><b>insightdocs</b></sub></a><br /><a href="https://github.com/SeppPenner/SparkplugNet/commits?author=insightdocs" title="Tests">⚠️</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/OffTravel"><img src="https://avatars.githubusercontent.com/u/19183574?v=4?s=100" width="100px;" alt="OffTravel"/><br /><sub><b>OffTravel</b></sub></a><br /><a href="https://github.com/SeppPenner/SparkplugNet/commits?author=OffTravel" title="Code">💻</a> <a href="https://github.com/SeppPenner/SparkplugNet/commits?author=OffTravel" title="Tests">⚠️</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/cjmurph"><img src="https://avatars.githubusercontent.com/u/2868949?v=4?s=100" width="100px;" alt="cjmurph"/><br /><sub><b>cjmurph</b></sub></a><br /><a href="https://github.com/SeppPenner/SparkplugNet/commits?author=cjmurph" title="Code">💻</a> <a href="https://github.com/SeppPenner/SparkplugNet/commits?author=cjmurph" title="Tests">⚠️</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/BoBiene"><img src="https://avatars.githubusercontent.com/u/23037659?v=4?s=100" width="100px;" alt="Bo Biene"/><br /><sub><b>Bo Biene</b></sub></a><br /><a href="https://github.com/SeppPenner/SparkplugNet/commits?author=BoBiene" title="Code">💻</a> <a href="https://github.com/SeppPenner/SparkplugNet/commits?author=BoBiene" title="Tests">⚠️</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/TimJoehnk"><img src="https://avatars.githubusercontent.com/u/93274944?v=4?s=100" width="100px;" alt="Tim Jöhnk"/><br /><sub><b>Tim Jöhnk</b></sub></a><br /><a href="https://github.com/SeppPenner/SparkplugNet/commits?author=TimJoehnk" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/Patrick2607"><img src="https://avatars.githubusercontent.com/u/9799823?v=4?s=100" width="100px;" alt="Patrick.GK"/><br /><sub><b>Patrick.GK</b></sub></a><br /><a href="https://github.com/SeppPenner/SparkplugNet/commits?author=Patrick2607" title="Code">💻</a> <a href="https://github.com/SeppPenner/SparkplugNet/commits?author=Patrick2607" title="Tests">⚠️</a> <a href="#infra-Patrick2607" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td> </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/geraldasp"><img src="https://avatars.githubusercontent.com/u/1334535?v=4?s=100" width="100px;" alt="Gerald Asp"/><br /><sub><b>Gerald Asp</b></sub></a><br /><a href="https://github.com/SeppPenner/SparkplugNet/commits?author=geraldasp" title="Tests">⚠️</a> <a href="https://github.com/SeppPenner/SparkplugNet/commits?author=geraldasp" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/adityashahazilen"><img src="https://avatars.githubusercontent.com/u/132545158?v=4?s=100" width="100px;" alt="adityashahazilen"/><br /><sub><b>adityashahazilen</b></sub></a><br /><a href="https://gitRelated Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
