Project

General

Profile

Library req » History » Version 21

Konrad Meier, 11/15/2011 03:12 PM

1 1 Triatmoko -
h1. Library requirement
2 1 Triatmoko -
3 1 Triatmoko -
h2. Python Library
4 1 Triatmoko -
5 2 Triatmoko -
h3. PJSUA Library
6 1 Triatmoko -
7 1 Triatmoko -
pjsua is an open source command line SIP user agent (softphone) that is used as the reference implementation for PJSIP, PJNATH, and PJMEDIA. Despite its simple command line appearance, it does pack many features!
8 1 Triatmoko -
9 1 Triatmoko -
This library use for SIP handler. More information about this library you will found in this site http://www.pjsip.org/pjsua.htm
10 1 Triatmoko -
11 3 Triatmoko -
How to use it and how to install will explain here: [[SIP| SIP Handler]]
12 3 Triatmoko -
13 3 Triatmoko -
h3. SSH
14 3 Triatmoko -
15 6 Triatmoko -
Secure Shell (SSH) is a network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers that it connects via a secure channel over an insecure network: a server (running an SSH server program) and a client (running an SSH client program).[1] The protocol specification distinguishes two major versions that are referred to as SSH-1 and SSH-2.
16 6 Triatmoko -
17 6 Triatmoko -
Instalation
18 6 Triatmoko -
19 6 Triatmoko -
<pre>
20 6 Triatmoko -
sudo apt-get install ssh
21 6 Triatmoko -
</pre>
22 6 Triatmoko -
23 6 Triatmoko -
We need to configure ssh connection to the client without typing password. This will be done with copying public key into the client. For more information how to configure, you can find in this tutorial "3 Steps to Perform SSH Login Without Password Using ssh-keygen & ssh-copy-id" by RAMESH NATARAJAN http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/
24 6 Triatmoko -
25 13 Konrad Meier
h3. install easy_install
26 13 Konrad Meier
27 13 Konrad Meier
<pre>
28 13 Konrad Meier
sudo apt-get install python-setuptools python-dev build-essential
29 13 Konrad Meier
</pre>
30 13 Konrad Meier
31 13 Konrad Meier
h3. Setproctitle 
32 3 Triatmoko -
33 5 Triatmoko -
The library allows a process to change its title (as displayed by system tools such as ps and top).
34 5 Triatmoko -
35 5 Triatmoko -
Changing the title is mostly useful in multi-process systems, for example when a master process is forked: changing the children's title allows to identify the task each process is busy with. The technique is used by PostgreSQL and the OpenSSH Server for example.
36 5 Triatmoko -
37 5 Triatmoko -
The procedure is hardly portable across different systems. PostgreSQL provides a good multi-platform implementation: this module is a Python wrapper around PostgreSQL code.
38 5 Triatmoko -
Installation
39 5 Triatmoko -
40 5 Triatmoko -
You can use easy_install to install the module: to perform a system-wide installation use:
41 5 Triatmoko -
42 5 Triatmoko -
<pre>
43 5 Triatmoko -
sudo easy_install setproctitle
44 5 Triatmoko -
</pre>
45 5 Triatmoko -
46 5 Triatmoko -
If you are an unprivileged user or you want to limit installation to a local environment, you can use the command:
47 5 Triatmoko -
48 5 Triatmoko -
<pre>
49 5 Triatmoko -
easy_install -d /target/path setproctitle
50 5 Triatmoko -
</pre>
51 5 Triatmoko -
52 5 Triatmoko -
Notice that easy_install requires /target/path to be in your PYTHONPATH.
53 5 Triatmoko -
54 5 Triatmoko -
Module content
55 5 Triatmoko -
56 5 Triatmoko -
The module exports the following functions:
57 5 Triatmoko -
58 5 Triatmoko -
<pre>
59 5 Triatmoko -
setproctitle(title)
60 5 Triatmoko -
</pre>
61 5 Triatmoko -
62 5 Triatmoko -
Set title as the title for the current process.
63 5 Triatmoko -
64 5 Triatmoko -
<pre>
65 5 Triatmoko -
getproctitle()
66 5 Triatmoko -
</pre>
67 5 Triatmoko -
68 5 Triatmoko -
Return the current process title.
69 5 Triatmoko -
70 5 Triatmoko -
More information about this library. http://pypi.python.org/pypi/setproctitle
71 5 Triatmoko -
72 10 Triatmoko -
h3. Serial port library
73 10 Triatmoko -
74 10 Triatmoko -
The serial port library is required for the cell phones to communicate with the server
75 10 Triatmoko -
computer and the BeagleBoards. The required library for Python can be installed by typing the following command:
76 10 Triatmoko -
77 10 Triatmoko -
<pre>
78 10 Triatmoko -
sudo apt-get install python-serial
79 10 Triatmoko -
</pre>
80 10 Triatmoko -
81 3 Triatmoko -
h3. MySQLdb
82 5 Triatmoko -
83 5 Triatmoko -
MySQLdb is an thread-compatible interface to the popular MySQL database server that provides the Python database API.
84 5 Triatmoko -
 _mysql is a low-level API similiar to the MySQL C API. ZMySQLDA is a Database Adapter for Zope2.
85 5 Triatmoko -
86 5 Triatmoko -
If you want to write applications which are portable across databases, use MySQLdb, and avoid using this module directly. _mysql provides an interface which mostly implements the MySQL C API. For more information, see the MySQL documentation. The documentation for this module is intentionally weak because you probably should use the higher-level MySQLdb module. If you really need it, use the standard MySQL docs and transliterate as necessary.
87 3 Triatmoko -
88 12 Triatmoko -
h3. pChart library
89 12 Triatmoko -
90 12 Triatmoko -
The pChart library is within our installation les and does not require to be installed individually. The library is only required if one uses the web interface and requires the generated resulting image. The library is open source and does not require any licensing. However, if one needs to learn how the library works, information can be found on the pChart web page http://www.pchart.net/
91 12 Triatmoko -
92 3 Triatmoko -
h2. PhpMyadmin
93 4 Triatmoko -
94 7 Triatmoko -
phpMyAdmin is a very famous MySQL mangement software package. To use it you should install and configure PHP, Apache and php mysql.
95 7 Triatmoko -
The easy way to install PhpMyadmin is installing from package using Apt-get command.
96 7 Triatmoko -
<pre>
97 7 Triatmoko -
sudo apt-get install phpmyadmin
98 7 Triatmoko -
</pre>
99 7 Triatmoko -
100 9 Triatmoko -
For detailed instructions on using repositories and package managers, please go to the site: https://help.ubuntu.com/community/phpMyAdmin
101 7 Triatmoko -
102 4 Triatmoko -
h2. MySQL Server
103 8 Triatmoko -
104 8 Triatmoko -
MySQL is a fast, multi-threaded, multi-user, and robust SQL database server. It is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.
105 8 Triatmoko -
106 8 Triatmoko -
h3. Installation
107 11 Triatmoko -
108 8 Triatmoko -
To install MySQL, run the following command from a terminal prompt:
109 8 Triatmoko -
<pre>
110 8 Triatmoko -
sudo apt-get install mysql-server
111 8 Triatmoko -
</pre>
112 8 Triatmoko -
113 8 Triatmoko -
During the installation process you will be prompted to enter a password for the MySQL root user.
114 8 Triatmoko -
115 9 Triatmoko -
Once the installation is complete, the MySQL server should be started automatically. More information, please see: https://help.ubuntu.com/11.04/serverguide/C/mysql.html
116 14 Konrad Meier
117 14 Konrad Meier
118 14 Konrad Meier
h1. Installation guide from Konrad
119 14 Konrad Meier
120 14 Konrad Meier
SSH
121 14 Konrad Meier
<pre>
122 14 Konrad Meier
apt-get install apache
123 14 Konrad Meier
</pre>
124 14 Konrad Meier
125 14 Konrad Meier
Python:
126 14 Konrad Meier
<pre>
127 14 Konrad Meier
apt-get install python python-serial python-setuptools python-dev build-essential
128 14 Konrad Meier
easy_install setproctitle
129 14 Konrad Meier
</pre>
130 14 Konrad Meier
131 16 Konrad Meier
Apache + php:
132 1 Triatmoko -
<pre>
133 16 Konrad Meier
apt-get install apache2 
134 16 Konrad Meier
apt-get install libapache2-mod-php5
135 17 Konrad Meier
a2enmod php5
136 17 Konrad Meier
/etc/init.d/apache2 restart
137 14 Konrad Meier
</pre>
138 14 Konrad Meier
139 14 Konrad Meier
MySQL:
140 14 Konrad Meier
<pre>
141 21 Konrad Meier
apt-get install mysql-server python-mysqldb php5-mysql php5-gd
142 14 Konrad Meier
</pre>
143 15 Konrad Meier
144 15 Konrad Meier
PJSUA
145 15 Konrad Meier
<pre>
146 15 Konrad Meier
wget http://www.pjsip.org/release/1.12/pjproject-1.12.tar.bz2
147 15 Konrad Meier
tar --bzip2 -xvf pjproject-1.12.tar.bz2
148 15 Konrad Meier
./configure && make dep && make
149 15 Konrad Meier
cd pjsip-apps/src/python/
150 15 Konrad Meier
make 
151 1 Triatmoko -
sudo make install
152 18 Konrad Meier
</pre>
153 18 Konrad Meier
154 18 Konrad Meier
155 18 Konrad Meier
Webserver-Config: 
156 18 Konrad Meier
(TODO)
157 18 Konrad Meier
see Report page 30 ff.
158 18 Konrad Meier
159 18 Konrad Meier
Database preparation:
160 18 Konrad Meier
<pre>
161 18 Konrad Meier
mysql -u root -p -h localhost
162 18 Konrad Meier
create databas gsmselftesting;
163 18 Konrad Meier
use mysql;
164 18 Konrad Meier
GRANT ALL PRIVILEGES ON gsmselftesting.* TO 'selftest'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
165 18 Konrad Meier
166 18 Konrad Meier
mysql -u selftest -p -h localhost -D gsmselftesting < gsmselftesting.sql
167 18 Konrad Meier
mysql -u selftest -p -h localhost -D gsmselftesting < InsertData.sql
168 18 Konrad Meier
</pre>
169 18 Konrad Meier
170 19 Konrad Meier
Change mysql login credentials in the code:
171 18 Konrad Meier
<pre>
172 1 Triatmoko -
vim Code/Server-Code/DbClass.py
173 19 Konrad Meier
</pre>
174 19 Konrad Meier
175 19 Konrad Meier
Chnage mysql login credentials in the website:
176 19 Konrad Meier
<pre>
177 19 Konrad Meier
vim /var/www-ssl/gsm-selftest/dbconnection.php
178 15 Konrad Meier
</pre>
179 20 Konrad Meier
180 20 Konrad Meier
181 20 Konrad Meier
182 20 Konrad Meier
Running the System:
183 20 Konrad Meier
<pre>
184 20 Konrad Meier
export DISPLAY=:0.0
185 20 Konrad Meier
./startSoftware.py
186 20 Konrad Meier
</pre>
187 20 Konrad Meier
188 20 Konrad Meier
<pre>
189 20 Konrad Meier
https://132.230.8.115
190 20 Konrad Meier
</pre>