Module tier2

Module tier2 

Source
Expand description

Tier 2: XLX live monitoring via UDP JSON protocol.

Maintains concurrent UDP connections to active XLX reflectors on port 10001, receiving real-time push notifications about connected nodes, heard stations, and on-air/off-air events.

The monitor pool is activity-driven:

  • Reflectors detected as active by Tier 1 are connected (up to the configured maximum).
  • Reflectors idle beyond the configured threshold are disconnected to free slots.
  • Newly active reflectors are connected as Tier 1 detects them.

Events are written to the activity_log and connected_nodes PostgreSQL tables, and on-air events can trigger Tier 3 auto-promotion for voice capture.

Modulesยง

monitor ๐Ÿ”’
Single-reflector XLX UDP JSON monitor client.
protocol ๐Ÿ”’
XLX UDP JSON monitor protocol message types.

Constantsยง

REFRESH_INTERVAL ๐Ÿ”’
How often to re-query the database for newly active reflectors.

Functionsยง

connect_eligible_monitors ๐Ÿ”’
Queries the database for tier2-eligible reflectors and connects monitors for any that are not already in the pool.
handle_message ๐Ÿ”’
Dispatches a parsed monitor message to the appropriate handler.
handle_nodes_update ๐Ÿ”’
Processes a nodes update: clears stale entries and upserts the fresh snapshot.
handle_stations_update ๐Ÿ”’
Processes a stations update: inserts each station as an activity observation.
poll_any_monitor ๐Ÿ”’
Polls all monitors via round-robin and returns the first message received along with the reflector callsign that produced it.
run ๐Ÿ”’
Runs the Tier 2 XLX monitoring loop.