forked from OpenCPN/OpenCPN
-
Notifications
You must be signed in to change notification settings - Fork 3
RTL SDR AIS on macOS
Ersin edited this page Apr 15, 2022
·
3 revisions
- Move somewhere close to a waterway full of vessels transmitting AIS signals...
- Get a suitable dongle with Realtek RTL2832U chipset
- Configure Homebrew on your Mac
- Get GQRX from http://gqrx.dk/download
- Mount the DMG
- Pull
Gqrx.app
into yourApplications
- Connect the dongle to a USB port of your Mac
- Start GQRX (Depending on your security settings you may need to
Ctrl
-click it and select Open from the context menu to be able to run it) and configure it to use your dongle: - Tune to 161.975 MHz
- Turn on Hardware AGC on the
Input controls
tab - Start DSP (
⌘
+D
, from theFile
menu or clicking the "power" icon in the toolbar) - Wait until the dongle gets sufficiently warm and the internal crystal oscillates with it's normal error (Few minutes should be fine)
- If you are lucky enough, you already can identify traces of AIS radio signals (like the ones in the blue circle on screenshot above)
- Switch to the
FFT Settings
tab and setRef. level
slider all the way to the right to 0 - Adjust the
dB range
slider so that the histogram in the upper left part of the window "sits" more or less on the bottom of it's area and the bottom part is almost all black with occasional light spots more or less in the center (These are hopefully radio bursts from the AIS transponders in range) - Adjust the zoom slider to make the AIS radio bursts more apparent. Normally the value should be something like 10 or a bit more.
- Retune to the middle of channel A bursts by dragging the centerline of the histogram display in the upper left part on the screen to the middle of the radio bursts
- Read and annotate the frequency value, which usually is a bit less than the nominal AIS channel A frequency of 161.975 MHz
- Calculate your PPM using the following formula:
1000000 * (161.975 - YOUR_VALUE) / 161.975
Ex.:1000000 * (161.975-161.968)/161.975 ~= 43
- Exit GQRX
- Open
Terminal
- Install RTL-AIS using
brew install nohal/navutils/rtl-ais
- Cross your fingers and try to capture some targets using RTL-AIS:
rtl_ais -p <YOUR_PPM> -n
, replacing<YOUR_PPM>
with the value you calculated for your very dongle in the previous step.
You should see something similar to:
Edge tuning disabled.
DC filter enabled.
RTL AGC disabled.
Internal AIS decoder enabled.
Buffer size: 163.84 mS
Downsample factor: 64
Low pass: 25000 Hz
Output: 48000 Hz
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Log NMEA sentences to console ON
AIS data will be sent to 127.0.0.1 port 10110
Tuner gain set to automatic.
Tuner error set to 43 ppm.
Tuned to 162000000 Hz.
Sampling at 1600000 S/s.
And in a while AIS NMEA0183 message should start appearing on your screen:
!AIVDM,1,1,,A,406cnniv27Bb4s7FrmP`vii02D06,0*62
!AIVDM,1,1,,A,406cnniv27Bb4s7FrmP`vii02D06,0*62
!AIVDM,1,1,,A,1JLUjp8000K7El?P`ka<Wa4B0000,0*7A
!AIVDM,1,1,,A,1JLUjp8000K7El?P`ka<Wa4B0000,0*7A
- Start
OpenCPN
go toToolbox
->Connections
and set up a network type connection usingUDP
protocol, andlocalhost
port10110
and the targets should start appearing shortly.
- Get HDSDR OSX - Jan 2016.dmg from http://k1fm.us/2016/01/hdsdr-on-osx-the-easy-way-sdrplay-edition/
- Mount the DMG, pull rtl_tcp.app into your Applications
- You may also find the rest of the contents of this bundle (Notably the HDSDR packaged with Wine and easily runnable on macOS) useful, but we are not going to need it just now.
- Open Terminal, type
/Applications/rtl_tcp.app/Contents/Resources/rtl_tcp
and hit
nohalombp:rtl-ais nohal$ /Applications/rtl_tcp.app/Contents/Resources/rtl_tcp
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuned to 100000000 Hz.
listening...
Use the device argument 'rtl_tcp=127.0.0.1:1234' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).