Skip to content

MQTT Client Proxy ​

The MQTT Client Proxy is an optional sidecar container that enables reliable MQTT connectivity for MeshMonitor deployments. It routes MQTT traffic through MeshMonitor instead of relying on your Meshtastic node's WiFi connection.

Credit

The MQTT Proxy was created by LN4CY. MeshMonitor integrates it as an optional Docker sidecar.

Overview ​

The MQTT Client Proxy behaves like the official Meshtastic mobile apps - it uses the mqttClientProxyMessage protocol to route MQTT traffic through a client device instead of directly from the node. This provides several advantages over the node's built-in MQTT gateway.

When to Use the MQTT Proxy ​

ScenarioWhy MQTT Proxy Helps
Unreliable node WiFiNodes with poor WiFi (T-Deck, portable devices) frequently drop connections. The proxy runs on stable infrastructure.
No WiFi-enabled nodeSerial or BLE-connected nodes can still use MQTT through the proxy.
Mobile apps not runningGet MQTT without keeping the Meshtastic app open on your phone.
Server-grade reliabilityDocker containers with health checks and auto-restart are more reliable than embedded hardware.
Centralized MQTT managementAll MQTT traffic flows through your server, making it easier to monitor and debug.

When NOT to Use It ​

  • Your node has reliable, stable WiFi/Ethernet connectivity
  • You're already running the mobile app and it handles MQTT fine
  • You don't need MQTT connectivity at all
  • You prefer minimal Docker complexity

How It Works ​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Your Server                              β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚  β”‚  MeshMonitor   │────▢│  MQTT Proxy    β”‚                  β”‚
β”‚  β”‚  (port 3001)   β”‚     β”‚  (sidecar)     β”‚                  β”‚
β”‚  β”‚                β”‚     β”‚                β”‚                  β”‚
β”‚  β”‚  Virtual Node  │◀────│  TCP Client    β”‚                  β”‚
β”‚  β”‚  (port 4404)   β”‚     β”‚                β”‚                  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚           β”‚                     β”‚                            β”‚
β”‚           β”‚                     β”‚ mqttClientProxyMessage     β”‚
β”‚           β”‚                     β–Ό                            β”‚
β”‚           β”‚             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚           β”‚             β”‚  MQTT Broker  β”‚                   β”‚
β”‚           β”‚             β”‚  (external)   β”‚                   β”‚
β”‚           β”‚             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚
            β”‚ TCP (port 4403)
            β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Meshtastic   β”‚
    β”‚    Node       β”‚
    β”‚  (WiFi/BLE/   β”‚
    β”‚   Serial)     β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Points:

  1. The proxy connects to MeshMonitor's Virtual Node (port 4404)
  2. It reads MQTT settings directly from your node - no duplicate configuration
  3. Messages flow bidirectionally between your mesh and the MQTT broker
  4. The proxy uses the same protocol as the official mobile apps

Setup Instructions ​

Prerequisites ​

  1. Virtual Node enabled - The MQTT Proxy requires MeshMonitor's Virtual Node feature
  2. Node MQTT configured - Your Meshtastic node must have MQTT settings configured
  3. Client Proxy mode enabled - On your node, enable "Proxy to Client" in MQTT settings

Step 1: Configure Your Meshtastic Node ​

In MeshMonitor's Device Configuration tab, or using the Meshtastic mobile app:

  1. Enable MQTT on your node
  2. Set the MQTT broker address (e.g., mqtt.meshtastic.org:1883)
  3. Configure username/password if required by your broker
  4. Enable "Proxy to Client" - This is critical! It tells the node to send MQTT traffic through a client rather than directly.

Step 2: Enable in Docker Configurator ​

Use the Docker Configurator to generate your docker-compose.yml with the MQTT Proxy enabled:

  1. Check "Enable MQTT Client Proxy Sidecar" in the Additional Settings section
  2. The Virtual Node will be automatically enabled if not already
  3. Copy the generated docker-compose.yml

Step 3: Deploy ​

bash
docker compose up -d

The MQTT Proxy container will:

  1. Connect to MeshMonitor's Virtual Node
  2. Read MQTT configuration from your node
  3. Establish connection to the MQTT broker
  4. Begin forwarding messages bidirectionally

Manual Docker Compose Configuration ​

If you prefer to add the MQTT Proxy manually to an existing setup:

yaml
services:
  meshmonitor:
    image: ghcr.io/yeraze/meshmonitor:latest
    # ... your existing MeshMonitor configuration ...
    environment:
      - ENABLE_VIRTUAL_NODE=true
      - VIRTUAL_NODE_PORT=4404
      # ... other environment variables ...

  # MQTT Client Proxy - routes MQTT through MeshMonitor
  # Credit: https://github.com/LN4CY/mqtt-proxy
  mqtt-proxy:
    image: ghcr.io/ln4cy/mqtt-proxy:master
    container_name: meshmonitor-mqtt-proxy
    restart: unless-stopped
    environment:
      - INTERFACE_TYPE=tcp
      - TCP_NODE_HOST=meshmonitor
      - TCP_NODE_PORT=4404
      - LOG_LEVEL=INFO
      - TCP_TIMEOUT=300
      - CONFIG_WAIT_TIMEOUT=60
      - HEALTH_CHECK_ACTIVITY_TIMEOUT=300
    depends_on:
      - meshmonitor
    healthcheck:
      test: ["CMD-SHELL", "test -f /tmp/healthy && find /tmp/healthy -mmin -1 | grep -q healthy"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s

Configuration Options ​

The MQTT Proxy is configured via environment variables:

VariableDefaultDescription
INTERFACE_TYPEtcpConnection type: tcp or serial
TCP_NODE_HOST-Hostname of MeshMonitor (use meshmonitor in Docker)
TCP_NODE_PORT4403Port of Virtual Node (use 4404 for MeshMonitor)
LOG_LEVELINFOLogging level: DEBUG, INFO, WARNING, ERROR
TCP_TIMEOUT300TCP connection timeout in seconds
CONFIG_WAIT_TIMEOUT60Time to wait for node configuration
HEALTH_CHECK_ACTIVITY_TIMEOUT300Restart if no activity for this many seconds
HEALTH_CHECK_PROBE_INTERVAL60Send probe message if idle this long

Monitoring & Troubleshooting ​

Checking Logs ​

bash
docker compose logs mqtt-proxy -f

Common Issues ​

"No localNode available" ​

  • Ensure MeshMonitor is connected to your Meshtastic node
  • Check that Virtual Node is enabled in MeshMonitor
  • Verify TCP_NODE_HOST and TCP_NODE_PORT are correct

"MQTT not enabled on node" ​

  • Enable MQTT in your node's configuration
  • Enable "Proxy to Client" mode

Connection Timeouts ​

  • Verify network connectivity between containers
  • Check that your MQTT broker is accessible
  • Review TCP_TIMEOUT and CONFIG_WAIT_TIMEOUT settings

Health Check Failures ​

  • The proxy expects regular message activity
  • If your mesh is quiet, the proxy sends periodic probes
  • Check HEALTH_CHECK_ACTIVITY_TIMEOUT setting

Health Status ​

The proxy writes a health file at /tmp/healthy that Docker uses for health checks. The container will restart automatically if the health check fails.

Comparison: Node MQTT vs Proxy MQTT ​

FeatureNode's Built-in MQTTMQTT Proxy
ReliabilityDepends on node WiFiServer-grade reliability
WiFi RequiredYes (on node)No (can use Serial/BLE)
ConfigurationOn nodeRead from node
Mobile App NeededNoNo
Resource UsageNode CPU/MemoryServer CPU/Memory
DebuggingLimited logsFull Docker logs
RecoveryManual restartAuto-restart via Docker

Security Considerations ​

  • The MQTT Proxy runs inside your Docker network
  • It inherits your node's MQTT credentials (stored on the node)
  • TLS/SSL for MQTT is configured on the node, not the proxy
  • The proxy only forwards messages; it doesn't store or modify them

License Note ​

The MQTT Proxy uses the Python meshtastic library which is licensed under GPLv3. The proxy is distributed separately from MeshMonitor as a Docker image maintained by LN4CY.