How to setup a client on RPi

Requirements:

Download and extract

Open a shell

1. Create a new directory and change to this directory.

mkdir /home/pi/modesfiltered
cd /home/pi/modesfiltered


2. Download the tool.

wget https://www.live-military-mode-s.eu/Rpi/modesfiltered.zip

3. Extract the files from zip-file

unzip modesfiltered.zip

4. Copy the start script "modes.sh" to /etc/init.d/.

sudo cp /home/pi/modesfiltered/modes.sh /etc/init.d/

5. Make it executable

sudo chmod +x /etc/init.d/modes.sh

Configure the client

Location
Much of the site is automated. Please take a look at this list for Abbreviations For Country Wikipedia ISO 3166-1 alpha-2 and use the ALPHA-2 code assigned to your country. This will help to show your logs at the correct sub page.

example: Munich, DE

6. Open the file with an editor:

nano variables.txt

enter your location town and country code

exit the editor with CTRL+O followed by CTRL+X

7. Check your local time date

If the time is not properly set, do raspi-config.

8. Start the script with sudo service modes.sh start

9. To always run the service at system start enter: sudo update-rc.d modes.sh defaults

Check function

10. Check the logfile: cat /var/log/modes.log

The result should begin like this:

# Mode-S logger Version 11 started.
# Using 127.0.0.1:30003 as host.
# Elements found in blacklist file: 12
# [3C4, 4CA, 3C7, 3C6, 3C5, 489, 4B1, 400, 484, 471, 440, 45A]
# Elements found in whitelist file: 9
# [3E, 3F, AE, A3, AD, 3B, 4D, 15, 43]
# Elements found in blacklist callsign file: 79
# [AAL, ADR, AIB, AFL, AFR, AMT, ASL, AUA, AUI, AWU, AZA, BAW, BEE, BEL, BER, BMR, CAL, CAO, CES, CFG, CHH, CHX, CLW,
# CLX, CMP, COA, CSA, CSN, CTN, DAL, DEO, DLH, EIN, ELO, ELY, ENT, EXS, EWG, ETH, EZY, FIN, GMI, GWI, HAL, HLX, IBK,
# ISR, JEA, KAL, KLM, LDA, LLP, MSC, NAX, NLY, NWA, PGT, PIA, QTR, ROT, RUS, RYR, SAS, SKS, SRN, SWR, SXS, TCX, THA,
# THY, TOM, TRA, UPS, VIM, VIR, VLG, VKG, WZZ, 2BB]
# Thread-2 connected to SQL.

Real data would look like this:

MSG, 5, 3EB2B2, 2017/03/13, 21:53:51.734, STRIKE, Munich, DE

Every 5 minutes there is a statistics output:

# 7476 MSGs sorted by type (1, 2, .., 8), 3-Mlat: 59, 0, 702, 716, 2318, 326, 1149, 2201, 23
#
# usable (correct, without 4, 8) MSGs: 4554, blacklist filtered MSGs: 1844


If you see errors like this:

java.net.ConnectException: connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)


restart the service: sudo service modes.sh restart

If you see errors like this:

/etc/init.d/modes.sh: line 26: java: command not found
or
Failed to start modes.service: Unit modes.service not found.

install java: sudo apt-get update && sudo apt-get install oracle-java8-jdk

nowadays: sudo apt-get update && sudo apt-get install -y galternatives openjdk-8-jdk

Optimize


Uninstall the client

Updating the client

In most cases replacing the main file modesfiltered would be sufficent. If you edited the start script we advice to uninstall the client and reinstall the new version.