Test b59 — path_len decode/encode fix + path diagnostics (#309/#298)
Pre-releaseFor Bandit: this build targets the 2-byte-net repeater routing failures (#240 / #279). It contains both a real fix and much better diagnostics.
The fix (#309)
MeshCore's path_len byte is packed: high 2 bits = hash size, low 6 bits = hop COUNT, and byte length = count x size (firmware src/Packet.h:79-84). Offband had it wrong in both directions:
- Receiving: it read the hop count as a byte count, so on a 2-byte net it kept half of every path and threw the rest away. A 2-hop route to
DAYTON VAbecame a 2-byte fragment, which is why those repeater logins timed out every single attempt. - Sending: it wrote the hop count raw, leaving the width bits at
00= "1-byte hashes", while handing the radio 2-byte hash data. The radio then routed on a 1-byte reading of 2-byte data. This is the likeliest cause of "routes via c6 and 5c separately" and paths flying off across the map.
Paths now carry their own width, so a stored path can never be re-sliced at the wrong width.
Migration: contacts saved by an older build hold truncated bytes that cannot be recovered, so their paths are dropped on first launch and those contacts fall back to flood until your radio re-supplies the route. That is expected and self-heals.
The diagnostics (#298)
If routing is still wrong, the log now says why. Contact lines read:
hops=2 w=2 bytes=4/4 [C65C,A1B2]
hops = real hop count, w = width, bytes = held/expected, plus TRUNCATED if short. Device info now logs its frame length and warns on any width change (Path hash width: 2 -> 1).
If it is still broken, please send a debug log. The previous capture recorded path lengths but never path bytes, which is why the root cause took so long. This one will show it directly.
Honest caveats
- The doubling is still unexplained. You reported 4 hops becoming 8. The receive-side fix predicts halving, not doubling. The send-side fix is the part expected to actually unbreak your repeaters. If it does not, the new logs should finally show which assumption is wrong.
- Not yet validated on hardware. CI is green on 7 platforms and 495 tests pass, but no radio has confirmed it routes correctly. That is what this build is for.
Also bundled (unrelated in-flight work)
Settings reorganisation (#268), FEM LNA toggle (#304), inline Giphy/Tenor URLs (#283), GIF notification summaries (#284), self-block guard (#250).
Because these ride along, anything odd is not automatically the path fix.
Verification
flutter analyze clean; 495 tests pass; CI green on android, ios, linux, macos, web, windows, analyze. Gemini adversarial review run on the path diff, its one finding fixed (_pathDiag false-TRUNCATED on mixed widths).
Built from dev @ 879523d plus the branches listed above.