Professional Documents
Culture Documents
General Note
The reader should know before reading that this Training Exercise Book is an additional document to the training and
has for aim to assist the customer in his practical training. Last but not least, this document is more a personal
reminder than a real and official document.
1
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
2
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
3
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
4
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
5
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
The most common command line editor is "vi". Start vi from the command line. vi has two modes, one editing mode
and other mode in which you can move within the file. To start editing the file use "i". Once you want to save: press
the Esc key (escape button) and write ":wq". If you want to exit without saving use ":q!".
Exercise V. Tail, pipe and grep tool & Appending information to a file
Difficulty:
HINT: Commands/tools that can be used during this exercise: cd, tail, echo, more, less, vi, nedit, grep, man, info
1. Navigate to the “orange” directory and using the grep command, search the “creation-file” for the word (or
pattern) “target”.
2. Using the command in step 1 and the “>” symbol, create a new document called “create.txt”
3. Read the content of “create.txt”
4. Using the command in step 1 and the “>>” symbol, append the result in “create.txt”
5. Read the content of “create.txt”. As you can notice, the “>” symbol creates and replaces any former file and the
“>>” symbol appends (or adds) any new information at the end of the file instead of replacing any former
content.
6. Read the last content of “create.txt” using “tail” with the follow option.
7. Open a second terminal window, navigate to “orange” and type: echo ‘Hello Target’.
8. Repeat step 7 but this time append the result in the “create.txt” file
9. Return to the first terminal, check for any new material. Cancel the tail command with Ctrl + C.
10. Using the command in step 6 and using the pipe symbol “ | ” as well as the command “grep”, search for the
word/pattern “target”.
11. Return to the second terminal; type: echo ‘Hello TarGEt’ >> create.txt.
12. Return to the first terminal; check any output. Cancel the tail command with Ctrl + C.
13. Use the command in step 10 but add an option to grep so that his search becomes non-case sensitive.
14. Repeat step 11.
15. Return to the first terminal and check for any output. Cancel the tail command with Ctrl + C.
16. Read the complete content of “create.txt”
6
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
7
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
8
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
9
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
Data Type File Owner File Group Last modified File Name
4. To build a script, you first need to create an empty file where you will type in your commands. Name it
“script.sh”
5. Open this file with either nedit or vi, and type the following lines:
#! /bin/ksh
#Author : Zorro
#Date : 25/08/2011
#Filename : script.sh
6. Lines starting with the “ # ” symbol will not be executed and are just hidden comment lines for an eventual file
reader. To launch this script, you will need to give the correct execution rights to your file (give at least the
execution right to the owner of the file). You can use the “chmod” command and the “ls” with the detailed
option to check that the rights were correctly taken into account
7. Once the execution rights are given to your script, you can type, if you are in /tmp, the line “./script.sh” or if
you have navigated elsewhere, use a direct or relative path as follows “/tmp/script.sh” or “../script.sh” etc etc…
8. Log in as root user and change the owner of your script to “root” and the file group to “supervisor” by using the
“chown” command. Do the same with the “green” directory and all the files contained in “green”. Check with
a detailed “ls” that the change has been made.
9. Revert to the former owner and file group.
10. Type “exit” to log-out from root user.
11. Edit your script so that it will now automatically create in /tmp a “red” directory, containing a “blue.sh” script
with execution rights for it’s owner.
12. Run your script and check with a detailed “ls” if the “blue.sh” and “red” have been correctly created.
10
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
Exercise X. Variables
Difficulty:
HINT: Commands/tools of this exercise: ls, vi, nedit, cat, chmod, man, pwd, date, info
1. Navigate to /tmp and copy “script.sh” to “zorro.sh”
2. Make sure that “zorro.sh” still has execution rights
3. Modify “zorro.sh” to contain the following:
#! /bin/ksh
#Author : Zorro
#Date : 25/08/2011
#Filename : zorro.sh
11
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
9. In the terminal, type “mount /dev/cdrom /media/test” if you inserted a CD-ROM or “mount /dev/<sdXX>
/media/test” if you inserted a USB (replace XX with the last values found in the dmesg command).
10. Navigate to /media/test and check it’s content.
11. Navigate to another directory outside of /media/test and exit all applications using files in /media/test
12. Type “umount /media/test” to unmount the volume. Now check the content of /media/test
13. To mount a virtual image (such as an ISO file), let’s assume you have a test.iso located in /tmp. You must then
type “mount –o loop /tmp/test.iso /media/test” instead of “mount /dev/cdrom /media/test”.
14. Navigate to /tmp/test and check content.
15. Unmount the virtual image from /media/test.
16. Create new directories “test2” and “test3” in /media and mount in “test” a CD-ROM, in “test2” an USB and in
“test3” an ISO image.
17. Check content of all three locations
18. Unmount all three locations and check that all three directories are now empty
19. Remove all three empty directories
20. Type “exit” to log-out from the root user.
12
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
The Linux tree structure is in many respects the same as the windows tree structure. Instead of C:\ as starting point of
the tree, Linux uses / (called “root” of the tree structure) as starting point.
To navigate through the directories, one can use direct or relative navigation. Direct navigation implies using the full
path of the location. For example: to move to a location in /usr/local/etc from anywhere in the system, you would have
to use “cd /usr/local/etc” as a direct link.
Relative navigation implies moving from your current position to this new position. For example: you are located
in /usr/local/etc/orange and want to navigate to /usr/local/etc, you will then use the command “cd ..” which is the
shortcut implying “move to my parent directory”.
Shortcuts are:
Exactly where I am (Linux replaces . with the value The home directory of my current user (example:
. ~
from the pwd command) user is supervisor, directory is /home/supervisor)
The directory directly before my current location, Root directory – this is the starting point of the tree
.. /
also known as the parent directory architecture
13
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
The touch command is used to change the time stamp (or last modification date) of a file. When no file exists, touch
will create an empty file with a time stamp.
The cp command will copy one or more files from their location to a target destination.
The mv command will move one or more files from their location to a target destination.
The rm command will remove one or more files from their location.
14
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
[supervisor@rcms /]$ cd ~
[supervisor@rcms ~]$ mkdir blue
[supervisor@rcms ~]$ ls .
blue Desktop exercises
[supervisor@rcms ~]$ mv blue /tmp/red
[supervisor@rcms ~]$ mv /tmp/creation-file /tmp/red/
[supervisor@rcms ~]$ mv /tmp/red ~/green
[supervisor@rcms ~]$ ls
Desktop exercises green
[supervisor@rcms ~]$ ls /tmp
15
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
16
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
Terminal 1 Terminal 2
[supervisor@rcms /]$ cd /tmp/orange/
[supervisor@rcms orange]$ grep target creation-file
Line 2 with the word target
[supervisor@rcms orange]$ grep target creation-file >
create.txt
[supervisor@rcms orange]$ ls
create.txt creation-file
[supervisor@rcms orange]$ more create.txt
Line 2 with the word target
[supervisor@rcms orange]$ grep target creation-file
>> create.txt
[supervisor@rcms orange]$ more create.txt
Line 2 with the word target
Line 2 with the word target
[supervisor@rcms orange]$ tail -f create.txt [supervisor@rcms /]$ cd /tmp/orange/
Line 2 with the word target [supervisor@rcms orange]$ echo 'Hello Target'
Line 2 with the word target Hello Target
Hello Target [supervisor@rcms orange]$ echo 'Hello Target' >>
create.txt
17
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
18
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
PC1 should have a route to PC2 with the address and mask 149.204.17.0/24 through the gateway 192.168.24.254
PC2 should have a route to PC1 with address and mask 192.168.24.0/24 through the gateway 149.204.17.94
19
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
20
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
21
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
The example here did not have a foreign machine available and therefore used 127.0.0.1 (localhost)
# Ground stations
# ---------------------------------------------------------
10.10.10.1 PhnomPenh Phnom-Penh phnompenh phnom-penh gs1
10.10.10.2 SiemReap Siem-Reap siemreap siem-reap gs2
10.10.10.3 StungTreng Stung-Treng stungtreng stung-treng gs3
#10.10.10.10 rcms
#255.255.255.0 mask
[supervisor@rcms green]$ ping -c4 -w10 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.273 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.038 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.063 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.039 ms
22
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
supervisor@rcms's password:
Last login: Thu Jul 28 12:31:53 2011
[supervisor@rcms ~]$ exit
Connection to rcms closed.
[supervisor@rcms green]$ ssh root@rcms
root@rcms's password:
Last login: Tue Jul 26 13:13:12 2011 from rcms
[root@rcms ~]# ls /
bin dev home local media mnt opt root selinux sys tmp var
boot etc lib lost+found misc net proc sbin srv tftpboot usr
[root@rcms ~]# touch /tmp/transfer
[root@rcms ~]# exit
[supervisor@rcms green]$ scp root@rcms:/tmp/transfer ~
root@rcms's password:
transfer 100% 0 0.0KB/s 00:00
[supervisor@rcms green]$ ls ~
Desktop exercises transfer
[supervisor@rcms green]$ ssh root@rcms "echo 'Hello from far far away' > /tmp/transfer"
root@rcms's password:
[supervisor@rcms green]$ scp root@rcms:/tmp/transfer ~/transfer2
root@rcms's password:
transfer 100% 24 0.0KB/s 00:00
[supervisor@rcms green]$ more ~/transfer2
Hello from far far away
[supervisor@rcms green]$
23
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
/tmp/green/:
total 4
lrwxrwxrwx 1 supervisor users 28 Jul 28 13:24 create.txt -> /tmp/green/orange/create.txt
lrwxrwxrwx 1 supervisor users 28 Jul 28 13:24 link2 -> /tmp/green/orange/create.txt
lrwxrwxrwx 1 supervisor users 17 Jul 28 13:20 link3 -> orange/create.txt
drwxr-xr-x 2 supervisor users 4096 Jul 28 13:10 orange
[supervisor@rcms tmp]$ touch script.sh
[supervisor@rcms tmp]$ vi script.sh
[supervisor@rcms tmp]$ more script.sh
#! /bin/ksh
#Author: Zorro
#Date: 25/08/2011
#Filename: script.sh
/tmp/:
total 24
drwxr-xr-x 3 root supervisor 4096 Jul 28 13:24 green
-rw-r--r-- 1 root root 174 Jul 28 13:30 ifcfg-eth0
-rw-r--r-- 1 root root 71 Jul 28 13:30 network
24
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
/tmp/green/orange:
total 8
-rw-r--r-- 1 root supervisor 95 Jul 28 13:13 create.txt
-rw-r--r-- 1 root supervisor 48 Jul 28 13:07 creation-file
[root@rcms ~]# chown -R supervisor:users /tmp/script.sh /tmp/green
[root@rcms ~]# exit
[supervisor@rcms tmp]$ vi script.sh
[supervisor@rcms tmp]$ more script.sh
#! /bin/ksh
#Author: Zorro
#Date: 25/08/2011
#Filename: script.sh
/tmp:
total 24
drwxr-xr-x 3 supervisor users 4096 Jul 28 13:24 green
-rw-r--r-- 1 root root 174 Jul 28 13:30 ifcfg-eth0
-rw-r--r-- 1 root root 71 Jul 28 13:30 network
drwxr-xr-x 2 supervisor users 4096 Jul 28 14:15 red
-rw-r--r-- 1 root root 48 Jul 28 13:30 route-eth0
-rwxr--r-- 1 supervisor users 176 Jul 28 14:15 script.sh
-rw-r--r-- 1 root root 24 Jul 28 13:49 transfer
[supervisor@rcms tmp]$
25
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
Variables permit you to save entries or values throughout a script. This is particularly useful when you want to build
generic means of doing tasks in different locations.
This is typically the first steps to developing software. For further use, please follow up on constructs using if, do,
while, how to do mathematical operations, how to use functions, etc…
The use of “cat <<-EOF”, further down in the example, is a trick to force the cat command to record everything it
sees until it meets the characters EOF.
26
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
#Date: 25/08/2011
#Filename: generate-script.sh
execshell=/bin/ksh
binpath=$(pwd)
fname=${1-default.sh}
EOF
[supervisor@rcms tmp]$
27
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
28
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
/media/test2:
MLAT-RPMS
/media/test3:
ADSB-CFG-CATS-CAMBODIA autorun Copyright installCPS.sh pkgs.txt repodata
[root@rcms /]# umount /media/test*
[root@rcms /]# ls /media/test*
/media/test:
/media/test2:
/media/test3:
[root@rcms /]# rm -r /media/test*
rm: remove directory `/media/test'? y
rm: remove directory `/media/test2'? y
rm: remove directory `/media/test3'? y
[root@rcms /]# exit
An alias is a way of building command shortcuts. Instead of typing a long command line like “snmpwalk –v3 –u
monitor –A 12monitor21 –l authNoPriv <hostname>:<port> snmpEngineID.0”, you could build an alias “blue” that
contains always the following “snmpwalk –v3 –u monitor –A 12monitor21 –l authNoPriv”. You could then type
“blue <hostname>:<port> snmpEngineID.0” to obtain the exact same result.
This is simply a way of making life easier for the user if he wants to work with shortcuts. Some users generally like to
have aliases such as:
alias cp=’cp –i’
alias rm=’rm –i’
alias mv=’mv –i’
[supervisor@rcms tmp]$ cd ~
[supervisor@rcms ~]$ pwd
/home/supervisor
[supervisor@rcms ~]$ ls
Desktop exercises transfer transfer2
[supervisor@rcms ~]$ ls -a
. .bashrc exercises .ICEauthority .neditdb .Xclients
.. .cache .gconf .lesshst .ssh .Xclients-default
.bash_history .config .gconfd .local .tools .xsession-errors
.bash_logout Desktop .gnome2 .mozilla transfer .zshrc
.bash_profile .dmrc .gnome2_private .nedit transfer2
[supervisor@rcms ~]$ more .bashrc
# .bashrc
29
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
30
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
31
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
32
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
General Check
9. Open a terminal window and connect to the GS by using the command “ssh gsmaint”
10. Type “tcpdump –i eth1 host <Host IP configured in step 5> and port <Port configured in step 5>”
11. If you see the screen outputting continuous data, then the ground station is sending data correctly. To exit this
continuous feed of information, press “Ctrl + C” simultaneously. If you do not see continuous data, this can
either mean that the GS is not receiving data (check the front panel LED) or the “GS → SPB3 → ADS-B” tab
to see if targets are seen (No. Of Targets field), or that you have wrongly configured the GS.
33
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
This exercise will show you how to access the local configuration and to force the system to take the changes into
account. This is however the “difficult” way since the Graphical User Interface (GUI) of the RCMS also does it
through the GS Manager.
==========================================================================
=
== ==
== Welcome to SPB3 RADIO ==
== ==
==========================================================================
=
root@FKORN-1# ls /
bin init mnt sbin sys usr
dev lib proc site.xml system.xml var
etc libexec root spb3.xml tmp
root@FKORN-1# more site.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE ConfigSite SYSTEM "/usr/local/mags/dtd/ConfigSite.dtd">
<ConfigSite id="ConfigSitePyG0CY">
<requestedExecutionMode>1</requestedExecutionMode>
<eventStatusChangeEnabled>true</eventStatusChangeEnabled>
<heartbeatEnabled>false</heartbeatEnabled>
<heartbeatPeriod>1</heartbeatPeriod>
<ptmAvailability>true</ptmAvailability>
<txAvailability>true</txAvailability>
<rawDataChannelEnabled>true</rawDataChannelEnabled>
<rawDataChannelName>RawData</rawDataChannelName>
[… extract from the terminal cut to save space in this document…]
<RFOverallScale>0.7</RFOverallScale>
<RFPoolSize>60</RFPoolSize>
<RFPoolTime>90</RFPoolTime>
</RF>
</Sync>
</ConfigSite>
root@FKORN-1# more system.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE ConfigSystem SYSTEM "/usr/local/mags/dtd/ConfigSystem.dtd">
34
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
<ConfigSystem id="ConfigSystem000">
<CentralMonitoringServers>
<CentralMonitoringServer id="CentralMonitoringServer000">
<ipAddress>10.110.56.201</ipAddress>
<name>cms1</name>
[… extract from the terminal cut to save space in this document…]
<GroundStation id="GroundStation042">
<sic>63</sic>
<sac>97</sac>
<ipAddress>10.110.56.2</ipAddress>
<posLatitude>48.8261505</posLatitude>
<posLongitude>9.1107197</posLongitude>
<posAltitude>370.33</posAltitude>
<modeSID>0x003C002B</modeSID>
<name>FKORN-1</name>
</GroundStation>
</GroundStations>
</ConfigSystem>
root@FKORN-1# more spb3.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE ConfigSPB3 SYSTEM "/usr/local/mags/dtd/ConfigSPB3.dtd">
<ConfigSPB3 id="ConfigSPB3MJY7nc">
<spb3FunctionMask>0</spb3FunctionMask>
<ptmFunctionMask>0</ptmFunctionMask>
<txFunctionMask>0</txFunctionMask>
<deviceID>deviceID0</deviceID>
<name>FKORN-1</name>
<rxTaskEnabled>true</rxTaskEnabled>
<asxTgtTaskEnabled>true</asxTgtTaskEnabled>
<asxStatusTaskEnabled>true</asxStatusTaskEnabled>
<txTaskEnabled>true</txTaskEnabled>
<thresholdTemperature>60</thresholdTemperature>
<gpsMode>1</gpsMode>
<maxReceiverRange>1000000</maxReceiverRange>
<trackstoreSize>1123</trackstoreSize>
<runGsApp>true</runGsApp>
<runGsSync>true</runGsSync>
<runGsDso>false</runGsDso>
<runGsSync>true</runGsSync>
<NTP id="NTPHmm1JR">
<ntpMode>0</ntpMode>
<NtpServers>
<NtpServer id="NtpServerI8yV5w">
<ntpServer>127.0.0.1</ntpServer>
</NtpServer>
</NtpServers>
</NTP>
</ConfigSPB3>
root@FKORN-1# exit
Connection to gsmaint closed.
[supervisor@lcmsX ~]$
35
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
This exercise will show you how to change the IP of the ground station, and to tell the system to take the changes into
account. This is however the “difficult” way since the Graphical User Interface (GUI) of the RCMS also does it
through the GS Manager.
==========================================================================
=
== ==
== Welcome to SPB3 RADIO ==
== ==
==========================================================================
=
root@FKORN-1# vi /etc/network
root@FKORN-1# netconfig
root@FKORN-1# ifconfig
eth0 Link encap:Ethernet HWaddr 00:09:CF:B4:05:2C
inet addr:192.168.23.1 Bcast:192.168.23.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:457 errors:0 dropped:0 overruns:0 frame:0
TX packets:280 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80035 (78.1 KiB) TX bytes:80403 (78.5 KiB)
Base address:0x2000
36
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
root@FKORN-1#
37
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
This shows how to use a script to make a global snapshot of the system and save the data on the RCMS.
Two elements will be new to this exercise: the “IF” condition and the “FOR” loop.
The IF condition works as follows: if the testing condition is True, then execute the script after the words “then”; if the
testing condition is False, then execute the script after the words “else”.
Syntax:
if [ TEST ]
then
Command line(s) to execute only if TEST is True
else
Command line(s) to execute only if TEST is False
fi
The FOR loop works as follows: starting from a certain number (variable parameter), execute the content inside the
loop, increment the number, and execute again until the number has reached his limit.
Syntax:
for (( Variable = Start value ; Variable <= Limit ; Variable+
+))
do
Command line(s) to execute (Limit – Start Value) times
done
38
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
Example of script for a simple solution (but subject to error reports if repeated multiple times) to exercise 15:
#! /bin/ksh
#Date: 27/01/2012
#Filename: configuration-saver.sh
#For this example, assume that the synonyms for ground stations are gs1, gs2, gs3
directory=”/home/supervisor/groundstation-backup”
mkdir $directory
mkdir $directory/gs1 $directory/gs2 $directory/gs3
#For this example, assume that the synonyms for ground stations are gs1, gs2, gs3
totalName=3
#The following line will let you choose the destination
#or will as set as backup /home/supervisor/groundstation-backup
directory=${1:-/home/supervisor/groundstation-backup}
39
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
supervisor@gs1 password:
site.xml 100% 6793 6.6KB/s 00:00
spb3.xml 100% 885 0.9KB/s 00:00
system.xml 100% 4125 4.0KB/s 00:00
Extracting gs2 files (spb3.xml, system.xml, site.xml)"
supervisor@gs2 password:
site.xml 100% 6793 6.6KB/s 00:00
spb3.xml 100% 885 0.9KB/s 00:00
system.xml 100% 4125 4.0KB/s 00:00
Extracting gs3 files (spb3.xml, system.xml, site.xml)"
supervisor@gs3 password:
site.xml 100% 6793 6.6KB/s 00:00
spb3.xml 100% 885 0.9KB/s 00:00
system.xml 100% 4125 4.0KB/s 00:00
Transfer is now complete
[supervisor@rcms tmp]$ ls ~/groundstation-backup/
gs1 gs2 gs3
[supervisor@rcms tmp]$ ls ~/groundstation-backup/gs*
/home/supervisor/groundstation-backup/gs1
site.xml spb3.xml system.xml
/home/supervisor/groundstation-backup/gs2
site.xml spb3.xml system.xml
/home/supervisor/groundstation-backup/gs3
site.xml spb3.xml system.xml
How to stop and start the GS application and to check it’s status.
==========================================================================
=
== ==
== Welcome to SPB3 RADIO ==
== ==
==========================================================================
=
root@GSName0# gs status
gsctrl with PID=1090 is running
root@GSName0# gs stop
Stopping gsctrl ..........
root@GSName0# gs status
gsctrl is not running
root@GSName0# gs start
gsctrl started as daemon
40
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
root@GSName0# exit
Connection to 192.168.24.200 closed.
[supervisor@rcms ~]$
===========================================================================
== ==
== Welcome to SPB3 RADIO ==
== ==
===========================================================================
root@GSName0# /mnt/app/gsapp -h
usage:
/mnt/app/gsapp <options>
-h = print this help
-d = run as daemon
-r = raw data output
-R = raw data output in debug mode
-a = asterix target data output
-s = asterix status data output
-p <port> = raw data input port
-u = use UTC system time instead of TOA
-x = log TX messages
-b = don't filter duplicate
-w = log duplicates
-A = suppress ACKs in RD output
-F <file> = log FPGA write-access to file
-c <maxSignalLevelDiff> = max. signal level [db] difference for Mode A/C pattern matcher,
default = 3.0, set to -1 if signal level shall be ignored
-m <nanoSeconds> = max. TOA jitter for Mode A/C pattern matcher, default 300ns
root@GSName0# /mnt/app/gsapp -a
FPGA::alloc
FPGA mapped to 30044000
ModeACPatternMatcher: 10 pattern(s) configured
TXThread started with TOA: 55385.513736204
Starting RXThread ... with PID 1518
Starting AdsbThread ... with PID 1519
Starting BiteThread ... with PID 1520
Starting TXThread ... with PID 1521
Starting Cat23WriterThread ... with PID 1522
Starting TstMsgThread ... with PID 1523
Starting SyncMsgThread ... PID 1524
41
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
root@GSName0# /mnt/app/gsapp -r
FPGA::alloc
FPGA mapped to 30044000
ModeACPatternMatcher: 10 pattern(s) configured
TXThread started with TOA: 55475.056177753
Starting RXThread ... with PID 1527
Starting AdsbThread ... with PID 1528
Starting BiteThread ... with PID 1529
Starting TXThread ... with PID 1530
Starting Cat23WriterThread ... with PID 1531
Starting TstMsgThread ... with PID 1532
Starting SyncMsgThread ... PID 1533
55475.550707|2| 0| 0|0|0|06|1|55475550024223|1|0|0|0|1|-75.0|0|0|A020078010000680A000003D257D|
55475.564687|2| 0| 0|0|0|06|1|55475563025754|1|1|0|0|1|-75.0|0|0|A020078010000680A000003D257D|
55475.577687|2| 0| 0|0|0|06|1|55475576590230|1|0|0|0|1|-75.5|0|0|A020078010000680A000003D257D|
55475.926706|2| 0| 0|0|0|05|1|55475925179621|1|0|0|0|1|-76.0|0|0|5F3D257D000000|
55475.933687|2| 0| 0|0|0|06|1|55475932386128|1|0|0|0|1|-76.0|0|0|A0001097F49A592D61D43B4CA803|
poll /dev/tx | rcv socket: Interrupted system call
user abort!
DUP: ModeS in: 13
DUP: ModeS out: 13
DUP: ModeAC in: 0
DUP: ModeAC out: 0
Pattern matched: 0
FPGA::release
FPGA::release done
root@GSName0# gs restart
root@GSName0# exit
Connection to 192.168.24.200 closed.
[supervisor@rcms ~]$
42
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
Preparation:
1. Using MTSC, open a CPS Manager.
2. Under “CPS → ADS-B → Output”, press the “Expand all” button.
3. Under “Channel / Report Mapping Table”, check that the Report for ADS-B Reports is enabled.
4. Under Report, look for an internal CAT21 channel and write down IP & Port number.
5. Close the CPS Manager.
Exercise:
1. In the toolbar at the bottom of the screen, press the second icon:
2. Select the “Asterix Recorder - AC21”
3. Select the “I/O Parameters” tab
a. Fill the “Read from interface” section with the IP and Port you previously wrote down
b. Make sure “Output to” has both “screen” and “file” boxes checked
c. In the section “Screen Mode” select “Verbose”
d. Under “File:” select the destination to save your file. For example, you could use /tmp/record.txt
4. Select the “Screen Output” tab
a. Press the red button on the top left corner.
b. Wait 1 minute and make sure you see targets being recorded
c. Press the stop button (where the red button was located)
5. Using a terminal or the File Manager, check that your file exists and contains data.
6. Close the Recording tool
1. In the toolbar at the bottom of the screen, press the second icon:
2. Select “Technical Situation Display – TSD”.
3. Under “Display”, select “Details”. A panel will open on the left side with information left blank.
4. Under “Display”, make sure that “Contributing Receivers” is selected.
5. Navigate on the map.
6. Under “Help → Reference”, you will find a detailed overview of different actions possible.
7. Close the Short Reference.
8. Under “Preferences → Interfaces”, you can see all selected interfaces that are displayed on the map.
9. Uncheck all enabled boxes except mlat-plots-val-int.
10. Select an aircraft.
11. Notice the yellow dotted lines signalling the contributing receivers
12. Notice the information in the Target Details panel has been added:
13. Re-enable the enabled boxes you uncheck previously
14. Under “Tracks → Plot Shape” and change the shape. Notice the difference on the map.
15. Under “Tracks → Plot Size” and change the size. Notice the difference on the map.
16. Under “Tracks → History” and change the time of display. Notice the difference on the map.
17. Under “Tracks → Speed Vector” and change the time length of the vector. Notice the difference on the map.
18. Close the Technical Situation Display
43
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
1. In the toolbar at the bottom of the screen, press the second icon:
2. Select the “Asterix Replayer - AP21”
3. Select the “I/O Parameters” tab
a. Make sure that “Replay data of either:” has “ASCII” selected.
b. Make sure the “file” button is selected.
c. Make sure the target file is the file recorded in the first exercise of this chapter (ex: /tmp/record.txt ).
d. Under “Send ASTERIX data to:”, make sure that “Host:” has “localhost” and “Port:” has “1337”.
e. Make sure that the box “Log replayed data to screen output size:” is checked.
f. Make sure that “Screen mode:” has “Verbose”.
4. Select “Screen Output” tab
a. Press the play button.
b. Make sure data are being shown, and then press the Stop button.
5. Close the Replay tool.
1. In the toolbar at the bottom of the screen, press the second icon:
2. Select the “Technical Situation Display – Configuration”
3. On the left side panel, go to “DisplayConfig → Interface”
4. You will see on the left side panel a list of all current Interfaces listened to by the TSD. On the right side panel,
you will find an “Add a new 'ItfParameter' element”. Click on this button
a. New panel opens, and under “Interface:” check the “Enabled” box.
b. Under “Incoming interface:”, make sure that “localhost” is the target.
c. Under “Incoming port:”, make sure that “1337” is the target.
d. Using the color wheel, choose a color you wish to see on the TSD for your data replay.
e. Under “Opacity:”, select a value higher than 0 (for example: 100)
5. On the bottom right, click on the "Apply" button
6. Go to “File → Save”
7. Close the “Technical Situation Display – Configuration” window
8. Using your knowledge of previous exercises,
a. Open a new Technical Situation Display.
b. Make sure that the only Enabled interface is the one you have configured in step 4. ( HINT: for this,
you will need to consult the interface menu of the TSD)
c. Open a Replay Tool for Asterix data Category 21
d. Replay data to the IP: “localhost” with the port “1337”
9. As long as your data replay is running, you should see targets on your TSD with the color you set in step 4.
44
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
1. Practice Chapter 8.2: Configuration of a Ground station and add a new ground station to the system
2. Practice Chapter 8.4: Removal of a Ground station and remove the new ground station from the system
1. Practice Chapter 8.6: LDAP User Configuration of the Software User Manual
45
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013
46