mirror of
https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder.git
synced 2024-11-22 05:40:10 +00:00
add remote input-config params to mlat-client
This commit is contained in:
parent
3f9269f52d
commit
0226c8a3ee
3 changed files with 84 additions and 46 deletions
10
README.md
10
README.md
|
@ -281,6 +281,8 @@ The ULTRAFEEDER_CONFIG parameter can have multiple config strings, separated by
|
||||||
- ULTRAFEEDER_CONFIG=adsb,host,port,protocol[,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,extra-arguments]
|
- ULTRAFEEDER_CONFIG=adsb,host,port,protocol[,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,extra-arguments]
|
||||||
...or...
|
...or...
|
||||||
- ULTRAFEEDER_CONFIG=mlat,host,port[,return_port][,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,extra-arguments]
|
- ULTRAFEEDER_CONFIG=mlat,host,port[,return_port][,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,extra-arguments]
|
||||||
|
...or to retrieve MLAT data from a remote receiver...
|
||||||
|
- ULTRAFEEDER_CONFIG=mlat,host,port[,return_port][,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,input_connect=remote-host:port,lat=xx.xxxx,lon=yy.yyyy,alt=zzz][,extra-arguments]
|
||||||
...or...
|
...or...
|
||||||
- ULTRAFEEDER_CONFIG=mlathub,host,port,protocol[,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,extra-arguments]
|
- ULTRAFEEDER_CONFIG=mlathub,host,port,protocol[,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,extra-arguments]
|
||||||
```
|
```
|
||||||
|
@ -300,6 +302,11 @@ In the above configuration strings:
|
||||||
- `vrs_out`: SBS-format output
|
- `vrs_out`: SBS-format output
|
||||||
- `uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` is an optional parameter that sets the UUID for this specific instance. It will override the global `UUID` parameter. This is only needed when you want to send different UUIDs to different aggregators.
|
- `uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` is an optional parameter that sets the UUID for this specific instance. It will override the global `UUID` parameter. This is only needed when you want to send different UUIDs to different aggregators.
|
||||||
- `extra-arguments` can be any additional command line argument you want to pass to readsb, mlathub, or mlat-client. Example: `--net-only`. Please make sure to only once pass in an extra argument for each of the adsb|mlat|mlathub service.
|
- `extra-arguments` can be any additional command line argument you want to pass to readsb, mlathub, or mlat-client. Example: `--net-only`. Please make sure to only once pass in an extra argument for each of the adsb|mlat|mlathub service.
|
||||||
|
- To connect to a remote receiver and send MLAT data to a MLAT Server, create a `mlat` instance with these additional parameters - `input_connect=remote-host:port,lat=xx.xxxx,lon=yy.yyyy,alt=zzz`, where:
|
||||||
|
- `input_connect=remote-host:port` defines the remote receiver's hostname or IP address and the port number where BEAST output data is available
|
||||||
|
- `lat=xx.xxxx` defines the remote receiver's latitude
|
||||||
|
- `lon=yy.yyyy` defines the remote receiver's longitude
|
||||||
|
- `alt=zzz` defines the remote receiver's altitude in meters above the eliptoid (~above sea level)
|
||||||
|
|
||||||
##### Networking parameters
|
##### Networking parameters
|
||||||
|
|
||||||
|
@ -387,11 +394,12 @@ where:
|
||||||
- `port` is the port (TCP or UDP) of the target MLAT server (mandatory)
|
- `port` is the port (TCP or UDP) of the target MLAT server (mandatory)
|
||||||
- `return_port` is the port at which the MLAT results are made available in BEAST format. We recommend to sequentially number them starting at 39000 (optional)
|
- `return_port` is the port at which the MLAT results are made available in BEAST format. We recommend to sequentially number them starting at 39000 (optional)
|
||||||
- `uuid=xxxx` defines a unique user ID for this MLAT server instance. If included, the string must start with `uuid=` (optional)
|
- `uuid=xxxx` defines a unique user ID for this MLAT server instance. If included, the string must start with `uuid=` (optional)
|
||||||
|
- `input_connect=hostname:port` / `lat=xxxx` / `lon=xxxx` / `alt=xxxx` defines a unique input connection/latitude/longitude/altitude. This can be used to connect to a remote Beast source and forward MLAT data to an MLAT server
|
||||||
- `extra-arguments` are any additional command line arguments that you would like to use for this MLAT Client instance (optional)
|
- `extra-arguments` are any additional command line arguments that you would like to use for this MLAT Client instance (optional)
|
||||||
|
|
||||||
Note - the three optional parameters (`return_port`, `uuid=`, and `extra-arguments`) can be given in any order.
|
Note - the three optional parameters (`return_port`, `uuid=`, and `extra-arguments`) can be given in any order.
|
||||||
|
|
||||||
If no UUID is specified with the `MLAT_CONFIG` parameter, it will use the value of the `UUID` parameter if it exists. If that fails, no UUID parameter is included with `mlat-client`.
|
If no UUID is specified with the `MLAT_CONFIG` parameter, it will use the value of the `UUID` parameter if it exists. If that fails, a random UUID will be generated for each instance of `mlat-client` with format `00000000-ffff-aaaa-rrrr-tttttttttttt` where `rrrr` is a random hexadecimal number and `tttttttttttt` contains the UUID creation time (secs since epoch) in hexadecimal format.
|
||||||
|
|
||||||
### Web Gui (`tar1090`) Configuration
|
### Web Gui (`tar1090`) Configuration
|
||||||
|
|
||||||
|
|
|
@ -74,9 +74,6 @@ do
|
||||||
# put individual params into the $params array:
|
# put individual params into the $params array:
|
||||||
readarray -td "," params < <(printf '%s' "${instance}")
|
readarray -td "," params < <(printf '%s' "${instance}")
|
||||||
|
|
||||||
uuid_arg=false
|
|
||||||
extra_args=""
|
|
||||||
|
|
||||||
# Check if the params array has values for the mandatory elements:
|
# Check if the params array has values for the mandatory elements:
|
||||||
if [[ -z "${params[0]}" ]] || [[ -z "${params[1]}" ]]
|
if [[ -z "${params[0]}" ]] || [[ -z "${params[1]}" ]]
|
||||||
then
|
then
|
||||||
|
@ -86,31 +83,49 @@ do
|
||||||
sleep infinity
|
sleep infinity
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Now process the the arguments
|
||||||
|
# The order doesn't matter, we'll do pattern matching:
|
||||||
|
# If the argument is a number, then it must be the beast_results port
|
||||||
|
# If the argument starts with "uuid=", then it must be a UUID, etc.
|
||||||
|
# If the argument isn't any of the above, then it's an "extra argument"
|
||||||
|
|
||||||
|
unset uuid_arg lat_arg lon_arg alt_arg input_connect_arg extra_args
|
||||||
|
|
||||||
|
for ((i=2; i<${#params[*]}; i++))
|
||||||
|
do
|
||||||
|
if [[ -n "${params[i]}" ]] && [[ "${params[i]}" =~ ^[0-9]+$ ]]; then
|
||||||
|
# It's a number so it must be the return port
|
||||||
|
MLAT_PARAM+=("--results beast,listen,${params[i]}")
|
||||||
|
elif header="${params[i]:0:5}" && [[ "${header,,}" == "uuid=" ]]; then
|
||||||
|
# It's a UUID
|
||||||
|
uuid_arg="${params[i]#*=}"
|
||||||
|
elif header="${params[i]:0:4}" && [[ "${header,,}" == "lat=" ]]; then
|
||||||
|
# It's a latitude
|
||||||
|
lat_arg="${params[i]#*=}"
|
||||||
|
elif header="${params[i]:0:4}" && [[ "${header,,}" == "lon=" ]]; then
|
||||||
|
# It's a longitude
|
||||||
|
lon_arg="${params[i]#*=}"
|
||||||
|
elif header="${params[i]:0:4}" && [[ "${header,,}" == "alt=" ]]; then
|
||||||
|
# It's a latitude
|
||||||
|
alt_arg="${params[i]#*=}"
|
||||||
|
elif header="${params[i]:0:14}" && [[ "${header,,}" == "input_connect=" ]]; then
|
||||||
|
#It's the input_connect parameter value
|
||||||
|
input_connect_arg="${params[i]#*=}"
|
||||||
|
else
|
||||||
|
# It's an Extra Args string
|
||||||
|
extra_args="$extra_args ${params[i]}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
# Build the MLAT parameter string:
|
# Build the MLAT parameter string:
|
||||||
MLAT_PARAM=(--input-type "${MLAT_INPUT_TYPE}")
|
MLAT_PARAM=(--input-type "${MLAT_INPUT_TYPE:-auto}")
|
||||||
MLAT_PARAM+=(--input-connect localhost:30005)
|
|
||||||
MLAT_PARAM+=(--server "${params[0]}:${params[1]}")
|
MLAT_PARAM+=(--server "${params[0]}:${params[1]}")
|
||||||
|
|
||||||
if [ -n "${LAT}" ]; then
|
# add input-connect to the param array:
|
||||||
MLAT_PARAM+=(--lat "${LAT}")
|
MLAT_PARAM+=(--input-connect "${input_connect_arg:-localhost:30005}")
|
||||||
elif [ -n "${READSB_LAT}" ]; then
|
|
||||||
MLAT_PARAM+=(--lat "${READSB_LAT}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${LONG}" ]; then
|
if [ -n "${MLAT_USER}" ]; then
|
||||||
MLAT_PARAM+=(--lon "${LONG}")
|
|
||||||
elif [ -n "${READSB_LON}" ]; then
|
|
||||||
MLAT_PARAM+=(--lon "${READSB_LON}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${ALT}" ]; then
|
|
||||||
MLAT_PARAM+=(--alt "${ALT}")
|
|
||||||
elif [ -n "${READSB_ALT}" ]; then
|
|
||||||
MLAT_PARAM+=(--alt "${READSB_ALT}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -n "${MLAT_USER}" ]]; then
|
|
||||||
MLAT_PARAM+=(--user "${MLAT_USER}")
|
MLAT_PARAM+=(--user "${MLAT_USER}")
|
||||||
else
|
else
|
||||||
rnd="${RANDOM}"
|
rnd="${RANDOM}"
|
||||||
|
@ -118,33 +133,44 @@ do
|
||||||
MLAT_PARAM+=(--user "${rnd}")
|
MLAT_PARAM+=(--user "${rnd}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Now process the rest of the arguments
|
# add LAT/LON/ALT to instance:
|
||||||
# The order doesn't matter, we'll do pattern matching:
|
if [ -n "${lat_arg}" ]; then
|
||||||
# If the argument is a number, then it must be the beast_results port
|
MLAT_PARAM+=(--lat "${lat_arg}")
|
||||||
# If the argument starts with "uuid=", then it must be a UUID
|
elif [ -n "${LAT}" ]; then
|
||||||
# If the argument isn't any of the above, then it's an "extra argument"
|
MLAT_PARAM+=(--lat "${LAT}")
|
||||||
|
elif [ -n "${READSB_LAT}" ]; then
|
||||||
|
MLAT_PARAM+=(--lat "${READSB_LAT}")
|
||||||
|
fi
|
||||||
|
|
||||||
for ((i=2; i<${#params[*]}; i++))
|
if [ -n "${lon_arg}" ]; then
|
||||||
do
|
MLAT_PARAM+=(--lat "${lon_arg}")
|
||||||
if [[ -n "${params[i]}" ]] && [[ "${params[i]}" =~ ^[0-9]+$ ]]; then
|
elif [ -n "${LONG}" ]; then
|
||||||
# It's a number so it must be the return port
|
MLAT_PARAM+=(--lon "${LONG}")
|
||||||
MLAT_PARAM+=("--results beast,listen,${params[i]}")
|
elif [ -n "${READSB_LON}" ]; then
|
||||||
|
MLAT_PARAM+=(--lon "${READSB_LON}")
|
||||||
|
fi
|
||||||
|
|
||||||
elif header="${params[i]:0:5}" && [[ "${header,,}" == "uuid=" ]]; then
|
if [ -n "${alt_arg}" ]; then
|
||||||
# It's a UUID
|
MLAT_PARAM+=(--lat "${alt_arg}")
|
||||||
MLAT_PARAM+=("--uuid ${params[i]:5}")
|
elif [ -n "${ALT}" ]; then
|
||||||
uuid_arg=true
|
MLAT_PARAM+=(--alt "${ALT}")
|
||||||
|
elif [ -n "${READSB_ALT}" ]; then
|
||||||
|
MLAT_PARAM+=(--alt "${READSB_ALT}")
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
# Add UUID to instance
|
||||||
# It's an Extra Args string
|
if [ -n "$uuid_arg" ]; then
|
||||||
extra_args="$extra_args ${params[i]}"
|
MLAT_PARAM+=("--uuid ${uuid_arg}")
|
||||||
|
elif [ -n "${UUID}" ]; then
|
||||||
fi
|
MLAT_PARAM+=("--uuid ${UUID}")
|
||||||
done
|
else
|
||||||
# If no UUID was set in the argument strings, check if we can use the generic UUID parameter
|
# generate a random UUID
|
||||||
if [[ $uuid_arg == false ]] && [[ -n "${UUID}" ]]; then
|
UUID="$(cat /proc/sys/kernel/random/uuid)"
|
||||||
|
[[ -z "${UUID}" ]] && UUID="$(printf '00000000-ffff-aaaa-%04x-%012x\n' "$RANDOM" "$(date +%s)")"
|
||||||
|
s6wrap --prepend="${APPNAME}" --timestamps --args echo "WARNING: UUID is not defined - using randomized uuid \"${UUID}\""
|
||||||
MLAT_PARAM+=("--uuid ${UUID}")
|
MLAT_PARAM+=("--uuid ${UUID}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Now add the extra_args, if any:
|
# Now add the extra_args, if any:
|
||||||
[[ -n "${extra_args}" ]] && MLAT_PARAM+=("${extra_args}") || true
|
[[ -n "${extra_args}" ]] && MLAT_PARAM+=("${extra_args}") || true
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,10 @@
|
||||||
# `vrs_out`: SBS-format output
|
# `vrs_out`: SBS-format output
|
||||||
# `uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` is an optional parameter that sets the UUID for this specific instance.
|
# `uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` is an optional parameter that sets the UUID for this specific instance.
|
||||||
# It will override the global `UUID` parameter. This is only needed when you want to send different UUIDs to different aggregators.
|
# It will override the global `UUID` parameter. This is only needed when you want to send different UUIDs to different aggregators.
|
||||||
|
# `input_connect=host:port is an optional parameter that sets the input_connect values for this instance`
|
||||||
|
# `lat=xxxx` is an optional parameter that sets the latitude for this specific instance
|
||||||
|
# `lon=xxxx` is an optional parameter that sets the longitude for this specific instance
|
||||||
|
# `alt=xxxx` is an optional parameter that sets the altitude for this specific instance
|
||||||
# `extra-arguments` can be any additional command line argument you want to pass to readsb, mlathub, or mlat-client
|
# `extra-arguments` can be any additional command line argument you want to pass to readsb, mlathub, or mlat-client
|
||||||
# Example: `--net-only`. Please make sure to only once pass in an extra argument for each of the adsb|mlat|mlathub service.
|
# Example: `--net-only`. Please make sure to only once pass in an extra argument for each of the adsb|mlat|mlathub service.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue