Figure 1 San Diego, California
|
|
The Automatic Position Reporting System is one of the most popular facets of amateur radio today. It is a marriage of several cutting edge technologies including the Global Positioning System (GPS), amateur packet radio, and the global Internet. It incorporates satellite technology, wireless networks, and both analog and digital communication. The applications to support the APRS protocol are also sophisticated. They provide the user with an easy to use interface into the APRS world. Software such as MacAPRS for the Apple Macintosh, WinAPRS for Windows 95/NT, and APRSdos for DOS machines provide powerful and elegant solutions. With this software and support system, it is possible to display any APRS network. Other support software for APRS includes the work of Steve Dimse, K4HG, who extended the concept for the promulgation of APRS packets to the Internet with javAPRS. In addition, Steve Boyle, KD6WXD; and Dale Heatherington, WA4DSY, developed APRS servers for the Internet which allow users to remotely connect to the server and examine remote APRS networks.
These programs provide flexibility, functionality, and a highly visual means for tracking APRS activity. However, they are passive in that they provide predominately monitoring functionality. They do not provide the ability to control. For example, if you wish to know when an APRS tracker escorting marathon runners reaches a specific location, you need more than monitoring capability, you need control functionality. It is this ability that PerlAPRS provides.
PerlAPRS is a program written in the Perl computer language. Perl runs on all popular computer platforms today including MacOS, Windows3.1/95/NT, AMIGA, Unix, Linux, and many more. In addition, since Perl is compiled at run time, there is no need for a version precompiled or packaged for a specific platform. Also, since all source code is included for PerlAPRS, the user may easily alter the program to meet specific needs and is encouraged to do so. However, most users will find modifying the shell scripts rather than the program should meet most requirements.
PerlAPRS examines incoming packets from an APRS network and executes commands when a callsign and location match the criteria specified by the user. Location criteria is specified using grid squares. For example, when KC5PVL enters grid square DM12LW, a computer command specified by the user can be automatically executed.Figure 1 shows grid squares overlaid on the city of San Diego, California, it will serve as the basis for the examples in this paper. The map shows several grid squares that are targeted for an action when the criteria specified in the callsign.dat file is met.
When PerlAPRS starts, it reads the user's callsign database file with the default filename of callsign.dat. This file provides the list of callsigns that PerlAPRS is to search for. The file consists of one or more lines of text as shown in Figure 2. A separate line (record) is required for each callsign. Each line of the file is further broken into five fields, a separate field for each parameter.
KI6MP-10 cmd2.sh DM12JV 2 1440 KC6VVT-9 cmd1.sh DM12IT 3 1440 KD6AZU cmd3.sh DM12KR 3 180 KE6PHB cmd4.sh DM12LT 5 60 * cmd5.sh DM12LN 2 60
The first field indicates the callsign that PerlAPRS is to listen for. In the example, PerlAPRS will listen for KI6MP-10, along with KC6VVT-9, KD6AZU, and KE6PHB. The asterisk character, shown on the last line of the example, is a wildcard that means "any" callsign.
The second field indicates the command that will be executed when the callsign is heard. It can be any computer command, however, as we will discuss later, shell scripts are powerful and easily implement commands. In the example, cmd2.sh will be executed when KI6MP-10 is heard.
The third field represents the grid square in which the callsign must be heard. Returning to the example, PerlAPRS is listening for KI6MP-10 in grid square DM12JV. The fourth field is provided to limit the number of times the command is executed during an active period. This parameter is necessitated by the repetitive nature of APRS packets. For example, if a station continues to broadcast packets while located within the grid square, the command would be executed each time a packet is heard. Since some APRS packets (e.g., mobile) are transmitted every few minutes, in many cases it would be undesirable to have the command executed repetitively in a short period. For this reason, the value is typically a small number (e.g., 1-5). However, indicating a large value will cause the command to be executed virtually without limit. Conversely, if one wishes to disable execution, setting the value to zero essentially disables the command without removing it from the database. In the example, the command, cmd2.sh, will be executed no more than 2 times during an active period.
The last field is provided to allow the user to specify the active period. The active period is the time expressed in minutes in which PerlAPRS is actively listening for the specified callsign. This is important, since without a means of resetting the execution counter, it would be inconvenient to leave the program running for an extended period (e.g., many weeks).
The following scenario may help to illustrate the need for specifying the active period. Assume we wish to leave
PerlAPRS running indefinitely. Also assume we don't want to execute a command every time a packet is heard since this
could be hundreds of time during a 24 hour period. If we set the execution counter to a small value, we will limit the
number of times the command is executed. However, once that count is reached, commands will no longer be executed. The
active period parameter is therefore provided to allow the user to specify when the execution counter specified in
field 4 is to be reset. Returning to our example, we see that a command will be executed no more than 2 times in a 24
hour (1440 minutes) period for KI6MP-10. At the end of the 24 hour period, the counter is reset and the command can
again be executed up to 2 times during the next active period.
When PerlAPRS begins it reads in the callsign file and shows the original information provided by the user along with the conversion of the grid square to latitude and longitude. To completely describe the grid square, requires the latitude and longitude of the lower left and upper right points of the square. These corner points are used by PerlAPRS to determine if the station is within the grid square.
[rparry@blue aprs]$ perlAPRS -s
*** USER DATA ***
Callsign Command Grid Exe Reset LwrLat LwrLon UprLat UprLon
1 KI6MP-10 cmd2.sh DM12JV 2 1440 3252.0 -11715.0 3255.0 -11710.0
2 KC6VVT-9 cmd1.sh DM12IT 3 1440 3247.5 -11720.0 3250.0 -11715.0
3 KD6AZU cmd3.sh DM12KR 3 180 3242.5 -11710.0 3245.0 -11705.0
4 KE6PHB cmd4.sh DM12LT 5 60 3247.5 -11705.0 3250.0 -11700.0
5 * cmd5.sh DM12LN 2 60 3232.5 -11705.0 3235.0 -11700.0
perlAPRS -h
perlAPRS -helpperlAPRS -v
perlAPRS -versionperlAPRS -s
perlAPRS -showperlAPRS
-d
perlAPRS -debugperlAPRS -d -sperlAPRS -p /dev/cua2 perlAPRS -port /dev/cua2perlAPRS -p www.wa4dsy.radio.org:14579
perlAPRS -p sboyle.slip.netcom.com:14579
perlAPRS -p www.ne1h.radio.org:14579perlAPRS -p
trip.tncperlAPRS -f callsign2.datperlAPRS &
Packet= KD6AZU>APRS,KD4DLT-7,N4NEQ-2,WIDE*:@042327/3243.70N/11707.70W/0
KD6AZU 3243.700 11707.700
- KI6MP-10 DM12JV
- KC6VVT-9 DM12IT
* KD6AZU DM12KR Sun Aug 10 15:56:13 1997 3
Sun Aug 10 15:57:13 1997 1 cmd3.sh
- KE6PHB DM12LT
- * DM12LN
Packet= KD6AZU>APRS,KD4DLT-7,N4NEQ-2,WIDE*:@042327/3243.70N/11707.70W/0
KD6AZU 3243.700 11707.700
- KI6MP-10 DM12JV
- KC6VVT-9 DM12IT
* KD6AZU DM12KR Sun Aug 10 15:56:23 1997 3
Sun Aug 10 15:57:13 1997 2 cmd3.sh
- KE6PHB DM12LT
- * DM12LN
Packet= KD6AZU>APRS,KD4DLT-7,N4NEQ-2,WIDE*:@042327/3243.70N/11707.70W/0
KD6AZU 3243.700 11707.700
- KI6MP-10 DM12JV
- KC6VVT-9 DM12IT
* KD6AZU DM12KR Sun Aug 10 15:56:34 1997 3
Sun Aug 10 15:57:13 1997 3 cmd3.sh
- KE6PHB DM12LT
- * DM12LN
Packet= KD6AZU>APRS,KD4DLT-7,N4NEQ-2,WIDE*:@042327/3243.70N/11707.70W/0
KD6AZU 3243.700 11707.700
- KI6MP-10 DM12JV
- KC6VVT-9 DM12IT
* KD6AZU DM12KR Sun Aug 10 15:56:44 1997 3
Sun Aug 10 15:57:13 1997 3 cmd3.sh
- KE6PHB DM12LT
- * DM12LN
Packet= KD6AZU>APRS,KD4DLT-7,N4NEQ-2,WIDE*:@042327/3243.70N/11707.70W/0
KD6AZU 3243.700 11707.700
- KI6MP-10 DM12JV
- KC6VVT-9 DM12IT
* KD6AZU DM12KR Sun Aug 10 15:57:14 1997 3
Sun Aug 10 15:58:14 1997 1 cmd3.sh
- KE6PHB DM12LT
- * DM12LN

Note that only the longitudinal distance varies between the southern and northern portion of the United States. The reason for this apparent anomaly stems from the fact that lines of latitude are parallel to each other and therefore separated by a constant distance. Lines of longitude are not parallel, they meet at the poles and are farthest apart at the equator.
chmod 755 perlAPRS to set the permissions correctly.dev/cua1". On some systems, I/O default permissions are limited to root
only. If you get the error message, "Can't open PORT /dev/cua1" the permissions may need to be altered.
This is done with, "chmod 666 /dev/cua1". If you are not sure, use "ls -l /dev/cua1"
to check.Socket.pm which should be included with every Perl distribution. This
module is required only to support perlAPRS's ability to get APRS packets from the Internet. If you get an error
message that perlAPRS can't find the module, you can check where perl is looking by type at the command prompt:
perl -e 'print "@INC\n";'. The variable @INC is the "include" array which tells perl where to look
for the modules and other things that it needs. If your Socket.pm is not located where perl is looking, then you need
to add your directory path to the @INC array with either of the following, the first is preferred.use lib
'/mypath/toSocket.pm'BEGIN {unshift (@INC, '/mypath/toSocket.pm/'}The code needs to be added prior to the command: use
Socket, for example:use lib '/mypath/toSocket.pm'
require 5.002;
use Socket;
use strict;