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.11
set AMMC_WEBSOCKET=9000
set AMMC_DB=mysql://root:password@localhost:3306/mysql
set AMMC_INTERFACE=192.168.1.11
ammc-amb.exe

Connection

OptionEnvironment variableDescription
<INTERFACE>AMMC_INTERFACEIP address or hostname of the decoder. Append :port to override the default port
-a, --autoconnectAMMC_AUTOCONNECTDiscover decoders on the local network and connect
-m, --timeout_msAMMC_TIMEOUT_MSConnection timeout to the decoder in milliseconds (default 3000)

Storing and forwarding data

OptionEnvironment variableDescription
-b, --dbAMMC_DBDatabase connection string, see Storing data
--deAMMC_DEThe same connection string base64 encoded, so the password is not in plain text. Takes precedence over --db
-cAMMC_DB_CONNECTION_TIMEOUT_MSDatabase connection timeout in milliseconds (default 1000)
-yAMMC_DB_CONNECTION_POOL_SIZE_MAXMaximum database connection pool size (default 10)
-w, --websocketAMMC_WEBSOCKETWebSocket server port
-e, --udp_portAMMC_UDP_PORTUDP broadcast port

Decoder behaviour

OptionEnvironment variableDescription
-t, --timesyncAMMC_TIMESYNCSet the computer's local time on the decoder at startup
-u, --timesync_utcAMMC_TIMESYNC_UTCSet UTC time on the decoder at startup
-p, --request_passingsAMMC_REQUEST_PASSINGSAsk the decoder to resend all stored passings
-r, --requery_dbAMMC_REQUERY_DBLook up the last stored passing number and request only newer ones

Track information

Added to every passing record, see Track info.

OptionEnvironment variable
--trackIdAMMC_TRACK_ID
--trackNameAMMC_TRACK_NAME
--trackLayoutIdAMMC_TRACK_LAYOUT_ID
--trackLayoutNameAMMC_TRACK_LAYOUT_NAME

Other

OptionEnvironment variableDescription
-v, --verboseAMMC_VERBOSEVerbose logging
-q, --quiteAMMC_QUITEErrors and warnings only
--skip_telemetry_uploadAMMC_SKIP_TELEMETRY_UPLOADDo not send the runtime telemetry ping
-s, --startup_delay_secsAMMC_STARTUP_DELAY_SECSWait before connecting, useful when starting as a service
-V, --versionPrint the version and build
-h, --helpPrint 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.