Skip to content

07 Development

Mark Todd edited this page Aug 3, 2026 · 2 revisions

Development

This page is for contributors and anyone building MQTTProbe from source. For the contribution workflow (issues, PRs, git hooks, style, CI), see CONTRIBUTING.md.

Prerequisites

  • .NET 10 SDK
  • MAUI workload only if you are building the MAUI targets (Android, Windows MAUI)
  • Python 3 for the helper scripts (coverage, format check)

Clone with submodules

The repo includes SparkplugNet as a git submodule. Clone with submodules from the start:

git clone --recurse-submodules https://github.com/bluegrassiot/mqttprobe.git

If you already cloned without that flag:

git submodule update --init --recursive

Solution layout

Project Path Role
MqttProbe.Shared src/MqttProbe.Shared Shared UI (Blazor components), models, services. This is where most of the application logic lives.
MqttProbe.Web src/MqttProbe.Web ASP.NET Core web host. Used for the web deployment and Docker image.
MqttProbe.Maui src/MqttProbe.Maui MAUI host for Android and Windows MAUI builds.
MqttProbe.Desktop src/MqttProbe.Desktop Photino desktop host for Linux and macOS desktop builds.
MqttProbe.Tests tests/MqttProbe.Tests Unit and integration tests.
MqttProbe.Benchmarks benchmarks/MqttProbe.Benchmarks Standalone MQTT payload publisher for load/format testing against a real broker (not unit tests).

The main solution file is MqttProbe.slnx at the repo root. A filter solution MqttProbe.NoMaui.slnf excludes the MAUI project for faster builds when you do not need MAUI targets.

Key libraries

  • MQTTnet 5.x with an in-house managed client wrapper that handles reconnect, resubscribe, and message queuing. The wrapper lives under src/MqttProbe.Shared/Services/Mqtt/.
  • MudBlazor for the UI component library.
  • SparkplugNet (submodule): see SparkplugNet fork below.
  • Protobuf generation as needed for Sparkplug and protocol schemas.
  • Blazor-ApexCharts for message and topic visualizations.

SparkplugNet fork

MQTTProbe uses SparkplugNet for Sparkplug B encoding and decoding. The original library by SeppPenner is published on NuGet, but it still targets the MQTTnet v4 era. Since MQTTProbe runs on MQTTnet 5.2.x, we maintain a fork that ports SparkplugNet onto the newer MQTTnet version.

Repo
Upstream https://github.com/SeppPenner/SparkplugNet
Fork (used here) https://github.com/bluegrassiot/SparkplugNet

The fork lives at external/SparkplugNet as a git submodule and is consumed as a project reference from the submodule (see the comment in MqttProbe.Shared.csproj), not the NuGet package. Clone with --recurse-submodules to pull it automatically (see Clone with submodules above).

Credit to SeppPenner for the original work. The fork is purely for MQTTnet 5 compatibility maintenance.

Benchmarks

The benchmarks project publishes realistic multi-format payloads (Sparkplug, JSON, MessagePack, hex, and others) to a broker so you can exercise MQTTProbe's decode and UI paths under load. It is a standalone tool built on MQTTnet 5.2 and does not depend on MqttProbe.Shared (except for linked Sparkplug protobuf sources). It is included in the main MqttProbe.slnx solution.

Quick run:

dotnet run --project benchmarks/MqttProbe.Benchmarks -c Release -- publish

Optional flags to control volume and format:

dotnet run --project benchmarks/MqttProbe.Benchmarks -c Release -- publish --count 500 --rate 200 --format Sparkplug,Json

For the full list of options, see benchmarks/MqttProbe.Benchmarks/README.md.

Common commands

Run the test suite:

dotnet test tests/MqttProbe.Tests

Launch the web project with hot reload:

dotnet watch --project src/MqttProbe.Web

Check code coverage (writes a report under coverage/):

python scripts/ci/coverage.py

Check C# and Razor formatting:

python scripts/ci/format-check.py

Auto-fix formatting issues:

python scripts/ci/format-check.py --fix

Helper scripts live under scripts/ by purpose: ci/ (format, coverage, inspect, hooks), packaging/ (build, pack, version checks), and dev/ (certs, local config helpers).

Contributing

For the full contribution workflow, including how to report issues, open PRs, set up git hooks, code style, and CI pipeline details, see CONTRIBUTING.md.

Clone this wiki locally