AIS for Vera

From MiOS
(Difference between revisions)
Jump to: navigation, search
(Installation)
(Limitations)
 
Line 168: Line 168:
  
 
</source>
 
</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==

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