mirror of
https://github.com/meshtastic/mqtt.git
synced 2026-03-28 17:42:35 +01:00
84fcd568a1157437eb2d105581dce8f210dfe291
Meshtastic MQTT Broker Boilerplate
This project provides an MQTT broker boilerplate specifically designed for Meshtastic device networks. It handles encrypted mesh packets, validates messages, and can be configured to run with or without SSL.
Features
- MQTT server implementation for Meshtastic devices
- Support for encrypted mesh packet handling and validation
- SSL support for secure MQTT connections
- Configurable logging with Serilog
- Packet filtering and validation logic
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:
- "1883:1883" # Standard MQTT port
# - "8883:8883" # SSL port (uncomment if using SSL)
# environment:
# - SSL=true # Uncomment to enable SSL
# volumes:
# - ./certificate.pfx:/app/certificate.pfx # Mount certificate if using SSL
restart: unless-stopped
Configuration Options
- SSL: Set environment variable
SSL=trueto enable SSL mode - Certificate: Mount your PFX certificate file to
/app/certificate.pfxin the container - Ports: The application uses port 1883 for standard MQTT and 8883 for SSL MQTT
Troubleshooting
- Ensure proper network access to the Docker container
- Check that certificates are correctly formatted (for SSL mode)
- Review logs using
docker logs [container-id]
Languages
C#
93%
Dockerfile
7%