Files
MeshCore/tools/hil/profile_pair_status.py
mikecarper 091c8d8324 Preserve radio lab experiments and reuse unchanged SX1262 modulation
Skip redundant modulation writes during owned fast RX retunes when the last
acknowledged SF/BW/CR/LDRO tuple matches. Invalidate that cache after ordinary
setters, failed writes, and lifecycle changes.

Include the remaining scan, preamble, settling, and memory-soak experiments,
their collectors, validation notes, and original capture records. Preserve
capture bytes across checkouts and keep private soak credentials local.

Run lab collector and compiled contract tests in CI. Update the expectation,
profile mapping, and result-buffer tests for the extended lab tools, and make
the private WiFi override header optional for ordinary soak diagnostics.

Validation: 145 host tests passed from the staged source snapshot. Clean
heltec_v4_repeater and Xiao_S3_WIO_companion_radio_usb builds passed their
RAM/flash gates. All 229 staged capture files retain their original bytes;
all 75 local documentation links resolve in the clean snapshot.
2026-09-14 22:34:17 -07:00

27 lines
1.8 KiB
Python

"""Read-only progress/health snapshot; no port opens or RF operations."""
import json
from pathlib import Path
import statistics
root=Path.home()/'hwtest/runs/pair-sf8-32-20260914'
def signals(trials):
rows=[t['received'] for t in trials if t['valid']]
return {k:{'n':len(values),'mean':statistics.mean(values),'min':min(values),'max':max(values)}
for k in ('rssi','snr') if (values:=[r[k] for r in rows if k in r])}
def rates(trials):
return [{'channel':ch,'attempted':len(rows),'received':sum(t['valid'] for t in rows),'signals':signals(rows)}
for ch in (0,1) if (rows:=[t for t in trials if t['channel']==ch])]
if (root/'deployment.json').exists():
d=json.loads((root/'deployment.json').read_text())
print(json.dumps({'deployment':d.get('complete'),'error':d.get('error'),
'writes':[{k:w.get(k) for k in ('board','complete','application_write_started')} for w in d['writes']]}),flush=True)
if (root/'results.json').exists():
r=json.loads((root/'results.json').read_text())
print(json.dumps({'complete':r['complete'],'phase':r['phase'],'error':r.get('error'),
'baseline':[dict(channel=b['channel'],rates=rates(b['trials']),complete=b['complete']) for b in r['baseline']],
'scans':[dict(loop_us=s['loop_us'],slow_extra_us=s['slow_extra_us'],dwell_us=s['dwell_us'],complete=s['complete'],
rates=rates(s['trials']),switch=s.get('status',s.get('timing_before',{})).get('switch'),
idle_cycle=s.get('status',s.get('timing_before',{})).get('idle_cycle')) for s in r['scans']],
'cleanup':r.get('cleanup')}),flush=True)
if (root/'run-exit.json').exists():print((root/'run-exit.json').read_text(),flush=True)
if (root/'collector.log').exists():print((root/'collector.log').read_text()[-1800:],flush=True)