If this isn’t allowed then I apologise and I do appreciate it’s a long shot.
I’d really like to have more ground traffic shown on my VRS server so if anyone is near Heathrow, Stansted, Gatwick or Luton airports and can see ground movements, would you be interested in helping me please?
All I’d need from you is a single port forwarded through your router to your Raspberry Pi and a way to contact you, either via a static IP if you have one or a free dynamic DNS service.
/edit - Or there’s a better way that I mentioned. See the next post in this thread. I can give you full instructions on how to configure your Pi so that it pushes data to me. That means you don’t need to open a port and don’t need to set up a dynamic DNS. It’s all fully under your control.
Note that if you configure a receiver for them as a push receiver in VRS they won’t need to open a port, they can simply send the data to you using socat, and that can be scripted to ensure it’s running automatically.
$ cat /usr/local/bin/vrsfeed
#!/bin/bash
# Start ADS-B transmission if not already running
if [[ -z $(ps -ef | grep '[s]ocat.*30005') ]]; then
socat -u TCP:localhost:30005 TCP:your.vrs.host:yourwaitingpushport &> /dev/null &
fi
Run via pi’s crontab → */5 * * * * /usr/local/bin/vrsfeed &> /dev/null
It would be better for me as it means that anyone providing me data would be in control themselves and wouldn’t have to open any ports in their router. I can provide full instructions on how to do this.
Fantastic thankyou, I’ve grabbed them. I wish VRS had a way to assign a location to a logged in user. That way you could have multiple participants with each one defaulting to their own location. As it stands I have a myself and friend feeding a server but I have to default the location to somewhere, which means one or both of us has to set our location on a per-browser basis. But the location is already configured for the receivers, so it would be nice to be able to assign a configured location to a user and have that be their default location.
But i like to have logs in the systemd journal, so i’d make a systemd service anyway.
Also linked it because of the reduced network bandwidth someone might be interested in.
I’ve just set up the MTG receiver to push into Essex Radar this way and I’m stunned. VRS shows the data throughput and it’s roughly 5KB/sec which I reckon will be around 80Mb data/day. That’s nothing!
Handy to know how to do this, but this is a script which checks to see if socat is running and, if not, runs it. It’s designed to be run periodically, say every 5 minutes, and that’s what crontab is doing.
So what does it mean to turn it into a service? What does it mean to “start” this script, or to “restart” it, what is a “failure”?
It feels like a service-led approach for this kind of script is not appropriate, since it’s not a continuous service and not designed to be.
Yeah, I don’t think there was anything wrong with starting it via cron and then using that to check every five minutes just to make sure it’s running. Doing it as a service seems like overkill to me. My aim here is to make this very simple for someone to do if they’re happy to share their data with me.
With the interval set to 4 as the script installs it, the position of aircraft is only updated every 2 to 3 seconds.
You can reduce that interval to 2 and probably get a position update every second.
Explaining the actual update rates for stuff … is complicated … but if you try it you’ll probably be happy with it.
(1) Well this can be achieved by adding a while loop to your script as shown below.
With a while loop added to the script, the starting method (cron or systemd) will be required to start it only at boot, and wont be required to repeat start every 5 minutes (300 seconds).
#!/bin/bash
while sleep 300
do
# Start ADS-B transmission if not already running
if [[ -z $(ps -ef | grep '[s]ocat.*30005') ]]; then
socat -u TCP:localhost:30005 TCP:your.vrs.host:yourwaitingpushport &> /dev/null &
fi
done
To stop the cron job, one has to edit crontab and comment out relevant line, then reboot the Pi. It is much easier to start and stop by systemd commands which neither require editing nor reboot. If someone wants to disable the sctipt, simply issue following command:
sudo systemctl disable vrsfeed
(2) That said, if bandwidth is a concern, then @wiedehopf’s method is the way to go.
Well yes but now it’s getting silly. The whole point of the vrsfeed script is to test for, and restart, socat on a per-feed basis. This is because socat will exit if the connection is interrupted. It doesn’t make sense for vrsfeed to run continuously. If anything it is socat which is the service element and that’s what should be ‘servicifed’. Turning vrsfeed itself into a service, and then adding a while and sleep construct to hack around its unsuitability as a service, is just really nasty.
Your comments about cron are correct generally (although a reboot isn’t needed), but again consider why someone would use vrsfeed. Like dump1090 itself, it’s not a function which would need to be turned off and on all the time; most of the time it simply ticks along checking that socat is running. If for some reason socat does need to be interrupted now and again, one can simply rename vrsfeed and pkill socat, do whatever needs doing and rename vrsfeed back when ready. If there was a need to do this a lot I’d still rather edit the vrsfeed script to use a lock file and manage it via that rather than hack it into a service.
As for bandwidth, reduced bandwidth is useful for a remote site running a cellular data plan, for example, but it’s nothing to do with whether a service is the way to go. The execution aspect is divorced from the function aspect. And using external installation scripts for these mods has its own pitfalls – it’s something else to have to trust and track and hope that it’s behaving and it’s difficult to implement offline if a baseline build is desired, and it can make system management more difficult as there’s now external scripting out of your control influencing your environment. It’s got its place but for simpler requirements the risks and costs outweight the benefits in my admin experience.
Back to the original question - Is there anyone near any of the main London Airports who can see ground traffic who would be prepared to help Essex Radar by giving me a feed of their data please?