AIS Reception
AIS Reception
Contents
Page 1
1 What is AIS?
AIS is an international tracking system for ships. Messages can contain position, speed, course, name,
destination, status, dimensions, and many other types of information.
The radios use 25 kHz channel spacing with a peak deviation of ±5 kHz. AIS uses HDLC over 9600 bps
GMSK. It is very much like our ham radio 9600 bps G3RUH style transmission.
Located about 50 km from the ocean, I’m able to hear a few ships with an ordinary 2 meter ham
transceiver and a vertical antenna on the roof.
AIS receivers produce NMEA style sentences which are sent to other devices. These are much like the
sentences you see from a GPS receiver. Instead of starting with something like $GPRMC, it starts
with !AIVDM instead. A typical sentence might look like:
!AIVDM,1,1,,A,15N4cJ`000rrjq@H@0i2hbuN0L0U,0*31
Page 2
2 Connecting to Radio
This will not work with the audio from your receiver’s speaker!!! Don’t waste your time trying.
For proper decoding, about 5kHz of audio bandwidth is required. Like 9600 bps AX.25, this will not work
with the speaker connection because the audio processing stages distort the signal too much.
You need to get the audio signal from the FM discriminator before the de-emphasis and other audio
processing make it useless for this purpose.
Some Ham Radio VHF transceivers have a special connector for use with external modems. The big 3
Japanese manfacturers (Kenwood, Icon, Yaesu) all standardized on the same 6 pin round mini-DIN
connector. Radios with the 6 pin round connector provide this signal. Some Alinco models have the
same signals available but the connector is physically different.
The connector is often labeled “data” but it is really audio for an external modem. There are two
receive audio signals:
You need to use the latter. The other distorts the signal too much to be usable.
Software Defined Radios can also be used. The Dire Wolf User Guide has details on usage with popular
software such as
Gqrx
rtl_fm
SDR#
Gnu Radio
The one thing you must remember is the audio bandwidth. It must be fairly flat out to 5kHz. Be sure
that an de-emphasis or other audio filtering is disabled.
Page 3
3 Selecting AIS mode
For the first, or only, radio channel, the “-B” (upper case B) command line option can be used to
specify the speed.
In a multiple radio setup, you would need to use the MODEM command in the configuration file.
A suitable modem is selected for the given speed. This defaults to 1200 AFSK but other values, such as
9600 G3RUH style, are possible when using APRS/Packet Radio. AIS also uses 9600 bps so a special case
was added. Instead of a number, the characters “AIS” are used.
Example:
"-B" sets the speed. 9600 is for ham radio AX.25 G3RUH. A special case was added for AIS.
"-r" sets the audio sample rate. 44100 is the default. I found that 48000 can provide a slight
benefit for 9600 bps.
"-T" adds a time stamp.
If all goes well, you should see some lines similar to this:
[0.3 08:51:47]
AIS>APDW16:
The ship identifier won’t fit in the source address field so “AIS” is there to indicate the
origin. The destination field indicates the software doing the reception.
{DA
An information part beginning with “{“ indicates user defined data. D and A indicate
Dire Wolf and AIS.
!AIVDM,1,1,,A,15N4cJ`000rrjq@H@0i2hbuN0L0U,0*31
This is what you would get out of a normal AIS receiver. It is similar to the NMEA
sentences from a GPS receiver.
Page 4
4 Using with Mapping Applications
Dire Wolf generates NMEA sentences like those from a normal AIS receiver. Looking at them is not
much fun for most people. You probably want to feed this information into some sort of mapping
application.
4.1 SARTrack
The Connections panel has a special button for connecting to the Dire Wolf TNC.
SARTtrack recognizes the APRS information fields starting with “{DA” and knows how to decode the AIS
sentences.
Page 5
Move your mouse pointer over a ship to see more details.
APRS and AIS can be viewed on a single map without any special configuration required.
Page 6
4.2 Most other APRS Applications
At the time this is being written, I’m not aware of any other APRS applications that know how to decode
the AIS sentences. For applications, such as APRSISCE/32, YAAC, PinPoint APRS, Xastir, etc. Dire Wolf
can translate AIS positions into normal APRS Object Reports.
Simply add the “-A” (upper case A) option to the direwolf command line. Example:
With this method less detailed information will be available because other types of AIS messages will
not be converted.
Applications can connect to the Dire Wolf TNC in a variety of ways. Modern applications allow
connection to a TNC over the network. The TNC and application(s) using it can be on different
computers.
For older applications, that only know how to talk to a hardware TNC over a serial port, the Linux version
provides a “pseudo terminal” which is a virtual serial port with a KISS TNC on the other side.
Windows does not have similar functionality built in so it takes a little more effort to do the same thing.
The User Guide describes the use of “comocom” to create a pair of virtual serial ports, connected to
each other with a “null modem” cable.
Page 7
4.3 OpenCPN
Open Chart Plotter Navigation (OpenCPN) is designed specifically for use a on a boat. Naturally, it knows
how to decode AIS sentences but it doesn’t know anything about packet radio TNCs or APRS or KISS
protocols. We need to communicate with it in a different way.
Install OpenCPN, then download and install some charts, as detailed here:
https://opencpn.org
Select Options > Connections, then click “Add Connection” in the lower pane:
Page 8
Select:
Network
UDP
Make note of the dataport number because we will need this later. 2947 appeared as the default so we
will use that here.
Click OK.
Page 9
Edit the direwolf.conf configuration file and add a line, similar to one of these depending on whether
you want to use a specific IP address or a hostname where OpenCPN is running. Use the same UDP
port number from the OpenCPN connections.
WAYPOINT 192.168.12.34:2947 A
WAYPOINT localhost:2947 A
The “A” at the end is very important. It means that AIS NMEA sentences should be sent.
Run direwolf in the usual way, with the “-B AIS” command line option.
Page 10
Here we see a ship represented by a green triangle. Mousing over the icon will produce details.
Page 11
Right click on the icon and pick “Target List…” to get a list of ships.
As mentioned earlier, I’m about 50 km from the coast and this doesn’t seem to be a very good radio day
with only one ship currently displayed.
My current location is not known to the application so I had to supply a very large Limit Range to see
anything listed here.
Page 12
4.4 Display APRS on OpenCPN
I happened to stumble across something interesting under Options > Ships > AIS Targets.
It seems there is a limited ability to display information, from APRS, by the use of $GPWPL waypoint
location sentences. Waypoints are meant to be stationary points, along a route, so it’s a bit of a kludge
to repurpose them for multiple types of moving objects.
Some Kenwood transceivers, the Dire Wolf software TNC, and perhaps others, can translate received
APRS Positions and Objects into NMEA sentences for display on GPS receivers and other mapping
applications.
Any combination of these can be generated by adding corresponding letters to the WAYPOINT
command in the Dire Wolf configuration file.
Sentence Origin
Config Name Location Altitude Speed Symbol Comment
file &
option Course
$GPWPL APRS N
$PGRMW APRS G *
$PMGNWPL APRS M
$PKWDWPL APRS K
!AIVDM AIS A
* = $PGRMW adds additional attributes to a waypoint with same name.
WAYPOINT localhost:2947 N
This will send a $GPWPL sentence each time an APRS Position or Object Report is received.
Page 13
The feature works but it is not very satisfying when looking at APRS stations on land. The maps
(“charts”) are designed for navigating near the coast and don’t have inland features.
All of the stations show up as a square because $GPWPL does not have provision for a symbol.
($PKWDWPL would have been a much better choice!) Names are displayed when the mouse pointer
hovers over the icon.
Page 14
Page 15