A trace to a companion turns at its last relay
A companion, a room server, or a sensor does not relay a trace with the firmware defaults (allowPacketForward in Mesh.cpp: client repeat is off, and allowed only on 433.000, 869.495, and 918.000 MHz; disable_fwd is on). A walk that turned at one of them never came home: the history held 36 companion traces and no reply from a real one. The route to such a node is the same. Only the walk changes: it turns at the last relay of the route, and the node is not in the spec. The route out of a walk that comes home is still the full route to the node, so the Device route row can offer it for DMs and admin. - relays_traces() in models states the rule. render_forced_spec takes relays=False, and forced_outbound reads the route back from a walk. - services/trace_plan holds the route choice that the trace screen made inline (radio route, outbound paths, best observed, last trace, direct), so the CLI uses the same one. - The trace screen names the relay where the walk turns, in a line under the route. With no relay to turn at, Trace is dim. A neighbour that does not relay gets "no relays" offered on the Device route row, with the packets heard directly as its proof. - The trace session turns a caller's spec (node page, Message paths) at the last relay, so the callers do not need the rule. A sender that is not a contact gets its type from its stored adverts. - The composer and Explore paths turn the walk at the last hop. - `meshterm trace -t NAME` with no --path walks the menu's route and says on stderr where it turns. With no known relay, it is a usage error. - The connection turns a device-routed trace at the last learned relay. The simulator now stops a walk at a node that does not relay, as the mesh does, and the tests that walked through Alice walk repeaters. The picker keeps one list with no mark, sorted as before (JP's choice). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fe8a70d516
commit
d3166170ff
18 files changed
+1118
-229
No files matched your search
+41
-21
@@ -156,8 +156,9 @@ samples:
|
||||
matching width, they match.
|
||||
- **A `trace` that the device routes invents its hop names.** If you give
|
||||
`trace --target NAME` with no `--path`, the simulator router returns placeholder hops.
|
||||
A forced path (`--path "a1,d4"`) resolves correctly. The samples use the forced form.
|
||||
Use the forced form also to build a golden file.
|
||||
A forced path (`--path "a1,b2,a1"`) resolves correctly. The samples use the forced
|
||||
form. Use the forced form also to build a golden file. As on the real mesh, a forced
|
||||
path through a simulated companion or room server never comes home.
|
||||
|
||||
> **`--mock` records into its own history, not yours, but it still writes the caches.**
|
||||
> The simulator is a fake radio. It is not a fake MeshTerm. MeshTerm stores what the
|
||||
@@ -230,8 +231,8 @@ would be a behaviour that nobody can find.
|
||||
different. These are two lines from the facts block of a trace:
|
||||
|
||||
```
|
||||
path a1,d4
|
||||
route MockCompanion (00) → Yagi-Repeater (a1) → Alice (d4) → MockCompanion (00)
|
||||
path a1,b2
|
||||
route MockCompanion (00) → Yagi-Repeater (a1) → Local-Repeater (b2) → MockCompanion (00)
|
||||
```
|
||||
|
||||
A **path** is a spec. It is the list of hops that you write and force. It is the one line
|
||||
@@ -1547,19 +1548,20 @@ Walk the path to a target one time and report what came back.
|
||||
without a target is [`trace-path`](#meshterm-trace-path).
|
||||
|
||||
```console
|
||||
$ meshterm trace --target Alice --path "a1,d4"
|
||||
target Alice
|
||||
path a1,d4
|
||||
$ meshterm trace --target Local-Repeater --path "a1,b2,a1"
|
||||
target Local-Repeater
|
||||
path a1,b2,a1
|
||||
success yes
|
||||
hops 3
|
||||
hops 4
|
||||
min_snr_db +2.0
|
||||
rtt_ms 123
|
||||
route MockCompanion (00) → Yagi-Repeater (a1) → Alice (d4) → MockCompanion (00)
|
||||
rtt_ms 458
|
||||
route MockCompanion (00) → Yagi-Repeater (a1) → Local-Repeater (b2) → Yagi-Repeater (a1) → MockCompanion (00)
|
||||
|
||||
HOP FROM TO SNR_DB
|
||||
0 00 a1 +6.0
|
||||
1 a1 d4 +2.0
|
||||
2 d4 00 +6.0
|
||||
1 a1 b2 +2.0
|
||||
2 b2 a1 +2.4
|
||||
3 a1 00 +6.0
|
||||
```
|
||||
|
||||
The output has two blocks. The first block shows what the walk did. It has the drawn
|
||||
@@ -1572,6 +1574,24 @@ and the hash joins the two blocks.
|
||||
A trace that never came home is **not** a failure of the command. The radio transmitted,
|
||||
and the walk ran. The command reports `success no` and returns `5`.
|
||||
|
||||
A companion, a room server, or a sensor does not relay a trace, so a walk that turns at
|
||||
one of them never comes home. When the target is one of these and you omit `--path`,
|
||||
MeshTerm chooses the route as the menu does. Then the walk turns at the last repeater of
|
||||
that route. A line on stderr names that repeater, and `path` shows the walk:
|
||||
|
||||
```console
|
||||
$ meshterm trace --target Alice
|
||||
Alice can't relay a trace, so the trace turns at Yagi-Repeater (device route)
|
||||
target Alice
|
||||
path a1
|
||||
success yes
|
||||
...
|
||||
```
|
||||
|
||||
The route out of that walk is also the route that the radio can use to send to the
|
||||
target. If MeshTerm knows no repeater on the way to the target, nothing is transmitted,
|
||||
and the command returns `2`.
|
||||
|
||||
#### `meshterm trace-path`
|
||||
|
||||
The other half of tracing. It has no target. You compose a path by hand, out and back, in
|
||||
@@ -1582,19 +1602,19 @@ any way that you choose. The path only has to end where this node can hear it.
|
||||
| `--path SPEC` | **Required.** The whole walk, comma-separated. |
|
||||
|
||||
```console
|
||||
$ meshterm trace-path --path "a1,d4,a1"
|
||||
$ meshterm trace-path --path "a1,b2,a1"
|
||||
target -
|
||||
path a1,d4,a1
|
||||
path a1,b2,a1
|
||||
success yes
|
||||
hops 4
|
||||
min_snr_db +2.0
|
||||
rtt_ms 458
|
||||
route MockCompanion (00) → Yagi-Repeater (a1) → Alice (d4) → Yagi-Repeater (a1) → MockCompanion (00)
|
||||
route MockCompanion (00) → Yagi-Repeater (a1) → Local-Repeater (b2) → Yagi-Repeater (a1) → MockCompanion (00)
|
||||
|
||||
HOP FROM TO SNR_DB
|
||||
0 00 a1 +6.0
|
||||
1 a1 d4 +2.0
|
||||
2 d4 a1 +2.4
|
||||
1 a1 b2 +2.0
|
||||
2 b2 a1 +2.4
|
||||
3 a1 00 +6.0
|
||||
```
|
||||
|
||||
@@ -1618,8 +1638,8 @@ table of hops is under `edges`.
|
||||
| `edges` | array | The `edge` shape, one for each hop, in the order of the walk. `[]` when nothing came home. |
|
||||
|
||||
```console
|
||||
$ meshterm trace-path --path "a1,d4" --json | jq -r '.edges | min_by(.snr_db) | "\(.from.hash) -> \(.to.hash) \(.snr_db) dB"'
|
||||
a1 -> d4 2.0 dB
|
||||
$ meshterm trace-path --path "a1,b2" --json | jq -r '.edges | min_by(.snr_db) | "\(.from.hash) -> \(.to.hash) \(.snr_db) dB"'
|
||||
a1 -> b2 2.0 dB
|
||||
```
|
||||
|
||||
#### `meshterm outbound`
|
||||
@@ -2331,14 +2351,14 @@ fi
|
||||
are about:
|
||||
|
||||
```bash
|
||||
meshterm trace-path --path "a1,d4" --json \
|
||||
meshterm trace-path --path "a1,b2" --json \
|
||||
| jq -r '.edges | min_by(.snr_db) | "\(.from.hash) -> \(.to.hash) \(.snr_db) dB"'
|
||||
```
|
||||
|
||||
**A route as one line**, with our node, as the plain face draws it:
|
||||
|
||||
```bash
|
||||
meshterm trace-path --path "a1,d4,a1" --json \
|
||||
meshterm trace-path --path "a1,b2,a1" --json \
|
||||
| jq -r '.route | map(.name // .hash) | join(" -> ")'
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user