mirror of
https://github.com/meshtastic/mqtt.git
synced 2026-03-28 17:42:35 +01:00
a735b04a64bedfafb7eb29c015db9c0956f87f3a
Meshtastic MQTT Broker Boilerplate
This project provides an MQTT broker boilerplate specifically designed for Meshtastic mesh networks. It handles encrypted mesh packets, validates messages, and can be configured to run with SSL.
Features
- MQTT server implementation for Meshtastic devices
- Allows for more precise access control than Mosquito ACLs
- Support for encrypted mesh packet handling and validation
- Support for validating client connections and subscriptions
- SSL support for secure MQTT connections
- Built using C# / .NET 9.0 with MQTTnet
- Multi-platform support
- Can be easily be packaged to run as a portable standalone binary
- Configurable logging with Serilog
Docker Setup
Prerequisites
- Docker installed on your system
- Certificate file (if using SSL mode)
Docker Installation
-
Clone the repository:
git clone https://github.com/meshtastic/mqtt cd mqtt -
Build the Docker image:
docker build -t meshtastic-mqtt-broker .
SSL Mode (Port 8883)
To run with SSL enabled:
- Place your certificate file (
certificate.pfx) in the project directory. (see MQTTnet Server Wiki) - Run the container with the SSL environment variable:
docker run -p 8883:8883 -v $(pwd)/certificate.pfx:/app/certificate.pfx meshtastic-mqtt-broker
Docker Compose Example
version: '3'
services:
mqtt-broker:
build: .
ports:
- "8883:8883"
volumes:
- ./certificate.pfx:/app/certificate.pfx
restart: unless-stopped
Configuration Options
- Certificate: Mount your PFX certificate file to
/app/certificate.pfxin the container - Ports: The application uses 8883 for SSL MQTT (default) and port 1883 for standard MQTT
Troubleshooting
- Ensure proper network access to the Docker container
- Check that certificates are correctly formatted
- Review logs using
docker logs [container-id]
Languages
C#
93%
Dockerfile
7%