summaryrefslogtreecommitdiffstats
path: root/vorlagen/thesis/src/kapitel_A.tex
blob: cea6e90771f343450dc1ab0a8ea3e410981ab1e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
\addchap{Appendix}
\section{Installation and configuration guide}
In order to evaluate the localization system, it is required to install OpenBSC
and to modify the proper source files and compile the system. The aim of this
section is to describe that process in such detail that the presented material is
sufficient to reproduce equivalent or similar results. The guide 
was successfully tested out on the following operating systems: 
Ubuntu 10.04 LTS 64 bit and Ubuntu 12.04 LTS 64 bit. A self-bootable test 
USB system is supplied with the thesis and it can be evaluated without executing
the given steps in A.1.
\subsection{Installation of OpenBSC}
In order to compile OpenBSC it is required to install the following precompiled
packages\footnote{If more details are required for the installation process a guide can be found at \citep{openbscInstall}.}:

\begin{itemize}\addtolength{\itemsep}{-0.8\baselineskip}
\item libdbi0
\item libdbi0-dev
\item libdbd-sqlite3
\item libortp-dev
\item build-essential
\item libtool
\item autoconf
\item automake
\item git-core
\item pkg-config
\end{itemize}

Before installing the required packages and libraries, to keep the
installation process clean and free of modifying other files, the
author will create a new directory. 
\begin{lstlisting}[backgroundcolor=\color{light-gray}]
mkdir gsm_localization
cd gsm_localization
\end{lstlisting}


By executing the following instructions the required libraries will be installed. 
\begin{lstlisting}[backgroundcolor=\color{light-gray}]
sudo apt-get install libdbi0-dev libdbd-sqlite3 build-essential
sudo apt-get install libtool autoconf automake git-core
sudo apt-get install pkg-config libortp-dev
\end{lstlisting}

After the packages were installed, \textit{libosmocore} library must be downloaded, compiled and installed.
By executing the following instructions: 
\begin{lstlisting}[backgroundcolor=\color{light-gray}][numbers = none]
git clone git://git.osmocom.org/libosmocore.git
cd libosmocore
autoreconf -fi
./configure
make
sudo make install
sudo ldconfig
cd ..
\end{lstlisting}

In the next step \textit{libosmo-abis} will be installed. 
\begin{lstlisting}[backgroundcolor=\color{light-gray}][numbers = none]
git clone git://git.osmocom.org/libosmo-abis.git
cd libosmo-abis
autoreconf -fi
./configure
make
sudo make install
sudo ldconfig
cd ..
\end{lstlisting}

After the previous steps have finished successfully, the author will
proceed with downloading, compiling and installing OpenBSC.
\begin{lstlisting}[backgroundcolor=\color{light-gray}][numbers = none]
git clone git://git.osmocom.org/openbsc.git
cd openbsc/openbsc
autoreconf -i
sudo export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure
make
\end{lstlisting}

At this point, OpenBSC should be successfully compiled. 
\newpage
\subsection{Configuring nanoBTS for OpenBSC}
To enable the nanoBTS and OpenBSC to be fully operational, the last configuration
steps have to be made. It is necessary to inform the nanoBTS of the IP address of 
the server that is running OpenBSC since it must connect to OpenBSC. We need
to find a free ARFCN channel where our system is
expected to operate\footnote{A licence has to be obtained from the Federal
Network Agency (German: \textit{Bundesnetzagentur}), otherwise it is ilegal and may
be considered as a criminal act.}. 

To find the ID and the IP address of the nanoBTS it is required to
start \textit{ipaccess-find}\footnote{The nanoBTS ought to be blinking in orange color
before starting \textit{ipaccess-find}.}.
\begin{lstlisting}[backgroundcolor=\color{light-gray}][numbers = none]
cd ~/gsm_localization/openbsc/openbsc/src/ipaccess
./ipaccess-find
\end{lstlisting}
\textit{ipaccess-find} will produce an output similar to the one given:
\begin{lstlisting}[backgroundcolor=\color{light-gray}][numbers = none]
Trying to find ip.access BTS by broadcast UDP...
MAC_Address='00:02:95:00:61:70'  IP_Address='132.230.4.63'
Unit_ID='1801/0/0'  Location_1=''  Location_2='BTS_NBT131G' 
Equipment_Version='165g029_73' 
Software_Version='168a352_v142b30d0'  
Unit_Name='nbts-00-02-95-00-61-70'  
Serial_Number='00110533'
\end{lstlisting} 
In the next step, the nanoBTS is informed of the OpenBSC IP
address by typing the following commands (the first IP address 
belongs to the server running OpenBSC and the second to the nanoBTS):
\begin{lstlisting}[backgroundcolor=\color{light-gray}][numbers = none]
cd ~/gsm_localization/openbsc/openbsc/src/ipaccess
./ipaccess-config -o 132.230.4.65 132.230.4.63 -r
\end{lstlisting}

It is required to create the directory where the configuration file
will be located and to modify the configuration file.
\begin{lstlisting}[backgroundcolor=\color{light-gray}][numbers = none]
sudo mkdir /usr/local/lcr
cd ~/gsm_localization/openbsc/openbsc/doc/
cd examples/osmo-nitb/nanobts 
sudo cp openbsc.cfg /usr/local/lcr
sudo vim /usr/local/lcr/openbsc.cfg
\end{lstlisting}

A free ARFCN channel can be found using a spectrum analyzer and by
setting the frequency range to the GSM frequency band. One 
has to slide through the frequencies shown on the X-axis,
and by looking at the Y-axis with appropriate frequency 
resolution\footnote{The frequency resolution must be set to 
$f_{CB}=200 \,\mathrm{KHz}$ or more for faster movement in the
frequency spectrum.}, where the received power is represented\footnote{
Dependent of the manufacturer and settings of the spectrum analyzer,
it can show signal amplitude, magnitude and power.}. By patiently
observing the Y-axis it can be easily seen on the X-axis which channels are
taken by other GSM service providers and which are free. The chosen channel
ought to be peak free. Once a free frequency channel has been found, it is
necessary to instruct the nanoBTS to operate in that frequency range.
The line, numbered 58, has to be modified with the
correct free ARFCN channel,in this case 877\footnote{
A table with frequency channels can be found at the following URL:
\url{https://gsm.ks.uni-freiburg.de/arfcn.php} or it can be calculated
using the given formulas $f_{up}(ARFCN) = f_{start}+f_{CB}\cdot(ARFCN-Offset)$,
for the uplink where $f_{start}=1710.2 \,\mathrm{MHz}$ is the starting frequency
of the uplink bandwitdh for DCS1800, $f_{CB}=200 \,\mathrm{KHz}$ is the channel
bandwidth and $Offset=512$; whereas for downlink
$f_{down}(ARFCN) = f_{start}+f_{CB}\cdot(ARFCN-Offset)$ where 
$f_{start}=1805.2 \,\mathrm{MHz}$ and the rest of the variables remain same.}.
\begin{lstlisting}
arfcn 877
\end{lstlisting}
On line 53, the last configuration file modification has to be made.
The Unit ID from the output above has to be set\footnote{Indentation has to match the one of the configuration file.}. 
\begin{lstlisting}
ip.access unit_id 1801 0
\end{lstlisting}
At this point the nanoBTS and OpenBSC configuration is done. 

\newpage
\subsection{Installation and configuration of GNSS assistance software}
To install the RRLP software that generates GNSS assistance data several
libraries are required to be installed, \textit{cURL}\footnote{It may happen that
the given download URLs are wrong and in the meantime have changed, but one
can easily find the latest versions on \url{http://curl.haxx.se/} and \url{http://www.hyperrealm.com/libconfig/}}, 
\textit{libconfig} and \textit{SQLite}. \textit{cURL} was used
for the purpose of safely downloading GNSS data from the 
Navigation Center of the US Coast Guard and Trimble server. \textit{libconfig}
library is used for reading in the configuration file, this
way compiling of the software whenever one changes the settings was avoided. The
\textit{SQLite} library was employed to access the database used by OpenBSC to
store the respondence data from the mobile stations.
\begin{lstlisting}[backgroundcolor=\color{light-gray}][numbers = none]
cd ~/gsm_localization
sudo apt-get install libsqlite3-dev
wget http://curl.haxx.se/download/curl-7.25.0.tar.gz
wget http://www.hyperrealm.com/libconfig/libconfig-1.4.8.tar.gz
tar -xvzf curl-7.25.0.tar.gz
tar -xvzf libconfig-1.4.8.tar.gz
cd curl-7.25.0
make
sudo make install
cd ..
cd libconfig-1.4.8/
./configure
make
sudo make install
\end{lstlisting}
Once the libraries have been successfully installed, the user may proceed 
with the configuration and compiling the GNSS assistance software, which is the
key software produced in this thesis. 
\begin{lstlisting}
// An example configuration file for the GNSS RRLP software.
name = "Configuration for GNSS and RRLP";

// Change the settings if required:
settings =
{
  config = ( { 
    ephemeris_url  = "ftp://ftp.trimble.com/pub/eph/CurRnxN.nav";
    almanac_url = "http://www.navcen.uscg.gov/ ?pageName=currentAlmanac&format=yuma";
    latitude_of_BTS  = 48.003601;
    longitude_of_BTS    = 7.848056; 
    altitude_of_BTS  = 0.0; 
    uncertainty_of_lat_long  = 7; 
    uncertainty_of_alt  = 7; 
    confidence_level    = 0; 
    ephemeris_repair  = false; 
    use_reference_time  = false; 
    extra_seconds_to_add  = 7; 
    timezone_of_BTS  = 1; 
    time_to_refresh_ephem = 1;
    time_to_refresh_alm = 1 ; } );
};
\end{lstlisting}

\newpage

\section{Sourcecode}
Beispiel:
\lstset{%
caption=,%
label=lst:example,%
}
\begin{lstlisting}
#include <stdio.h>
 
int main(void)
{
    printf("Hallo Welt!\n");
    return 0;
}
\end{lstlisting}