Multibyte paths
“Multibyte” is short for multibyte path hashes: a longer ID for each repeater in the route a message takes. On Oklahoma Mesh we use 2-byte IDs, on companions and repeaters alike.
The two setup guides each cover this in a line or two. This page puts the reasons and the steps in one place.
The short version
| Your radio | What to set | Where |
|---|---|---|
| Companion | Default path hash size: 2 bytes | MeshCore app: settings cog, then Network Settings |
| Repeater | Path hash mode 1 | Typed command: set path.hash.mode 1 |
Both need MeshCore firmware v1.14 or newer.
What a path hash is
Every message carries a list of the repeaters it passed through. That list is the message’s path. It’s how a reply finds its way back, and how a repeater knows it has already handled a message.
Each repeater in the list is written as a short ID, taken from the start of its public key. That ID is the path hash. Out of the box it’s 1 byte long.
Why 1 byte isn’t enough
One byte only has room for 256 different IDs. A network with a few dozen repeaters will very likely have two that share one, and every repeater added makes it more likely.
When two repeaters share an ID:
- A message can be passed along by the wrong one. A direct message follows its path one ID at a time. If two repeaters in range of each other have the same ID, both believe it’s their turn, and both transmit.
- Paths are harder to read. When you look at the route a message took, in the app or on the live map, you can’t tell which of the two repeaters it went through.
- Loop detection is cruder. A repeater spots a message going round in circles by looking for its own ID in the path. If another repeater shares that ID, it can’t be as strict about it.
With 2 bytes there are 65,536 IDs, so two repeaters sharing one is rare.
| Size | Mode | Different IDs | Most hops a message can make |
|---|---|---|---|
| 1 byte | 0 | 256 | 64 |
| 2 bytes (ours) | 1 | 65,536 | 32 |
| 3 bytes | 2 | 16,777,216 | 21 |
What it costs
- Fewer hops. The path has a fixed amount of room, so longer IDs mean fewer of them fit: 32 hops, where 1-byte IDs allow 64. That’s still far more than a message needs to cross Oklahoma.
- A slightly longer message. Each hop adds 2 bytes to the message, not 1.
What you need
- Firmware v1.14 or newer on the radio. Check the version in the app, or with the
vercommand on a repeater. To update, see step 1 of Companion setup or Repeater setup, and don’t choose a full erase. - A recent MeshCore app for a companion: version 1.41.0 or newer.
Older repeaters drop these messages. A repeater on firmware older than v1.14 doesn’t understand the longer IDs, and it quietly ignores any message that uses them. So the most useful thing a repeater owner can do for multibyte is keep the firmware current.
Set it on a companion
- Open the MeshCore app and connect to your radio.
- Tap the settings cog, then Network Settings.
- Set Default path hash size to 2 bytes.
From then on, the messages you send use 2-byte IDs. The radio that sends a message decides the size for that message, and every repeater along the way keeps to it.
If you take your radio to another network and your messages stop getting through, the repeaters there may be on older firmware. Set it back to 1 byte while you’re there.
Set it on a repeater
Send this command, over USB from config.meshcore.io or from the app’s command line once you’re logged in to the repeater:
set path.hash.mode 1
To check it:
get path.hash.mode
Mode 1 means 2 bytes. Mode 0 is 1 byte and mode 2 is 3 bytes.
This setting covers less than you might expect. It only sets the ID size the repeater uses in its own announcements (its adverts). It doesn’t change what the repeater passes along. A repeater on v1.14 or newer passes along 1-, 2- and 3-byte messages whatever this is set to.
So for a repeater there are two separate jobs:
- Update to v1.14 or newer, so it passes along everyone’s 2-byte messages.
- Set mode 1, so its own adverts match the rest of the network.
Mixing sizes
Each message says which size it uses, so different sizes work side by side. A radio from a network that uses 3-byte IDs gets through our repeaters, and ours get through theirs, as long as the repeaters are on v1.14 or newer.
References
- The official MeshCore command reference, under
path.hash.mode. - The official MeshCore FAQ, section 3.9.