Running ADS-B Receiver + AIS Receiver on Same RPi
- ADS-B : Aircraft Tracking at 1090MHz (using DVB-T Dongle)
- AIS: Ship and Vessel Tracking at 162MHz (using DVB-T Dongle)
I am running following on RPi model 4 (1 GB ram):
- RaspberryPi OS Lite Bullseye
- AIS-catcher (receiver+decoder+feeder software) - CLICK HERE
- AIS Dispatcher for local map at ip-of-pi:8181 - CLICK HERE
- dump1090-fa
- piaware
- fr24feed
- rbfeeder
- pfclient
- adsbexchange
- opensky
- modesmixer2
- graphs1090
I had to serialize dongles by following commands:
sudo apt install rtl-sdr
sudo systemctl stop piaware dump1090-fa aiscatcher
## SERIALIZED ONE DONGLE AT A TIME
## REMOVED ALL OTHER DONGLES WHEN GIVING FOLLOWING COMMAND
rtl_eeprom -s [desired_serial_number]
to prevent conflict. Used serial numbers as follows:
00001090
for dump1090
00000162
for AIS-catcher
Also set serial number 00001090
in file /etc/default/dump1090-fa
by following command:
sudo sed -i 's/^RECEIVER_SERIAL=.*/RECEIVER_SERIAL=00001090/' /etc/default/dump1090-fa
Port 8080 Conflict:
To clear conflict between Skyaware map and AIS Dispatcher map, I changed port number from 8080 to 8181 in following file of AIS Dispatcher:
/home/ais/etc/aiscontrol.cfg
PPM CORRECTION
AIS-catcher tunes in on a frequency of 162 MHz. However, due to deviations in the internal oscillator of RTL-SDR devices, the actual frequency can be slightly off which will result in no or poor reception of AIS signals. It is therefore important to provide the program with the necessary correction in parts-per-million (ppm) to offset this deviation where needed. For optimal reception ensure you determine the necessary correction, and provide as input via the -p
switch on the command line.
I am using a $10 Generic DVB-T (Black) WITHOUT TCXO. The PPM is much higher than it is for costlier dongles which have TCXO correction.
Here is how I determined the value of PPM to be used in file aisctacher.cfg
:
(1) Installed test software
sudo apt install rtl-sdr
(2) Determined the device index of the dongle for AIS-catcher by following command
rtl_test -t
(3) In my case the device index was 1.
I used following command to determine ppm
rtl_test -d 1 -p60
(4) Waited until the cumulative error value (in PPM) remains more-or-less the same for three consecutive minutes. Note the last cumulative error value (in PPM) and use it in config of AIS-catcher. I am using 34 (-p 34
) in my config. Your value may be different
CLICK ON SCREENSHOT TO SEE LARGER SIZE
NOTE:
If you are using a cheap DVB-T dongle that suffers from thermal drift (i.e. the required PPM correction drifts when the dongle is getting warmer), you could consider to use the option -go AFC_WIDE on
or switch to a FM decoding model which is less sensitive for frequency offsets (-m 0
). The frequency correction applied by the default decoding model can be made visible with the switch -M D
so you can inspect.
AIS-CATCHER CONFIGURATION
Location of Config file
/usr/share/aiscatcher/aiscatcher.conf
Default contents of config file (To be modified by user after installation)
-d 00000162
-v 10
-M DT
-gr TUNER 38.6 RTLAGC off
-s 2304k
-p 3
-o 4
-u 127.0.0.1 10110
AFTER INSTALLATION IS COMPLETED, PLEASE DO FOLLOWING:
-
The Map Software installed on RPi (AIS Dispatcher OR OpenCPN) should
be configured to use UDP Port 10110, IP 127.0.0.1 OR 0.0.0.0 -
As per advice at AIS-catcher Github site, first systematically identify
the optimal settings starting with-s 1536K -gr tuner auto rtlagc on -a 192K
before editing the file/usr/share/aiscatcher/aiscatcher.conf
-
Open file aiscatcher.conf by following command:
sudo nano /usr/share/aiscatcher/aiscatcher.conf
-
In above file:
(a) Change 00000162 in “-d 00000162” to actual Serial Number of AIS dongle
(b) Change 3 in “-p 3” to the actual ppm correction figure of AIS dongle
(c) Change 38.6 in “-gr TUNER 38.6 RTLAGC off” to desired Gain for AIS dongle
(d) For each Site you want to feed AIS data, add a line immediately below the
last line, in following format:
-u [URL or IP of Site] [Port Number of Site]
NOTE: Do NOT leave any blank spaces between lines
(e) Save (Ctrl+o) and Close (Ctrl+x) file aiscatcher.conf5. REBOOT RPi
REBOOT RPi
MONITORING EFFECT OF CHANGING PPM AND GAIN SETTING:
Use Following Command to output Message Rate (msg/s):
:
sudo journalctl -u aiscatcher -n 150 | grep -o 'received.*'
AIS ANTENNA I USED IS A VERTICAL DIPOLE MADE OF COAX