feat(e2e): Meshtasticator radio-level validation harness for the adapter #2

Closed
eric wants to merge 9 commits from feat/meshtasticator-e2e into main
Showing only changes of commit b3063239f7 - Show all commits
+33 -1
View File
@@ -93,7 +93,31 @@ start_forwards() {
} }
SIM_LOG="$REPO_ROOT/meshtasticator-sim.log" SIM_LOG="$REPO_ROOT/meshtasticator-sim.log"
SIM_ARGS=("$NODES" -v) # -v: meshtastic/debug logging for RF diagnostics # Deterministic topology: random placement may leave nodes out of range
# (nothing was ever delivered between nodes). Provide a --from-file scenario
# with all nodes within ~10 m of each other so RF adjacency is guaranteed.
NODE_CONF_DIR="$SIM_DIR/out"
mkdir -p "$NODE_CONF_DIR"
"$VENV/bin/python" - "$NODE_CONF_DIR/nodeConfig.yaml" "$NODES" <<'PY'
import sys
from pathlib import Path
path, count = sys.argv[1], int(sys.argv[2])
conf = {}
for i in range(count):
x = float((i - (count - 1) / 2) * 10.0) # 10 m spacing around the origin
conf[i] = {
"x": x, "y": 0.0, "z": 1.0,
"isRouter": False, "isRepeater": False, "isClientMute": False,
"hopLimit": 3, "antennaGain": 0, "neighborInfo": False,
}
Path(path).write_text(
"".join(f"{k}:\n" + "".join(f" {ck}: {cv}\n" for ck, cv in v.items())
for k, v in conf.items())
)
print(f"wrote deterministic node scenario ({count} nodes) to {path}")
PY
SIM_ARGS=("--from-file" -v) # node count/positions come from nodeConfig.yaml
if [ "$MODE" = native ]; then if [ "$MODE" = native ]; then
[ -n "$PROGRAM" ] && [ -d "$PROGRAM" ] || { echo "--mode native needs --program <dir>" >&2; exit 2; } [ -n "$PROGRAM" ] && [ -d "$PROGRAM" ] || { echo "--mode native needs --program <dir>" >&2; exit 2; }
SIM_ARGS+=(-p "$PROGRAM") SIM_ARGS+=(-p "$PROGRAM")
@@ -159,6 +183,14 @@ new = old + (
assert old in src, "simulator subscription moved in the pinned meshtasticator" assert old in src, "simulator subscription moved in the pinned meshtasticator"
src = src.replace(old, new, 1) src = src.replace(old, new, 1)
old = ' rxs, rssis, snrs = self.calc_receivers(transmitter, receivers)'
new = old + (
'\n print(f"[sim] TX node={transmitter.nodeid} candidates={[n.nodeid for n in receivers]} '
'rxs={[n.nodeid for n in rxs]} rssis={rssis}")'
)
assert old in src, "calc_receivers call moved in the pinned meshtasticator"
src = src.replace(old, new, 1)
interactive.write_text(src) interactive.write_text(src)
print("patched lib/interactive.py (RF instrumentation)") print("patched lib/interactive.py (RF instrumentation)")
PY PY