This is the companion piece to Floatr. It receives, decodes, converts and persists AIS messages received with your SDR.
- An antenna and SDR. I highly recommend an FM notch filter and 162 MHz bandpass filter as well.
- nmea_plus
- AIS-catcher
In order for Floatr to work correctly, two services must run (I use systemd):
decode-ais.sh
uses your SDR to turn radio signals into AIVDM sentences with AIS-catcherlog-ais.sh
parses these sentences with nmea_plus and saves them to the database
You'll need to replace the following placeholders throughout:
RAILS_APPLICATION_PATH
- path to the Floatr applicationDECODER_PATH
- path to AIS-catcherFLOATR_SERVICE_PATH
- path to ais.rb (i.e./usr/local/share/floatr/
)RBENV_PATH
- i.e./home/username/.rbenv/shims/ruby
Ideally, the services work like this:
- Your antenna receives AIS messages...
- That are decoded into AIVDM sentences by
decode-ais.sh
... - And echoed to port 4159.
- The output of this port is then piped into
log-ais.sh
... - Where it's parsed into Active Record objects by
ais.rb
... - And saved to the database for the Rails application to consume.
Note that it's possible to replace decode-ais.sh
with any stream of AIVDM sentences (from another service, STDIN, etc.)