A feature-rich MQTT broker specifically designed for Meshtastic mesh networks with advanced packet filtering, rate limiting, privacy controls, and moderation capabilities.
- Fail2Ban Style Connection Moderation - Automatically ban abusive clients
- Rate Limiting - Per-node and global packet rate limits with duplicate detection
- Topic Filtering - Whitelist/blacklist MQTT topics
- Connection ACLs - Allow/block specific clients
- Location Filtering - Block or strip GPS data from POSITION packets
- Position Precision Reduction - Degrade location accuracy for privacy
- Bitfield Stripping - Remove "OK to MQTT" consent metadata
- Selective Node Filtering - Per-node location policies
- Zero-Hopping - Prevent specific packet types from being forwarded
- Hop Count Limits - Enforce maximum hop counts
- Port Number Filtering - Block/allow specific Meshtastic port numbers
- Real-time Statistics - Track packets, bans, rate limits, and filters
- Comprehensive Logging - Serilog integration with configurable levels
- Metrics Export - Built-in statistics reporting
- .NET 9.0 SDK
- Docker (optional, for containerized deployment)
# Clone the repository
git clone https://github.com/yourusername/meshtastic-mqtt-broker.git
cd meshtastic-mqtt-broker
# Copy and customize configuration
cp appsettings.json appsettings.local.json
# Build and run
dotnet restore
dotnet build
dotnet run{
"MqttBroker": {
"Port": 8883,
"UseSsl": true
},
"RateLimiting": {
"Enabled": true,
"PerNodePacketLimit": {
"MaxPacketsPerMinute": 60
}
},
"LocationFilter": {
"ReducePositionPrecision": true,
"TargetPrecisionBits": 12
},
"PacketFiltering": {
"BlockUnknownTopics": true,
"ZeroHopPortNums": [67]
}
}- Implementation Guide - Complete setup instructions
- Zero-Hopping Explained - How hop count modification works
- Protobuf Setup Guide - Adding Meshtastic protobuf support
- Bitfield Stripping Guide - Removing "OK to MQTT" flags
- Location Blocking Guide - Privacy controls for GPS data
- Security Flow Diagrams - Visual guide to security features
{
"LocationFilter": { "BlockPositionPackets": true },
"PacketModification": { "StripOkToMqttBitfield": true }
}{
"LocationFilter": {
"ReducePositionPrecision": true,
"TargetPrecisionBits": 12
}
}{
"RateLimiting": { "Enabled": false },
"PacketFiltering": { "BlockUnknownTopics": false }
}Working without protobuf:
- ✅ Rate limiting
- ✅ Fail2Ban
- ✅ Topic filtering
- ✅ Connection ACLs
Requires protobuf setup (guide):
- ⏳ Zero-hopping
- ⏳ Location stripping
- ⏳ Bitfield stripping
- ⏳ Precision reduction
GPL-3.0 License - See LICENSE file
- Original boilerplate: meshtastic/mqtt
- Meshtastic Project: meshtastic.org
- MQTTnet Library: dotnet/MQTTnet
Made with ❤️ for the Meshtastic community