Telnet usage: Difference between revisions

Jump to navigation Jump to search
1,712 bytes added ,  26 March 2013
(→‎Interfacing with other programs: http://www.mail-archive.com/flightgear-devel@flightgear.org/msg26269.html)
Line 33: Line 33:


== Starting FlightGear with Telnet Server ==
== Starting FlightGear with Telnet Server ==
For example, to start FlightGear and open the port 5401 as available telnet server use this command:
(Note if you want to use an SSH client like putty, you'll need to disable the SSH mode, FG does NOT support SSH, it only supports the raw telnet mode!)
fgfs --telnet=5401


Note if you want to use an SSH client like putty, you'll need to disable the SSH mode, FG does NOT support SSH, it only supports the raw telnet mode!
Now, start up FlightGear with the following option: --telnet=5401 (or pick your favorite port number) Once FlightGear is up and running, go to an xterm/shell on the same machine running flightgear and type "telnet localhost 5401". You could do this from any machine on the net by substituting the appropriate machine name/ip-address. From the telnet session hit enter or type "help" to get a list of available commands. You can now remotely navigate through the property structure and examine and change values in the live running copy of FlightGear. This is very powerful (although low bandwidth) and allows you to set and change a huge range of values in FlightGear.
 
Even better, it's pretty easy to automate a remote telnet session so you can write scripts or code that can remotely control FlightGear in various ways. I've written a commercial operator GUI that interfaces to FlightGear in this way. I've scripted (perl) out all the FAA Level 3 FTD certification tests in this way (setting up initial conditions, reseting the FDM, enabling/adjusting autopilot modes, and even remotely manipulating control surfaces when needed.)
 
And you can use the same mechanism to adjust view parameters, configure weather settings, time of day, etc.
 
The only draw back is that it's low bandwidth. It's good for setting a few parameters at a relatively low rate, it's good for interactive use, it's good for many remote scripting tasks, but you don't want to use it to try to blast a bunch of position/orientation data in real time. We have other interfaces better suited for that.
 
I should also point out that we have an html version of the telnet interface "--httpd=5400" that allows you to connect up to a live copy of FlightGear from any web browser and interact with the sim. Just type in a url like this: "http://localhost:5401/";


== Connect with Telnet Client ==
== Connect with Telnet Client ==

Navigation menu