Started Feeding “MarineTraffic”
AIS-catcher (decoder) + NmeaRouter (data feeder) + OpenCPN (Map)
https://www.marinetraffic.com/
https://www.marinetraffic.com/ais/details/stations/22620
Is this all running on the one device?
I run AIS-Catcher on a Pi and OpenCPN on a desktop PC and also feed Marine Traffic.
What does NMEARouter do for you? (I hadn’t seen it before and seems an interesting tool but unnecessary in this scenario)
S.
Yes, all 3 software are on Windows-10 PC
It does the same thing as piaware, fr24feed, rbfeeder, and pfclient do - receive data from decoder (AIS-catcher) and sends it to Marine Traffic.
Go to following page, scroll down, and under Special software you will find links to download 4 different data-feeders, one of them is NMEA Router
Use the -u option in AIS-catcher to send data directly without the need for middleware. You can have multiple -u statements to send to different locations.
-u xxx.xx.xx.xx yyy - UDP IP address and port
Thanks for the guidance.
So we have 3 ways to feed data
I feed to MarineTraffic directly from AIS-Catcher or AISDispatcher as noted above.
Hence I asked what it did for you.
I am using a Pi3 at the moment running the image from https://www.sarcnet.org/ais-receiver.html which runs AISDispatcher and that is feeding MarineTraffic directly.
I am running OpendCPN on a Windows machine when I raise enough interest. The available free charts are a bit clunky around this part of the world.
And when you tire of AIS and are looking for the next Pi based transport tracker you might like to look at trains.
S.
CLICK ON SCREENSHOT TO SEE LARGER SIZE
The AIS-catcher Linux executable binary was created as per procedure at https://github.com/jvde-github/AIS-catcher#build-process. The procedure built and installed the executable binary "AIS-catcher
"in folder /usr/local/bin/
sudo mkdir /usr/share/aiscatcher
start.sh
sudo nano /usr/share/aiscatcher/start-ais.sh
start-ais.sh
, copy-pasted following code, Save and close file#!/bin/sh
CONFIG=""
while read -r line; do CONFIG="${CONFIG} $line"; done < /usr/share/aiscatcher/aiscatcher.conf
cd /usr/share/aiscatcher
/usr/local/bin/AIS-catcher ${CONFIG}
aiscatcher.conf
sudo nano /usr/share/aiscatcher/aiscatcher.conf
aiscatcher.conf
NOTE:
-d 00000162
in first line is Dongle’s serial number. You may use any number in place of 00000162.192.168.0.10 10101
use IP & Port of PC on which you are running OpenCPN5.9.207.224 xxxxx
use IP & Port of site you want to feed
-d 00000162
-v 10
-u 192.168.0.10 10101
-u 5.9.207.224 xxxxx
-M DT
-gr TUNER 25.4 RTLAGC off
-s 2304k
-p 34
-o 4
aiscatcher.service
sudo nano /lib/systemd/system/aiscatcher.service
aiscatcher.service
. Save & Close file# AIS-catcher service for systemd
[Unit]
Description=AIS-catcher
Wants=network.target
After=network.target
[Service]
User=aiscatcher
RuntimeDirectory=AIS-catcher
RuntimeDirectoryMode=0755
ExecStart=/bin/bash /usr/share/AIS-catcher/start-ais.sh
SyslogIdentifier=aiscatcher
Type=simple
Restart=on-failure
RestartSec=30
RestartPreventExitStatus=64
Nice=-5
[Install]
WantedBy=default.target
plugdev
to enable it to access the Dongle.sudo useradd --system aiscat
sudo usermod -a -G plugdev aiscat
sudo chown aiscat:aiscat -R /usr/share/AIS-catcher/
sudo systemctl enable aiscatcher
sudo reboot
sudo systemctl status aiscatcher
There is a copy of some CM93 charts floating around if you do some searching, which although aren’t strictly legitimate are of no real commercial value as they are from 2011. If you’re not using them for navigation, the land hasn’t moved that much since they were produced.
The bash script below does following:
(1) Clones AIS-catcher source-code from GitHub - jvde-github/AIS-catcher: AIS receiver for RTL SDR dongles, Airspy R2, Airspy Mini, Airspy HF+, HackRF, SDRplay and SoapySDR
(2) Builds Linux executeable from source-code, & installs it in folder /usr/local/bin/
(3) Creates Systemd service to automatically start AIS-catcher when RPi boots. It also provides Systemd commands to start stop, restart, and status
sudo bash -c "$(wget -O - https://raw.githubusercontent.com/abcd567a/install-aiscatcher/master/install-aiscatcher.sh)"
REBOOT YOUR PI
REBOOT YOUR PI
Open file aiscatcher.conf by following command:
sudo nano /usr/share/aiscatcher/aiscatcher.conf
(1) Modify following lines:
-u 192.168.0.10 10101
-u 5.9.207.224 12345
Replace IP and Port by your actual IP & Port of Map Software and Feeding Site
(2) Change “-d 00000162” to the actual Serial Number of your DVBT dongle for AIS
NOTE: While editing file aiscatcher.conf
, take care NOT to create blank spaces between lines
Save (Ctrl+o) and Close (Ctrl+x) file aiscatcher.conf
then restart AIS-catcher by following command: sudo systemctl restart aiscatcher
To see status sudo systemctl status aiscatcher
To restart sudo systemctl restart aiscatcher
To stop sudo systemctl stop aiscatcher
I followed your original instructions and everything looked alright but Status reported it couldn’t find device 00000001.
pi@AIS2:~ $ sudo systemctl status aiscatcher
● aiscatcher.service - AIS-catcher
Loaded: loaded (/lib/systemd/system/aiscatcher.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2022-10-12 22:22:45 AEDT; 4s ago
Process: 3895 ExecStart=/bin/bash /usr/share/aiscatcher/start-ais.sh (code=exited, status=0/SUCCESS)
Main PID: 3895 (code=exited, status=0/SUCCESS)
CPU: 50ms
Oct 12 22:22:45 AIS2 systemd[1]: Started AIS-catcher.
Oct 12 22:22:45 AIS2 aiscatcher[3896]: Searching for device with SN 00000001.
Oct 12 22:22:45 AIS2 aiscatcher[3896]: Device does not exist.
Oct 12 22:22:45 AIS2 systemd[1]: aiscatcher.service: Succeeded.
pi@AIS2:~ $
I then ran the command I had been using to run Catcher manually and it ran correctly
sudo AIS-catcher -d 00000001-v 10 -p -3 -gr tuner 35 rtlagc off -u 127.0.0.1 10110 -u 192.168.178.154 10101 -u 192.168.178.154 10112 -u 5.9.207.224 nnnn
pi@AIS2:~ $ sudo AIS-catcher -v 10 -p -3 -d 00000001 -gr tuner 35 rtlagc off -u 127.0.0.1 10110 -u 192.168.178.154 10101 -u 192.168.178.154 10112 -u 5.9.207.224 nnnn
AIS-catcher (build Oct 12 2022) v0.38
(C) Copyright 2021-2022 jvde-github and other contributors
This is free software; see the source for copying conditions.There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Device selected: Realtek, RTL2838UHIDIR, SN: 00000001
Detached kernel driver
Found Rafael Micro R820T tuner
RTLSDR settings: -gr tuner 35 rtlagc OFF biastee OFF -p -3
Generic settings: sample rate -s 1536K -p -3
[R82XX] PLL not locked!
Allocating 15 zero-copy buffers
!AIVDM,1,1,,A,404k1R1vJV;M1bGDG1bEAQ7000S:,0*4C ( MSG: 4, REPEAT: 0, MMSI: 5030280)
[AIS engine v0.38 ] received: 1 msgs, total: 1 msgs, rate: 0.0972558 msg/s
!AIVDM,1,1,,B,34hDFf1000:G?0ebAme1kiil0Dg:,0*0C ( MSG: 3, REPEAT: 0, MMSI: 319100600)
!AIVDM,1,1,,B,404k1R1vJV;M;bGDG1bEAQ700D0o,0*07 ( MSG: 4, REPEAT: 0, MMSI: 5030280)
[AIS engine v0.38 ] received: 2 msgs, total: 3 msgs, rate: 0.199522 msg/s
!AIVDM,1,1,,A,E>lt;J@aSqP0000000000000000E;WUdm7Mu800003v010,0*51 ( MSG: 21, REPEAT: 0, MMSI: 995036009)
!AIVDM,1,1,,A,404k1R1vJV;MEbGDG1bEAQ700<0o,0*02 ( MSG: 4, REPEAT: 0, MMSI: 5030280)
[AIS engine v0.38 ] received: 2 msgs, total: 5 msgs, rate: 0.199562 msg/s
!AIVDM,1,1,,B,E>lt<902QQnpP000000000000005;2QOm2aB@00000N010,0*5E ( MSG: 21, REPEAT: 0, MMSI: 995036196)
!AIVDM,1,1,,A,38Ld?p52@0bGFGsbEv1=Hlbr2Ddr,0*63 ( MSG: 3, REPEAT: 0, MMSI: 566956000)
!AIVDM,1,1,,B,E>lsp9Pb1L00000000000000000E;aiRm2;;h00000N010,0*2B ( MSG: 21, REPEAT: 0, MMSI: 995031078)
!AIVDM,1,1,,B,404k1R1vJV;MObGDG1bEAQ7000S:,0*31 ( MSG: 4, REPEAT: 0, MMSI: 5030280)
[AIS engine v0.38 ] received: 4 msgs, total: 9 msgs, rate: 0.399112 msg/s
!AIVDM,1,1,,A,404k1R1vJV;MabGDG1bEAQ7005Il,0*55 ( MSG: 4, REPEAT: 0, MMSI: 5030280)
[AIS engine v0.38 ] received: 1 msgs, total: 10 msgs, rate: 0.0997833 msg/s
!AIVDM,1,1,,A,34a@FV5000:GDAWbF=irdE5P0EKb,0*20 ( MSG: 3, REPEAT: 0, MMSI: 311695000)
!AIVDM,1,1,,B,404k1R1vJV;MkbGDG1bEAQ700@NI,0*0B ( MSG: 4, REPEAT: 0, MMSI: 5030280)
[AIS engine v0.38 ] received: 2 msgs, total: 12 msgs, rate: 0.199583 msg/s
!AIVDM,1,1,,A,E>lt;Ih9Qh2Pab00000000000005;bj3m2@=800000N010,0*6E ( MSG: 21, REPEAT: 0, MMSI: 995036007)
!AIVDM,1,1,,A,404k1R1vJV;N1bGDG1bEAQ700D0o,0*0D ( MSG: 4, REPEAT: 0, MMSI: 5030280)
If it makes a difference I am using a Raspberry Pi 3 Model B Plus Rev 1.3 and a V3 dongle.
Any suggestions on how to find the device.
Thanks,
S
Never came across such a problem. Don’t know how to solve it.
Some guess suggestions below:
(1) Try these commands:
sudo systemctl restart aiscatcher
sudo systemctl status aiscatcher
(2) Reboot RPi and recheck status
sudo systemctl status aiscatcher
(3) Unplug V3 from RPi, then replug it, and try these commands
sudo systemctl restart aiscatcher
sudo systemctl status aiscatcher
CLICK ON SCREENSHOT TO SEE LARGER SIZE
CLICK AGAIN TO SEE FULL SIZE
[-h display this message and terminate (default: false)]
[-s xxx sample rate in Hz (default: based on SDR device)]
[-c [AB/CD] [optional: AB] select AIS channels and optionally the NMEA channel designations]
[-p xxx set frequency correction for device in PPM (default: zero)]
[-a xxx set tuner bandwidth in Hz (default: off)]
[-v [option: 1+] enable verbose mode, optional to provide update frequency in seconds (default: false)]
[-M xxx set additional meta data to generate: T = NMEA timestamp, D = decoder related (signal power, ppm) (default: none)]
[-T xx auto terminate run with SDR after xxx seconds (default: off)]
[-o set output mode (0 = quiet, 1 = NMEA only, 2 = NMEA+, 3 = NMEA+ in JSON, 4 JSON Sparse, 5 JSON Full (default: 2)]
[-n show NMEA messages on screen without detail (-o 1)]
[-q suppress NMEA messages to screen (-o 0)]
[-u xxx.xx.xx.xx yyy - UDP destination address and port (default: off)]
[-r [optional: yy] filename - read IQ data from file, short for -r -ga FORMAT yy FILE filename, for stdin input use filename equals stdin or .]
[-w filename - read IQ data from WAV file, short for -w -gw FILE filename]
[-t [host [port]] - read IQ data from remote RTL-TCP instance]
[-y [host [port]] - read IQ data from remote SpyServer]
[-z [optional [format]] [optional endpoint] - read IQ data from [endpoint] in [format] via ZMQ (default: format is CU8)]
[-l list available devices and terminate (default: off)]
[-L list supported SDR hardware and terminate (default: off)]
[-d:x select device based on index (default: 0)]
[-d xxxx select device based on serial number]
[-m xx run specific decoding model (default: 2), see README for more details]
[-b benchmark demodulation models for time - for development purposes (default: off)]
[-F run model optimized for speed at the cost of accuracy for slow hardware (default: off)]
[-gr RTLSDRs: TUNER [auto/0.0-50.0] RTLAGC [on/off] BIASTEE [on/off] ]
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 most of our testing we have used the RTL-SDR v3 dongle where in principle no frequency correction is needed as deviations are guaranteed to be small. For optimal reception though ensure you determine the necessary correction, e.g. see and provide as input via the -p
switch on the command line.
If you are using a cheap RTL-SDR 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 -o 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.
Tried all your suggestions to no avail.
Also tried using a generic dongle in place of the V3 but that didn’t help either.
I suspect this may have something to do with it
pi@AIS2:~ $ sudo chown aiscatcher:aiscatcher -R /usr/share/AIS-catcher/
chown: cannot access '/usr/share/AIS-catcher/': No such file or directory
If you have not conquered your noise problem you could try narrowing the bandwidth to say 20 Khz
I haven’t tried it yet.
S
what is the output of following command?
sudo find / -name aiscatcher.conf
pi@AIS2:~ $ sudo find / -name aiscatcher.conf
find: ‘/run/user/1000/gvfs’: Permission denied
/usr/share/aiscatcher/aiscatcher.conf
pi@AIS2:~ $
The name of directory is aiscatcher
, NOT AIS-catcher
Seems you have done the systemd installation by bash script, not manually.
In manual method, I usesd folder name /usr/share/AIS-catcher
, whereas in bash script I used name /usr/share/aiscatcher
There are two more differences
In manual method, user name to run systemd is aiscatcher
In bash script install, user name to run systemd is ais
In manual method, start file name is /usr/share/AIS-catcher/start.sh
In bash script install, start file name is /usr/share/aiscatcher/start-ais.sh
You can check above by following command
ls -l /usr/share/aiscatcher
OK. Seems I need to install it all from the beginning.
Just to be clear do I do the following steps?
Take new microSD card and install Raspberry Pi OS (32bit) using Raspberry Pi Imager
Run your install script sudo bash -c “$(wget -O - https://raw.githubusercontent.com/abcd567a/install-aiscatcher/master/install-aiscatcher.sh)”
Edit the aiscatcher file with sudo nano /usr/share/aiscatcher/aiscatcher.conf
Thanks,
S
Sadly, the same problem.
Open to suggestions.
Thanks,
S.
aiscatcher
and uninstall it’s Systemd Servicesudo systemctl stop aiscatcher
sudo systemctl disable aiscatcher
sudo rm /lib/systemd/system/aiscatcher.service
sudo rm /usr/local/bin/AIS-catcher
sudo rm -rf /usr/share/aiscatcher
sudo userdel ais
sudo rm -rf /usr/share/AIS-catcher
sudo userdel aiscatcher
sudo bash -c "$(wget -O - https://raw.githubusercontent.com/abcd567a/install-aiscatcher/master/install-aiscatcher.sh)"