Automatic Position Updater for NFL, using the NMEA stream of the boat.
Go to file
2025-09-17 07:27:26 +00:00
.gitignore Initial commit 2025-09-16 07:41:22 +00:00
LICENSE Initial commit 2025-09-16 07:41:22 +00:00
nfl-apu.pl Initial release 2025-09-17 07:27:26 +00:00
README.md Initial release 2025-09-17 07:27:26 +00:00

NFLpositionUpdater

Automatic Position Updater for NFL (https://NoForeignLand.com), using the NMEA stream of your boat.

This script takes the NMEA stream from the UDP/TCP network of the boat, or directly from OpenCPN. It periodically updates the boat position on NoForeignLand.com by sending them a position update e-mail.

The script distuingishes between stationary updates ("at anchor") and while sailing. When sailing, optionally the speed and course over ground are added to the report. Position updates will be send at a configurable distance interval (default 2nm). The position update is deliberately one unit "behind", so that when the boat arrives at its destination, regardless of the distance of the most recent position update, the distance is sufficently large to be accepted by NFL for an accurate final update. This way the anchor spot is always spot on. Furthermore, when arrived, optionally the depth will be added to the message.

An "arrival" is determined by the speed of the boat being less than 0.4 kts for at least 10 minutes, and a distance of at least 0.1nm from the most recent position update.

I wrote this script because none of the suggested tracking options on the NFL website were suitable to me.

I had hoped to be able to use a more efficient way of updating the position than by sending e-mails, but despite multiple attemps, I never got any replies from the NFL support e-mail address.

This script is open source, and a master copy is maintained at https://git.TheFloatingLab.world/NFLpositionUpdater. This is part of the website https://www.thefloatinglab.world where you can find my contact details and other information.

I'm in no way affiliated with NFL. Use this software "as is".

Installation

This is a Perl script. It should run "out of the box" on any Linux system, and most likely also on Windows and Mac systems. There is no installation required, just copy the script to a suitable location. On linux, you need to set the "executable" flag, either via a file manager GUI or on the command line with "sudo chmod a+x nfl-apu.pl". You can then test run the program with "perl nfl-apu.pl -?". It should respond with a help screen.

Usage

The program is started from the command line. A few command line options are necessary. The available options are:

Control options

  • -h --help Display help
  • -T --test Debug output
  • -d --daemon Run as daemon

NMEA connection options

  • -t --tcp Use TCP source instead of UDP
  • -g --gpsd Use GPSD source The IP address and port of the NMEA stream are given as the final option on the command line. See example below

Update options

  • -x --extended Extended updates (with SOG, COG, DPT)
  • -i --interval= Nautical miles between position updates (default $interval). A value 0 means "arrival updates only"

Email options

  • -u --user= Email account inlog user
  • -w --password= The password associated with the user account
  • -s --server= SMTP server
  • -p --port= SMTP port (default $port)
  • -e --email= Source email address
  • -o --override= Override destination email address (default '$destination')

Example:

perl nfl-apu.pl -t -g -i=2 -x -u=Frans -s=mail.fransveldman.nl -e=noreply@thefloatinglab.world 127.0.0.1:2947

NMEA source

The NMEA stream must be somehow accessible on the computer. There are a few possible sources:

  • You have an NMEA multiplexer with a WiFi and/or Ethernet output.
  • You have a "GPS-mouse" connected to the computer.
  • You run OpenCPN on the computer.

You need to consult the documentation of these sources to see how they deliver the NMEA stream on the network.

  • If you have an NMEA multiplexer, the NMEA stream is often available on port 10110. You can then use "192.168.1.255:10110" as a source. The first three octets are from your network, the 255 is the broadcast address, the 10110 part is the port.
  • If you have a GPS-mouse, they can often be made available on the network via the program GPSD.
  • If you run OpenCPN, you can in the connections screen configure an output for its NMEA data.

If you configure one of the above options, select UDP instead of TCP if possible. UDP is more suitable for this kind of services. If you need to select a port, use 10110 because this port is dedicated to NMEA streaming.

By default, nfl-apu assumes an UDP port. If you use TCP, use the -t option. If you use GPSD, use the -g option.

Email

For sending position update emails you are going to use your own e-mail account. You need to provide:

  • Your e-mail account user name.
  • Your e-mail account password.
  • The smtp server (like "smtp.gmail.com")
  • The port number of the smtp server (default 587, leave it as is, unless you are sure that your server is one of the rare cases with a non standard e-mail submission port).
  • Your e-mail address.
  • The destination e-mail address is already set by default to deliver the e-mails to NFL, but for testing you can use the -o (--override) option to set a different destination.

The e-mail account user name and your e-mail address are often the same. Consult the information of your e-mail provider.

If you are not comfortable with writing the password on the command line, you can leave it away. At startup, nfl-apu will then ask you to type the password.

Note that nfl-apu is completely open source. Anyone with some knowledge of programming can confirm that the command line options are only used for their intended purpose. Nothing is stored or send anywhere else. Your inlog credentials are only send to your e-mail provider, who has to verify that you have the right to use that e-mail account to submit a message.

Additional options

By default, nfl-apu will update your position at every 2 nm. For slow boats, you might want to set it to 1, for fast boats, you could set a higher number. For a boat sailing with 6 kts, the default will send 3 e-mails per hour. If you don't want position updates "on the move", you can set the value to 0. In that case, only an update will be send when you have arrived at your destination. You are assumed to have arrived somewhere if the boat speed is less than 0.4 kts for at least 10 minutes.

The -x (--extended) option will add your SOG and COG to the position update, or the DEPTH when you are at anchor. The public can find this information if they read the "story" of your travel.

By default, nfl-apu will start as a normal program, so it "occupies" the terminal as long as it runs, and if you close the terminal it will stop. This is nice for testing, but once this is finished, it is better to use the -d (--daemon) option. The program will start "as a service process" and stay active in the background.

Troubleshooting

First you need to establish that you have an NMEA input. When started, nfl-apu will almost immediately put a message on the screen saying "NMEA stream detected". It will then quickly follow with a one time location and depth report on the screen.

If the problem is with e-mail, use the -T (--test) option. It will output the conversation between the e-mail provider and nfl-apu. An "authentication error" means that eihter the user name or the password is incorrect. For gmail, the server is smtp.gmail.com and the port is 587. For those who only use gmail via the app or web-interface, you might need to configure a password so that thirdt party e-mail clients can use the service.