LoRa and MeshCore: Networking Without Infrastructure

Everything else on this blog assumes infrastructure. Loading a web page assumes a switch, a router, an ISP and a few hundred thousand kilometres of somebody else’s fibre. Configuring an interface assumes there is a network on the other side of it to join.

LoRa assumes none of that. A twenty-dollar board with a wire antenna will reach several kilometres across a city and considerably further with line of sight, on a budget measured in milliwatts, with no carrier, no SIM, no account and nothing to pay. What it will not do is carry your traffic. The entire link runs at roughly the speed of a 1980s modem, and that one fact drives every design decision in this post.

MeshCore is firmware that turns a pile of those boards into a mesh. It is MIT-licensed and lives at github.com/meshcore-dev/MeshCore. It is also the first mesh protocol I have read about that made me stop and think “oh, that is the right answer” — for a reason I will get to.

Two kilobits per second, and why that changes everything

LoRa is not a packet format, it is a modulation. It encodes bits as chirps — signals that sweep across the band rather than sitting at one frequency — and that sweep is what lets a receiver dig a signal out from below the noise floor. You trade data rate for sensitivity, and the exchange rate is brutal.

Three settings control it. Spreading factor (SF7 to SF12) sets how far each chirp is smeared: higher means longer range and exponentially more airtime. Bandwidth sets how wide the sweep is. Coding rate sets how much forward error correction rides along. Run the numbers on the preset Australia currently uses — SF7, 62.5 kHz, coding rate 7 — and you get a little under 2 kbit/s of raw on-air rate, shared by every node within earshot.

Airtime is the only resource that matters

On Ethernet you think about bandwidth. On LoRa you think about airtime: how many milliseconds of the shared channel a packet consumes, because while it is transmitting nothing else in range can. A single message at SF12 can occupy the channel for well over a second. This is why a LoRa mesh is a text-message network and not a small internet, and why every protocol decision below is really a decision about how many retransmissions you are willing to pay for.

Four firmware types, four jobs

This is the bit that confused me first, because it is not how Meshtastic works. In MeshCore a device does not have a “mode” you toggle — you flash it with the firmware for the job it is going to do, and that build is what it is until you reflash it. The project describes four firmware types:

FirmwareWhat it is forRelays for others?
BLE CompanionYour personal radio, paired to the phone app over Bluetooth. The phone is the keyboard and screen; the board is the radio.No
USB Serial CompanionThe same job, but tethered over USB to a desktop or web client. This is the one to reach for when the “phone” is actually a server.No
RepeaterInfrastructure. Forwards packets towards their destination. Deploy it high, on power you do not have to think about.Yes
Room ServerA store-and-forward bulletin board — the project calls it “a simple BBS server for sharing posts”. Holds history and pushes what you missed when you next connect.Yes

The division that matters: companions do not relay. Your pocket node carries your own traffic and nothing else. If you want coverage, you deploy a repeater — infrastructure is a deliberate act, not a side effect of someone walking past with a phone. For anyone who has watched a Meshtastic channel saturate because every handset in town is rebroadcasting everything, that distinction alone is worth the migration.

Two practical consequences. A repeater needs no client to do its job — it forwards whether or not anything is paired to it. And a repeater cannot be reached over Bluetooth, so administering one means either USB or going over the air from a companion app with the admin password.

It learns paths

Here is the part that made me sit up. The naive way to build a mesh on a 2 kbit/s channel is to flood: every node rebroadcasts everything it has not seen before, and you accept the cost. It works, it is simple, and it scales terribly — the channel fills with duplicates of other people’s conversations.

MeshCore floods once, and then stops.

A direct message to a contact you have never reached before path = R1, R3 A you R1 R2 R3 R4 B them silent silent No route is known, and nothing in the mesh is keeping a routing table. So the first message floods: every repeater in earshot retransmits it. The reply carries back the repeaters it actually crossed. Every later message follows that path. R2 and R4 never hear it.
Path discovery, once per contact. The first direct message floods because nothing in the mesh holds a routing table; the delivery report brings back the list of repeaters it traversed; that list is stored against the contact and used for everything after. Group channel messages skip all of this and always flood.

If you have met AODV, this will feel familiar

What MeshCore is doing is reactive routing: discover a route only when you need one, cache it, use it until it breaks. If you have ever read the AODV or DSR specifications for wireless ad-hoc networks, this is the same family of idea, implemented small enough to fit on a microcontroller.

The trade-offs come along for the ride, and they are worth naming:

  • The first message to anyone is the expensive one. After that you are paying for one path, not the whole mesh.
  • Nothing holds a routing table. The path lives on the contact, at the sender. Repeaters are dumb by design — no state to go stale, nothing to converge.
  • A path that breaks heals by falling back to flooding. You lose a message or two, the retry re-floods, and a new path is learned. Move a repeater and the mesh works it out without being told.
  • Group channels always flood. There is no single destination to learn a path to, so a channel message goes everywhere, every time. Chat on a busy channel and you are back to paying the flooding cost — which is a reason to keep real conversations in direct messages.
  • The firmware ceiling is 64 hops, which is far more than any real deployment will use. Reality runs out long before the counter does.

What a real mesh looks like

Most introductions stop at one board and a phone. That is not a mesh, that is a walkie-talkie with extra steps. Here is how the roles actually divide up once you have more than one node, using mine as the example:

NodeFirmwareJob
Seeed nRF boardRepeaterThe infrastructure. nRF52-class parts idle in microamps, which is what makes a repeater you can leave somewhere on solar and forget about.
Seeed XIAO ESP32-S3 + SX1262USB Serial CompanionTethered to a Raspberry Pi, which is the interesting bit — a companion on a serial port is a companion a script can drive. This is where a bot and monitoring live.
Heltec LoRa32 V3BLE CompanionThe one in a pocket, paired to the phone. OLED on board, so it tells you something useful without the phone in hand.
LilyGO T-DeckCompanion (standalone)Keyboard and screen on the device — the T-Deck and T-Pager run without a phone at all, which is the one that matters when the phone is flat.

That third row is the one I would push anyone towards. A USB companion on a Pi turns the mesh into something you can automate against: the serial protocol is documented, so a handful of Python can answer queries, relay alerts, or log every advert it hears into a database. The radio stops being a chat toy and becomes a transport.

Repeater and room server want separate hardware

They are different firmware builds, so one board cannot be both, and the project recommends not trying to make it. If you want a BBS on your mesh, that is a second node — which is a reasonable thing to discover before you climb a roof to install the first one.

Getting on the air

Flashing is refreshingly undramatic. There is an official web flasher at flasher.meshcore.io — it talks to the board over WebSerial, so it wants Chrome or Edge, and you pick your board and the firmware type from a dropdown. ESP32 boards flash directly; nRF52 boards go through DFU. After that, pair a BLE companion to the phone app, or point the web client at app.meshcore.nz and plug a USB companion in.

Then the setting that actually determines whether you can talk to anyone: the radio preset. Everybody in a mesh must agree on frequency, bandwidth, spreading factor and coding rate, or you are all transmitting into a void. For this part of the world:

RegionFrequencySFBandwidthCoding rate
Australia (Narrow)916.575 MHz762.5 kHz7
New Zealand (Narrow)917.375 MHz762.5 kHz5

Note that Australia and New Zealand are not the same — different frequency and a different coding rate, so “close enough, we are both 915” will not get you a link. Note also that the bandwidth is narrow: the wider 250 kHz presets you will find in older guides and forum posts have been superseded, and a node still on 250 will be invisible to everyone else.

Check the preset, do not trust this table

Those values are the current regional presets, and the project is explicit that the presets are served from the app’s API server, that they are “just suggestions”, and that they can change without notice. They have already moved once. Take them from your app’s region picker rather than from a blog post — including this one — and treat any guide that hard-codes a frequency as a snapshot of whenever it was written. Transmit power is your responsibility too: set tx accepts 1 to 22 dBm and the firmware’s own reference warns that a value too high may break the law where you are.

Configuring a repeater

A repeater is administered over a CLI, either on USB serial or remotely over the air from a companion app once it knows the admin password. The commands worth knowing on day one:

password ThisIsNotPassword      # the default admin password is literally "password"
set name roof-north             # how it advertises itself
set lat -37.8136                # note: lon, not long
set lon 144.9631

set radio 916.575,62.5,7,7      # freq,bw,sf,cr -- needs a reboot to take effect
set tx 20                       # 1-22 dBm. your licence conditions, your problem

set flood.advert.interval 47    # HOURS (3-168). how often it floods an advert
set advert.interval 120         # MINUTES (60-240). zero-hop advert, neighbours only

neighbors                       # repeater-only: who can it hear?
discover.neighbors              # repeater-only: go and find out

Three things in there will catch you out. The longitude setter is set lon — older guides say set long and that is gone. The two advert intervals use different units: the flood advert is in hours and defaults to 47, the zero-hop advert is in minutes. And set radio does nothing until you reboot the node, which is an excellent way to spend twenty minutes wondering why your repeater has gone quiet.

Change the admin password before the node goes anywhere. The default is password, and the reference notes that any node presenting the correct password gets added to the admin ACL — which is a sentence worth reading twice before you put a repeater on a roof you need a ladder to reach.

The one-sentence version

LoRa buys you kilometres of range for milliwatts and charges you about 2 kbit/s for it, and MeshCore spends that budget carefully: four firmware types so that only deliberate infrastructure relays traffic, and reactive routing so the mesh floods once per contact and then follows a learned path. Agree on the preset, change the admin password, and remember that set radio wants a reboot.

Next in this series: putting a repeater somewhere useful and leaving it there — power budget, antennas and the difference a few metres of height makes. And because a USB companion on a Pi is too interesting to leave alone, a look at driving one from Python.