Board index FlightGear Development Add-ons

METAR push for MP events

FlightGear has support for add-ons, to further extend the simulator's core functionality.

METAR push for MP events

Postby MariuszXC » Tue Jun 01, 2021 1:23 pm

Rationale (in a short story form):

Recently I joined a regularly hosted MP event. Unbeknown to me, this time the ATC host decided to offer training in very LV conditions, for which he published METAR on mumble, which I missed. That, in turn, resulted in me having entirely different weather situation from the rest of pilots. ATC was very accomodating and this turned into a lot of fun, but later he kindly wasted some of his time on explaining to me how to enter METAR into FG. And that is the key observation here - time waste.

Likely I was not the first and will not be the last to need some hand-holding with METAR entry (or simply miss the info), so I would like to propose an enhancement in this area.

Proposal:

Provide a method to receive METAR push messages configured by (ATC) hosts of Multiplayer Events.

This would enable ATCs of regularly hosted events, as well as ad hoc formed groups, with an easy way (just create a temporary mumble channel and add METAR data to it) to have consistent weather across participants.

How:

Possibly by using a data side-channel in a communications-plugin.
On the host side there would be a method to enter a METAR text string into a data channel associated with a specified frequency (and possibly to update METAR as time progresses).
On the pilot side tuning a radio to the ATIS frequency would additionally enable reception of METAR data from this data side-channel, if present. Since this has some potential for abuse probably a dialog should be offered, allowing the pilot to: accept METAR once / accept all / reject once / reject all.

Looking at the source code, there is already a similar mechanism of _metarBridge() and MetarPropertiesATISInformationProvider(), but, If I understand the code, it is currently focused on obtaining the real METARs for selected airports (via NavDataCache ?), identified by tuned frequencies.
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: METAR push for MP events

Postby benih » Wed Jun 02, 2021 10:08 pm

We just had a talk on mumble about that, and my basic opinion is, that the FGCom-mumble plugin is not the best way to implement this.

FlightGear already has the means I think:
  • The easiest way is of course, to set the METAR manually in the launcher beforehand; or adjust it insim in the weather dialog
  • Another option is to make a small addon for that.
    It just needs a small GUI to slave your metar to some remote client (enter the callsign like in the copilot implementation, and broadcast the metar from there).
    My open question here would be how we could actually broadcast the METAR string via multiplayer, but I really think this is already solved. Maybe utilizing a small custom Aircraft (like the existing ATC-aircraft? that assigns it to a multiplayer property, which is then read by remote addon nasal scripts?)
    Probably only the metar host needs to run this instance.
  • I once tought about just an alternative METAR source, which would just need the insim metar engine URL to be changed. I think nowadays this is just a change of a property. One would need a webserver for that, delivering the (unknown to me) METAR data.
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: METAR push for MP events

Postby merspieler » Wed Jun 02, 2021 11:39 pm

if you've got an atc aircraft, you can simply use the mp props... (except it they are too small to contain the entire metar string)

another metar server would imo be easier to setup and populate (<1 minute if you've got already a webserver running...)
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2241
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: METAR push for MP events

Postby MariuszXC » Thu Jun 03, 2021 10:17 am

benih wrote in Wed Jun 02, 2021 10:08 pm:We just had a talk on mumble about that, and my basic opinion is, that the FGCom-mumble plugin is not the best way to implement this.
...


Yes, and the summary is, that:
- idea is good,
- fgcom-mumble plugin is not the best place for it.

The main argument against having it implemented in this plugin was, that it would make users (wanting that functionality) dependant on this particular plugin for communication.

My line of thinking was, that group communication is a core element of multiplayer events, so it seemed natural having this functionality in comms (akin to listening to ATIS, or a group leader), but if it can be done by already existing means, all the better. However (@merspieler) I do not envision normal users setting up dedicated servers for the purpose of having occassional fun with group flying in consistent weather. Maybe more involved ATCs could be bothered, for their specific training scenarios, I don't know.. In other words, functionalities tend to be used when they are 'easy' to use (or made to look easy) :)
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: METAR push for MP events

Postby benih » Thu Jun 03, 2021 11:08 am

merspieler wrote in Wed Jun 02, 2021 11:39 pm:another metar server would imo be easier to setup and populate (<1 minute if you've got already a webserver running...)

I have no idea what is needed for the data that is delivered. Where can i get the current url from?

I think it would be very easy to make php website where we can edit metars that are then delivered.
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: METAR push for MP events

Postby Johan G » Thu Jun 03, 2021 11:58 am

benih wrote in Wed Jun 02, 2021 10:08 pm:FlightGear already has the means I think:
    [...]
  • I once tought about just an alternative METAR source, which would just need the insim metar engine URL to be changed. I think nowadays this is just a change of a property. One would need a webserver for that, delivering the (unknown to me) METAR data.

merspieler wrote in Wed Jun 02, 2021 11:39 pm:another metar server would imo be easier to setup and populate (<1 minute if you've got already a webserver running...)

Currently the URL to the server is in /environment/realwx/metar-url.

If an addon is made that can change that URL with a few mouse clicks, make sure it can restore it. :wink: And preferably announce the changes in the log file, for example using Nasal logprint() or printlog().
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: METAR push for MP events

Postby benih » Thu Jun 03, 2021 3:43 pm

Johan G wrote in Thu Jun 03, 2021 11:58 am:Currently the URL to the server is in /environment/realwx/metar-url.

Which resolves into https://tgftp.nws.noaa.gov/data/observations/metar/stations/[station].TXT, where "[station]" is probably filled by the nearbyest station from C++ fgfs space.
Using that with my currrent location gives: https://tgftp.nws.noaa.gov/data/observa ... s/EDMO.TXT which just delivers the METAR string.
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: METAR push for MP events

Postby benih » Thu Jun 03, 2021 6:59 pm

I just spent two beers hacking a rough proxy proof-of-concept together: https://github.com/hbeni/fgfs-metar-proxy
It just needs PHP. There are probably security holes in it, so be careful if you deploy it.

Basicly it redirects flightgear to the default metar url unless there is a locally modified version. The modified version can be uploaded by a simple web form, delivered from the script itself.
The readme explains all of it.

One problem with this is tough, that it's nowhere better than supplying a manual METAR string in the launcher:
- The launcher has to be adjusted anyways (either reset of the METAR URL source; or the manual metar setting)
- Flightgear seems to only fetch updates from time to time. The exact interval is not known to me so far (but at least several minutes). This does not help with the problem of inducing fast gusts as instructor.
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: METAR push for MP events

Postby merspieler » Thu Jun 03, 2021 7:07 pm

Gusting winds you can include in the metar 25013G23KN
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2241
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: METAR push for MP events

Postby Hooray » Thu Jun 03, 2021 7:10 pm

"pushing" basically assumes a listening socket (which isn't currently supported in fgdata space).
It would be pretty easy to expose the corresponding SGSocket* class to fgdata space, either via Nasal, XML, fgcommands or a via a dedicated property interface.

Then again, most people will be concerned about the potential security ramifications.

It should be MUCH easier, and safer, to modify the built-in metar checker to support an option to periodically query a configurable URL and check the time stamp/CRC or hash of the contents against the previous download

Speaking in general, since people mentioned dedicated hosting etc: none of that is needed, you could also use a standard MP setup and simply use one fgfs client as the METAR server, simply by running Phi there, adding the METAR info to $FG_ROOT/Phi/metar, opening the corresponding ports, and then share the IP/port number with your fellow MP pilots- in other words, once people are running fgfs, they already have everything they need to set up a METAR server locally. It would be pretty straightforward to put together an add-on so that Nasal and Canvas can provide a GUI dialog to configure/set up the metar node that way.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: METAR push for MP events

Postby benih » Thu Jun 03, 2021 9:19 pm

… and all this does not solve the initial root problem: how an atc can enforce custom metar onto nearby clients without any interaction on their side.
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: METAR push for MP events

Postby merspieler » Thu Jun 03, 2021 10:40 pm

it shouldn't be possible to "enforce" it... cause else -> abuse... there should alwas be the need to accep/opt in to receive the metar via MP... else you certainly see some trolls...
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2241
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: METAR push for MP events

Postby MariuszXC » Thu Jun 03, 2021 11:06 pm

benih wrote in Thu Jun 03, 2021 9:19 pm:… and all this does not solve the initial root problem: how an atc can enforce custom metar onto nearby clients without any interaction on their side.


I think it might be a misunderstanding. The idea was not about enforcing but about:

a) easy way of publishing METAR data for a group event,
b) easy way of joining such events by pilots (but always with consent).

Maybe I used the word 'push' incorrectly, but I meant 'an automated (METAR) offering, subject to user acceptance'.
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: METAR push for MP events

Postby Johan G » Fri Jun 04, 2021 9:25 am

This could be useful in other situations than the Wednesday group flights as well. A likely useful addition, would be to also be able to set a date and time offset from UTC.

A could see a package with a server and a FlightGear add-on that with an extra menu item and dialog that allow for syncing both weather and time with a few mouse clicks.

Preferably the addon-config.xml could allow for adding more than one server to sync METAR strings and time offset from, as I can easily see how this would be very useful for for example Operation Red Flag (OPRF) events. Currently we (OPRF) use use live weather during events and often an add-on that sets the time (not the UTC offset). In really bad visibility we often revert to setting fair weather.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: METAR push for MP events

Postby benih » Fri Jun 04, 2021 9:46 am

Good idea johan.
Honestly, i think it would be better implemented in the core, tough, so everyone had the option without further installation. It should be another option in the weather dialog in the launcher and in-sim.
For Syncing (aka server) we should use the existing mp protocol: this way any client (regardless of aircraft) could act as „server“. All that is needed is another property in the mp-tree which submits the time and weather data.
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit


Return to Add-ons

Who is online

Users browsing this forum: No registered users and 0 guests