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