Board index FlightGear Support Interfacing

"Out of Fuel" message with networked Flightgear  Topic is solved

Connecting two computers, using generic protocol, connecting with Matlab?

"Out of Fuel" message with networked Flightgear

Postby specky » Sat May 23, 2020 4:56 am

Hello everyone.

I am setting up a basic multiple monitor scenario using multiple PCs across a LAN, each displaying various views out the cockpit, or of the instruments etc, and have been following these guides:

* Multiple Monitors in FlightGear: Quick and Dirty
* Flightgear wiki: Slaving for Dummies
* Flightgear wiki: Howto:Multi-computing FlightGear

Using the following:
    * Flightgear 2019.1.1 running on Ubuntu 20.04 LTS
    * Default Cessna c172P, default airport & runway

I am able to get instances of Flighgear running across different computers slaved off a single master, however each of the slaves display the messages while on the ground and after the engine has been started
Cabin temperature falling below 32F/0C!
and
Out of fuel!
respectively as per the attached screenshot. These messages do not appear on the master.

Flightgear works fine otherwise, from the master I am able to start the engine, take off, fly around etc, and the view on the slaves stay in sync (except for the Out of Fuel / Cabin temperature messages, which continue to appear only on the slaves).

A minimal set of commands to reproduce this, with master on 192.168.1.70 and a single slave on 192.168.1.71 are:

Master:
Code: Select all
FG_ROOT=/usr/share/games/flightgear FG_HOME=/home/chris/.fgfs /usr/games/fgfs \
    --aircraft=c172p \
    --enable-auto-coordination \
    --timeofday=morning \
    --enable-fullscreen \
    --enable-terrasync \
    --prop:/sim/terrasync/http-server=http://flightgear.sourceforge.net/scenery \
    --enable-real-weather-fetch \
    --native-fdm=socket,out,60,192.168.1.71,5510,udp \
    --native-ctrls=socket,out,60,192.168.1.71,5511,udp \
    --httpd=8080 \
    --fg-aircraft=/home/chris/.fgfs/Aircraft


Slave:
Code: Select all
FG_ROOT=/usr/share/games/flightgear FG_HOME=/home/chris/.fgfs /usr/games/fgfs \
    --aircraft=c172p \
    --enable-auto-coordination \
    --timeofday=morning \
    --enable-fullscreen \
    --enable-terrasync \
    --prop:/sim/terrasync/http-server=http://flightgear.sourceforge.net/scenery \
    --enable-real-weather-fetch \
    --fov=66.7
    --prop:/sim/view[0]/config/heading-offset-deg=-70 \
    --prop:/sim/view[0]/config/pitch-offset-deg=0 \
    --fdm=null \
    --native-fdm=socket,in,60,,5510,udp \
    --native-ctrls=socket,in,60,,5511,udp \
    --fg-aircraft=/home/chris/.fgfs/Aircraft


I have tried this between Windows Masters & Slaves, OSX Masters and Slaves, and on Flightgear version 2018.3.5, and the result is always the same.

Has anyone else seen or experienced this issue?
Is there a switch or flag that I am missing?
Is this not supported by the default aircraft?
Is there any other troubleshooting you suggest I do?

Thanks

Image
specky
 
Posts: 3
Joined: Sat May 23, 2020 4:32 am

Re: "Out of Fuel" message with networked Flightgear

Postby wlbragg » Mon May 25, 2020 4:04 pm

I'll test as soon as I can. If able, you might want to create an issue at https://github.com/c172p-team/c172p/issues
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: "Out of Fuel" message with networked Flightgear

Postby wlbragg » Mon May 25, 2020 5:50 pm

Good news is I was able to duplicate your setup and get the same results. Bad news is I have never used this type of setup and have no idea how these connections are supposed to behave.

I noticed the slave has no access to the fuel and payload.
The controls such as fuel selector setting are not being passed from master to slave or vice verse.

The properties causing the fuel notice are
Code: Select all
    var leftTankUsable  = getprop("/consumables/fuel/tank[0]/selected") and getprop("/consumables/fuel/tank[0]/level-gal_us") > 0;
    var rightTankUsable = getprop("/consumables/fuel/tank[1]/selected") and getprop("/consumables/fuel/tank[1]/level-gal_us") > 0;
    var outOfFuel = !(leftTankUsable or rightTankUsable);

    # We use the mixture to control the engines, so set the mixture
    var usePrimer = getprop("/controls/engines/engine/use-primer") or 0;

    var engine_running = getprop("/engines/active-engine/running");

    if (outOfFuel and (engine_running or usePrimer)) {
        print("Out of fuel!");
        gui.popupTip("Out of fuel!");
    }


The properties /consumables/fuel/tank[0]/level-gal_us and /consumables/fuel/tank[1]/level-gal_us are = 0 in the slave so that alone triggers the popup.

How are these properties supposed to be passed to the slave or back to master? Are you missing a networking parameter or are the controls in the c172p not being registered correctly to the network systems?

I am assuming these are the mechanisms for that...
Code: Select all
--native-fdm=socket,out,60,192.168.1.71,5510,udp \
--native-ctrls=socket,out,60,192.168.1.71,5511,udp \

Specifically native-ctrls logically appears to be the one to handle the controls being passed? Interior animations nor properties don't appear to pass though.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: "Out of Fuel" message with networked Flightgear

Postby wlbragg » Mon May 25, 2020 5:55 pm

More reading may be required?
http://wiki.flightgear.org/Howto:Multi-computing_FlightGear
"enable-panel" does exactly what it says: it's enabling the instrument panel. That's what we want here


Just a guess, may not be what you want.


Nope, not anything helpful.

Here's what I think. Both of those notices are are property driven events that happen when certain conditions are met. I'm not sure what method is needed to suppress those messages when the simulator is acting as slave as it is in this instance.
We need more information on how this is supposed to work. Is there a property anywhere in the tree that indicates the model or FDM is getting its input from UDP or master? If so then we could condition the message display to not show in this case.

We need some input from someone experienced with this type of FG communication as to the proper approach.

Let me post the question to the mailing list and see if we can get some help wit this.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: "Out of Fuel" message with networked Flightgear

Postby Hooray » Tue May 26, 2020 9:03 am

without a proper solution, why don't you simply sync/copy the relevant set of properties to the slave or disable the message altogether ?

(I do agree however that the whole master/slave feature may need a proper review/update some day, it's kinda become an ugly stepchild over the years :lol: )

EDIT: Thinking about it a little more, the problem exists in other places, too - so what's needed is a property to differentiate between single/master/slave setups (i.e. the execution mode of a single fgfs instance) - at that point, you can condition computations to execute locally or fetch a corresponding property set from the master instance. It might be a good idea to reach out to AndersG, since he has extensive experience developing the dual-pilot feature, so maybe he can provide additional insight/ideas - he might also be able to review a corresponding patch set :D

Actually, Richard's opinion would also be good to have here, because Anders implemented all of his work on top of MP (generic properties), whereas Richard has now implemented Emesary. And that would seem like a perfect fit here. Also, Erik has repeatedly brought up the idea of "remote properties", i.e. properties (trees) that live in another instance of fgfs, which is obviously relevant in the context of master/slave setups where you have a need to fetch state from a master instance.

In other words, I am pretty sure we can work out a proper solution by reaching out to the corresponding people :wink:
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: "Out of Fuel" message with networked Flightgear

Postby wlbragg » Tue May 26, 2020 9:48 am

without a proper solution, why don't you simply sync/copy the relevant set of properties to the slave or disable the message altogether ?

Not sure what you mean. The slave is a running instance of the c172p without an FDM of its own and without any "ctrls", whatever that entails. It supposedly receives those portions from the master. It contains code to display messages but not the controlling properties because we never envisioned this type of implementation.

The proper solution in my opinion is to add another condition to the offending messages that will suppress them if the instance is a slave.

It may be that simple, but I have never worked with this before and thus I don't know what properties, if any, are available that might be used for this. Or maybe there is already a method to suppress messages. Or possibly the slaves are not configured fully. I have no background with this so I am operating in the blind here.

without a proper solution

I don't know if there is a proper solution available for this or not. Thus why I am asking on the mailing list.

simply sync/copy the relevant set of properties to the slave

It's not that simple. For one, we don't want to deal with fuel in the slave at all and we don't want any messages displayed on the slave screen in any event.

or disable the message altogether

Only on the slave computer ,that's the problem. The messages are working correctly on the master and we still want them.
This is the equivalence of writing MP code that behaves accordingly depending on if the aircraft is local or a remote.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: "Out of Fuel" message with networked Flightgear

Postby Hooray » Tue May 26, 2020 9:52 am

How about introducing a new "mode" property for standalone, master, slave - so that you can read that property and use that in slave mode to disable whatever you don't want ?
That should be a quick fix, right ?

Like you say, it's and old feature and one that isn't widely tested unfortunately - but it is indeed an important feature, and one that would deserve to be fleshed out (some day) - for now, you could work out an aircraft specific solution, defaulting the property to "standalone" - and whenever people are using master/slave setups, they'd honor that property.

Once that works reasonably well, it'd be worth moving this to $FG_ROOT/Nasal, i.e. a generic solution - and possibly reach out to Anders/Erik and Richard in order to come up with an Emesary based version that doesn't need any manually implemented heuristics
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: "Out of Fuel" message with networked Flightgear

Postby wlbragg » Tue May 26, 2020 9:56 am

so what's needed is a property to differentiate between single/master/slave setups (i.e. the execution mode of a single fgfs instance) - at that point, you can condition computations to execute locally or fetch a corresponding property set from the master instance.

Exactly. I understand the issue completely. I simply don't know what is available.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: "Out of Fuel" message with networked Flightgear

Postby wlbragg » Tue May 26, 2020 9:59 am

How about introducing a new "mode" property for standalone, master, slave

That's what I am looking for, how do I determine what type if instance this session is?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: "Out of Fuel" message with networked Flightgear

Postby Hooray » Tue May 26, 2020 9:59 am

Just make it available, either per-aircraft or via $FG_ROOT/Nasal

and then document a new option for people wanting master/slave setups to specifiy:

--prop:/sim/fgfs-mode=master
--prop:/sim/fgfs-mode=client

in your -set.xml file, you can default it to "standalone", i.e. ignore all master/slave stuff, and use getprop("/sim/startup-mode", "standalone")

That way you are delegating it to the user/launcher to specify the desired startup mode

Once that works, it's trivial to add this to the corresponding hard-coded protocols (1 lines of C++ code)
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: "Out of Fuel" message with networked Flightgear

Postby wlbragg » Tue May 26, 2020 10:01 am

One of my concerns though is if there is already methods in place to handle these types of issue? Such as we have a structure for MP that is not readily visible to the casual developer. Not looking to reinvent the wheel.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: "Out of Fuel" message with networked Flightgear

Postby Hooray » Tue May 26, 2020 10:03 am

No, that's unlikely - it really has become an ugly stepchild, I think Curt implemented most of this in the early 2000s, but we can check the sources to be sure.

But even if that were the case, it'd be easy to fix up any properties if it should turn out that someone designed a really clever scheme but simply forgot to document it.

You say, you raised this on the devel list - so they might even want to introduce dedicated command line arguments for standalone/master/slave, and then take it from there to flesh out what's needed in the various subsystems
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: "Out of Fuel" message with networked Flightgear

Postby wlbragg » Tue May 26, 2020 10:08 am

Maybe there is already a property in the tree I can use to condition an event without having to do anything. Something that --fdm=null \ is causing to be added to the tree?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: "Out of Fuel" message with networked Flightgear

Postby wlbragg » Tue May 26, 2020 10:10 am

No, that's unlikely - it really has become an ugly stepchild,

OK, that is actually helpful to know the lack of details in the documentation is because there are none. :lol:
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: "Out of Fuel" message with networked Flightgear

Postby wlbragg » Tue May 26, 2020 10:12 am

Code: Select all
--prop:/sim/fgfs-mode=master
--prop:/sim/fgfs-mode=client

That is actually all I need.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Next

Return to Interfacing

Who is online

Users browsing this forum: No registered users and 1 guest