Parameters
Every parameter can be given either on the command line or as an environment
variable. The variable is named AMMC_ followed by the long option in upper
case, so --udp_port becomes AMMC_UDP_PORT. Running ammc-amb --help shows
the variable name next to each option.
A value on the command line always wins over the environment. This is handy for services, containers and shortcuts, where the connection string or the decoder address is better kept out of the command line — see also hiding the connection string.
Both forms are equivalent:
ammc-amb.exe -w 9000 --db mysql://root:password@localhost:3306/mysql 192.168.1.11set AMMC_WEBSOCKET=9000
set AMMC_DB=mysql://root:password@localhost:3306/mysql
set AMMC_INTERFACE=192.168.1.11
ammc-amb.exeConnection
| Option | Environment variable | Description |
|---|---|---|
<INTERFACE> | AMMC_INTERFACE | IP address or hostname of the decoder. Append :port to override the default port |
-a, --autoconnect | AMMC_AUTOCONNECT | Discover decoders on the local network and connect |
-m, --timeout_ms | AMMC_TIMEOUT_MS | Connection timeout to the decoder in milliseconds (default 3000) |
Storing and forwarding data
| Option | Environment variable | Description |
|---|---|---|
-b, --db | AMMC_DB | Database connection string, see Storing data |
--de | AMMC_DE | The same connection string base64 encoded, so the password is not in plain text. Takes precedence over --db |
-c | AMMC_DB_CONNECTION_TIMEOUT_MS | Database connection timeout in milliseconds (default 1000) |
-y | AMMC_DB_CONNECTION_POOL_SIZE_MAX | Maximum database connection pool size (default 10) |
-w, --websocket | AMMC_WEBSOCKET | WebSocket server port |
-e, --udp_port | AMMC_UDP_PORT | UDP broadcast port |
Decoder behaviour
| Option | Environment variable | Description |
|---|---|---|
-t, --timesync | AMMC_TIMESYNC | Set the computer's local time on the decoder at startup |
-u, --timesync_utc | AMMC_TIMESYNC_UTC | Set UTC time on the decoder at startup |
-p, --request_passings | AMMC_REQUEST_PASSINGS | Ask the decoder to resend all stored passings |
-r, --requery_db | AMMC_REQUERY_DB | Look up the last stored passing number and request only newer ones |
Track information
Added to every passing record, see Track info.
| Option | Environment variable |
|---|---|
--trackId | AMMC_TRACK_ID |
--trackName | AMMC_TRACK_NAME |
--trackLayoutId | AMMC_TRACK_LAYOUT_ID |
--trackLayoutName | AMMC_TRACK_LAYOUT_NAME |
Other
| Option | Environment variable | Description |
|---|---|---|
-v, --verbose | AMMC_VERBOSE | Verbose logging |
-q, --quite | AMMC_QUITE | Errors and warnings only |
--skip_telemetry_upload | AMMC_SKIP_TELEMETRY_UPLOAD | Do not send the runtime telemetry ping |
-s, --startup_delay_secs | AMMC_STARTUP_DELAY_SECS | Wait before connecting, useful when starting as a service |
-V, --version | Print the version and build | |
-h, --help | Print all options |
Switches in the environment
For a switch such as --timesync, set the variable to true or false:
AMMC_TIMESYNC=true ammc-amb 192.168.1.11
Setting it to false is the same as leaving it out, so a variable set in a
service definition can be turned off without editing the command.