Difference between revisions of "RPiAIS"

From wiki.bastelbude.grade.de
Jump to: navigation, search
(install)
(legal issues)
 
(49 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
== about ==
 +
setting up a raspberry PI as AIS receiver using an DVB-T usb-stick and share data with [https://www.aishub.net/rpiais AIS Dispatcher]
 +
== newer machine (rPi 2 Model B)==
 +
* http://192.168.1.112:8080
 +
=== OS ===
 +
<pre>
 +
root@rPiAIS:~# cat /etc/os-release
 +
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
 +
NAME="Raspbian GNU/Linux"
 +
VERSION_ID="9"
 +
VERSION="9 (stretch)"
 +
ID=raspbian
 +
ID_LIKE=debian
 +
HOME_URL="http://www.raspbian.org/"
 +
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
 +
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
 +
 +
root@rPiAIS:~# uname -a
 +
Linux rPiAIS 4.14.71-v7+ #1145 SMP Fri Sep 21 15:38:35 BST 2018 armv7l GNU/Linux
 +
 +
root@rPiAIS:~# apt-get install rtl-sdr
 +
rtl-sdr is already the newest version (0.5.3-11+rpt1).
 +
 +
root@rPiAIS:~# apt-get install libusb-1.0-0-dev
 +
libusb-1.0-0-dev is already the newest version (2:1.0.21-1).
 +
 +
root@rPiAIS:~# apt-get install librtlsdr-dev
 +
librtlsdr-dev is already the newest version (0.5.3-11+rpt1).
 +
</pre>
 +
 +
=== hardware ===
 +
<pre>
 +
root@rPiAIS:~# cat /proc/cpuinfo
 +
processor      : 0
 +
model name      : ARMv7 Processor rev 5 (v7l)
 +
BogoMIPS        : 38.40
 +
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
 +
CPU implementer : 0x41
 +
CPU architecture: 7
 +
CPU variant    : 0x0
 +
CPU part        : 0xc07
 +
CPU revision    : 5
 +
 +
processor      : 1
 +
model name      : ARMv7 Processor rev 5 (v7l)
 +
BogoMIPS        : 38.40
 +
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
 +
CPU implementer : 0x41
 +
CPU architecture: 7
 +
CPU variant    : 0x0
 +
CPU part        : 0xc07
 +
CPU revision    : 5
 +
 +
processor      : 2
 +
model name      : ARMv7 Processor rev 5 (v7l)
 +
BogoMIPS        : 38.40
 +
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
 +
CPU implementer : 0x41
 +
CPU architecture: 7
 +
CPU variant    : 0x0
 +
CPU part        : 0xc07
 +
CPU revision    : 5
 +
 +
processor      : 3
 +
model name      : ARMv7 Processor rev 5 (v7l)
 +
BogoMIPS        : 38.40
 +
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
 +
CPU implementer : 0x41
 +
CPU architecture: 7
 +
CPU variant    : 0x0
 +
CPU part        : 0xc07
 +
CPU revision    : 5
 +
 +
Hardware        : BCM2835
 +
Revision        : a01041              (Pi 2 Model B v1.1 Sony, UK)
 +
Serial          : 00000000718d51e6
 +
 +
root@rPiAIS:~# lsusb
 +
Bus 001 Device 005: ID 0ccd:00d3 TerraTec Electronic GmbH
 +
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
 +
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
 +
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
 +
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 +
 +
root@rPiAIS:~# rtl_test -t
 +
Found 1 device(s):
 +
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
 +
 +
Using device 0: Terratec Cinergy T Stick RC (Rev.3)
 +
Found Elonics E4000 tuner
 +
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0
 +
Sampling at 2048000 S/s.
 +
Benchmarking E4000 PLL...
 +
[E4K] PLL not locked for 51000000 Hz!
 +
[E4K] PLL not locked for 2183000000 Hz!
 +
[E4K] PLL not locked for 1092000000 Hz!
 +
[E4K] PLL not locked for 1240000000 Hz!
 +
E4K range: 52 to 2182 MHz
 +
E4K L-band gap: 1092 to 1240 MHz
 +
 +
</pre>
 +
 +
== old machine (rPi B+)==
 +
* http://192.168.1.110:8080
 +
=== OS ===
 +
<pre>
 +
root@rPiAIS:~# cat /etc/os-release
 +
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
 +
NAME="Raspbian GNU/Linux"
 +
VERSION_ID="9"
 +
VERSION="9 (stretch)"
 +
ID=raspbian
 +
ID_LIKE=debian
 +
HOME_URL="http://www.raspbian.org/"
 +
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
 +
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
 +
 +
root@rPiAIS:~# uname -a
 +
Linux rPiAIS 4.14.71+ #1145 Fri Sep 21 15:06:38 BST 2018 armv6l GNU/Linux
 +
 +
root@rPiAIS:~# apt-get install rtl-sdr
 +
rtl-sdr is already the newest version (0.5.3-11+rpt1).
 +
 +
root@rPiAIS:~# apt-get install libusb-1.0-0-dev
 +
libusb-1.0-0-dev is already the newest version (2:1.0.21-1).
 +
 +
root@rPiAIS:~# apt-get install librtlsdr-dev
 +
librtlsdr-dev is already the newest version (0.5.3-11+rpt1).
 +
</pre>
 +
 +
=== hardware ===
 +
<pre>
 +
 +
root@rPiAIS:~# lsusb
 +
Bus 001 Device 005: ID 0ccd:00d3 TerraTec Electronic GmbH
 +
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
 +
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
 +
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
 +
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 +
 +
root@rPiAIS:~# cat /proc/cpuinfo
 +
processor      : 0
 +
model name      : ARMv6-compatible processor rev 7 (v6l)
 +
BogoMIPS        : 697.95
 +
Features        : half thumb fastmult vfp edsp java tls
 +
CPU implementer : 0x41
 +
CPU architecture: 7
 +
CPU variant    : 0x0
 +
CPU part        : 0xb76
 +
CPU revision    : 7
 +
 +
Hardware        : BCM2835
 +
Revision        : 0010 (Model B+)
 +
Serial          : 0000000081c958d6
 +
 +
root@rPiAIS:~# aisdeco-20140704 --device-list
 +
2018-10-15 09:19:03.467  INFO    AisDeco v.20140704
 +
Available Devices:
 +
0: Terratec Cinergy T Stick RC (Rev.3)
 +
 +
root@rPiAIS:~# rtl_test -t
 +
Found 1 device(s):
 +
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
 +
Using device 0: Terratec Cinergy T Stick RC (Rev.3)
 +
Found Elonics E4000 tuner
 +
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0
 +
Sampling at 2048000 S/s.
 +
Benchmarking E4000 PLL...
 +
[E4K] PLL not locked for 51000000 Hz!
 +
[E4K] PLL not locked for 2193000000 Hz!
 +
[E4K] PLL not locked for 1097000000 Hz!
 +
[E4K] PLL not locked for 1246000000 Hz!
 +
E4K range: 52 to 2192 MHz
 +
E4K L-band gap: 1097 to 1246 MHz
 +
 +
</pre>
 +
 
== stretch ==
 
== stretch ==
 
* get http://www.aishub.net/rpiais
 
* get http://www.aishub.net/rpiais
 
** enable SSH permanently
 
** enable SSH permanently
 
* check http://192.168.1.100:8080
 
* check http://192.168.1.100:8080
 +
* set configuration
 +
** input UDP Server
 +
** host 127.0.0.1
 +
** port 5001
 +
* start dispatcher
  
 
== setup ==
 
== setup ==
Line 17: Line 199:
 
** set root password <pre>sudo passwd root</pre>
 
** set root password <pre>sudo passwd root</pre>
  
* set up static IP at '''/etc/dhcpcd.conf'''
+
* <strike>set up static IP at '''/etc/dhcpcd.conf'''</strike>
 
<pre>
 
<pre>
 
interface eth0
 
interface eth0
Line 23: Line 205:
 
static routers=192.168.1.1
 
static routers=192.168.1.1
 
static domain_name_servers=192.168.1.1
 
static domain_name_servers=192.168.1.1
 +
</pre>
 +
 +
* set up static IP at '''/etc/systemd/network/20-eth0.network'''
 +
<pre>
 +
[Match]
 +
Name=eth0
 +
 +
[Network]
 +
DHCP=no
 +
Address=192.168.1.112/24
 +
Gateway=192.168.1.1
 +
DNS=192.168.1.1
 +
DNS=8.8.8.8
 +
 +
[DHCP]
 +
RouteMetric=200
 +
 +
[Address]
 +
#Label=eth0:0 # bug in systemd (Interface label is not valid or too long)
 +
Address=192.168.1.112/24
 +
 
</pre>
 
</pre>
 
* reboot
 
* reboot
  
 
== install ==
 
== install ==
 +
=== <strike>rtl-sdr</strike> use <code>apt-get install rtl-sdr</code> instead ===
 
* connect via ssh or scp as pi
 
* connect via ssh or scp as pi
 
<pre>
 
<pre>
Line 49: Line 253:
 
* Blacklist the kernel module dvb_usb_rtl28xxu by adding the line <code>blacklist dvb_usb_rtl28xxu</code> to <b>/etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf</b>
 
* Blacklist the kernel module dvb_usb_rtl28xxu by adding the line <code>blacklist dvb_usb_rtl28xxu</code> to <b>/etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf</b>
 
* reboot
 
* reboot
 +
* Test the installation:
 +
** <code>rtl_test -t</code>
 +
** output:
 +
<pre>
 +
Found 1 device(s):
 +
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
 +
 +
Using device 0: Terratec Cinergy T Stick RC (Rev.3)
 +
Found Elonics E4000 tuner
 +
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0
 +
Sampling at 2048000 S/s.
 +
Benchmarking E4000 PLL...
 +
[E4K] PLL not locked for 51000000 Hz!
 +
[E4K] PLL not locked for 2187000000 Hz!
 +
[E4K] PLL not locked for 1094000000 Hz!
 +
[E4K] PLL not locked for 1243000000 Hz!
 +
E4K range: 52 to 2186 MHz
 +
E4K L-band gap: 1094 to 1243 MHz
 +
</pre>
 +
 +
=== ais catcher ===
 +
<pre>
 +
apt-get update
 +
apt-get upgrade
 +
apt-get install git make gcc g++ cmake pkg-config -y
 +
git clone https://github.com/jvde-github/AIS-catcher.git
 +
cd AIS-catcher
 +
mkdir build
 +
cd build
 +
cmake ..
 +
make
 +
cp /root/AIS-catcher/build/AIS-catcher /usr/local/bin/AIS-catcher
 +
</pre>
 +
 +
* add <b>/etc/systemd/system/aiscatcher.service</b>
 +
<pre>
 +
[Unit]
 +
Description=AIS-catcher
 +
After=syslog.target network-online.target
 +
 +
[Service]
 +
Type=simple
 +
User=root
 +
ExecStart=/usr/local/bin/AIS-catcher -gr TUNER auto RTLAGC on -p 13 -v 10 -u 127.0.0.1 5001 -b -F -q -N 8100
 +
Restart=on-failure
 +
RestartSec=10
 +
KillMode=process
 +
 +
[Install]
 +
WantedBy=multi-user.target
 +
</pre>
 +
 +
* <code>systemctl daemon-reload</code>
 +
* <code>systemctl enable aiscatcher</code>
 +
* <code>systemctl start aiscatcher</code>
 +
* <code>systemctl stop aiscatcher</code>
 +
 +
'''webserver: http://192.168.1.112:8100/'''
 +
 +
=== rtl-ais ===
 +
<pre>
 +
apt-get update
 +
apt-get install rtl-sdr librtlsdr-dev libusb-1.0-0-dev
 +
apt-get install git
 +
git clone https://github.com/dgiardini/rtl-ais
 +
cd rtl-ais
 +
make
 +
cp rtl_ais /usr/local/bin/
 +
</pre>
 +
 +
* add <b>/etc/systemd/system/ais.service</b>
 +
<pre>
 +
[Unit]
 +
Description=AIS
 +
After=syslog.target network-online.target
 +
 +
[Service]
 +
Type=simple
 +
User=root
 +
ExecStart=/usr/local/bin/rtl_ais -p 28 -P 5001
 +
Restart=on-failure
 +
RestartSec=10
 +
KillMode=process
 +
 +
[Install]
 +
WantedBy=multi-user.target
 +
</pre>
 +
* <code>systemctl daemon-reload</code>
 +
* <code>systemctl enable ais</code>
 +
* <code>systemctl start ais</code>
 +
* <code>systemctl stop ais</code>
 +
* <code>systemctl disable ais</code>
 +
 +
=== aisdeco ===
 +
* http://xdeco.org/?page_id=30#ai2
 +
* https://github.com/xginn8/aisdeco
 +
 +
* pi B+:
 +
** aisdeco_rpi_20140704 runs
 +
** aisdeco2_rpi2-3_deb9_20180430 returns "Illegal Instruction"
 +
** aisdeco2_rpi1_deb9_20180729 runs
 +
* pi 2
 +
** aisdeco2_rpi2-3_deb9_20180430 runs
 +
 +
* apt-get install rtl-sdr libusb-1.0-0-dev
 +
* add to <b>/etc/modprobe.d/blacklist-dvb-t.conf</b>
 +
<pre>
 +
blacklist dvb_usb_rtl28xxu
 +
blacklist rtl2832
 +
blacklist rtl2830
 +
</pre>
 +
 +
* add <b>/etc/systemd/system/ais.service</b>
 +
<pre>
 +
[Unit]
 +
Description=AIS
 +
After=syslog.target network-online.target
 +
 +
[Service]
 +
Type=simple
 +
User=root
 +
ExecStart=/usr/local/bin/aisdeco2-20180430 --freq-correction 13 --udp 127.0.0.1:5001
 +
Restart=on-failure
 +
RestartSec=10
 +
KillMode=process
 +
 +
[Install]
 +
WantedBy=multi-user.target
 +
</pre>
 +
* <code>systemctl daemon-reload</code>
 +
* <code>systemctl enable ais</code>
 +
* <code>systemctl start ais</code>
 +
* <code>systemctl stop ais</code>
 +
 +
<pre>
 +
</pre>
 +
 +
== contributions ==
 +
* https://www.aishub.net/stations/2072
 +
* https://www.marinetraffic.com/en/ais/details/stations/376
 +
* https://stations.vesselfinder.com/stations/5136
 +
 +
== nearby stations ==
 +
* Bochum
 +
** https://www.marinetraffic.com/en/ais/details/stations/369 (Jens, http://haun-web.de/ais-station/ )
 +
* Dortmund
 +
** https://www.marinetraffic.com/en/ais/details/stations/469 (David, do1dbs)
 +
** https://stations.vesselfinder.com/stations/5835 (David)
 +
* Hamm
 +
** https://www.marinetraffic.com/en/ais/details/stations/114
 +
** https://www.aishub.net/stations/2600
 +
* Wesel
 +
** https://www.aishub.net/stations/2568
 +
* Mülheim
 +
** https://www.marinetraffic.com/en/ais/details/stations/5287
 +
* Duisburg
 +
** https://www.marinetraffic.com/en/ais/details/stations/2847 (Schwelgern?)
 +
** https://www.marinetraffic.com/en/ais/details/stations/6061 (Wanheimerort?)
 +
** https://www.aishub.net/stations/2840 (Wanheimerort)
 +
** https://www.aishub.net/stations/3017 (Huckingen)
 +
** https://stations.vesselfinder.com/stations/5797 (Wanheimerort, Rheinkilometer_774.3)
 +
** https://stations.vesselfinder.com/stations/5525 (Huckingen)
 +
* Erkrath
 +
** https://www.marinetraffic.com/en/ais/details/stations/2292
 +
 +
== legal issues  ==
 +
Mit geringem technischen Aufwand können AIS-Daten empfangen und aufbereitet werden. Diese enthalten mindestens eine Individualnummer (MMSI), Zeitstempel und Position des Schiffes und sind u.U. als 'personenbezogene Daten' anzusehen.
 +
 +
Die AIS-Informationen stehen
 +
* anderen Schiffen (Kollisionsverhütung, Erleichterung des Verkehrs)
 +
* Behörden (Verkehrslenkung und Überwachung)
 +
* Dritten (über Portale wie [https://marinetraffic.com marinetraffic] , [https://vesseltracker.com vesseltracker], [https://fleetmon.com fleetmon])
 +
zur Verfügung.
 +
 +
Mindesten zwei Länder sehen die Zurverfügungstellung der von ihnen empfangenen Daten als legitim an:
 +
* https://dma.dk/safety-at-sea/navigational-information/ais-data
 +
* https://www.kystverket.no/en/navigation-and-monitoring/ais/access-to-ais-data/
 +
 +
Besonders in der Binnenschifffahrt wird diese Praxis oft als kritisch (datenschutzverletzend) angesehen:
 +
* https://www.ccr-zkr.org/files/documents/ris/Brochure_AIS_2021_en.pdf (Seite 14)
 +
* https://binnenschifffahrt-online.de/2020/01/bds/12389/
 +
* z.B. https://www.binnenschifferforum.de/showthread.php?13794-Diskussion-um-Uhrzeitangaben-usw&highlight=datenschutz
 +
 +
Eine umfangreiche Betrachtung findet sich in dem Papier https://www.ranger-project.eu/wp-content/uploads/2018/03/D3.3.pdf
 +
 +
* [https://fleetmon.com fleetmon] (Rostock, kpler)
 +
* [https://marinetraffic.com marinetraffic] (Athen, kpler)
 +
* [https://vesseltracker.com vesseltracker] (Hamburg)
 +
* [https://www.vesselfinder.com vesselfinder] (Bulgarien, Astra Paging Ltd.)
 +
* [https://www.aishub.net aishub] (Bulgarien, Astra Paging Ltd.)
 +
 +
 +
 +
 +
 
[[category:Projekte]]
 
[[category:Projekte]]

Latest revision as of 07:07, 17 March 2023

about

setting up a raspberry PI as AIS receiver using an DVB-T usb-stick and share data with AIS Dispatcher

newer machine (rPi 2 Model B)

OS

root@rPiAIS:~# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

root@rPiAIS:~# uname -a
Linux rPiAIS 4.14.71-v7+ #1145 SMP Fri Sep 21 15:38:35 BST 2018 armv7l GNU/Linux

root@rPiAIS:~# apt-get install rtl-sdr
rtl-sdr is already the newest version (0.5.3-11+rpt1).

root@rPiAIS:~# apt-get install libusb-1.0-0-dev
libusb-1.0-0-dev is already the newest version (2:1.0.21-1).

root@rPiAIS:~# apt-get install librtlsdr-dev
librtlsdr-dev is already the newest version (0.5.3-11+rpt1).

hardware

root@rPiAIS:~# cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

processor       : 1
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

processor       : 2
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

processor       : 3
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

Hardware        : BCM2835
Revision        : a01041               (Pi 2 Model B v1.1 Sony, UK)
Serial          : 00000000718d51e6

root@rPiAIS:~# lsusb
Bus 001 Device 005: ID 0ccd:00d3 TerraTec Electronic GmbH
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@rPiAIS:~# rtl_test -t
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Terratec Cinergy T Stick RC (Rev.3)
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0
Sampling at 2048000 S/s.
Benchmarking E4000 PLL...
[E4K] PLL not locked for 51000000 Hz!
[E4K] PLL not locked for 2183000000 Hz!
[E4K] PLL not locked for 1092000000 Hz!
[E4K] PLL not locked for 1240000000 Hz!
E4K range: 52 to 2182 MHz
E4K L-band gap: 1092 to 1240 MHz

old machine (rPi B+)

OS

root@rPiAIS:~# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

root@rPiAIS:~# uname -a
Linux rPiAIS 4.14.71+ #1145 Fri Sep 21 15:06:38 BST 2018 armv6l GNU/Linux

root@rPiAIS:~# apt-get install rtl-sdr
rtl-sdr is already the newest version (0.5.3-11+rpt1).

root@rPiAIS:~# apt-get install libusb-1.0-0-dev
libusb-1.0-0-dev is already the newest version (2:1.0.21-1).

root@rPiAIS:~# apt-get install librtlsdr-dev
librtlsdr-dev is already the newest version (0.5.3-11+rpt1).

hardware


root@rPiAIS:~# lsusb
Bus 001 Device 005: ID 0ccd:00d3 TerraTec Electronic GmbH
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@rPiAIS:~# cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2835
Revision        : 0010 (Model B+)
Serial          : 0000000081c958d6

root@rPiAIS:~# aisdeco-20140704 --device-list
2018-10-15 09:19:03.467  INFO     AisDeco v.20140704
Available Devices:
 0: Terratec Cinergy T Stick RC (Rev.3)

root@rPiAIS:~# rtl_test -t
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Terratec Cinergy T Stick RC (Rev.3)
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0
Sampling at 2048000 S/s.
Benchmarking E4000 PLL...
[E4K] PLL not locked for 51000000 Hz!
[E4K] PLL not locked for 2193000000 Hz!
[E4K] PLL not locked for 1097000000 Hz!
[E4K] PLL not locked for 1246000000 Hz!
E4K range: 52 to 2192 MHz
E4K L-band gap: 1097 to 1246 MHz

stretch

setup

  • connect via ssh or scp as pi
sudo apt-get update
sudo apt-get upgrade
sudo su
mc
  • enable root login over SSH
    • add to /etc/ssh/sshd_config
      PermitRootLogin yes
    • restart service
      sudo /etc/init.d/ssh restart
    • set root password
      sudo passwd root
  • set up static IP at /etc/dhcpcd.conf
interface eth0
static ip_address=192.168.1.110/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
  • set up static IP at /etc/systemd/network/20-eth0.network
[Match]
Name=eth0

[Network]
DHCP=no
Address=192.168.1.112/24
Gateway=192.168.1.1
DNS=192.168.1.1
DNS=8.8.8.8

[DHCP]
RouteMetric=200

[Address]
#Label=eth0:0 # bug in systemd (Interface label is not valid or too long)
Address=192.168.1.112/24

  • reboot

install

rtl-sdr use apt-get install rtl-sdr instead

  • connect via ssh or scp as pi
sudo su -
apt-get update
apt-get install git
git clone git://git.osmocom.org/rtl-sdr.git
apt-get install libusb-dev libusb-1.0 libtool cmake
apt-get install build-essential
 
cd rtl-sdr/
mkdir build
cd build
cmake ../
make
make install
ldconfig
 
cd ..
cp rtl-sdr.rules /etc/udev/rules.d/
  • Blacklist the kernel module dvb_usb_rtl28xxu by adding the line blacklist dvb_usb_rtl28xxu to /etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf
  • reboot
  • Test the installation:
    • rtl_test -t
    • output:
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Terratec Cinergy T Stick RC (Rev.3)
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0
Sampling at 2048000 S/s.
Benchmarking E4000 PLL...
[E4K] PLL not locked for 51000000 Hz!
[E4K] PLL not locked for 2187000000 Hz!
[E4K] PLL not locked for 1094000000 Hz!
[E4K] PLL not locked for 1243000000 Hz!
E4K range: 52 to 2186 MHz
E4K L-band gap: 1094 to 1243 MHz

ais catcher

apt-get update
apt-get upgrade
apt-get install git make gcc g++ cmake pkg-config -y
git clone https://github.com/jvde-github/AIS-catcher.git
cd AIS-catcher
mkdir build
cd build
cmake ..
make
cp /root/AIS-catcher/build/AIS-catcher /usr/local/bin/AIS-catcher
  • add /etc/systemd/system/aiscatcher.service
[Unit]
Description=AIS-catcher
After=syslog.target network-online.target

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/AIS-catcher -gr TUNER auto RTLAGC on -p 13 -v 10 -u 127.0.0.1 5001 -b -F -q -N 8100
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target
  • systemctl daemon-reload
  • systemctl enable aiscatcher
  • systemctl start aiscatcher
  • systemctl stop aiscatcher

webserver: http://192.168.1.112:8100/

rtl-ais

apt-get update
apt-get install rtl-sdr librtlsdr-dev libusb-1.0-0-dev
apt-get install git
git clone https://github.com/dgiardini/rtl-ais
cd rtl-ais
make
cp rtl_ais /usr/local/bin/
  • add /etc/systemd/system/ais.service
[Unit]
Description=AIS
After=syslog.target network-online.target

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/rtl_ais -p 28 -P 5001
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target
  • systemctl daemon-reload
  • systemctl enable ais
  • systemctl start ais
  • systemctl stop ais
  • systemctl disable ais

aisdeco

  • pi B+:
    • aisdeco_rpi_20140704 runs
    • aisdeco2_rpi2-3_deb9_20180430 returns "Illegal Instruction"
    • aisdeco2_rpi1_deb9_20180729 runs
  • pi 2
    • aisdeco2_rpi2-3_deb9_20180430 runs
  • apt-get install rtl-sdr libusb-1.0-0-dev
  • add to /etc/modprobe.d/blacklist-dvb-t.conf
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
  • add /etc/systemd/system/ais.service
[Unit]
Description=AIS
After=syslog.target network-online.target

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/aisdeco2-20180430 --freq-correction 13 --udp 127.0.0.1:5001
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target
  • systemctl daemon-reload
  • systemctl enable ais
  • systemctl start ais
  • systemctl stop ais

contributions

nearby stations

legal issues

Mit geringem technischen Aufwand können AIS-Daten empfangen und aufbereitet werden. Diese enthalten mindestens eine Individualnummer (MMSI), Zeitstempel und Position des Schiffes und sind u.U. als 'personenbezogene Daten' anzusehen.

Die AIS-Informationen stehen

  • anderen Schiffen (Kollisionsverhütung, Erleichterung des Verkehrs)
  • Behörden (Verkehrslenkung und Überwachung)
  • Dritten (über Portale wie marinetraffic , vesseltracker, fleetmon)

zur Verfügung.

Mindesten zwei Länder sehen die Zurverfügungstellung der von ihnen empfangenen Daten als legitim an:

Besonders in der Binnenschifffahrt wird diese Praxis oft als kritisch (datenschutzverletzend) angesehen:

Eine umfangreiche Betrachtung findet sich in dem Papier https://www.ranger-project.eu/wp-content/uploads/2018/03/D3.3.pdf