trackmyvessel (TMV) is a tool to receive and decode a live feed of AIS AIVDM signals from ships.
It allows to define a personal list of ships and to track them. It also allows to define certain regions, so that when the ship reaches or leaves the region, an information e-mail is sent.
The program accepts an AIVDM data stream on UDP port 10110 and evaluates each incoming packet individually, compares it with the information from the database and initiates an e-mail dispatch if applicable.
Please be aware that this software is not intended for safety-critical applications, but for hobby use only. I disclaim all responsibility for any damage caused by the use of this software.
- Installing Rbenv (Installation Guide)
for MacOS
brew install rbenv ruby-build
for Debian, Ubuntu and derivatives
sudo apt install rbenv
- Learn how to init
rbenv init
-
Close your Terminal window and open a new one so your changes take effect.
-
Install a Ruby version ~> 2.0
rbenv install 2.7.4
- Switch to your local repository and set your local Ruby version.
rbenv local 2.7.4
- Install bundler for installing ruby gems
gem install bundler
- Specify the local gem installation directory: In the root of your project directory, create a file named .bundle/config (create the .bundle directory if it doesn't exist) and add the following content:
mkdir .bundle/
nano .bundle/config
---
BUNDLE_PATH: "vendor/bundle"
- Now you can install the Gemfile
bundle install
If this fails make sure you have installed the developmental libraries:
sudo apt-get install ruby-dev
sudo apt install libmariadb-dev-compat libmariadb-dev
- Activate the gem environment:
rbenv rehash
This will update the rbenv shims to include the locally installed gems.
I use the MariaDB database.
1a. MacOs
brew install mariadb
and activate it (after each reboot)
mysql.server start
or for auto-start MariaDB service
brew services start mariadb
1b. Debian/Ubuntu
sudo apt install mariadb-server
- Now run the configuration process:
sudo mysql_secure_installation
- Check if the service is running:
sudo systemctl status mariadb
Now you can import the table structures and the data: The user 'vesseltracker' is created and the password 'password' is set. I recommend to change the password in line 12 and 13 before you import the database in tmv_database.sql (combined table structures for all tables and area and terminal data for the port of Hamburg). After that you can import the database:
sudo mariadb < ./database/tmv_database.sql
To create your personal list of vessels to track run
sh ./scripts/tmv_myvessels_insert_new_vessel.sh
and enter the vessel's details. So far you can only enter one vessel at a time.
Add your database credentials to nmea_main.rb:
- IP address at line 50: "@socket.bind('<IPv4>', @port)"
- if necessary: UDP port at line 490: "client = Main.new(<UDP port>)"
Add your database credentials to DB_CONNECT.rb.
Add your mail client credential to nmea_mailer.rb.
In the main repo folder start the program with
ruby nmea_main.rb
- Optimization of the database access to reduce CPU and memory usage
- Implementation of additional features such as
- easier insertion of ships to be tracked into the database
- graphical representation of ship positions
- creation of a dashboard with additional information about the ships
This software is licensed with CC BY-NC-SA 4.0