1 | |
---|
2 | |
---|
3 | OVERVIEW |
---|
4 | |
---|
5 | This document describes the installation procedure for the Flarm-Radar Client |
---|
6 | on a Raspberry PI running Raspbian. At the time of writing this document, this |
---|
7 | is the only platform where the client has been tested over a long time period |
---|
8 | in a production-like environment. |
---|
9 | |
---|
10 | However, the client can be installed on any operating system where |
---|
11 | Perl (http://www.perl.org) is available. Some customising might be required |
---|
12 | in this case. |
---|
13 | |
---|
14 | |
---|
15 | REQUIREMENTS |
---|
16 | |
---|
17 | Note: Early versions of Raspbian had a nasty bug that caused minicom to freeze |
---|
18 | the entire system after some hours or days of operations. Don't forget to |
---|
19 | update the OS before starting with the installation. |
---|
20 | |
---|
21 | 1. Log on the Raspberry (as user 'pi') and install required dependencies |
---|
22 | -> $ sudo apt-get update && apt-get install zip dnsutils libwww-perl minicom |
---|
23 | |
---|
24 | 2. Connect the Flarm to the Raspberry and start minicom |
---|
25 | -> $ sudo minicom -s |
---|
26 | |
---|
27 | 3. Configure communication settings for minicom (tty, baud rate, etc.). Save the |
---|
28 | configuration file, exit and restart mincom (no parameters) to see the data |
---|
29 | stream. Once the configuration is correct and the Flarm Device is |
---|
30 | turned on, you must be able to see live position data when you start minicom: |
---|
31 | |
---|
32 | $ sudo minicom |
---|
33 | .... |
---|
34 | $GPRMC,123512.00,A,4710.24781,N,00902.46662,E,0.017,237.67,240312,,,A*6E |
---|
35 | $GPGGA,123512.00,4710.24781,N,00902.46662,E,1,8,1.40,413.2,M,48.0,M,,*6E |
---|
36 | $PFLAA,0,-118,-85,1,1,4B51BC,0,,0,0.1,1*1E |
---|
37 | $PFLAA,0,-35,-124,2,1,4B51FF,158,,0,0.1,1*14 |
---|
38 | $PFLAU,2,1,1,1,0,,0,,*61 |
---|
39 | $GPRMC,123513.00,A,4710.24782,N,00902.46659,E,0.002,237.67,240312,,,A*60 |
---|
40 | $GPGGA,123513.00,4710.24782,N,00902.46659,E,1,8,1.40,413.1,M,48.0,M,,*67 |
---|
41 | .... |
---|
42 | |
---|
43 | If you reach that: Congratulations, you're nearly done :-) |
---|
44 | |
---|
45 | |
---|
46 | INSTALLATION |
---|
47 | |
---|
48 | Installation is possible via software package or manually, the second option |
---|
49 | is for advanced users. |
---|
50 | |
---|
51 | Installation via Software Package |
---|
52 | |
---|
53 | 1. Download and unzip the client from http://www.flarmradar.ch/public/dist/pkg |
---|
54 | -> $ wget http://www.flarmradar.ch/public/dist/client/pkg/flarmclient_<version>_all.deb |
---|
55 | |
---|
56 | 2. Install the package |
---|
57 | -> $ sudo pkg -i flarmclient_<version>_all.deb |
---|
58 | |
---|
59 | |
---|
60 | Manual Installation |
---|
61 | |
---|
62 | 1. Create a new account named 'flarm' |
---|
63 | -> $ sudo useradd -m --system flarm |
---|
64 | |
---|
65 | Note1: This account does not need a password (because you might loose it and |
---|
66 | it is safer anyway). |
---|
67 | |
---|
68 | 2. Make sure that the user 'flarm' has permissions to read from the device |
---|
69 | that was previously configured in minicom. If RS232-USB adapter is used, then |
---|
70 | this is /dev/ttyUSB0, or alike. It is usually sufficient to assign the user |
---|
71 | with an additional secondary group. |
---|
72 | |
---|
73 | 3. Change identity to 'flarm' |
---|
74 | -> $ sudo su - flarm |
---|
75 | |
---|
76 | 4. Download and unzip the client from http://www.flarmradar.ch/public/dist |
---|
77 | -> $> wget http://www.flarmradar.ch/public/dist/client-<version>.zip |
---|
78 | -> $> unzip flarmclient-<version>.zip |
---|
79 | |
---|
80 | |
---|
81 | CONFIGURATION |
---|
82 | |
---|
83 | The client reads a single configuration file /etc/flarmclient.conf |
---|
84 | |
---|
85 | 1. Set the a client key. If you use your own server, then you are free to set |
---|
86 | your own key. To use the public server, request a key at info@flarmradar.ch |
---|
87 | with the following information: |
---|
88 | o) ICAO-Code of your airport/airfield |
---|
89 | o) Short Name (will appear in the menu) |
---|
90 | o) Elevation (in mAMSL) |
---|
91 | o) Antenna level (in mAGL) |
---|
92 | o) Email Address of a responsible person/organization |
---|
93 | |
---|
94 | 2. Configure the URL of the flarm server. If you use the public server, then |
---|
95 | you can leave the default value. |
---|
96 | |
---|
97 | 3. Configure the serial device: |
---|
98 | - serial_device = /dev/AMA0 (if you are using the UART port) |
---|
99 | - serial_device = /dev/ttyUSB0 (if you are using a USB-Serial adapter) |
---|
100 | |
---|
101 | TEST THE INSTALLATION |
---|
102 | |
---|
103 | 1. Download a file containing sample data for testing |
---|
104 | -> $ wget https://secure.netzschmiede.ch/trac/flarmradar/browser/core/trunk/client/data/2012_03_25_departure.data |
---|
105 | |
---|
106 | 2. Start the client as user 'flarm', use the test file from above for testing |
---|
107 | $> sudo -u flarm flarmclient -f 2012_03_25_departure.data |
---|
108 | |
---|
109 | The client must run without errors and stream the data to the server. Check on |
---|
110 | the server while the client is processing the data file. |
---|
111 | |
---|
112 | 3. Connect the FLARM device and run the client software |
---|
113 | $> flarmclient |
---|
114 | |
---|
115 | ... if all goes well, you can see live data on your radar. Congratulations! |
---|
116 | |
---|
117 | |
---|
118 | INTEGRATION |
---|
119 | |
---|
120 | We must make sure that the client starts automatically after booting the |
---|
121 | device. |
---|
122 | |
---|
123 | If the client was installed via software package, then you find |
---|
124 | a working example in /etc/cron.d/flarmclient. Remove the hash(#)-character |
---|
125 | at the beginning of the first line. The cron-job then periodically checks if |
---|
126 | the client is up and restarts it if necessary. This is useful for a device |
---|
127 | that is installed on the field where you don't have direct access to restart |
---|
128 | the process. |
---|
129 | |
---|
130 | Alternatively, use a runlevel script to start the client at boot time. Many |
---|
131 | examples for this can be found in the internet. |
---|