Archiv nach Schlagworten: Raspberry Pi

APRS Rx-only IGate with Raspberry Pi and DVB-T dongle

This step-by-step instruction is tested on the Raspberry Pi with the raspbian distribution and a Terratec Cinergy TStick RC with E4000 tuner and an ezcap 2.0 DVB-T dongle with R820T tuner. I recommend a USB hub with seperate power supply that supports more than 100mA on one USB port. The voltage at the raspbery has to be stable and not below 5.0 V, if not you can run into sync errors with the stick.

It is recommended to update to version 1.0.0 or higher of pymultimonaprs, because if the connection to the internet is interrupted there will be no packets routed to the APRS-IS network anymore. Also the startscript and setup was updated.

Preparing the Raspberry Pi

sudo apt-get update
sudo apt-get upgrade
sudo raspi-config
mkdir ~/src

Avoid the Raspberry to load a kernel module
Edit /etc/modprobe.d/raspi-blacklist.conf file and add the following lines

blacklist dvb_usb_rtl28xxu
blacklist dvb_usb_v2
blacklist rtl_2830
blacklist rtl_2832
blacklist r820t

Then reboot the Raspberry or enter ’sudo rmmod dvb_usb_rtl28xxu‘

Installation of driver for the DVB-T dongle

cd ~/src
sudo apt-get install git build-essential cmake libusb-1.0-0-dev
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DDETACH_KERNEL_DRIVER=ON -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig

Test the rtl dongle and determine possible gain settings

rtl_test

Based on your antenna setup you have to choose a different gain, so that your signal is strong enough but not overloaded. I suggest to start rtl_tcp on the console and start SDRsharp, SDR-Radio, etc. on another computer and play with the gain settings.

Installation of multimonNG decoder

cd ~/src
sudo apt-get install qt4-qmake libpulse-dev libx11-dev patch pulseaudio
git clone https://github.com/EliasOenal/multimonNG.git
cd multimonNG
mkdir build
cd build
qmake-qt4 ../multimon-ng.pro
make
sudo make install

Installation of kalibrate tool

cd ~/src
sudo apt-get install libtool autoconf automake libfftw3-dev
git clone https://github.com/asdil12/kalibrate-rtl.git
cd kalibrate-rtl
git checkout arm_memory
./bootstrap
./configure
make
sudo make install

Example of calibrating your DVB-T dongle with E4000 chip (remember PPM for later)

kal -s GSM900
kal -c 36

Channel 36 was the strongest in my region, yours can be different.

With the new R820T(2) Chip the kalibrate tool will give us often the wrong PPM value. You can use the command rtl_test -p instead, which will show you the right PPM value after some minutes runtime.

Installation of APRS IGate software

cd ~/src
sudo apt-get install python2.7 python-pkg-resources
git clone https://github.com/asdil12/pymultimonaprs.git
cd pymultimonaprs
sudo python2 setup.py install

Prepare the startscript

sudo cp pymultimonaprs.init /etc/init.d/pymultimonaprs
sudo chmod +x /etc/init.d/pymultimonaprs
sudo systemctl enable pymultimonaprs

Generate APRS-IS password for own CALL

cd ~/src/pymultimonaprs
./keygen.py CALLSIGN
Key for CALLSIGN: 31983

Please only use your CALLSIGN without the SSID.

Change configuration file (Call, password, position, gain, ppm, etc.)

sudo nano /etc/pymultimonaprs.json

Do not use leading zeros in front of lat and lon parameters.

To test if all is configured well and works fine enter the following (Strg+C cancels)

rtl_fm -f 144800000 -s 22050 -p 18 -g 42.0 - | multimon-ng -a AFSK1200 -A -t raw -

The 18 behind the -p option is my PPM and the 42.0 behind the -g option is one of the available gain settings of my stick

Start pymultimonaprs

sudo /etc/init.d/pymultimonaprs start

Have fun.

AddOn: Catch the ISS APRS Frames too
Edit pymultimonaprs/multimon.py and change line 32-35 to

proc_src = subprocess.Popen(
    ['rtl_fm', '-f', str(int(self.config['rtl']['freq'] * 1e6)), '-f', '145825000', '-s', '22050',
    '-p', str(self.config['rtl']['ppm']), '-g', str(self.config['rtl']['gain']), '-l', '10', '-'],
    stdout=subprocess.PIPE, stderr=open('/dev/null')

If you add more than one -f option, then the -l option is necessary (squelch).

After that build and install the code again.

sudo python setup.py build
sudo python setup.py install
sudo /etc/init.d/pymultimonaprs stop
sudo /etc/init.d/pymultimonaprs start

APRS-IS Bake mit dem Raspberry Pi

Möchte man eine Stationskennung per Internet an das APRS-IS Netzwerk absetzen, so bietet sich ein stromsparender Rechner wie z.B. der Raspberry Pi an. Diesen habe ich mit dem Debian Derivat Raspbian ausgestattet (http://www.raspbian.org).

Ich gehe davon aus das Raspbian vollständig eingerichtet ist und sich über das Netzwerk per SSH fernbedienen läßt. Unter Windows logge ich mich dann mit PuTTY oder unter Linux mit SSH auf dem Minirechner ein. Als erstes werden alle Pakete auf den neuesten Stand gebracht:

sudo apt-get update
sudo apt-get upgrade

Dann hole ich mir die benötigten Pakete und lege mir ein Arbeitsverzeichnis an:

apt-get install vim netcat aprsd
mkdir ~/aprs
cd ~/aprs

Um sich auf einem der APRS-IS server einzuloggen braucht man ein Passwort, dass vom Benutzernamen abhängt. Dieses Passwort kann komfortabel mittels des Programms aprspass aus dem Paket aprsd erzeugt werden was wir uns für später merken.

aprspass DB0ABC
APRS password for DB0ABC is = xxxxx

Nun erstellen wir eine Datei mit den APRS Daten, die an den APRS-IS Server gesendet werden sollen und unsere Position sowie den Status darstellen:

vi DB0ABC.txt

In diese Datei fügen wir (beispielsweise) folgendes hinzu:

user DB0ABC pass xxxxx
DB0ABC>APRS,TCPIP*:!0102.03N/00405.06Er1750 R20k 145.600MHz DB0ABC
DB0ABC>APRS,TCPIP*:>http://www.darc.de

In der ersten Zeile steht unser Rufzeichen und das Passwort. Die zweite Zeile enhält das APRS-Frame für die Position mit ergänzendem Text. Die dritte Zeile ist ein APRS-Frame für den Statustext. Der Aufbau der jeweiligen Frames ist z.B. unter http://www.aprs-dl.de/index.php?APRS_Detailwissen:Lokale_Informationen sehr gut beschrieben und muss für jede Station angepasst werden.

Was jetzt noch fehlt ist das regelmäßige Einloggen auf einem APRS-IS Server und das Absetzen der Frames. Dazu erstellen wir ein bash-Script was durch den cron Daemon regelmäßig aufgerufen wird.

vi aprsbake.sh

Der Inhalt dieser Datei ist wie folgt:

#!/bin/sh
nc -v 195.190.142.207 14580 < /home/pi/aprs/DB0ABC.txt

Die o.g. IP-Adresse gehört dem APRS-IS Server DB0ERF in Erfurt. Es kann aber auch ein beliebig anderer APRS-IS Server genutzt werden. Zuletzt muss nur noch der cron Daemon programmiert werden:

crontab -e

Diese sich öffnende Datei enthält am Ende eine neue Zeile mit folgendem Inhalt, was einem 15 Minuten Intervall entspricht:

*/15 * * * * /home/pi/aprs/aprsbake.sh

Viel Spaß!