Relay Test Console
The Relay Test Console is an exclusive startup mode of moas-server-cli. It reads
the same .moas configuration as the normal server, connects to each configured
switch over serial or TCP, and serves a browser interface from the native executable.
No separate web server or phone app is required at runtime.
Start the Console
Section titled “Start the Console”Run the installed CLI with your station configuration:
moas-server-cli relay-test "Configuration Files/2x6.moas" --web-port 8080On Windows, the executable is named moas-server-cli.exe. Substitute the path to
your own .moas file. The default web port is 8080; choose a different port if it
is already in use.
Startup prints the browser address:
RELAY TEST MODE: normal clients and automatic switching disabled. Do not transmit.Open this URL in your web browser (use your terminal's link action):Relay console: http://127.0.0.1:8080/#token=<temporary-access-token>For relay control, open the complete access link, including the #token= fragment. Supporting
terminals display it as a clickable hyperlink. In VS Code’s terminal, use Ctrl+click
on Windows/Linux or Cmd+click on macOS. If terminal hyperlinks are not supported,
open the complete printed URL in your browser.
The token is newly generated for each process.
Without a valid token, the console provides a Read only view of relay states, device connection details, and configured relay information. All relay-changing controls, including both all-off buttons, are disabled. Browsers retain the token for the current tab session after opening a complete access link.
Desktop Controls
Section titled “Desktop Controls”
Select a configured switch in Hardware device. Its ID, connection address, and connection status identify which hardware you are controlling. Each device has 64 relay buttons, arranged into four banks containing two groups of eight outputs.
Buttons use the relay numbers from configuration: device 1 has relays 0-63, device 2 has 100-163, and subsequent device IDs continue in blocks of 100. Press a relay button to toggle its commanded state. On buttons are green; Off buttons are neutral. Unknown means the state must not be relied on.
- All Relays (Device) Off clears only the selected device’s relay commands.
- All Relays (All Devices) Off clears relay commands for every configured device.
- Rapid clicks are queued without disabling navigation or other relay buttons. Queued and dashed outlines identify local selections awaiting acceptance; pending hardware writes do not prevent further selections.
- All-off commands are sent immediately, even while a toggle response is pending, and cancel unsent selections for the affected devices. Toggles on those devices pause only until the all-off request completes.
- A disconnected device has disabled relay toggles and unknown states. A hardware command rejection latches a fault and requires a process restart.
Relay Information
Section titled “Relay Information”Expand Relay Information below the buttons and select a relay. This selection is read-only: it does not change the relay’s commanded state. Relay button tooltips also show configured names and descriptions.
Tooltips use hover or keyboard focus rather than browser-native popups. For touch inspection, press and hold a numbered tile for about half a second to view its name and description without switching it. A short tap still toggles the relay. Moving your finger cancels the hold. Tap elsewhere or press Escape to close the tooltip. Read-only viewers can tap relay tiles directly to view details.
The power toggle below the selector changes the selected relay’s commanded state and displays On, Off, or Unknown, synchronized with the numbered grid. It follows the same authentication, controller, connection, and queued-state restrictions as the grid buttons. Selecting a relay alone never changes outputs.
The console reads optional wiring metadata from
Switches[].Relays[].Banks[].Relays[]. Each relay entry has an ID, Name, and
Description. Bank fields Mode, InternalVoltage, and SourceVoltage provide
the mode and power-supply details. For example, a bank inside a switch’s relay group
can contain:
{ "Mode": "Source", "InternalVoltage": true, "SourceVoltage": 12, "Relays": [ { "ID": 0, "Name": "Feed A", "Description": "Connector A, output 1" } ]}Relay metadata IDs can be local to the device (0-63) or use its global relay
numbers (for example, 100-163 for device 2). Missing metadata is shown as
Not specified; it does not prevent manual testing.
Configured usage is derived separately from antenna Relays, RXRelays, and
PersistentRelays, and relay-group Unavailable, Available, Selected,
TxSelected, and RxSelected lists. References include their station, radio,
role, and frequency ranges where configured. Repeated references are combined;
ignored control entries are omitted, and disabled antennas are marked.
These are configuration references, not the current antenna selection or physical wiring verification. A relay without references is not necessarily unwired or unused. Restart relay-test mode after changing the configuration.

Live Updates
Section titled “Live Updates”Relay names, descriptions, bank settings, configured usage, connection endpoints,
and the server version are loaded once per page load from /api/config.
/api/events uses server-sent events to push compact live snapshots when relay
states, connection status, pending writes, revisions, or control access change.
Static metadata is not repeated in these snapshots or command responses.
The event stream uses authenticated HTTP headers, not access tokens in query strings. Stream keepalives keep connections active, and the browser reconnects after interruptions. A small authenticated heartbeat every five seconds renews the controller lease without downloading state. A stream alone cannot renew that lease. Hidden tabs close their streams and reconnect when visible again. Streams are limited to four concurrent viewers, leaving connections available for control requests; additional viewers fall back to compact state requests every two seconds. Reload the page after restarting with a different configuration.
Clicks update their queued indicators immediately. Requests carry explicit On/Off values and are sent in order with the current device revision. Repeat clicks on an unsent relay selection retain the latest desired state. Newer snapshot ordering prevents a delayed response from replacing a more recent update. Disconnects, failed requests, hardware resets, and all-off cancel unsent selections rather than replaying them later. A queued indication does not prove hardware activation.
Phone Access
Section titled “Phone Access”Enable access from other devices on a trusted local network:
moas-server-cli relay-test "Configuration Files/2x6.moas" --web-port 8080 --allow-lanReplace 127.0.0.1 in the printed access link with the server computer’s LAN IP,
keeping the port and token unchanged. Open that link on a phone connected to the
same network. Allow the selected TCP web port through the server’s firewall if
necessary. Without --allow-lan, the interface is accessible only on the server
computer.

Banks stack vertically on smaller screens. On narrow phones, each group of eight wraps into two rows of four to preserve usable touch targets.
The relay information view and selected-relay toggle also adapt to a phone screen:

Multiple Browsers
Section titled “Multiple Browsers”Only one authenticated browser session can toggle relays at a time. Other authenticated browsers are Read only for toggles, but can still use the all-off commands. Browsers without a valid token cannot change any outputs or claim or renew the controller lease. Control becomes available 15 seconds after the controlling page stops sending heartbeats. Hidden tabs close their live connections; returning to a tab reconnects and refreshes state.
Closing a browser does not turn relays off. Use an all-off command before leaving the console.
Isolation and Shutdown
Section titled “Isolation and Shutdown”In relay-test mode, the server does not open the normal MOAS client listener or run automatic antenna switching, radio control, or rotator control. Hardware initialization uses a test-only handshake rather than loading normal antenna tables.
Startup and reconnect command all relays off; previous relay selections are never restored automatically. Graceful shutdown attempts to turn all relays off before closing hardware communications. Power loss, network failure, or forced process termination cannot guarantee that operation.
Press Ctrl+C to stop the process. Restart with run to return to normal operation.
Configuration changes are not applied automatically during relay testing, and the
core API also rejects switching modes within the same process.