Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Testing AISDecoder

Chris Roos edited this page Mar 27, 2015 · 1 revision

With a raw AIS data file

wget "https://github.com/freerange/ais-on-sdr/wiki/example-data/helsinki-210-messages.raw"

./aisdecoder -h 127.0.0.1 -p 12345 -a file -f ~/Downloads/helsinki-210-messages.raw -d

If everything's working as expected then you should see lots of output similar to:

!AIVDM,1,1,,A,402<HSiuRg63k1mCKVRLg<Q00L1=,0*26

With an audio file

We need to be able to simulate audio coming in on the line/mic in of the soundcard. I've been able to do that using a combination of aplay and pavucontrol. Thanks to this article.

Start by installing pavucontrol:

sudo apt-get install pavucontrol

Open pavucontrol (Pulse Audio Volume Control).

Select the "Input Devices" tab and select "Monitors" from the "Show:" dropdown list.

Select the "Recording" tab. It should be empty at the moment as nothing's listening for audio on line/mic in.

Download an audio file containing AIS data:

`wget "https://github.com/freerange/ais-on-sdr/wiki/example-data/long-beach-160-messages.wav"`

Start aisdecoder:

./aisdecoder-1.0.0/build/aisdecoder -h 127.0.0.1 -p 12345 -a alsa -d

Switch back to Pulse Audio Volume Control and note that you can see 'aisdecoder' on the "Recording" tab. Change the "ALSA Capture from" dropdown to "Monitor of Built-in Audio Analogue Stereo".

Open another terminal window and start playing the wav file downloaded above:

aplay long-beach-160-messages.wav

If you're listening to the audio then you'll hear what sounds like a lot of static. If you switch back to the tab running aisdecoder then you'll see lots of output similar to what we saw when reading from the raw data file.