Difference between revisions of "Server"

From PaparazziUAV
Jump to navigation Jump to search
m (url bug)
(Running server and GCS on different hosts)
 
Line 8: Line 8:
== Options ==
== Options ==
   -b Bus Default is 127.255.255.255:2010
   -b Bus Default is 127.255.255.255:2010
   -hostname <hostname> Set the address for the http server
  -http        Send http: URLs (default is file:)
   -http Send http: URLs (default is file:)
   -hostname     <hostname> Set the address for the http server
   -kml Enable KML file updating
   -port        <port> Set http port for serving XML and KML files (default is 8889)
   -kml_no_http KML without web server (local files only)
   -kml         Enable KML file updating
   -kml_port Port for KML files (default is 8889)
   -kml_no_http KML without web server (local files only)
   -n Disable log
   -n            Disable log
   -timestamp    Bind on timestamped messages
   -no_md5_check Disable safety matching of live and current configurations
   -no_md5_check Disable safety matching of live and current configurations
   -replay_old_log Enable aircraft registering on PPRZ_MODE messages
   -replay_old_log Enable aircraft registering on PPRZ_MODE messages
   -help Display this list of options
   -help         Display this list of options
   --help Display this list of options
   --help       Display this list of options


== Export KML to Google Map==
== Running server and GCS on different hosts ==
It is useful to export Flight information to Google Map. you can show basic flight information in google map cross platform through IP network.
Upon startup the [[GCS]] requests the <tt>CONFIG</tt> message from the server, which contains the URLs to the aircraft configuration files.<br/>
Normally these are sent as file URLs, e.g. ''file:///home/user/paparazzi/conf/airframes/your_airframe.xml''.


You will need a webserver runing in the GCS computer, for python simpleHTTPServer:
Which implies that you need the exact same configuration files on the computer where you start the GCS.


''cd ~/paparazzi/''
=== Serving XML files via http ===
Usually the nicer solution is to serve the XML files (flight plan, settings, etc) via http from the host running the server.


  ''python -m SimpleHTTPServer''
To do that, start server with the <tt>-http</tt> option and set the hostname/ip with <tt>-hostname host</tt>, e.g.
server -http -hostname 192.168.0.100
and start a http server that serves the contents of the paparazzi directory (Http Server from the Tools menu in Paparazzi Center), or:
cd ~/paparazzi/
  python -m SimpleHTTPServer 8889
to check if it works, you can open [http://192.168.0.100:8889 http://192.168.0.100:8889] in your webbrowser where you should see the contents of the paparazzi directory.
Or use netstat to see if 8889 port is opened for listening:
netstat -l|grep 8889


== Export KML to Google Maps ==
It is useful to export Flight information to Google Map. you can show basic flight information in google map cross platform through IP network.


to check if it work, you should see 8000 port is opened for listening.
You will need a webserver runing in the GCS computer, see above.
 
-''netstat -l|grep 8000''
 


Then in Paparazzi center, excute a session. Pass some parameters to server agent:
Then in Paparazzi center, execute a session. Pass some parameters to server agent:


  ''server -kml -kml_port 8000 -hostname 192.168.0.100(replace with you paparazzi center IP address)''
  ''server -kml -hostname 192.168.0.100(replace with you paparazzi center IP address)''




It's done. Now in any computer in the network, open browser to access <nowiki>http://192.168.0.100:8000/var/aircrafts/(you AC name)/</nowiki>
It's done. Now in any computer in the network, open browser to access <nowiki>http://192.168.0.100:8889/var/aircrafts/(you AC name)/</nowiki>
you will see FollowMe.kml file, open it with Google earth. you will be able to see the real time flight information. the information updated are:
you will see FollowMe.kml file, open it with Google earth. you will be able to see the real time flight information. the information updated are:



Latest revision as of 10:27, 17 July 2015

The server (in sw/ground_segment/tmtc/) is an agent that logs, distributes, and preprocesses messages for the GCS and other agents as described in the system overview.

See DevGuide/Server_GCS_com for the communication between the server and the GCS.

Options

 -b Bus	Default is 127.255.255.255:2010
 -http         Send http: URLs (default is file:)
 -hostname     <hostname> Set the address for the http server
 -port         <port> Set http port for serving XML and KML files (default is 8889)
 -kml          Enable KML file updating
 -kml_no_http  KML without web server (local files only)
 -n            Disable log
 -timestamp    Bind on timestamped messages
 -no_md5_check Disable safety matching of live and current configurations
 -replay_old_log Enable aircraft registering on PPRZ_MODE messages
 -help         Display this list of options
 --help        Display this list of options

Running server and GCS on different hosts

Upon startup the GCS requests the CONFIG message from the server, which contains the URLs to the aircraft configuration files.
Normally these are sent as file URLs, e.g. file:///home/user/paparazzi/conf/airframes/your_airframe.xml.

Which implies that you need the exact same configuration files on the computer where you start the GCS.

Serving XML files via http

Usually the nicer solution is to serve the XML files (flight plan, settings, etc) via http from the host running the server.

To do that, start server with the -http option and set the hostname/ip with -hostname host, e.g.

server -http -hostname 192.168.0.100

and start a http server that serves the contents of the paparazzi directory (Http Server from the Tools menu in Paparazzi Center), or:

cd ~/paparazzi/
python -m SimpleHTTPServer 8889

to check if it works, you can open http://192.168.0.100:8889 in your webbrowser where you should see the contents of the paparazzi directory. Or use netstat to see if 8889 port is opened for listening:

netstat -l|grep 8889

Export KML to Google Maps

It is useful to export Flight information to Google Map. you can show basic flight information in google map cross platform through IP network.

You will need a webserver runing in the GCS computer, see above.

Then in Paparazzi center, execute a session. Pass some parameters to server agent:

server -kml -hostname 192.168.0.100(replace with you paparazzi center IP address)


It's done. Now in any computer in the network, open browser to access http://192.168.0.100:8889/var/aircrafts/(you AC name)/ you will see FollowMe.kml file, open it with Google earth. you will be able to see the real time flight information. the information updated are:

 1. AC lat, lon, alt
 2. Flight Plan
 3. current route

Kml export.png