Skip to content

Commit cb50e8b

Browse files
authored
feat: add support to forward beast-tcp from remote dump1090 server to local dump1090
1 parent a4d1e50 commit cb50e8b

File tree

4 files changed

+37
-6
lines changed

4 files changed

+37
-6
lines changed

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ To disable starting a service you can add an environement variable :
5252
| `SERVICE_ENABLE_PIAWARE` | `false` | Disable piaware service |
5353
| `SERVICE_ENABLE_FR24FEED` | `false` | Disable fr24feed service |
5454
| `SERVICE_ENABLE_HTTP` | `false` | Disable http service |
55+
| `SERVICE_ENABLE_IMPORT_OVER_NETCAT` | `false` | Disable import over netcat|
56+
5557

5658
Ex : `-e "SERVICE_ENABLE_HTTP=false"`
5759

@@ -135,13 +137,28 @@ Example :
135137
| `HTML_SITE_LON` | `9.0` | |
136138
| `HTML_SITE_NAME` | `My Radar Site` | |
137139
| `DUMP1090_ADDITIONAL_ARGS` | empty | Additial arguments for dump1090 e.g.: `--json-location-accuracy 2`|
138-
| `DUMP1090_OVER_NETCAT` | `false` | Use dump1090 in combination with netcat to feed data from rtl_tcp server. (Requires appox. 35-40Mbit/s). Example RTL_TCP command: `./rtl_tcp -a 0.0.0.0 -f 1090000000 -s 2400000 -p 30005 -P 28 -g -10`|
139-
| `DUMP1090_REMOTE_HOST` | empty | IP of rtl_tcp server |
140-
| `DUMP1090_REMOTE_PORT` | empty | Port of rtl_tcp server |
141-
142140

143141
Ex : `-e "HTML_SITE_NAME=My site"`
144142

143+
## DUMP1090 forwarding
144+
| Environment Variable | Default value | Description |
145+
|---------------------------------------|--------------------------|-------------------------------------------------------------------|
146+
| `SERVICE_ENABLE_IMPORT_OVER_NETCAT` | `false` | Enable netcat forwarding the beast-output of a remote dump1090 server to the local dump1090 beast-input |
147+
| `DUMP1090_LOCAL_PORT` | empty | Must be the same port as specified as `--net-bi-port` in `DUMP1090_ADDITIONAL_ARGS`|
148+
| `DUMP1090_REMOTE_HOST` | empty | IP of remote dump1090 server |
149+
| `DUMP1090_REMOTE_PORT` | empty | Port of remote dump190 server specified as argument `--net-bo-port` on remote system|
150+
151+
## RTL_TCP forwarding
152+
153+
**WARNING:** This kind of forwarding is using a lot of bandwidth and could be unstable in WiFi environments.
154+
155+
| Environment Variable | Default value | Description |
156+
|---------------------------------------|--------------------------|-------------------------------------------------------------------|
157+
| `RTL_TCP_OVER_NETCAT` | `false` | Use dump1090 in combination with netcat to feed data from rtl_tcp server. (Requires appox. 35-40Mbit/s). Example RTL_TCP command: `./rtl_tcp -a 0.0.0.0 -f 1090000000 -s 2400000 -p 30005 -P 28 -g -10`|
158+
| `RTL_TCP_REMOTE_HOST` | empty | IP of rtl_tcp server |
159+
| `RTL_TCP_REMOTE_PORT` | empty | Port of rtl_tcp server |
160+
161+
145162
### Terrain-limit rings (optional):
146163
If you don't need this feature ignore this.
147164

root/etc/services.d/dump1090/run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ then
2020
default_value "site_lat" "45.0"
2121
default_value "site_lon" "9.0"
2222
default_value2 "additional_args" ""
23-
if [ "$DUMP1090_OVER_NETCAT" == "true" ]
23+
if [ "$RTL_TCP_OVER_NETCAT" == "true" ]
2424
then
25-
/bin/nc ${DUMP1090_REMOTE_HOST} ${DUMP1090_REMOTE_PORT} | /usr/lib/fr24/dump1090 --net --write-json /usr/lib/fr24/public_html/data --raw --quiet --lat ${HTML_SITE_LAT} --lon ${HTML_SITE_LON} ${DUMP1090_ADDITIONAL_ARGS} --ifile -
25+
/bin/nc ${RTL_TCP_REMOTE_HOST} ${RTL_TCP_REMOTE_PORT} | /usr/lib/fr24/dump1090 --net --write-json /usr/lib/fr24/public_html/data --raw --quiet --lat ${HTML_SITE_LAT} --lon ${HTML_SITE_LON} ${DUMP1090_ADDITIONAL_ARGS} --ifile -
2626
else
2727
/usr/lib/fr24/dump1090 --net --write-json /usr/lib/fr24/public_html/data --raw --quiet --lat ${HTML_SITE_LAT} --lon ${HTML_SITE_LON} ${DUMP1090_ADDITIONAL_ARGS}
2828
fi

root/etc/services.d/netcat/finish

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/execlineb -S0
2+
s6-svscanctl -t /var/run/s6/services

root/etc/services.d/netcat/run

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/with-contenv bash
2+
if [ "$SERVICE_ENABLE_IMPORT_OVER_NETCAT" != "false" ]
3+
then
4+
echo "Waiting until dump1090 is listening on configured port..."
5+
while ! nc -z localhost ${DUMP1090_LOCAL_PORT}; do sleep 5; echo "wait until local dump1090 is listening on port ${DUMP1090_LOCAL_PORT}"; done
6+
while ! nc -z ${DUMP1090_REMOTE_HOST} ${DUMP1090_REMOTE_PORT}; do sleep 5; echo "wait until remote dump1090 (${DUMP1090_REMOTE_HOST}) is listening on port ${DUMP1090_REMOTE_PORT}"; done
7+
echo "local and remote dump1090 is available now. Start forwarding..."
8+
9+
while /bin/true; do /bin/nc ${DUMP1090_REMOTE_HOST} ${DUMP1090_REMOTE_PORT} | /bin/nc -q1 localhost ${DUMP1090_LOCAL_PORT}; sleep 15; done
10+
else
11+
tail -f /dev/null
12+
fi

0 commit comments

Comments
 (0)