microReticulumTbeam/exercises/205_sustained_link/scripts/set_build_identity.py
John Poole 2a6fef41c7 What changed from 204:
Kept all units in transport mode with reticulum.transport_enabled(true).
Removed physical blocking: SIM_PHY_BLOCK_BOB_CY=0, no per-unit block.
Removed the extra deep transmission/debug flags from platformio.ini.
Kept the 204 announcement schedule/protocol.
Removed intentional Link teardown after message cycles.
Every unit now attempts an outbound Link to every peer that announces.
Added retry health behavior: 3 Link attempts within 3 minutes, then wait for a fresh announce before trying that peer again.
Preserved substantive parseable logs: TX ANNOUNCE, RX ANNOUNCE, TX LINKREQUEST, LINK ACTIVE, TX LINK, RX LINK, retry/failure/reset events.
Updated copied helper scripts to point at 205_sustained_link.
Updated README for the new exercise behavior.
2026-06-03 09:19:33 -07:00

23 lines
648 B
Python

import binascii
import time
from pathlib import Path
Import("env")
pioenv = env.subst("$PIOENV").upper()
identity_path = Path(env.subst("$PROJECT_DIR")) / "identities" / f"{pioenv}.identity"
if not identity_path.exists():
raise RuntimeError(f"Missing identity file for {pioenv}: {identity_path}")
identity_hex = binascii.hexlify(identity_path.read_bytes()).decode("ascii")
epoch = int(time.time())
utc_tag = time.strftime("%Y%m%d_%H%M%S", time.gmtime(epoch))
env.Append(
CPPDEFINES=[
("LOCAL_IDENTITY_HEX", f'\\"{identity_hex}\\"'),
("FW_BUILD_EPOCH", str(epoch)),
("FW_BUILD_UTC", f'\\"{utc_tag}\\"'),
]
)