Howto:Multi-computing FlightGear: Difference between revisions

Jump to navigation Jump to search
Typo
(Adding "Reflux")
(Typo)
Line 1: Line 1:
FlightGear has some very powerful functions which are (IMHO) quite disregarded: distributing the property tree via LAN (local area network). Thinking long about this feature I finally came to the conclusion to connect several computers in my LAN to react like one single FlightGear system.
FlightGear has some very powerful functions which are (IMHO) quite disregarded yet: distributing the property tree via LAN (local area network). Thinking long about this feature I finally came to the conclusion to interconnect several computers in my LAN to react like one single FlightGear system.


== Entrée ==
== Entrée ==
Advantages:
Advantages:
* distributing the load of several calculations from one local CPU to multiple other machines
* Distributing the load of several calculations from one PC to multiple machines
* attaching more screens for a more realistic simulation experience
* Attaching more screens for a more realistic simulation experience
* "cleaning up your screen" to see scenery on the screen(s) of your (graphically) most powerful machine and instruments on more weakly computers
* "Cleaning up your screen" to see scenery on the screen(s) of your (graphically) most powerful machine and instruments on more weakly computers
* add more advantages here...
* Add more advantages here...


Disadvantages:
Disadvantages:
* costs, as you need more computers, screens, network cables / wireless access points
* Costs, as you need more computers, screens, network equipment
* higher power consumption
* Higher power consumption
* more space for placing all devices
* More space for placing all devices


Ergo: low WAF (wife acceptance factor)
Ergo: low WAF (wife acceptance factor)
Line 18: Line 18:
So what is needed for multi-computing FlightGear?
So what is needed for multi-computing FlightGear?


* basic knowledge in networking (IP address, subnet mask)
* Basic knowledge in networking (IP address, subnet mask, protocols, network sockets, firewall, etc.)
* min. two computers (use the Operating System of your choice; I prefer using Linux and/or Windows, Mac may work too, though I don't have any knowledge about it)
* At least two computers (use the Operating System of your choice; I prefer using Linux and/or Windows, Mac may work too, though I don't have any knowledge about Macs)
* Switch / Access Point / Hub (yikes!) for interconnecting all participating devices (think of enough network cables if you decide to use a Switch or Hub)
* Switch / Access Point / Hub (yikes!) for interconnecting all participating devices (think of enough network cables if you decide to use a Switch or Hub)
I advise to use a modern 8-port Gigabit Switch which is quite low in price nowadays and will not give you too much headache in solving weird issues in your LAN. Select one from you favorite brand. The hardware differences in this price segment are only marginal.
I advise to use a modern 8-port Gigabit Switch which is quite low in price nowadays and will not give you too much headache in solving weird issues in your LAN. Choose your favorite brand. The hardware differences in this price segment are only marginal.


== Appetizer: Interconnecting your computers ==
== Appetizer: Interconnecting your computers ==
Line 28: Line 28:
== Main Dish: The Master Machine ==
== Main Dish: The Master Machine ==
I decided to make my most powerful computer to become a master for FlightGear. It's name is "leader" with IP 192.168.1.10, it runs on Ubuntu Lucid x64 and comes with a neat NVidia GTX260 and 5.1 sound output. This will be my:
I decided to make my most powerful computer to become a master for FlightGear. It's name is "leader" with IP 192.168.1.10, it runs on Ubuntu Lucid x64 and comes with a neat NVidia GTX260 and 5.1 sound output. This will be my:
* data sending instance (more of this later)
* Data sending instance (more of this later)
* scenery presenter
* Scenery presenter
* Joystick / Yokes / controller input
* Joystick / Yokes / Controller input
* sound output
* Sound output


Install FlightGear just like you would do on any other system. Make sure to have the corresponding FlightGear data folder and some [[Howto: Install scenery|scenery data]] if you are not flying on-line using [[TerraSync]], what I strongly suggest to do.
Install FlightGear just like you would do on any other system. Make sure to have the corresponding FlightGear data folder and some [[Howto: Install scenery|scenery data]] if you are not flying on-line using [[TerraSync]], what I strongly suggest to do.
Line 39: Line 39:
  --native-fdm=socket,out,60,192.168.1.11,5510,udp
  --native-fdm=socket,out,60,192.168.1.11,5510,udp
  --native-ctrls=socket,out,60,192.168.1.11,5511,udp
  --native-ctrls=socket,out,60,192.168.1.11,5511,udp
"socket" tells FlightGear how to present the data (here: as a network socket). "out" defines that the data is outgoing from "leader" to the slave(s). "60" is the update frequency in Hz (= updates per second). This must be set identically on all machines or you will get weird jitter. Regard the use of '''two different ports (5510 and 5511)''' for the two different UDP sockets we are creating here for sending data to 192.168.1.11.
* "socket" tells FlightGear how to present the data (here: as a network socket)
* "out" defines that the data is outgoing from "leader" to the slave(s)
* "60" is the update frequency in Hz (= updates per second). This must be set identically on all machines or you will get weird jitter
* "192.168.1.11" is the destination machine(s) where you want to send your data to
* Regard the use of '''two different ports (5510 and 5511)''' for the two different UDP sockets we are creating here for sending data to 192.168.1.11


In case of using a second slave (assuming IP 192.168.1.12):
In case of adding a second slave (assuming IP 192.168.1.12):
  --native-fdm=socket,out,60,192.168.1.12,5510,udp
  --native-fdm=socket,out,60,192.168.1.12,5510,udp
  --native-ctrls=socket,out,60,192.168.1.11,5511,udp
  --native-ctrls=socket,out,60,192.168.1.11,5511,udp
Regard the use of the IP 192.168.1.12 for sending the data to Slave #2. All further slaves follow the same principle.
Regard the use of the IP 192.168.1.12 for sending the data to Slave #2. All further slaves follow the same principle.


Now it's time to fire up "leader" the first time with the new settings at your favorite airport with you favorite aircraft. Watch carefully if you see any errors in console output as this will give you precious hints if you made any mistakes in the IO configuration. If all works fine just let it run idle for a while as we now set up the first slave and can test it's connectivity right away.
Now it's time to fire up "leader" the first time with the new settings at your favorite airport with you favorite aircraft. Watch carefully if you see any errors in console output as this will give you precious hints if you made any mistakes in the IO configuration. Double check IP addresses, socket ports and protocol settings. If all works fine just let "leader" run idle for a while as we now set up the first slave and can test it's connectivity right away.


== Side Dish: The Slave Machine(s) ==
== Side Dish: The Slave Machine(s) ==
After setting up "slave1" with IP 192.168.1.11 ("slave2" 192.168.1.12, etc.), connecting it to your LAN and installing FlightGear it's time to take care of some startup parameters. I don't use FGRun on the slaves therefor I don't provide screenshots like I did for "leader":
After setting up "leader" we will now configure "slave1" with IP 192.168.1.11 ("slave2" 192.168.1.12, etc.), connecting it to your LAN and installing FlightGear. It's time to take care of some startup parameters. I don't use FGRun on the slaves therefor I don't provide screenshots like I did for "leader":
  --native-fdm=socket,in,60,,5510,udp
  --native-fdm=socket,in,60,,5510,udp
  --native-ctrls=socket,in,60,,5511,udp
  --native-ctrls=socket,in,60,,5511,udp
Line 63: Line 67:
* "native-fdm" and "native-ctrls" are now sockets using the "in" parameter because they do listen on your network interface for incoming traffic.
* "native-fdm" and "native-ctrls" are now sockets using the "in" parameter because they do listen on your network interface for incoming traffic.
'''!!! Make sure to configure your firewall to accept incoming traffic on the above mentioned protocols/ports/sender IPs !!!
'''!!! Make sure to configure your firewall to accept incoming traffic on the above mentioned protocols/ports/sender IPs !!!
* "update frequency, port and protocol" are identical to the settings of "leader". Regard '''two commas''' between frequency and port. This is where normally the IP is placed and here intended. Now the socket "listens" on your configured IP (on "slave1" 192.168.1.11) and on localhost (which is always 127.0.0.1 and used for internal networking). If you want that FlightGear is just listening on your external interface you may add the address instead so you get line like:
* "update frequency, port and protocol" are identical to the settings of "leader". Regard '''two commas''' between frequency and port. This is where normally the IP is placed and two commas here are intended because now the socket "listens" on your configured IP (on "slave1" 192.168.1.11) and on localhost (which is always 127.0.0.1 and used for internal networking). You can verify this on the slave by opening a console window and use If you want that FlightGear is just listening on your external interface you may add the address instead so you get line like:
  --native-fdm=socket,in,60,192.168.1.11,5510,udp
  --native-fdm=socket,in,60,192.168.1.11,5510,udp
* "fdm=null" tells FlightGear not to use any flightmodel as this is given by "leader"
* "fdm=null" tells FlightGear not to use any flightmodel as this is given by "leader"
Line 84: Line 88:


== Reflux: Do's, Dont's and Despair ==
== Reflux: Do's, Dont's and Despair ==
* Until now I was only able to use the 2D panel of the default aircraft Cessna 172 independent of what aircraft I start with. In times of 3D cockpits it seems not very easy to find fresh 2D panels.
<br>
Please write down your findings and personal experiences here...
Please write down your findings and personal experiences here...
<br>
<br>
172

edits

Navigation menu