Introduction to Meshtastic

Meshtastic is an open-source project that turns LoRa radio modules into a decentralized mesh network for text messages and telemetry data. No cell service required, no WiFi, no internet infrastructure. Nodes communicate directly with each other and relay messages to nodes further away — the mesh extends range by having intermediate nodes repeat packets. It's designed for hiking, emergency preparedness, and remote field communication. For sensor networks in areas without cellular coverage, it's a practical solution.

How the Mesh Works

Meshtastic uses a flooding mesh protocol. When a node transmits a packet, any node that receives it rebroadcasts it (up to a configurable hop limit). This extends range far beyond what a single LoRa radio link could cover:

Meshtastic Relay Visualization Diagram showing Node A transmitting to relay Node B, which forwards to Node C, extending total range beyond Node A's direct capability. A's Max Range B's Max Range Hop 1 (2km) +1-2s latency Hop 2 (2km) +1-2s latency Total Distance: 4km (Out of A's direct range) A Sensor B Relay C Gateway
A flooding mesh protocol extends network range by having intermediate nodes repeat packets. Node A's transmission is rebroadcast by Node B, allowing it to reach Node C which is outside of Node A's direct physical range. Each hop adds ~1-2 seconds of latency.

Key Concepts

TermMeaning
ChannelA named, encrypted radio channel. All nodes on the same channel use the same frequency/SF/encryption key. Multiple channels can coexist on the same frequency.
Modem PresetPre-defined combinations of SF, bandwidth, and coding rate. LongFast, LongSlow, MediumSlow, etc. Nodes must use the same preset to communicate.
Node IDUnique 32-bit ID assigned at firmware flash time. Used for routing in the mesh.
MQTT BridgeA node connected to the internet that relays Meshtastic traffic to/from MQTT. Lets you see mesh traffic on a web dashboard.
Primary ChannelThe default channel; all nodes start with "LongFast" on the default key. Anyone with default settings can see this traffic — change the key for private networks.
TelemetryPeriodic packets containing battery level, GPS position, temperature, and other sensor data from each node.

Choose a Node Role Deliberately

Not every node should relay. A mesh is healthier when always-powered, well-positioned nodes do the relay work and battery nodes send only the data they need to send.

RoleGood fitTradeoff
ClientHandheld or ordinary fixed nodeParticipates normally; not designed as dedicated infrastructure
Client muteReceive-focused or low-impact nodeDoes not help extend the mesh
Router / router clientPowered, elevated relay with a good antennaConsumes more power and airtime
SensorBattery-powered field measurement nodeUsually should not be relied on for relaying

Role names and available options can vary slightly by firmware version and hardware target. Check the configuration exported from the exact node before building automation around a setting.

Modem Presets

PresetSFBWCRRangeSpeedUse case
ShortTurbo7500kHz4/5ShortVery fastClose-range, high-throughput (indoor)
ShortSlow8250kHz4/6Short-mediumFastShort range
MediumSlow9250kHz4/7MediumMediumSuburban, some obstacles
LongFast11250kHz4/5LongSlowerDefault; good balance for most field use
LongSlow12125kHz4/8MaximumSlowestMaximum range, difficult terrain
LongModerate11125kHz4/8Very longSlowLong range with better error correction

Supported Hardware

DeviceRadio chipNotes
Heltec WiFi LoRa 32SX1276/SX1262Popular; built-in OLED display, WiFi/BT; easy to get started
LILYGO T-BeamSX1276Has GPS built-in; battery management; popular for portable nodes
LILYGO T-EchoSX1262E-ink display; GPS; extremely low power — best for field deployment
RAK WisBlockSX1262Modular; very low power; good for custom sensor integration
Raspberry Pi Pico / Pico W + SX1262SX1262RP2040-based; the W adds WiFi/Bluetooth, but USB serial is available on both
Raspberry Pi Pico 2 / Pico 2 W + SX1262SX1262RP2350-based; use only when the installed Meshtastic release explicitly supports the board target
nRF52840 boardsSX1262Bluetooth native; pairs with phone easily

Channels and Encryption

Meshtastic uses AES-128 encryption on channels.
The "channel key" determines who can read your traffic.

Default channel:
  Name: LongFast (or your custom name)
  Key: AQ== (base64 for 0x01 — the public default)
  → Anyone with default Meshtastic settings can see this traffic

Private network setup:
  Generate a random key in the app or CLI:
  $ meshtastic --set-crypt-key random
  → Share this key with your nodes out-of-band (manually configure each node)

Multiple channels (up to 8):
  Primary channel: used for position and admin
  Secondary channels: for specific message groups or sensors
  Each channel can have different keys and settings

For a private field network, record the chosen region, modem preset, channel name, and key in a protected setup note. All of these must match before nodes can exchange useful traffic. A random key is only useful if it is backed up; losing it can mean rebuilding every node configuration.

Connecting to a Node

Three ways to interact with a Meshtastic node:

1. Phone app (iOS / Android)
   - Connect via Bluetooth
   - Send messages, see node map, view telemetry
   - Configure node settings

2. Python CLI (meshtastic package)
   $ pip install meshtastic
   $ meshtastic --info           # show connected node info
   $ meshtastic --sendtext "hello"  # send a message
   $ meshtastic --nodes          # list known nodes in the mesh
   $ meshtastic --export-config  # dump current config as YAML

3. Web UI (via WiFi on supported devices)
   - Heltec WiFi LoRa 32 and ESP32-based devices can run a web server
   - Access at http://192.168.x.x after connecting to the device's WiFi

Telemetry and Sensors

Meshtastic nodes automatically transmit telemetry packets on a configurable interval. Built-in telemetry includes battery voltage and node uptime. External sensors (I2C/SPI) can be added and their data included in telemetry packets — useful for field sensor networks:

Built-in telemetry:
  - Battery level (%)
  - Voltage
  - Channel utilization
  - GPS position (if GPS module present)

External sensor support (I2C):
  - BME280 / BME680: temperature, humidity, pressure
  - INA219: current/power monitoring
  - MLX90614: IR temperature
  - DS18B20: waterproof temperature probe

Configuration:
  $ meshtastic --set telemetry.device_update_interval 300  # seconds

Telemetry has a cost. Each periodic report uses airtime and battery capacity, and a flood mesh may relay it more than once. Start with a slow interval, verify that the information is useful, then shorten it only where the project needs fresher data.

A Small Mesh Plan

1. Build two nodes on the same private channel.
2. Prove direct communication on a bench and outdoors.
3. Add one elevated, powered relay only if the direct link needs it.
4. Add telemetry slowly and watch channel utilization.
5. Export and back up the working configuration before changing anything.

This approach makes faults easier to isolate. If a ten-node mesh does not work, it is hard to tell whether the problem is the channel, a single node, the terrain, or too much traffic.

References