The Problem

Organizations evaluating a MANET IP‑mesh radio toolkit face immediate blockers: the repository has no license, no CI/CD gate, and duplicated logic across eight files. Without a clear licensing model the code cannot be legally reused, and the absence of automated tests means every change merges untested. Duplicate 6‑line blocks (347 occurrences) and deep nesting (max depth 9) increase the risk of bugs and make future modifications costly.

What This Does

Haven is a toolkit for building decentralized, long‑range mesh networks over HaLow (802.11ah) links. Core functionality lives in scripts/tools/antenna_smart_routing.py (entry point main, 22 reachable functions, 2 classes) which drives radio selection, toggling, and cleanup. Signal‑strength and routing logic is concentrated in integrations/atak/cot_bridge.py (13 functions, including get_halow_info, make_mcast_socket, add_event) that also performs a cryptographic operation (ts) and runs external commands via subprocess.run. Range‑test and diagnostic utilities reside under scripts/tools/ – halow_range_test.py, rns_send.py, rns_receive.py etc. – each exposing a single top‑level function (detect_gateway, send_cot, link_established) that either reads/writes files or invokes subprocesses.

How It Is Wired

Execution starts at two entry points:

  • main in scripts/tools/antenna_smart_routing.py:441 – reaches 22 functions, itself called from 1 place. Paths from main go through _drive, select, toggle, and ultimately call ssh_run (subprocess) to reach external systems.
  • run in the same file at line 301 – reaches 13 functions and is the starting point for diagnostics; it calls get_link_quality → read_snr, which also runs a subprocess to read SNR values.

Key hub functions and their call counts (from the internal call graph):

FunctionCallersCallee(s)Notes
add_event5–Used by link_packet_callback, send_cot
draw2short_mac, snr_barUI‑related, appears in antenna_smart_routing.py
hex_dump2–Debug output
select2toggleGuard for radio state
get_halow_info2–Emitted from cot_bridge.py
_drive2–Low‑level motor/radio driver
on_packet3hex_dumpPacket handler in Reticulum stack

Traced out‑of‑process paths: main → ssh_run (subprocess) and run → get_link_quality → read_snr (subprocess). No circular import edges exist; the 8 internal modules import each other zero times, indicating a flat dependency graph aside from the duplicated logic.

How To Use It

Setup – Follow the getting‑started guide:

# flash OpenMANET firmware on the target device (see https://openmanet.org/)
# then run the setup script
bash scripts/node-setup/setup-haven-point.sh   # for point nodes
bash scripts/node-setup/setup-haven-gate.sh    # for the gateway

Configuration requires no environment variables beyond those generated by the scripts; the README notes that keys for Reticulum or ATAK integration are placed in integrations/atak/cot_bridge.py via the setup-cot-bridge.sh helper.

Running the tools – invoke the entry points directly:

python scripts/tools/antenna_smart_routing.py main    # start the routing loop
python scripts/tools/antenna_smart_routing.py run     # diagnostics mode

Individual utilities can be run similarly, e.g. python scripts/tools/rns_send.py.

Real‑World Use

A field team deploying a temporary comms node flashes OpenMANET on a Raspberry Pi, runs setup-haven-gate.sh to bring up the HaLow mesh and BATMAN‑adv bridge, then adds three setup-haven-point.sh units as leaf nodes. The gateway’s cot_bridge.py forwards ATAK situational‑awareness plots over multicast, while antenna_smart_routing.py continuously selects the least‑interfered HaLow channel. Result: a self‑healing IP mesh that relays a single internet uplink across >5 km without any central infrastructure.

Code Health & Issues

  • HIGH – No license file at repository root; usage/redistribution rights are undefined. Add an MIT or Apache‑2.0 license.
  • HIGH – No CI/CD pipeline; every change merges untested. Add a GitHub Actions workflow that runs the project’s build/test command on push and pull_request.
  • MEDIUM – Large binary assets/point-boot-screen.JPG (5.4 MB) inflates clone size. Track with Git LFS or move to object storage.
  • HIGH – Duplicated 6‑line blocks across 8 files (347 repeats). Extract shared helpers to DRY the code.
  • HIGH – Deep nesting (max depth 9) in antenna_smart_routing.py and halow_range_test.py. Flatten with guard clauses.
  • MEDIUM – Broad except clauses in cot_bridge.py, antenna_smart_routing.py, halow_range_test.py swallow errors indiscriminately. Catch specific exceptions.

The Bottom Line

The repository provides a functional, well‑structured set of scripts for HaLow‑based mesh networking and ATAK/Reticulum integration, but it ships without a license, automated testing, and with duplicated logic that raises maintenance risk. Teams that need a quick prototype and are comfortable manual testing can adopt it today; those requiring production‑grade reliability should add a license, CI, and refactor the duplicated blocks before wide deployment.