- 1 Presentation
- 2 How to get POW source code ?
- 3 Installation of the POW server
- 4 Installation On each Paparrazi system to connect to Internet
- 5 The web Interface
- 6 Some clues about how that it works
POW means Paparazzi On the Web. This software package provides a web interface for Paparazzi users. The application allows to watch and pilot a drone on a web browser via Internet. Current realease is version 2.0.
The system is mainly based on Java technology. It is divided in 3 parts : one running on the ground station, and the others on a server machine.
On Paparazzi side
Paparrazi drones are connected to the server via a software bus named ivy and a java application.This application listens to messages broadcasted on the Ivy bus and send them to a server via an udp channel. The udp channel is secured with an AES encryption. An web user connected to POW can be either an administrator, a authorized user or a visitor :
- a authorized user can watch all the drone on the map and pilot some drones.
- a administrator user can watch all the drone on the map, pilot all the drones and manage user accounts.
- a visitor can only watchs the drones on the map.
How to get POW source code ?
It is available on github : pow repo
- The source for the ivy client (link between Paparazzi and Internet). You have to get those 2 files :
- The source for the server (relay on the ground station). You have to get those 2 files :
Installation of the POW server
Setup Tomcat 6
- You have to install 2 package : tomcat6 and tomcat6-admin : sudo apt-get install tomcat6 tomcat6-admin
- Then you have to create an admin account in /etc/tomcat6/tomcat-users.xml .You just have to insert following lines :
- <role rolename="manager"/>
- <role rolename="admin"/>
- <user username="yourlogin" password="yourpassword" roles="admin,manager"/>
- Add or uncomment the line in /etc/tomcat6/server.xml to activate the connector that listen to apache (this will open the port 8009; change this value accordingly to your workers.properties settings):
- <Connector port="8009" redirectPort="8443" protocol="AJP/1.3" />
- Restart the server with sudo /etc/init.d/tomcat6 restart
- You can now access the 'Hello World' page : http://localhost:8080
- To install the server application, just open the admin page of the server : http://localhost:8080/manager. Now you just have to deploy the site which is packed into the file ServletPow.war
- Now you are able to access to the login page of the web site : http://localhost:8080/ServletPow
Setup Apache 2
- You have to install Apache2 package : sudo apt-get install apache2
- Now you can access to the 'Hello World' page via http://localhost
Link between Apache 2 and Tomcat 6
To link both servers, you have to setup a connector on the apache server named mod jk. It will redirect all the web request targeting our web site from the Apache server to the Tomcat server.
- you have to install 2 package : sudo apt-get install apache2-mpm-prefork libapache2-mod-jk
- In /etc/apache2/mods-available, you have to create a jk.load file if it doesn't exist with the following content :
- LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
- JkWorkersFile /etc/apache2/workers.properties
- LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
- In /etc/apache2, you have to create a workers.properties file if it doesn't exist with the following content :
- Be sure that the path to tomcat6 and java match your installation.
- Now you have to activate the module and restart the Apache server :
- sudo a2enmod jk
- sudo /etc/init.d/apache2 restart
An other tutorial can be found here.
Enabling SSL features
To enabling SSL features you have to follow 2 steps :
- create a SSL certificate with the command :
- sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -out /yourSSLfolder/server.crt -keyout /yourSSLfolder/server.key
- that create to files in yourpath folder : server.crt and server.key. You will be prompt for various information but the ones that really matters is the common name (CN). Be sure that you put in common name, the domain name of your server machine as it will be access via internet (ex : yourmachine or www.pow.fr).
- enable the module with : sudo a2enmod ssl
Configuring the web site for Apache
So that the web site was accessible via Apache, we now have to setup a virtualhost.
- To do that you have to insert into a file pow_ssl.conf the following lines :
- NameVirtualHost *:443
- <VirtualHost *:443>
- ServerAdmin firstname.lastname@example.org
- ServerName yourmachine
- LogLevel warn
- CustomLog /var/log/apache2/access.log combined
- ServerSignature On
- SSLEngine on
- SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
- SSLCertificateFile /yourSSLfolder/server.crt
- SSLCertificateKeyFile /yourSSLfolder/server.key
- SSLCACertificatePath yourSSLfolder
- SetEnvIf User-Agent ".*MSIE.*" \
- nokeepalive ssl-unclean-shutdown \
- downgrade-1.0 force-response-1.0
- JkExtractSSL On
- JkOptions +FlushPackets
- JkOptions +FlushHeader
- JkMount /ServletPow worker1
- JkMount /ServletPow/* worker1
- Be sure you set yourmachine (www.pow.fr) and yourSSLfolder parameters in accordance with your installation.
- Then you have to restart Apache : /sudo /etc/init.d/apache2 restart'
- 1nstall mysql on your server, you have to install the mysql-server package : sudo apt-get install mysql-server
- You will be prompt to enter a password for the root user.
- Thanks to this password you can access to the mysql_client with mysql -u root -p.
- Create the database for POW with the command source yourRealPath/pow_sql_maker.sql where pow_sql_maker.sql is the script which creates the database.
Now you have created a mysql user that can only access to the pow_sql database :
- login : pow_user
- password : pwdpow_user
Configuring the Application
When you have installed all these stuffs, your server installation is now almost complete.
The web interface is designed around a Google maps V2. In order to use it in your own website you have to ask a key to Google via http://code.google.com/intl/fr/apis/maps/signup.html. The key you will get has to be inserted in the Interface.jsp code that you will find in /var/lib/tomcat6/webapps/ServletPow/Interface.jsp.
Now it's really finished !
Three accounts have been created:
- An ivy client account (login:admin_ivy and password:pwdadmin_ivy) to connect a Paparazzi system to the server.
- A web user client account (login:admin and password:pwdadmin) which has got the administrator rights. This administrator can create users via the admin page accessible on the web interface.
- A mysql account so that the server could access to mysql database (login:pow_user and password:pwdpow_user).
To configure the application with your own parameter you can edit the configuration file (/var/lib/tomcat6/webapps/ServletPow/conf/pow_conf.xml)
Starting the server
Now to validate your installation , restart both Tomcat and Apache.
You should now access to the web site via https://yourmachine/ServletPow and have the following page on your browser.
Be sure that udp ports (8535 and 8536 by default) are reachable from the internet, otherwise the Paparazzi client will not be able to send data to the server.
Installation On each Paparrazi system to connect to Internet
You need to have Paparazzi installed. That won’t be detailed here, I think you can find the instructions by yourself on this site. To Install the java programm which connects Paparazzi to the server, there are two steps to follow :
- Fetch the SSL certificate of the server
- compile and launch InstallCert.java with the name of server as a parameter (ex : java InstallCert www.pow.fr).
- That creates a file named jssecacerts that you have to copy into your jvm security folder (/usr/lib/jvm/java-6-xxx/jre/bin/security)
- Launch the module : you just have to start it with the command java -jar pow_ivyclient.jar.
The following fields have to be completed:
- hostname : the name of the pow server (yourmachine or www.pow.fr)
- login : ask the administrator of the server to have them.
- password : ask the administrator of the server to have them.
The folowing fields are visible only if you press the More button and should normally not be changed.
- site name : the name of the webapplication on the server (only if you change the original configuration).
- servlet name : the name of the servlet which manage the login process (only if you change the original configuration).
- port : a specific port to connect to the server (only if you change the original configuration).
- protocol : a specific protocol to connect to the server (only if you change the original configuration).
The web Interface
Some clues about how that it works
- The application is designed around a Pushlet Framework (see http://www.pushlets.com). That allow data to be pushed by the server to all web clients without any request from web client. It based on a subscriber/publisher pattern. When a web client is connected to the server. It subscribes to a subject and then, all data related to this subject are sent directly to the user by the server (the publisher). Thus data are not to be store on the server. It's almost like streaming.
- Inside the server we use Java Servlet Technology, that's why we use a Tomcat server.
- On the interface you can see some of JQuery capabilities (the tabs and the sliders). To get more see http://jqueryui.com.