Meshtastic MQTT Setup
MQTT lets a Meshtastic node forward all mesh traffic to the internet, making your local mesh visible on the network map, bridging messages to internet clients, and enabling monitoring and logging. This is what puts your nodes on meshmap.net.
How MQTT works in Meshtastic
When MQTT is enabled on a node:
- Every mesh packet received by the node is forwarded to an MQTT broker over WiFi or TCP
- The MQTT broker stores and redistributes the messages to other subscribers
- The public Meshtastic MQTT broker (mqtt.meshtastic.org) accepts messages from anyone and shares them publicly — this is how meshmap.net gets its data
- Optionally, messages from the internet (MQTT) can be injected back into the local radio mesh
Hardware requirement: MQTT requires a WiFi-capable device (ESP32-based: Heltec V3/V4, T-Beam, etc.). nRF52840 devices (T-Echo, T-Deck, RAK4631) do not have WiFi and cannot connect to MQTT directly.
Connecting to the public Meshtastic MQTT broker
Via the Meshtastic app
- Go to Settings → Module Config → MQTT
- Enable MQTT: toggle ON
- MQTT Server Address:
mqtt.meshtastic.org - Username:
meshdev - Password:
large4cats - TLS Enabled: toggle ON (recommended)
- Map Reporting Enabled: toggle ON (to appear on meshmap.net)
- Save
Via CLI
meshtastic --set mqtt.enabled true
meshtastic --set mqtt.address mqtt.meshtastic.org
meshtastic --set mqtt.username meshdev
meshtastic --set mqtt.password large4cats
meshtastic --set mqtt.tls_enabled true
meshtastic --set mqtt.map_reporting_enabled true
Channel settings for MQTT
MQTT is enabled per channel. By default, the primary channel (channel 0) is configured to uplink to MQTT. Verify that your channel has Uplink Enabled set to ON:
meshtastic --ch-index 0 --ch-set uplink_enabled true
Important: If your channel uses a non-default PSK, messages are uploaded encrypted. The public meshmap.net can still see node positions (which are unencrypted) but cannot read message content.
Downlink: receiving messages from the internet
Downlink allows messages published to MQTT to be injected into the local radio mesh — enabling internet-connected users to send messages that appear on mesh nodes in your area:
meshtastic --ch-index 0 --ch-set downlink_enabled true
Security note: Only enable downlink on channels with PSK authentication if you want to control who can inject messages into your local mesh. The public LongFast channel has no authentication — anyone on the public MQTT broker can inject messages into your mesh if downlink is enabled on the default channel.
Running a private MQTT broker
For a community or organizational network, run your own Mosquitto broker instead of using the public one:
# Install Mosquitto
sudo apt install mosquitto mosquitto-clients
# Basic config: /etc/mosquitto/mosquitto.conf
listener 1883 localhost # Local only (use nginx/TLS for external)
listener 8883 # TLS port for internet clients
cafile /path/to/ca.crt
certfile /path/to/server.crt
keyfile /path/to/server.key
allow_anonymous false
password_file /etc/mosquitto/passwd
Point your Meshtastic nodes to your broker's address instead of mqtt.meshtastic.org.
MQTT topic structure
Meshtastic publishes to topics of the form:
msh/{region}/{channel_name}/2/json/{packet_type}/{node_id}
Examples:
msh/US/LongFast/2/json/nodeinfo/!abcd1234
msh/US/LongFast/2/json/position/!abcd1234
msh/US/LongFast/2/json/text/!abcd1234
Subscribe to msh/US/# to receive all US region traffic. The payload is JSON-encoded packet data.
No comments to display
No comments to display