Author Topic: AIS Decoder - beta release  (Read 72493 times)

Peter

  • Global Moderator
  • Lt.Commander
  • *****
  • Posts: 97
    • View Profile
    • Astra Paging Ltd
AIS Decoder - beta release
« on: 09 October, 2013, 04:49:43 pm »
Dear AISHub members,

Many AIS enthusiasts use their amateur radio equipment to receive and decode AIS data via sound card. There are some projects like ShipPlotter (http://www.coaa.co.uk/shipplotter.htm) and AISMon (http://groups.yahoo.com/neo/groups/aismon/info) which perform this task.

AISHub team released a small Linux tool for decoding AIS signal via sound card - AISDecoder. AISDecoder streams AIS sentences via UDP and it is quite easy to integrate it with AISDispatcher or other AIS tool listening on the same UDP port.

The project is currently in beta release and we will appreciate if you download and evaluate it.

1) Download http://www.aishub.net/downloads/aisdecoder.tar.gz
1) Download http://www.aishub.net/downloads/aisdecoder-1.0.0.tar.gz OR Windows binary (MinGW 4.8.1)
2) Untar and build

tar zxvf aisdecoder.tar.gz
cd aisdecoder
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=RELEASE
make

3) Execute aisdecoder without parameters (or -H) to see help
4) Plug in your sound cable and calibrate the sound level by using -l
The optimum level is 50-70%

5) Example:
Decodes AIS data using Pulse Audio driver and streams NMEA to localhost UDP port 12345

./aisdecoder -hlocalhost -p12345 -apulse

We are looking forward to your feedback.

Best regards,
AISHub team
« Last Edit: 16 July, 2014, 03:49:29 pm by sandman7920 »

sycophantic

  • New User
  • *
  • Posts: 8
    • View Profile
Re: AIS Decoder - beta release
« Reply #1 on: 09 October, 2013, 05:02:25 pm »
How does this differ from using gnuais (https://github.com/rubund/gnuais)?  Is it based on it?

Unfortunately, in order for me to submit data to another site I must still use gnuais.

I know I had to hack up the code of gnuais to output to a fifo.
« Last Edit: 10 October, 2013, 11:28:07 am by sandman7920 »

Peter

  • Global Moderator
  • Lt.Commander
  • *****
  • Posts: 97
    • View Profile
    • Astra Paging Ltd
Re: AIS Decoder - beta release
« Reply #2 on: 09 October, 2013, 05:12:12 pm »
AISDecoder uses parts of GNUAIS code (it is stated in the files). The main reasons for creating this tool are: 1) multiplatfom compilation - it supports Windows also and 2) very simple usage

sycophantic

  • New User
  • *
  • Posts: 8
    • View Profile
Re: AIS Decoder - beta release
« Reply #3 on: 09 October, 2013, 05:12:53 pm »
Thanks.  I'm going to try it out.  I didn't get a chance to read the code yet.

sycophantic

  • New User
  • *
  • Posts: 8
    • View Profile
Re: AIS Decoder - beta release
« Reply #4 on: 09 October, 2013, 05:26:34 pm »
I successfully compiled and run it on my raspberry pi with alsa and pulse support.

Code: [Select]
pi@raspberrypi ~/aishub/aisdecoder/build $ ./aisdecoder -h 127.0.0.1 -p 3000 -a alsa -c left -l -d
Level on ch 0: 82 %
!AIVDM,1,1,,A,15N3Q??P1WJe9MdGC=49v?v4081k,0*6A
!AIVDM,1,1,,A,15N0olgP0eJdfRjGBoTpNgv20H1v,0*51
!AIVDM,1,1,,A,35NSfJ5000Je?avGA>o@6D2:0m3r,0*62
Level on ch 0: 82 %
Level on ch 0: 81 %
!AIVDM,1,1,,A,15NR7SP00>re?thGACdTdaT:00Rm,0*21
!AIVDM,1,1,,A,15MnnH0P01Je8RBGChC;Igv<2@3>,0*4E
!AIVDM,1,1,,A,15NFV@000DJe?fvGAD;lOIB<05il,0*25
!AIVDM,1,1,,A,15NE7f0P4MJeD5hGBgt39wv:0000,0*70

An option to specify the alsa device would be good, since I use a usb dongle for the mic input.

Also, maybe pull over the json http posting code?

« Last Edit: 09 October, 2013, 05:33:25 pm by sycophantic »

mani210

  • Seaman
  • *
  • Posts: 2
    • View Profile
Re: AIS Decoder - beta release
« Reply #5 on: 09 October, 2013, 06:03:46 pm »
it compiles here on Cubieboard with Debian

I do not have ships around here but used -f file option and Gnuais raw example (gnuais-stereo-2rx.raw) and the decoder outputs the NMEA senteses to console

the decoder send UDP output to destination IP but I was not able to receive this UDP date with AisDecoder, Shipploter or AisDispatcher on my W7 PC all listen on UDP ...

tcpdump shows some udp data and nmea but is it in right format? Which client can I use to receive the UDP stream?
« Last Edit: 09 October, 2013, 10:43:01 pm by mani210 »

strehi

  • New user
  • Posts: 1
    • View Profile
Re: AIS Decoder - beta release
« Reply #6 on: 09 October, 2013, 06:29:05 pm »
Hi,

AISHub team released a small Linux tool for decoding AIS signal via sound card - AISDecoder. AISDecoder streams AIS sentences via UDP and it is quite easy to integrate it with AISDispatcher or other AIS tool listening on the same UDP port.

cool, I'll give that a try.

btw. Did you thought about a tool, which uses a funcube Dongle with it's I/Q output as a source, too?

Cheers
Bernd

sandman7920

  • Global Moderator
  • Ensign
  • *****
  • Posts: 19
    • View Profile
    • Astra Paging Ltd.
Re: AIS Decoder - beta release
« Reply #7 on: 10 October, 2013, 11:34:09 am »
it compiles here on Cubieboard with Debian

I do not have ships around here but used -f file option and Gnuais raw example (gnuais-stereo-2rx.raw) and the decoder outputs the NMEA senteses to console

the decoder send UDP output to destination IP but I was not able to receive this UDP date with AisDecoder, Shipploter or AisDispatcher on my W7 PC all listen on UDP ...

tcpdump shows some udp data and nmea but is it in right format? Which client can I use to receive the UDP stream?

Check your windows firewall.

P.S. You can try to debug on linux board with socat or nc
1. With aisdecoder stream to localhost on port 1234
2.1 socat UDP-LISTEN:1234 -
2.2 nc -u -l -p 1234

mani210

  • Seaman
  • *
  • Posts: 2
    • View Profile
Re: AIS Decoder - beta release
« Reply #8 on: 10 October, 2013, 12:31:11 pm »
ok thanks for the hint, it works now with other PC and displays on Shipplotter :D

What will be the solution to decode both AIS channels, running two decoder with two inputs or will there be an option over left and right audio channel within one decoder similar to gnuais?
« Last Edit: 10 October, 2013, 12:33:39 pm by mani210 »

Peter

  • Global Moderator
  • Lt.Commander
  • *****
  • Posts: 97
    • View Profile
    • Astra Paging Ltd
Re: AIS Decoder - beta release
« Reply #9 on: 10 October, 2013, 05:42:25 pm »
Just use "stereo" :) left channel is A, right channel is B

FredZ

  • New user
  • Posts: 1
    • View Profile
Re: AIS Decoder - beta release
« Reply #10 on: 12 October, 2013, 12:25:14 pm »
Hi this also works with the RTL2832U (RTL SDR usb sticks) tested with R820T tuner.

Usage is as follows:

create a common fifo
mkfifo /tmp/aisdata

open one terminal with rtl_fm, writes to fifo:
rtl_fm -f 161975000 -g 40 -p 95 -s 48k -r 48k /tmp/aisdata

open a second terminal with aisdecoder, reads from fifo:
./aisdecoder -h 127.0.0.1 -p 10110 -a file -c mono -d -l -f /tmp/aisdata

using opencpn and configuring a UDP port with IP 0.0.0.0 and port 10110 you can see received AIS positions in realtime.

important usage of rtl_fm:
for second AIS frequency use  -f 162025000
fine tune gain parameter (-g )  and most important ppm error ( -p )

best
Fred
« Last Edit: 12 October, 2013, 04:03:16 pm by FredZ »

Broncus

  • Seaman
  • *
  • Posts: 2
    • View Profile
Re: AIS Decoder - beta release
« Reply #11 on: 15 November, 2013, 05:49:28 pm »
The last post caught my eye regarding the RLT2832U.

I am very new to Linux and the Raspberry Pi (my first Linux machine). I am very interested in receiving AIS using the Pi and the RTL2832.

Do the instructions in the last post use a single RTL2832 with each AIS frequency on separate channels?

And a question for AIS Decoder, will it decode from two audio sources, such as the left channel and the right channel of the sound card?

Thanks!

Best regards,
Fred
« Last Edit: 15 November, 2013, 08:39:53 pm by Broncus »

Broncus

  • Seaman
  • *
  • Posts: 2
    • View Profile
Re: AIS Decoder - beta release
« Reply #12 on: 15 November, 2013, 11:33:26 pm »
Greetings,

I figured I would at least get going on the install.

My initial results were non-functional. I was in error! So I have edited this post and removed my questions.

Now I will start working on getting a radio (RTL2832) connected.

Thanks!

Best regards,
Fred N7FMH


« Last Edit: 19 November, 2013, 12:40:29 am by Broncus »

fkjradio

  • New User
  • *
  • Posts: 7
    • View Profile
Re: AIS Decoder - beta release
« Reply #13 on: 17 November, 2013, 12:46:52 pm »
Hi
Using both channel ( left or right) looks great.

Any issu/project for windows ?



73 jeje


tetramonium

  • New User
  • *
  • Posts: 8
    • View Profile
Re: AIS Decoder - beta release
« Reply #14 on: 09 December, 2013, 10:42:05 pm »
Hi
It seem to work well on linux with very low cpu usage
I tested the FredZ mod ( for info I must to delete and create  the fifo at each boot), it's very light
I've tried 2 channels on one rtl2832 with gnuradio , it work well and with low cpu usage than gnuais.
Read my comments onthis page :
http://www.oz9aec.net/index.php/gnu-radio/gnu-radio-blog/482-a-2-channel-ais-receiver-using-rtl-sdr-and-gnuais
does it work on windows, and if, is there a simple way to compile?
Thanks and sorry for my bad english
Regards
Christophe