Bridging Two Meshes
Relaying chat between Meshtastic and MeshCore at the station, so an operator on one network can talk to an operator on the other. Each line is tagged with where it came from, and the relay is built so it can't loop.
Overview
Meshtastic and MeshCore are two different LoRa mesh networks. A node on one cannot hear a node on the other. The station already runs both, so it is in a position to pass messages between them.
Meshtastic user MeshCore user
| |
v v
RAK radio <---- the Pi ----> Heltec radio
relays plain chat
"[MC] Alice: hi" <-> "[MT] Bob: copy that"
How it works
The station listens for chat on a chosen channel of each mesh and relays it to the
other, tagging each line with where it came from. A line from MeshCore shows up on
Meshtastic as [MC] name: text, and the other way around. The tag tells everyone
which side a message originated on.
Keeping it from looping
Relaying between two networks is an easy way to build an echo loop, so three rules prevent it:
- A line that is already tagged is never relayed again. That alone stops a message from bouncing back and forth.
- Command lines are left to the gateway, not bridged, so the command bot and the relay never fight over the same text.
- Direct messages are not bridged. Only channel chat crosses. A private message stays private.
The bridge is off by default, and which channel it uses on each side is configurable, so it never touches the command channel or a busy public channel unless you point it there.
Why
The simplest version of the case: a friend on MeshCore and a friend on Meshtastic, both in range of the station, who want to talk to each other. Without the bridge they cannot. With it, the station is the relay, and the tags keep it clear who is on which network.
Lessons
- Tag at the boundary. A one-character origin tag both informs the reader and doubles as the loop guard. One mechanism, two jobs.
- Bridge chat, not commands, not DMs. Being specific about what crosses keeps the bridge from interfering with the gateway or leaking private messages.
- Off by default, explicit by configuration. A cross-network relay should never surprise anyone. You turn it on and you choose what it touches.