AIS for Vera

From MiOS
(Difference between revisions)
Jump to: navigation, search
m (DIY AIS receiver for less than $20)
(Limitations)
 
(8 intermediate revisions by one user not shown)
Line 13: Line 13:
 
====DIY AIS receiver for less than $20====
 
====DIY AIS receiver for less than $20====
  
Windows PC
+
USB DVB-T stick supported by SDR software (e.g., chipset RTL2832U and tuner R820T)
  
USB DVB-T stick supported by SDR# (e.g., chipset RTL2832U and tuner R820T)
+
[http://nmearouter.com/docs/ais/aerial.html AIS antenna], optional: [http://www.qth.at/oe1xhc/data/coax_collinear_70cm.html waterproof enclosure]
 +
 
 +
=====Windows PC=====
  
 
[http://sdrsharp.com/ SDR#]
 
[http://sdrsharp.com/ SDR#]
Line 22: Line 24:
  
 
[http://nmearouter.com/docs/ais/nmearouter.html NMEARouter]
 
[http://nmearouter.com/docs/ais/nmearouter.html NMEARouter]
 
[http://nmearouter.com/docs/ais/aerial.html AIS antenna], optional: [http://www.qth.at/oe1xhc/data/coax_collinear_70cm.html waterproof enclosure]
 
  
 
optional: [http://nmearouter.com/docs/ais/ais_decoder.html AIS Decoder]
 
optional: [http://nmearouter.com/docs/ais/ais_decoder.html AIS Decoder]
 +
 +
'''or'''
 +
 +
=====Raspberry Pi=====
 +
 +
[[File:AIS_Raspberry_Pi.jpg|400px]]
 +
 +
[http://sdr.osmocom.org/trac/wiki/rtl-sdr rtl_fm]
 +
 +
[http://forum.aishub.net/ais-decoder/ais-decoder-beta-release/ AIS Decoder]
  
 
===Software===
 
===Software===
Line 31: Line 41:
 
AIS4Vera plugin [to be published]
 
AIS4Vera plugin [to be published]
  
==Installation==
+
==Installation on Raspberry Pi==
  
[tbc]  
+
 
 +
===Set up Raspberry Pi===
 +
 
 +
<source lang="text">
 +
 
 +
Download latest Raspian image from: http://www.raspberrypi.org/downloads
 +
 
 +
Write Raspian image to SD card.
 +
 
 +
Boot and login.
 +
 
 +
sudo apt-get update
 +
sudo apt-get upgrade
 +
 
 +
Expand rootfs (sudo raspi-config), then reboot (shutdown -r now).
 +
 
 +
</source>
 +
 
 +
 
 +
===Install Software Defined Radio===
 +
 
 +
<source lang="text">
 +
 
 +
Based on:
 +
http://tubbyaustin.blogspot.de/2013/03/compiling-rtlfm-on-raspberry-pi.html
 +
 
 +
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/raspi-blacklist.conf and reboot.
 +
 
 +
Plug in DVB-T stick.
 +
 
 +
Test the installation:
 +
 
 +
rtl_test -t
 +
 
 +
output:
 +
Found 1 device(s):
 +
  0:  Generic, RTL2832U, SN: 7777XXXXXXXX
 +
 
 +
Using device 0: Generic RTL2832U
 +
Found Rafael Micro R820T tuner
 +
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
 +
Sampling at 2048000 S/s.
 +
No E4000 tuner found, aborting.
 +
 
 +
</source>
 +
 
 +
 
 +
===Install AIS decoder===
 +
 
 +
<source lang="text">
 +
 
 +
Based on:
 +
http://forum.aishub.net/ais-decoder/ais-decoder-beta-release/msg12754/?PHPSESSID=4krr2m8bouu59k146004vov733#msg12754
 +
 
 +
sudo apt-get install libasound-dev libpulse-dev
 +
 
 +
wget http://www.aishub.net/downloads/aisdecoder.tar.gz
 +
 
 +
tar zxvf aisdecoder.tar.gz
 +
cd aisdecoder
 +
mkdir build
 +
cd build
 +
cmake ../ -DCMAKE_BUILD_TYPE=Release
 +
make
 +
 
 +
</source>
 +
 
 +
 
 +
===Install startup script===
 +
 
 +
<source lang="text">
 +
 
 +
Based on:
 +
http://forum.aishub.net/ais-decoder/ais-decoder-beta-release/msg12766/?PHPSESSID=4krr2m8bouu59k146004vov733#msg12766
 +
 
 +
sudo apt-get install socat
 +
 
 +
Start AIS decoder and relay AIS messages from UDP port 10110 to TCP server at port 2702:
 +
 
 +
mkfifo /tmp/aisdata
 +
rtl_fm -f 161966899 -g 40  -s 48k -r 48k /tmp/aisdata &
 +
./aisdecoder/build/aisdecoder -h 127.0.0.1 -p 10110 -a file -c mono -d -f /tmp/aisdata 2>> AIS_data.log &
 +
socat TCP-LISTEN:2702,fork UDP-LISTEN:10110 &
 +
 
 +
</source>
 +
 
 +
 
 +
===Install A4V Luup plugin===
 +
 
 +
<source lang="text">
 +
 
 +
Extract plugin files, upload plugin files to Vera, create device:
 +
 
 +
Description        : A4V
 +
Upnp Device Filename: D_A4V.xml
 +
Ip Address          : <Raspberry Pi's IP address>
 +
 
 +
Reload Luup engine.
 +
 
 +
TCP port 2702 is hard-coded in D_A4V.xml and cannot be changed without changing D_A4V.xml
 +
(and don't forget to adjust your startup script).
 +
 
 +
</source>
 +
 
 +
 
 +
==Example use case==
 +
 
 +
Create your own [http://translate.google.de/translate?sl=de&tl=en&js=n&prev=_t&hl=de&ie=UTF-8&u=http%3A%2F%2Fde.wikipedia.org%2Fwiki%2FSchiffsbegr%25C3%25BC%25C3%259Fungsanlage_Willkomm-H%25C3%25B6ft Schiffsbegr&uuml;&szlig;ungsanlage]:
 +
 
 +
[tbc]
  
 
==Limitations==
 
==Limitations==
Line 41: Line 182:
 
==Further reading==
 
==Further reading==
  
[tbc]
+
[http://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.1371-4-201004-I!!PDF-E.pdf Recommendation ITU-R M.1371-4 (04/2010)]
 +
 
 +
[http://www.unece.org/fileadmin/DAM/trans/doc/finaldocs/sc3/ECE-TRANS-SC3-176e.pdf International Standard for Tracking and Tracing on Inland Waterways (VTT) - Resolution No. 63 (ECE/TRANS/SC.3/176)]
 +
 
 +
[http://www.imo.org/blast/blastData.asp?doc_id=13413&filename=289.pdf Guidance on the use of AIS application-specific messages]
 +
 
 +
[http://www.navcen.uscg.gov/pdf/AIS/IALA_AIS_Guidelines_Vol1_Pt1%20OPS%20%281.3%29.pdf IALA Guideline No. 1028 on the Automatic Identification (AIS) Volume 1, Part I, Operational Issues, Edition 1.3 December 2004]
 +
 
 +
[http://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.585-4-200703-S!!PDF-E.pdf Recommendation ITU-R M.585-4]
 +
 
 +
[http://www.unece.org/trans/doc/2006/sc3/TRANS-SC3-2006-04a2e.doc European Vessel Identification Number, ECE/TRANS/SC.3/2006/4/Add.2, 19 July 2006]

Latest revision as of 17:56, 9 February 2014

SDR AIS.jpg

Contents

[edit] Requirements

[edit] Hardware

AIS receiver (must support NMEA 0183 output compatible with ITU-R 1371)

Some vessels equipped with AIS transponder within reception range

[edit] DIY AIS receiver for less than $20

USB DVB-T stick supported by SDR software (e.g., chipset RTL2832U and tuner R820T)

AIS antenna, optional: waterproof enclosure

[edit] Windows PC

SDR#

AISMon

NMEARouter

optional: AIS Decoder

or

[edit] Raspberry Pi

AIS Raspberry Pi.jpg

rtl_fm

AIS Decoder

[edit] Software

AIS4Vera plugin [to be published]

[edit] Installation on Raspberry Pi

[edit] Set up Raspberry Pi

Download latest Raspian image from: http://www.raspberrypi.org/downloads
 
Write Raspian image to SD card.
 
Boot and login.
 
sudo apt-get update
sudo apt-get upgrade
 
Expand rootfs (sudo raspi-config), then reboot (shutdown -r now).


[edit] Install Software Defined Radio

Based on:
http://tubbyaustin.blogspot.de/2013/03/compiling-rtlfm-on-raspberry-pi.html
 
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/raspi-blacklist.conf and reboot.
 
Plug in DVB-T stick.
 
Test the installation:
 
rtl_test -t
 
output:
Found 1 device(s):
  0:  Generic, RTL2832U, SN: 7777XXXXXXXX
 
Using device 0: Generic RTL2832U
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.


[edit] Install AIS decoder

Based on:
http://forum.aishub.net/ais-decoder/ais-decoder-beta-release/msg12754/?PHPSESSID=4krr2m8bouu59k146004vov733#msg12754
 
sudo apt-get install libasound-dev libpulse-dev
 
wget http://www.aishub.net/downloads/aisdecoder.tar.gz
 
tar zxvf aisdecoder.tar.gz
cd aisdecoder
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
make


[edit] Install startup script

Based on:
http://forum.aishub.net/ais-decoder/ais-decoder-beta-release/msg12766/?PHPSESSID=4krr2m8bouu59k146004vov733#msg12766
 
sudo apt-get install socat
 
Start AIS decoder and relay AIS messages from UDP port 10110 to TCP server at port 2702:
 
mkfifo /tmp/aisdata
rtl_fm -f 161966899 -g 40  -s 48k -r 48k /tmp/aisdata &
./aisdecoder/build/aisdecoder -h 127.0.0.1 -p 10110 -a file -c mono -d -f /tmp/aisdata 2>> AIS_data.log &
socat TCP-LISTEN:2702,fork UDP-LISTEN:10110 &


[edit] Install A4V Luup plugin

Extract plugin files, upload plugin files to Vera, create device:
 
Description         : A4V
Upnp Device Filename: D_A4V.xml
Ip Address          : <Raspberry Pi's IP address>
 
Reload Luup engine.
 
TCP port 2702 is hard-coded in D_A4V.xml and cannot be changed without changing D_A4V.xml
(and don't forget to adjust your startup script).


[edit] Example use case

Create your own Schiffsbegrüßungsanlage:

[tbc]

[edit] Limitations

[tbc]

[edit] Further reading

Recommendation ITU-R M.1371-4 (04/2010)

International Standard for Tracking and Tracing on Inland Waterways (VTT) - Resolution No. 63 (ECE/TRANS/SC.3/176)

Guidance on the use of AIS application-specific messages

IALA Guideline No. 1028 on the Automatic Identification (AIS) Volume 1, Part I, Operational Issues, Edition 1.3 December 2004

Recommendation ITU-R M.585-4

European Vessel Identification Number, ECE/TRANS/SC.3/2006/4/Add.2, 19 July 2006

Personal tools