Aprs Interaction Examples

Interaction with the APRS servers

You need to create a simple TCP connection and the dialog is all-text, thus no binary stuff.


Ask the DNS for aprs.glidernet.org port 14580.
There are more than one APRS server thus you may get different IP each time you ask.
This is normal and good, as it spreads the loads over the available servers
and in case one server is down you will be eventually redirected to another one.

Don't stick with one particular server and/or one particular IP unless you have a good reason.

If your connection fails then restart: ask again the DNS, attempt to connect, etc.

If you want to terminate then simply close the TCP connection, no other action is needed.

Login process

Once the TCP connection is established you need to login to the server.
The first line you send to the APRS server should contain the login information.
You need to choose an APRS name for you system or your device and you need to produce the password for it (which is a 15-bit unsigned number.
Ask us how to produce a password or consult the open sources (we will explain why so).

We take here a case of a device which wants to report its position onto the OGN and would like to get position of other devices within certain range, say 10km.
We choose a sample name for the device: OGN123456 (please choose another name…) the login line would look like this:

user OGN123456 pass 12345 vers DemoApp 0.0.0 filter m/10

the password here is not correct, ask us for the algorithm.
Replace "DemoApp" with your application name and "0.0.0" with the actual version number of your real application.
"m/10" says to the APRS server: forward me positions of all devices within 10km from the position I am going to report for myself.

The server will respond with the message like this:

# logresp OGN123456 verified, server GLIDERN4

To read more about connecting and login to the APRS server: [http://www.aprs-is.net/Connecting.aspx]
To read mode about filters that can be applied for you by the APRS server: [http://www.aprs-is.net/javAPRSFilter.aspx]

Please avoid pulling excessive amount of data fromt he server: it contributes to the internet traffic at the server and at your device, where it can be critical if the link is for example GPRS.

The actual dialog

Once you are logged in, the actual dialog follows.

You report your position (which gets distributed to others) and the APRS server sends you position of other devices within the range you asked for (here 10km).

About every 20 seconds you will as well receive a keep-alive message, just to let you know the server and the connection is still up.
If you don't hear anything for like 1 minute you should drop the connection and restart by asking the DNS for the IP, connecting, etc.

Position report

You can report your position by sending lines like this:

OGN123456>OGNAPP:/123456h5123.45N/00123.45E'180/025/A=001000 !W66! id07123456 +100fpm +1.0rot FL011.00 gps4x5

Which means:
my position at time 12:34:56 UTC is/was 51deg 23.456min north and 001deg 23.456min east,
ground track is 180deg, ground speed is 25knots, altitude is 1000feet AMSL, standard pressure altitude is 1100feet,
climbing rate is +100 feet-per-minute, ground turning rate is 180deg/min, GPS accuracy is 4m horizontal, 5m vertical
I am a glider: Aircraft-type = 1 encode in the id07123456 and as well in the APRS two-character icon

In the position message, the characters up to the !Wxx! follow exactly the APRS standard.
The fields after are "comments" thus are free in format and content and are used by OGN to pass more information.

You need to replace OGNAPP, this is called TO-CALL, which tells your system and/or transmission method.
Please speak to us about the proper name.

Please do not send your position each and every second as this will make lot of data which is not useful.
The current police is to send new position only in case if the track is not well predictable thus unexpected maneuvering takes place.
The ground stations report received positions on average every 5 seconds for a flying/moving device and every 20 seconds for a stationary device.
If a device goes beyond a normal flying envelope like high sink and/or high turning rate then every known position is reported.

Please report your position with a correct and precise UTC timestamp.

Report your status and other information

You can report the status of your device and other information like registration, pilot, airfield, etc.

OGN Tracker report the information like this:

OGN123456>OGNTRK:>112146h Reg=SP-XXX Base=EPXX

These are status message, the different from the position messages is the first character after the colon ':'

this is feature is new and not yet well established. the currently used list of fields:

     char   Pilot[InfoParmLen];                // Pilot name
     char   Manuf[InfoParmLen];                // Manufacturer
     char   Model[InfoParmLen];                // Model
     char    Type[InfoParmLen];                // Type
     char      SN[InfoParmLen];                // Serial Number
     char     Reg[InfoParmLen];                // Registration
     char      ID[InfoParmLen];                // Competition ID
     char   Class[InfoParmLen];                // Competition class
     char    Task[InfoParmLen];                // Competition task
     char    Base[InfoParmLen];                // Base airfield
     char     ICE[InfoParmLen];                // In Case of Emergency
     char PilotID[InfoParmLen];                // Pilot ID based on his BT or WiFi MAC
     char    Hard[InfoParmLen];                // Hardware
     char    Soft[InfoParmLen];                // Software

is subject to changes and adjustments

Keep the rate of status messages low, unless needed. Messages on APRS almsot never get lost thus you don't need to resend them "just in case".
As a general rule "constant" information (like for example the positions of the ground stations) should be send on the APRS about every 5 minutes.

Other devices positions forwarded to you by the server

The APRS server will forward you the positions of other devices, like this:

OGN82149C>OGNTRK,qAS,OxfBarton:/130208h5145.95N/00111.50W'232/000/A=000295 !W33! id3782149C +000fpm -4.3rot FL000.00 55.0dB 0e -3.7kHz gps3x5

Which contains similar information like you send in your position report.
There are some additional fields like who received the signal: OxfBarton and the transmission method (OGNTRK) and signal strength 55.0dB
You are most likely interested in the position, but you can use other info as well.

If you parse these message, first look for a colon ':' - this splits the actual message from the header.
You can then parse the message starting from the first character after the colon.

Second: look for the '>' in the header: this splits the source ID from the reset of the header.

Now you have the source ID (who's position is this) and the position itself in the message.

The position reports of other devices can be send at any time, not as a response to your position reports
thus you should read the data from the APRS connection all the time or at regular intervals even when not sending your own position.

Keep-alive messages by the APRS server

About every 20 seconds you will get a keep-alive message like this one:

# aprsc 2.1.4-g408ed49 2 Nov 2019 14:48:58 GMT GLIDERN4

They always start with a hash '#': you can take them as sign of the connection and the server being alive and you can crosscheck your system time.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License