Compared to the other capabilities in this repo, GPS loss alerting is more complex. You need to set up signalk. Then you should be prepared to run python programs, and configure parameters that enable sending alerts to internet messaging services.
GPS Loss Alerting is accomplished by two python programs:
diff_starlink_gps.py relies on signalk being set up to publish Starlink position and GPS data. In turn, this requires you to have set up Starlink to publish position data.
The programs come with .service files which allow them to run as services that start automatically upon boot and run in the background on an Ubuntu linux system. If you have a Raspberry Pi, you could set it up as a server and run these programs on it.
First, we describe how to set up signalk. Then we go on to set up diff_starlink_gps.py and starlink_gps_alert.py and its configuration file.
The alerting system has been designed to be extensible to other alerting technologies besides email and Telegram messages. The system comprises:
You can extend the system to other notification techniques by monitoring the alert file: $HOME/logs/starlink_gps_alerts.txt. Anytime the file changes, it means there’s an alert to be sent, and the file contains the timestamp and description for the alert. If you have some other program that can monitor that file and do your favorite thing, feel free to use it in place of starlink_gps_alert.py.
Note: signalk standard/default convention is to have 192.168.1.xxx:3000 as the path to control/view signalk. Port 3000 was already taken on my server with a grafana page, so I changed the default to port 80 for my signalk.
To add the signalk-starlink plugin to your signalk, login to signalk
(top right, three horizontal lines)
then click on Appstore, then Available
You will find the plugin here.
The next step is to configure the signalk-starlink plugin by going to
Server, then Plugin Config, and look for Starlink
You will want to enable it, then check the option for “Use Starlink as a GPS
source (requires enabling starlink access on local network
as previously described).”
Restart signalk, and then using the Data Browser for siganlk, look for the path
navigation.position. You probably have multiple of these, but one should have
signalk-starlink in the far right Source column. Note the path for
the other “navigation.position” source that you want to use to
compare against stalink position.

All the following steps must be done on the computer (Windows or Linux) that you are going to run the Loss-Alerting software on.
cd starlink_position-0.2/GPS_loss_alerting
python -m pip install -r requirements.txt
Note: if you are installing on Ubuntu 24.04 or later you might want to create and activate a virtual environment. Google for instructions on that.
The alerting program, starlink_gps_alert.py sends alerts via gmail to any email address, and also sends alerts via Telegram to any configured Telegram app. Configuration is done in a file, “alerting_secrets.py”, which you create by copying alerting_secrets_template.py.
You can drop one or the other of email and Telegram alerts by setting the gmail_alert_enabled or telegram_alert_enabled variables in the alerting_secrets.py files to False.
Copy the file alerting_secrets_template.py to alerting_secrets.py. This file will contain your passwords and secrets - never make it public. Open alerting_secrets.py in a text editor.
Telegram is a messaging service that’s like WhatsApp. It has an associated phone app which will receive the alerts.
Using Telegram alerts involves creating a bot in Telegram which starlink_gps_alert.py sends alerts to. The bot passes the alerts along to the Telegram app installed on your phone.
Install the Telegram app on your phone and create a Telegram account if you don’t have one.
Google “I want to set up a telegram bot to receive messages sent to it and send them on to the telegram app on my phone. I am sending the messages from a python script which posts a BOT_ID and CHAT_ID and message to the bot.” Follow the AI instructions which cover how to create the bot and establish communications between it and the Telegram app on your phone.
Out of this process you will obtain a BOT_TOKEN and a CHAT_ID. Edit alert_secrets.py and enter the BOT_TOKEN and CHAT_ID into the appropriate places in that file. You can have one or more bots - one for each Telegram user who is to receive alerts. Delete any unused entry in the alert_secrets.py file.
In a command window or shell, run:
python diff_starlink_gps.py
It should display something like:
2026-02-04 03:43:12,037 - INFO - GpsAlerter initialized.
2026-02-04 03:43:12,038 - INFO - Starting GPS Alerter...
2026-02-04 03:43:12,067 - INFO - Connected to Signal K websocket at ws://192.168.1.116:80/signalk/v1/stream?subscribe=none
2026-02-04 03:43:12,067 - INFO - Subscribed to navigation.position updates.
2026-02-04 03:43:14,900 - INFO - Starlink Position: 4° 7.298' N, 73° 27.873' E. GPS delta: 0.004 NM (max: 0.004 NM)
2026-02-04 03:44:29,911 - INFO - Starlink Position: 4° 7.298' N, 73° 27.873' E. GPS delta: 0.004 NM (max: 0.004 NM)
2026-02-04 03:45:44,893 - INFO - Starlink Position: 4° 7.298' N, 73° 27.873' E. GPS delta: 0.004 NM (max: 0.004 NM)
Observe the delta-distance between the location provided by Starlink and that provided by GPS. In a normal environment, the GPS delta should be a small fraction of a mile.
The program writes logs to a file: $HOME/logs/starlink_gps_logs.txt, and you can look at the history of position readings and current and max difference between Starlink and GPS.
The program writes alerts to a file: $HOME/logs/starlink_gps_alerts.txt, from where they may be read and removed by the alerting program: starlink_gps_alert.py
You can also start diff_starlink_gps.py in self-test mode by running it with the -t option. This is useful for testing that the alerting process is working correctly.
python diff_starlink_gps.py -t
In self-test mode, it simulates all the faults it can detect and sends alerts, spaced a few minutes apart, for each one. After it has simulated all the faults it returns to normal operation, checking for real faults. If you have configured sending alerts properly you should see an alert for each simulated fault.
In a command window or shell, run:
python starlink_gps_alert.py
You should receive an email and a Telegram message with a startup message from the app.
Different OS’s and versions deal with services differently. For Ubuntu 22.04 you should copy diff_starlink_gps.service and starlink_gps_alert.service to /etc/systemd/system, then run the following commands to activate the services.
sudo systemctl daemon reload
sudo systemctl enable starlink_gps_alert
sudo systemctl start starlink_gps_alert
sudo systemctl enable diff_starlink_gps
sudo systemctl start diff_starlink_gps
Use Google to tell you how to configure services on other OS’s or versions.
Wait for an message saying GPS is wrong. Check logs to confirm. Switch to alternate navigation. Sail on happily with good position. :-)