In the early 2000’s , together with Piero I7IGX, an APRS digipeater was installed in Trani, my Town. For about an entire decade, the Digipeater IZ7BOJ-11 was almost alone in the region, but..starting from 2016, thanks to my dear friend Luigi IZ0YAY (now back in zone 7 for QRL), the interest for APRS increased again!
Luigi involved other OMs and other digipeaters were installed. A beautiful technical exchange started between the sysops, and sometime we had to announce temporary down-time of our nodes on a whatsapp group.
Most of us are very busy for QRL, so it’s not easy to constantly monitor the state of our node, then I thought to an automatic monitoring system, whit these two simple purposes:
- Gather information of all nodes of the group and show the situation in a simple (possibly graphical way)
- Sends alerts on whatsapp or telegram in case of technical problems on the nodes.
The first concern was: how it’s possible to determine the status of a Digipeater or I-gate, in terms of vitality? Well, the first idea is to use the most powerful database in order to see the “last heard” time. This is possible thanks to aprs.fi and its API, which allow the direct connection of a custumer application directly to the database.
The second concern was: given that the method to determine the vitality is the “last heard time”, which is the right timeout before declare a problem on a station? Well, this parameters has been tuned experimentally.
I then developed a simple web interface in php, and emedded a view of all apulian station in APRSdirect (I had some problem trying to enclose aprs.fi into a view).
Here below a picture with a tipical situation.
The website is hosted at http://iz7boj.dyndns.org/aprsdash/aprsdash.php
The main query is the following:
which returns, for every station declared in $stationsquery, its basic location and other basic data, including “last heard” in JSON format (see aprs.fi api help for furher details)
The variable “$stationsquery” is declared inside the config.php file.
The output of the query is then parsed and the last time converted from Unix Time to a human readable format, then compared to the timeout.
The source of the packet (TCP-IP or RF) is also showed. This information is useful in order to understand if a compound station Digi+Igate has problem on RF side.
The sources are available at: https://github.com/IZ7BOJ/APRS_dashboard .
If you want to use the dashboard, you must have php libraries and a web server installed. Copy the content from Github to your web server folder, then edit config.php file with the following informations:
- stations to observe
- aprs.fi APIkey (you must have an account or aprs.fi)
- timeout (default is 30min)
Well, now we have gathered all the necessary information to a dashboard. This is helpful, but you will never now that your node has a problem, unless you open the dashboard. For this reason, I thought to an automatic systems which sends alerts to our smartphones. Telegram is the easiest choise, since is an open-source and well documented Application.
Preferrably, the criteria for the vitality should be the same of the dashboard (last heard) and the database should be aprs.fi again.
After some researches on telegram BOTs under python, I found a very useful library to install to my raspberry for sending notification: the library is “telegram-send“.
You can install telegram-send with pip:
sudo pip3 install telegram-send
then, depending by the destination of your messages, you can choose:
- telegram-send –configure if you want to send to your account
- telegram-send –configure-group to send to a group
- telegram-send –configure-channel to send to a channel
The source code can be found here:
Note that the daemon should continuously run in background, since it stores the status of the nodes (in terms of “dead/alive”) and sends messages only when a state change is triggered (from dead to alive and viceversa).
This daemon runs and sends notifications since summer 2018 and no problems are detected.
Here below, a screenshot of some messages received on telegram is reported, for example only: