Skip to content

Commit

Permalink
add input_type option to ULTRAFEEDER_CONFIG mlat settings string
Browse files Browse the repository at this point in the history
  • Loading branch information
kx1t committed Dec 19, 2024
1 parent 47e24e4 commit 72b999a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@ The ULTRAFEEDER_CONFIG parameter can have multiple config strings, separated by
...or...
- 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]
- ULTRAFEEDER_CONFIG=mlat,host,port[,return_port][,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,input_connect=remote-host:port,input_type=xxxx,lat=xx.xxxx,lon=yy.yyyy,alt=zzz][,extra-arguments]
...or...
- ULTRAFEEDER_CONFIG=mlathub,host,port,protocol[,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,extra-arguments]
```

- To connect to an external ADSB (for input or output), UAT, or MLAT results source, use `- ULTRAFEEDER_CONFIG=adsb,host,port,protocol[,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,extra-arguments]`
- To connect and send data to an MLAT Server, use `- ULTRAFEEDER_CONFIG=mlat,host,port[,return_port][,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,name=Friendly_Name-123][,input_connect=remote-host:port,lat=xx.xxxx,lon=yy.yyyy,alt=zzz][,extra-arguments]`. For the optional parts in this structure, see [MLAT configuration](#mlat-configuration). Note - any MLAT results data received from the MLAT Server will automatically be aggregated in an [MLAT Hub](#configuring-the-built-in-mlat-hub) and shared with `tar1090`
- To connect and send data to an MLAT Server, use `- ULTRAFEEDER_CONFIG=mlat,host,port[,return_port][,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,name=Friendly_Name-123][,input_connect=remote-host:port,input_type=xxxx,lat=xx.xxxx,lon=yy.yyyy,alt=zzz][,extra-arguments]`. For the optional parts in this structure, see [MLAT configuration](#mlat-configuration). Note - any MLAT results data received from the MLAT Server will automatically be aggregated in an [MLAT Hub](#configuring-the-built-in-mlat-hub) and shared with `tar1090`
- To add MLAT results from additional MLAT Servers not configured with Ultrafeeder (for example, MLAT results from FlightRadar24 or FlightAware/piaware), use `- ULTRAFEEDER_CONFIG=mlathub,host,port,protocol[,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX][,extra-arguments]`. You can further configure this MLAT Hub as described in the section [Configuring the built-in MLAT Hub](#configuring-the-built-in-mlat-hub)

In the above configuration strings:
Expand All @@ -329,8 +329,10 @@ In the above configuration strings:
- `sbs_out`: SBS-format output
- `vrs_out`: SBS-format output
- `uat_in`: "special" RAW format input as generated by the `dump978` container on port 30978. It is advisable to use this protocol and port to get UAT data from dump978, for example: `- ULTRAFEEDER_CONFIG=adsb,dump978,30978,uat_in`
- `uuid` is a Universally Unique Identifier. You can reuse the one you generated for AdsbExchange, or you can generate a new one with this Linux command: `cat /proc/sys/kernel/random/uuid`. If omitted, it will use the `UUID` environment parameter, or if that one doesn't exist, it will leave the field empty.
- `name` is a friendly name (containing any character of the set \[A-Za-z0-9_-\] - do not use any spaces, quotes, or other non-alphanumeric characters!) that will be sent to the MLAT Server, used to identify the station by name. If omitted, it will use the `MLAT_USER` parameter, or if that one doesn't exist, it will leave the field empty.
- `uuid` is a Universally Unique Identifier. You can reuse the one you generated for AdsbExchange, or you can generate a new one with this Linux command: `cat /proc/sys/kernel/random/uuid`. If omitted, it will use the `UUID` environment parameter, or if that one doesn't exist, it will leave the field empty
- `name` is a friendly name (containing any character of the set \[A-Za-z0-9_-\] - do not use any spaces, quotes, or other non-alphanumeric characters!) that will be sent to the MLAT Server, used to identify the station by name. If omitted, it will use the `MLAT_USER` parameter, or if that one doesn't exist, it will leave the field empty
- `input_connect` is a `host:port` combination where the ADSB data for this MLAT connection is coming from. If omitted, it will get its input from the `readsb` instance that is present in the container
- `input_type` is the type of data that the input source provides. This can be one of these: `auto`, `dump1090`, `beast`, `radarcape_12mhz`, `radarcape_gps`, `radarcape`, `sbs`, or `avrmlat`. If omitted, the value of the `MLAT_INPUT_TYPE` variable will be used, or if that one does not exist, `auto` will be used

##### Networking parameters

Expand Down
9 changes: 6 additions & 3 deletions rootfs/etc/s6-overlay/scripts/mlat-client
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ do
# 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 name_arg uuid_arg lat_arg lon_arg alt_arg input_connect_arg return_port_arg extra_args
unset name_arg uuid_arg lat_arg lon_arg alt_arg input_connect_arg input_type_arg return_port_arg extra_args

for ((i=2; i<${#params[*]}; i++))
do
Expand All @@ -198,7 +198,7 @@ do
elif header="${params[i]:0:5}" && [[ "${header,,}" == "uuid=" ]]; then
# It's a UUID
uuid_arg="${params[i]#*=}"
elif header="${params[i]:0:5}" && [[ "${header,,}" == "name=" ]]; then
elif header="${params[i]:0:5}" && [[ "${header,,}" == "name=" ]]; then
# It's a MLAT_NAME
name_arg="${params[i]#*=}"
elif header="${params[i]:0:4}" && [[ "${header,,}" == "lat=" ]]; then
Expand All @@ -213,6 +213,9 @@ do
elif header="${params[i]:0:14}" && [[ "${header,,}" == "input_connect=" ]]; then
#It's the input_connect parameter value
input_connect_arg="${params[i]#*=}"
elif header="${params[i]:0:14}" && [[ "${header,,}" == "input_type=" ]]; then
#It's the input_type parameter value
input_type_arg="${params[i]#*=}"
else
# It's an Extra Args string
extra_args="$extra_args ${params[i]}"
Expand All @@ -221,7 +224,7 @@ do

# ------------------------------------------------
# Build the MLAT parameter string:
MLAT_PARAM=(--input-type "${MLAT_INPUT_TYPE:-auto}")
MLAT_PARAM=(--input-type "${input_type_arg:-${MLAT_INPUT_TYPE:-auto}}")
MLAT_PARAM+=(--server "${params[0]}:${params[1]}")

servername=${params[0]}
Expand Down

0 comments on commit 72b999a

Please sign in to comment.