Skip to content

Running the Server

There are currently two server implementations. This guide will only discuss the V2 version.

Available from K1XM on his website. It requires a PC running Windows 7 or any newer version of Windows. It has one window. Once the server is started and a configuration file is opened it can usually be minimized and ignored.

This is a multi platform version that runs on Windows, Linux and MacOS. There are prebuilt binaries and Docker images available for all major platforms. It does not have a GUI and is designed to be run in the background. Once running, you shouldn’t need to interact with it.

The computer it runs on must have a USB port and networking capability.

The server can control multiple switches. The design limit is 99 but this has never been tested. It has been used with at least four switches.

It does not use a lot of memory or CPU resources. It can be run on a computer which is also running a logging program or other programs.

The server communicates with clients using TCP/IP (Ethernet). The communication can be over a local or wide area network, wired or wireless. Remote connections are supported.

When the server starts it reads a configuration file. This file provides all of the information needed. Some of the configuration information is sent to the switches.

The V2 server binary is moas-server-cli.

Terminal window
moas-server-cli [run|validate] <path-to-config.moas> [error|info|debug] [--sim] [--duration <seconds>] [--version]
  • run (optional) starts the server. If omitted, run is assumed.
  • validate loads and validates the config, then exits.
  • <path-to-config.moas> is required unless using version-only mode.
  • error sets log level to errors only.
  • info sets log level to info (default).
  • debug sets log level to debug.
  • --sim enables simulation mode (hardware start failures are ignored).
  • --duration <seconds> auto-stops after N seconds (N > 0).
  • --duration=<seconds> same as above.
  • --version prints version and exits.
  • -v same as --version.
  • --version and -v are standalone (do not combine with other args).
  • Unknown arguments or invalid values return a usage error.
Terminal window
moas-server-cli --version
moas-server-cli run "Configuration Files/2x6.moas"
moas-server-cli validate "Configuration Files/2x6.moas" debug
moas-server-cli "Configuration Files/2x6.moas" info --sim
moas-server-cli run "Configuration Files/2x6.moas" --duration 10
moas-server-cli run "Configuration Files/2x6.moas" --duration=10

The server displays a log of activity. The amount of detail shown is based on the log level selected when starting. If you change the configuration file, this is monitored and the server is automatically restarted to reflect the changes. CTRL + C will force the server to exit if you are running it via a command line.

When the MOAS Server reads a configuration file it attempts to communicate with all configured MOAS switches. If it is unable to communicate with a switch, either because the switch is not connected or the COM port does not exist, or because the switch is not responding, it periodically retries. When it connects to a switch it initializes it and makes it operational.

A typical startup log looks like:

__ __ ___ _ ____ ___ ___
| \/ | / _ \ / \ / ___| |_ _| |_ _|
| |\/| | | | | | / _ \ \___ \ | | | |
| | | | | |_| | / ___ \ ___) | | | | |
|_| |_| \___/ /_/ \_\ |____/ |___| |___|
Master Of Antenna Switching (MOAS)
Developed by James Patterson, M1DST and Paul Young, K1XM.
Version: v2.0.0
Loading configuration: /config/m1dst_tcp.moas
Configuration loaded.
MOAS core running. Press Ctrl+C to stop.
Stopped.
Read 3905 lines from configuration file
Linux TCP listener started on port 12059
Switch 1 port 192.168.10.94:12058 is not connected
Switch 1 port 192.168.10.94:12058 is connected
Switch 1 port 192.168.10.94:12058 is operational