GPS.TXT           GPS or LORAN INTERFACED TO APRS
===========================================================================
Document version: 8.4.6.   (previous version was 8.3.5)
Document dated:   18 Jan 2000 ( had been 10 Mar 99)
Author(s):        Bob Bruninga, WB4APR <bruninga@nadn.navy.mil>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ABSTRACT
GPS.TXT           An overview of GPS with APRS, plus GPS equipment summary,
                  detailed schematics of GPS interfaces, detailed schematic
                  of the Hardware Single Port (HSP) interface to allow a 
                  GPS and a TNC to share a single COM port, and information
                  on differential GPS correction.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


NEW in 846:
     APRSdos can now send STATIONS and OBJECTS for display on standalone
     TRACKER's GPS map displays.  Just select station on P-LIST and hit
     W for Waypoint.  APRSdos will then transmit out an NMEA Waypoint for
     that station when ever a new posit comes in.  If the GPS on the
     tracker is wired to the TNC receive data line, the GPS should
     display the station!  NOTE. Since APRSdos also displays WAYPOINTS,
     (for connection to the GPS port of a Kenwood data radio, this
     should be disabled or you will capture duplicate posits.  The
     alt-SETUP-MODES-WAYPOINTS or CONTROLS-FILTERS-WAYPOINTS commands
     will disable these duplicate captures.
END NEW

     All GPS units (except for aviation and some without serial ports)
output data according to the National Marine Electronics Standard, NMEA-
0183.  The data is generated about once every 2 seconds and APRS will
capture the needed position, course and speed.  There are two distinct 
arrangements:

  STAND-ALONE-TRACKER - This is the combination of a GPS, a TNC and a
  radio.  It tansmits raw NMEA data over the air.  There is no laptop,
  no APRS nor any display in the vehicle.   It is a TNC function.
  (Although the GPS can display WAYPOINTS transmitted by APRSdos 846.)

  APRS-MOBILE  - The GPS is connected to an APRS serial port and APRS 
  uses the data to transmit its own shorter formats.  If only a single
  port is available, the GPS and TNC may share a COMM port if a suitable
  momentary switch circuit is provided.  APRS must be registered for the
  GPS option for this to work.
  
  NEW OEM GPS TRACKER mode in APRS8.01.  Setting alt-S-GPS-MODES to MY$
  will allow your stand alone tracker to operate configured for on-air
  but still let you use your laptop with programmable OEM GPS cards.
  See below.

HISTORY:  We began seriously parsing GPS data within APRS for amateur 
applications when the MAGELAN OEM GPS card dropped to $445 in Sept 92.  
Next, DRSI made a special APRS ROM for TAPR-2 clone TNC's to permit 
power-up in the converse mode.  In August 93, we added the GPS interface 
to APRS using a second COMM port.  By Dec 93, APRS could share a single 
port with GPS cards that could be programmed to a 1 minute or so reporting 
rate.  This is called the SINGLE-PORT-MODE (SPM).  Later I developed the 
HARDWARE-SINGLE-PORT (HSP) mode for use with any GPS regardless of its 
output rate.  In HSP mode, APRS toggles the DTR line on the single serial 
port so that two transistors can then switch between the GPS and the TNC 
on the same port.

     In mid 1993, PACCOMM added a GPS mode to its TNC's and Howie 
Goldstein, N2WX, wrote special GPS commands into the standard TAPR-2 
TNC code.  AEA and Kantronics soon followed.  Now that handheld GPS units 
are under $250 and most TNCs include GPS commands, the only significant
advantage of the OEM GPS cards is in totally autonomous stand-alone 
tracking devices which can power up without human interaction.  

                                                              
* * * * * * * * * *     CURRENT RECOMMENDATION SUMMARY  * * * * * * * * * *

TNC GPS SUPPORT:  For stand alone tracking, the TNC operates in GPS mode
only and is not further usable for 2-way packet communications.  (There
are now exceptions to this in the KPC-3 and Paccomm Pico TNC).  
The Pico and KPC-3+ has two ports, one for the GPS, and one for APRS,
so it can send GPS posits regardless of how the user is using the TNC...  
Conversly, if you are using a laptop, you do NOT use any of the GPS modes
in the TNC, since APRS handles all of the communication between the GPS
and the TNC using any of the following arrrangements.  In this case
any TNC will work:

FOR DUAL-PORT LAPTOPS:   ANY NMEA GPS and ANY TNC will work with APRS

SINGLE-PORT LAPTOPS: Choose between the following options:

    SPM (SINGLE PORT) MODE:  Program an OEM GPS circuit board to a 1 
    or 2 minute rate and diode-OR the data with the TNC data to the same 
    serial port.  There are occasional glitches when both the TNC and GPS 
    data collide.

    KENWOOD MODE:  This is the SPM mode, but the Kenwood THD7 and TMD700
    radio is merging the GPS data with the TNC data into one stream.

    PUSH BUTTON MODE:  Configure APRS for SPM, and connect both the GPS 
    and TNC to your serial port via a SPDT Push Button.  Press the button
    for 2 secs whenever you want a fresh posit.  The rest of the time, 
    the TNC is connected normally.  Glitches will still occasionally 
    occur.  But you have the advantage of an exact posit on demand.

    HSP (HARDWARE SINGLE PORT) MODE:  Use ANY GPS with APRS in the HSP
    mode using a simple two transistor interface which permits APRS to 
    switch between the two devices.  Since APRS controls the switching,
    the potential for garbling is reduced.  HSP devices are available
    from PacComm, AEA, and Kantronics.

    ESP MODE:  This is for Dual port Paccom and Kantronics TNCs so that
    a control-E will trigger a GPS report instead of the HSP method.

    MY$ MODE:  This mode also uses a programmable GPS reporting rate 
    but the GPS is diode-OR-ed to the TNC not to the laptop.  This way
    it acts as a stand alone tracker, sending its posit whether or not
    laptop is connected.  But with alt-S-GPS-MY$ selected, your laptop
    (if connected) will accept your own $NMEA packets if it hears them
    digipeated, so you can see where you are.  (only if the packet was 
    digipeated...)  With MY$ enabled, APRS will NOT send a redundant posit.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

GPS EQUIPMENT SUMMARY

     The following comments are from my personal experience only, but any 
GPS unit with NMEA output should definately work.  Some Aeronautical models 
DO NOT have a NMEA output!  Also, I do NOT use the USER interface and 
displays on most units since I am only interested in the NMEA output to
APRS.  For this reason, my sole purchasing criteria has been price! 
Here are some of my early GPS units (retained here for historical
purposes):

MAGELAN OEM 5000 CIRCUIT BOARD:  My first GPS.  Cost $450 plus $130 
antenna (1993). Output fully programmable using GGA.  LNA on board, 
can use home-made antenna.  5 channel. 

MOTOROLA OEM CIRCUIT BOARD:  Very small.  Requires active antenna.
Output fully programmable and has GGA,GLL,VTG and RMC.  Great for any 
TNC stand-alone.  5 channel.  VP-ENCORE was a 5 volt version 
(TTL) for $299. ($344 w/antenna).  July 95 prices.

GARMIN-50:    $300 with mounting bracket, NMEA cable and 6-40 volt 
supply capability built in!  Has RMC, but NO GGA (no altitude).  
Handheld antenna can be remoted about 6 ft.  8 channel.
CAUTION:  All nautical GARMINS have a 90 kt limit and will NOT WORK 
above that speed!

GARMIN GPS-45:  Seems to be the most popular in 1996.  Includes 
graphic display with Zoom.  Price about $249 INCLUDED bracket and 
detachable NMEA cable.  Antenna is BNC and remotable too.  Replay track 
histories in the unit into APRS conversion programs and build your own 
APRS maps.  Output is +/- 2.5 volts and is usually RS-232 compatible.

CURRENT:  Too many models to choose from.  THey are all good for APRS.

MAGELAN MERIDIAN:   The later Magelan Meridians dropped the RMC sentence,
(you lose Course and Speed).  8 channel.  BNC antenna.  Current drain
is 130 ma.  Below is the pinout, looking at the back of the GPS with
wire colors for their $80 power/data cable.  THeir interface box is only
for 6V power.

  GPS    POWER/DATA CABLE BOX    WIRES OUT  SIGNALS

   *- +6V --[*reg*]-------------- Red       9 to 16 volts input
   *--------[-----]-------------- Yellow    reserved for future
   *--------[-----]-------------- orange    NMEA (+)
   *--------[?????]-------------- white     -20k +100K continuity through box
   *--------[-----]-------------- brown     NMEA (-)
   *--------[-----]-------------- black     Ground

I do not know how they manage power internally, but the GPS will run from
internal 3 AA cells with or without the cable attached.  If there is 
external power, it knows it, and switches to external power.  When external 
power goes away, THE GPS POWERS DOWN.  Pressing the ON button will power it 
back up again on internal power!  

Final comments, the Meridian does NOT output any data unless it is getting 
a good GPS fix.  THis means you will be doing a lot of troubleshooting
out at the picnic table!

TEKK DATA RADIO:  Not a GPS, but is a 2 watt UHF 9600 baud data radio about
the size of a credit card (and 3/4 inch thick).  See page 18 in Feb 94 QST.
Cost between $120 to $130.  Great for future 9600 baud POSITION REPORTING
NET TO DEVELOP on 445.925 MHz.  See UHF-FREQ.txt.

ALINCO DJ-190 is a $99 HT that will do 5 watts on 13 volts.  Nice price!

PACCOMM PICO-TNC:  Smaller than a cigarette pack.  Has an optional 2nd GPS
serial port!  Will sell for about $130 plus options..

MIM MODULE:  This is a matchbook sized TNC which not only trasnmitts GPS
data from an attached GPS, but also 5 analog and 8 digital telemetry 
channels.  See TELEMTRY.TXT and Mic-LITE.TXT

MOTOROLA HT-220:  The venerable HAMFEST single channel HT can be bought for
as low as $20.  After taking off the front and back covers, hacksawing off
the battery compartment, and replacing the PTT switch with a tiny RELAY from
Radio Shack (PN# 275-241, you have a nice 3/4 watt packet radio, about the
size of a cigarette pack.  The PTT leads also carry the antenna RF, so put
the relay in place of the PTT switch and keep the leads short.  Add $20 
worth of crystals for 145.79, and away you go on 2-meters.  Be sure to get 
the models that will tune down to 2m.
----------------------------------------------------------------------------

THE REMAINDER OF THIS FILE HAS THREE SECTIONS:

    The first describes the TNC GPS interfaces.
    Second is the direct APRS software interface of GPS to your PC
    Third is the direct TNC/GPS interface for building stand alone trackers
       using the MAGELAN and Motorola OEM cards.
    Forth, in March 94, I added a section on Differential correction.


TNC GPS STAND ALONE TRACKERS:  All recent TNC's have GPS modes which let
the TNC schedule the transmissions. WHILE IN GPS MODE, the TNC is not used 
for other packet communications (except for the dual poort Pico and KPC-3+).
You may also connect some of these TNC's to an Ultimeter weather station
for remote reporting of WX conditions by programming the TNC to look for
just a * or a # instead of the usual $xxxxx GPS strnigs.  (See WX.txt)

    Since each TNC implementation is different, you should refer to the
instructions that come with your TNC for setting up a tracker.  But do
connect the Receive Data line from your TNC (RXD) to the NMEA Input of
your GPS so that it can receive WAYPOINTS over the air..

GPS-to-PC INTERFACE:  The optional APRS GPS registration enables APRS to
read GPS data from the serial port.  APRS will then plot you and also
transmit your positions to the net.  You can select TRACK on the P-LIST
to keep your vehicle centered on the map.  There are four possible
operational configurations:

     TNC only  - 1 Serial - Normal APRS for tracking other stations
     TNC/GPS   - 2 Serial - Normal APRS with automatic GPS position update
     GPS only  - 1 Serial - Tracking yourself (no other stations appear)
     TNC/GPS   - 1 Serial - Single Port Mode will do both! See below
     TNC/GPS   - 0 Serial - Stand-alone-tracker.  Doesnt use APRS except to
                            plot the resulting packets off-the-air

NMEA INTERFACING NOTES:  Note that NMEA and RS-232 are not exactly 
compatible.  The NMEA data is actually EIA-422, an isolated differential 
receive circuit.  But in most cases it should also work by simply connecting 
the NMEA pin A to the PC RXD and pin B to ground.  Both standards have the 
same sense, with NMEA at 0 and +5 volts, and RS-232 at least a -3 and +3 
volt signal.  The direct connection may not work with some serial ports
without a (-) voltage pulldown resistor.  In this case a series 1k resistor 
and a 5 to 10k resistor tied to your unused TXD data line will suffice to 
provide the (-) voltage:

GPS NMEA OUT                                           LAPTOP SERIAL PORT
                       1 k
   A  >-------------/\/\/\/\---*------------------------> RXD
                               |          10K
                               *-------\/\/\/\/\--------< TXD

   B  *-------------------------------------------------* GND

NOTE 1:  If you use this circuit to your TNC, then remember that the
definitions of TXD and RXD are reversed.  This is the biggest cause of
initial setup problems for new users.  Also, if you use this biasing on 
your GPS when connected to a TNC for a stand-alone-tracker, be sure to 
set ECHO OFF so that echoed data on the TXD(RXD) line do NOT come back 
and garble the bias!  Usually you do not need the opposite serial data
going from the PC to the GPS.  APRS recognizes four of the NMEA-0183 
formats:

    $GPGGA - for position and height  (no loran equivalent)  ] Use only one
    $GPGLL - for position only        ($LCGLL for LORAN)     ] of these two
    $GPVTG - for velocity and course  ($LCVTG for LORAN)
    $GPRMC - Posn, Course and speed   (Has all but height)   ] Preferred
    $GPWPL - For sending Waypoints to stand-alone trackers
    $PMGLB - Magelan Altitude
    $PGRMZ - Garmin Altitude

APRS has two commands under the alt-SETUP-GPS-MODES to force APRS to only
use GGA or RMC sentences.  The default is BOTH.  It is best to select
RMC only, since it has both course and speed.

    The data on the NMEA interface is nearly continuous and refreshed every 
two seconds.  For the much slower APRS network, however, APRS only samples 
the data at a much slower rate called the REFRESH rate usually set to once 
every 15 seconds or so.   This period determines how often your screen is 
updated from your own GPS.  The other period called PACKET PERIOD is usually 
set for 1 to 10 minutes.  Set these periods with the alt-S-POSRATE command.
We have found that 30 seconds updates are OK for special events when there 
are only a few mobile APRS stations.  As more and more stations go mobile 
with GPS/APRS, 1 minute or 2 minute updates are more appropriate.  To 
further reduce channel loading, APRS will decay the period when the station 
is not moving.


GPS MOBILE AND TNC WITH ONLY ONE SERIAL PORT (Single Port Mode)

     For programmble OEM GPS cards (and some LORANS) simply set the rate
to once every N minutes and enable only the $GPRMC sentence.  Then simply
diode-OR this data with the TNC output into a single serial port.  
In single port mode (SPM), APRS distinguishs between the TNC packet data 
and the unique NMEA data.  The only problems with this arrangement are 
data collisions about 1% of the time and ambiguity on incoming VTG packets.  
Are they off the air, or from an attached GPS?  APRS resolves this by
by ONLY matching up a VTG sentence if it has been received within 2 seconds 
of a GGA or GLL from a known station.  Another disadvantage is that the
refresh rate is now fixed by the programming of the GPS.

          DIODE OR-ing of GPS and TNC in SINGLE PORT MODE:


    GPS DATA OUT  >----------*------>|--------*----->  TNC RXD
                             |----/\/\/\/\----|
                                              |
    TNC DATA OUT  >----------*------>|--------*        both R's abt 10K
                             |----/\/\/\/\----|

A simple SPDT PUSH BUTTON switch can do the same thing and doesnt require
the special programmable GPS's.  The switch has the advantage that it 
gives the user control of when he wants a FIX.  The operator only needs
to press and hold the button for 2 seconds, in order to get a posit at
any time.

   Activate this Single Port Mode (SPM) using the alt-S-GPS-MODES-SPM
command.  Be sure your TNC and GPS baud rate are identical! (usually 
4800 baud).  Next to an alt-S-SAVE and provide your validation and GPS 
numbers.  If done correctly, the lowercase (spm) on the control panel 
(TAB) goes to uppercase.  

   In the Single Port mode, the screen refresh rate is set by the period
programmed into your programmable GPS (45 seconds or longer is about right).
The position report transmission rate from APRS to the TNC is set by 
POS-RATE command in the SETUP Menu.


MY$ STANDALONE TRACKER / AND OCCASIONAL LAPTOP:

   This mode allows your TRACKER to always work with or without a laptop.
This only works if you have a programmable rate OEM GPS, since the GPS
is DIODE-OR-ed to the TNC so it can send its data at any time.  But when 
the laptop is connected, it will listen for your OWN $NMEA report if
digipeated so that you can see where you are.  Select alt-S-GPS-MODE-MY$.
With MY$ on, your APRS position is not transmitted, since it would be
redundant with the GPS => TNC position already transmitted.

HARDWARE SINGLE PORT MODE  (HSP)  FOR USE WITH ALL GPS UNITS:

   APRS can control the switching of the Single Port Mode between the TNC
and ANY GPS using the handshaking lines of the COMM port and a simple two
transistor switch soldered into the serial port data connector hood.  This
mode is called the HSP mode.  In this HSP mode, APRS periodically toggles the
DTR output of the serial port for two seconds whenever it needs data from
the GPS.  With DTR held high (normal) the GPS data is shunted to GND while
the TNC operates normally.  When APRS toggles the DTR low, this holds off
output from the TNC, but also enables data through the emitter follower from
the GPS.  As soon as APRS receives the GPS data it needs, it restores DTR so
the TNC is connected for normal APRS operations.  

    In some TNC's, (PACCOMM) the RTS is used instead of the DTR for 
holding off TNC data.  Also, this circuit uses your PC RTS line to derive 
a cource of +V.  If the impedance of your PC RTS line is not strong 
enough, you might need to get it from the TNC's DSR line.  

REMEMBER THAT YOUR TNC AND GPS MUST BE SETUP AT THE SAME 
BAUD RATE, usually 4800 baud.

PACCOMM now sells this little circuit assembled inside of DB-9 connector
with two pigtail connectors for your TNC and GPS for about $30.  NOTE:
Not all of this circuit is needed in all applications.  Omit parts
as needed depending on your laptop and GPS bias levels.

                                      *------------------< +V (PC RTS)
 GPS NMEA                           |/ c                   or TNC DSR)
   >--------------/\/\/\/---*----*--|
 OUTPUT              1k     |   NPN |\ e     * see important notes below
                            |         *--->|-->|---*-----> RXD
 TNC RXD                    |              diode   |               
   >--*-------------------------------*----->|-----*
      |       15k           |         |    10k     |       SINGLE
      *-|<-*-/\/\/--*-------*         *---/\/\/\/--*       LAPTOP
           | note 1 |      c \|                            RS-232
          ===       |         |--*--------/\/\/\/--*       PORT
           | 1uF    |      e /| NPN        10k     |
 TNC DTR  ---       |       |                      |
 (or RTS) ///       |     ////                     |
   <-----------------------------------------------*-----< DTR
                    |                  1uF
                    |-----/\/\/\----*--||--------*
                    |      15k      |            |
                    |     note 2    *-->|--*    ---
 TNC TXD            *                      |    ///
   <--------*-----> *----------------------*-------------< TXD
                SW-1
   *-----------------------------------------------------* GND
 GND

OPTION Note1: This optional resistor-diode-cap provides a little -V bias 
       to the GPS output line going to SW-1 when the GPS is used with 
       the TNC only in stand alone tracker mode (no PC).  
OPTION Note2: This optional 10K resistor-diode provides a little -V bias 
       to the GPS output when the PC and GPS are operated alone (WITHOUT 
       the TNC).

    Install these components in a back-to-back DB-9 connector on the cable
comming from my GPS so that it is always handy.  Almost any NPN transistor 
and switching diodes will work.  A 2N2222 is fine.  The SWITCH SW-1 allows
you to easily re-configure for STAND-ALONE-TRACKER without re-cabling.  You 
still need to use the laptop to tell the TNC to got to GPS mode, however.  
In the implementation below you will notice that a dotted line shows how to 
add just one wire to take the output of the TNC to the DGPS input of the 
GPS if your GPS is DGPS capable and if someone in your area is transmitting 
DGPS data on your packet channel.


PHYSICAL LAYOUT OF BACK-TO-BACK DB-9's WITH HSP CIRCUIT INSTALLED


                1     2     3     4     5   DB-9 FEMALE TO COMM PORT
                O     O     O     O     O
                      |  7  |     |     |
                   O  |  O  |  O  |  O  |
                      |  |  |     |     |
                      |  |  |     |     |
  NMEA      N C------ | -*  |     |     *--------E N
  FROM      P E--->|--*     |     *---- | -/\/\/-B P  (2N2222 or equiv)
  GPS       N B---*-- | --- | --- | --- | -------C N
                  |   |     |     |     |
                  |   *--*  |     |     |                  
   A >-----/\/\/--*   |  |  |     |     |
                      \  -  |     |     |
   DGPS < - - - - *   /  ^  |     |     |
                  |   \  |  |     |     |
                  |   |  |  |     |     |
                  * - *--*  |     |     |
   B ---------------- | --- | --- | ----*
                      |     |     |     |
                      |     |     |     |
                O 1   O 2   O 3   O 4   O 5   DB-9 MALE TO TNC CABLE

                   O     O     O     O


In this adapter, the voltage to provide the -V bias to convert the NMEA 
output to RS-232 levels comes from the RXD output of the TNC.  For this 
reason, if the GPS is used alone with the PC, without the TNC, you must 
include the components of note2.  OR you may connect a jumper between 
pins 2 and 3 of the empty TNC connector.  This takes the -v from the 
unused TXD output of the PC.  I recommend carrying a stubby DB-9 female 
connector with this jumper permanently installed.

                O 1   O 2   O 3   O 4   O 5   FEMALE STUB USED TO PROVIDE
                      |     |                 -V BIAS WHEN TNC IS NOT USED
                   O  |  O  |  O     O
                      |     |
                      *-----*

HSP OPERATIONS:  Setup HSP just like SPM from the alt-SETUP-GPS menu.  Be
sure your GPS and TNC are at the same baud RATE as your GPS, usually 4800.  
Select alt-S-GPS-MODES-HSP and then SAVE a new CONFIG file and provide
your GPS validation number.  You will see the lower case (hsp) on the 
TAB control panel shift to upper case.  In HSP mode both the screen 
refresh rate and position transmission rate are set with the POS-RATE 
command.  You may force an HSP update at any time by pressing the F8 key.

CAUTION:  This interface is operating with slim voltage margins at the
RS-232 level and may need to be tailored to your particular PC, GPS and 
TNC.  Some experimenting may be required to make it work for you and once  
working, it may not work if you change TNC, GPS or PC.  You may have to
try one or two or NO series diodes in the emiter lead of the GPS switching 
transistor as well as different R values for the 1k series resistor.
IF YOU ARE USING A GARMIN 45 YOU MIGHT NEED TO TAKE BOTH diodes out, since
the GARMIN ouputs +/- voltages...


NOTES ON MOBILE GPS OPERATION:  See the MOBILE.txt file.  
  * write down your V#'s IN THE CAR!  You may need to re-configure!
  * For FLOPPY only operations, take only the maps you will need.
  * When you QUIT APRS, your TRACK HISTORY is NOT saved UNLESS you 
    specify a file name OTHER than BACKUP.BK (or do a FILE-SAVE).
  * Use the TRACK mode to keep yourself on the map.
  * Set your refresh rate long enough (20 sesc or more) so that APRS
    has time to service the keyboard and is not saturated with GPS
  * Notes any map errors or disagreements with GPS, so at home you
    can use MAPFIX.bas, to replay your track history and fix the map.
  * Use the TIME-SYNC command to sync your PC time to GPS time on the next
    receipt of a GGA or RMC sentence to eliminate dead-reckoning errors.

For most highway maps and 1 minute reporting at 60 MPH, zooming in below
eight miles is usually a waste of time.  For this reason don't waste your
time making maps with every little twist and turn in the road; it just takes
time and memory and makes no difference.  A straight line between A and B 
is not as pretty, but shows the road as well as 20 points showing all the 
curves.  If you do save any RAW GPS data outside of the APRS environment, 
the following two programs may be useful in reconstructing GPS data.  They 
were written hastilly for a one time need and are provided as-is.  Still,
they might be useful to others as a basis for writing your own routines.

FILTRHST.bas:  APRS automatically builds a track history for all moving
stations.  APRS avoids saving redundant position reports automatically with
its POS-FILTER.  The default value of the filter is wide enough to include 
the variations in position due to GPS selective avaiability. (+/- 0.03 mins)
With the filter off, this is reduced to 0.01.  FILTRHST.bas can be used to 
re-filter a track history file to remove additional points.  Use the source 
code to write your own filters for your own needs.  In addition to filtering, 
this program can be used to combine a number of separate track history files 
into one file.

GPStoHST.bas:  Takes any NMEA DOS text file and generate an APRS track 
history file.  It only looks for the GGA and VTG NMEA-0183 sentences and 
combines them into the one line APRS format.



STAND-ALONE OEM GPS TRACKERS:

NEW in APRS8.01 is the MY$ mode which allows occassional LAPTOP operation
with an OEM GPS tracker without reconfiguration by letting APRS copy
your own $NMEA posits off-the-air (they have to be digipeated to be heard).

     This section only applies to TNC's that have programmable reporting
rates and selectible NMEA sentences.  It does not apply to most handheld
GPS units; but it does apply for such applications as Balloons, and small 
stand-alone tracking boxes.  Also, this method has the advantage of trans-
mitting any of the NMEA-0183 sentences without dependence on the particular 
TNC GPS modes.   The GPS or LORAN must have a reporting rate that can be 
configured by the user to output a report once every N minutes or hours.


1.    The original MAGELAN OEM 5000 board is no longer available and recent
versions do not have a NMEA output!

2.  The Motorola OEM prototype card work well.  Call  MOTOROLA, 800 421-2477
for the latest.   Many of their models require an external 20 dB active
antenna.  Use my MOTOROLA.BAS program to send the needed initialization
and NMEA timing commands and to take the OEM card out of its 
default BINARY format, and place into NMEA format.

     An automatic vehicle tracking system can be assembled by simply
connecting the RS-232 output from one of these programmable GPS's directly
into the TNC, setting the periodicity to 1 minute or so and selecting only
the RMC or GGA/VTG sentences to be output.  The TNC must be placed in 
UNPROTO CONVERSE, and from then on, every minute a GPS position report 
will be transmitted.  

GPS ENGINE SET UP:  Follow all manufacturer instructions for initializing 
your GPS engine using your PC and their setup program.  After the system 
is running and producing fixes, send commands to enable GGA/VTG or RMC 
data between 30 to 120 seconds using the following commands:

MAGELAN COMMANDS:
$PMGLI,00,B00,7,A  (for GGA GPS position only)       Where 6 = 30 Secs
$PMGLI,00,B01,7,A  (for GLL LORAN position only)           7 = 1 Minute
$PMGLI,00,EOO,7,A  (for course and speed with either)      8 = 2 Minutes
                                                           9 = 5 minutes

     Each line must end with a carriage return-linefeed.  The GPS engine
gives no responses to commands, other than doing what it is commanded.  You
might try a value of 5 which is once every 10 seconds as a test to be sure
the GPS card is recognizing your commands.  The commands for the MOTOROLA
card are similar, but MUST have the proper checksum.  Use my MOTOROLA.BAS
program to send these commands with proper checksum calculated...

MOTOROLA COMMANDS:
$PMOTG,GGA,0030*csCRLF (sets up GGA once every 30 secs)
$PMOTG,RMC,0060*csCRLF (sets up RMC once every 60 secs etc..)

TNC SETUP DETAILS:  If your OEM card does NOT output the RMC sentence, you 
must use the GGA and also the VTG sentence to get course and speed.  The
problem is that these two sentences then key the TNC with two sequential
packets.  This is a problem through a digipeater path is used, because the 
digipeat of the 1st packet will collide with the second VTG packet.  To 
solve this, (not needed for balloons which dont need digipeaters), use the
following trick:

Set CPACTIME ON and change the SENDPACK character from $0D to anything 
else (say $01).  This way, both the position fix and velocity lines will 
not be sent based on a CR/LF, but automatically in the same packet 
one second after the last character is received from the GPS.  This 
packet, containing two frames, will then be digipeated all together by 
the digipeater with no break in between.  If you use a GPS with the RMC 
sentence, this double packet problem does not exist.

LINEFEEDS and FLOW CONTROL:  Since the GPS is sending each line with a CR/LF
on the end, your TNC will always end up placing the superfluous linefeed at
the beginnning of the next packet.  To defeat linefeeds, set LFIGNORE on.
(for AEA, try Linefeed Supress, LFS ON).  Similarly, your terminal program 
must send CR-LF on each command to the GPS card.  When you try to talk to 
your TNC with CR-LF, you will experience a lockup condition since the extra 
LF will look to the TNC like the beginning of a new command line and will 
hold off all TNC output.  To overcome  this problem, set FLOW OFF.  Here 
are the commands which must be changed from factory defaults for most TNC's:

  ECHO OFF,  FLOW OFF,  LFIGNORE ON,  CPACTIME ON, SENDPAC $01


UNPROTO-CONVERSE-MODE:   And now for the last problem; keeping the TNC in
converse mode.  Since TNC's always default to command mode when turned on,
they cannot be expected to operate autonomously with GPS data supplied to
their inputs from power up.  As of 1995, most new TNC's now include some
kind of UI mode that will force the TNC to power up in CONVERSE.  To get out
of this mode, you just hit ctrl-c as usual.


DUMB TERMINAL SETUP:  While programming a GPS, you may want to configure 
your terminal for half duplex so you can see what you are sending to the
GPS.  The GPS may also need the CR/LF sequence at the end of each command, 
so set the terminal to translate CR to the CR/LF sequence. 

SYMBOLS:  To specify the APRS symbol character for a STAND-ALONE-TRACKER,
there are 2 methods.  First, when APRS receives a raw NMEA posit over the 
air, it will use one of 15 default symbols based on the callsign SSID.
Secondly, choose a TOCALL of GPSxyz according to the table shown in 
SYMBOLS.TXT


BUILDING A STAND-ALONE TRACKER WITH ONLY A 5 VOLT TTL OEM GPS UNIT:

   Building a tracker out of a 5 volt TTL GPS and any of the TAPR-2 CLONE 
TNC's is trivial.  In the PACCOMM TINY-2, MFJ-1274, and DRSI-DPK2 there is 
a diode in the TXD circuit to provide isolation between the RS-232 converter 
chip and the TTL modem disconnect header.  This diode is labeled D7, CR22, 
and D12 respectively.  By providing the GPS TTL data output to the RXDB 
line (pin 5) of the modem disconnect header (via a reverse biased diode) 
the GPS NMEA data will be transmitted by the TNC.  Similarly, by tapping 
off of the cathode of this diode, the TTL data from an attached terminal 
can be sent to the GPS input.  With the TNC in converse mode, setup commands 
from the terminal are not only transmitted on the air (without confusing the 
TNC) but also sent to the GPS unit.  Conversly, GPS data is always 
transmitted on the air, but if ECHO is on in the TNC, then the GPS output 
is also echoed back out to the attached terminal!  In this manner, no 
external switches are required to switch between talking to the GPS unit 
and the TNC.  Of course, the GPS sees everything sent from the terminal, 
but will IGNORE everything that does not match a GPS setup command.



DIFFERENTIAL CORRECTION

Tom Clark (W3IWI) experimented with a Differential GPS xmtr in the Wash DC
area transmitting 30 second DGPS data on the APRS freq.  APRS GPS mobiles 
can then obtain accuracies to 5 meters or so.  We are pleased to report 
that the RTCM-104 format works perfectly well with APRS and with TNC's:

*  The GPS rcvrs seem to ignore the packet headers and act on the RTCM data
*  The RTCM gybrish is all printable ASCII and does not garble APRS screens

Although this is an excellent demonstration and there are surely HAM
applications that can take advantage of the DGPS accuracy, APRS is usually
not one of them.  First, APRS is not concerned with NAVIGATION accuracy,
because  a) no maps are that accurate (with DGPS you can make 'em so!), and
b) the purpose of APRS is to inform others of mobile locations over a wide 
VHF area, NOT to the nearest 15 feet.  (APRS formats do maintain positions 
to 60 foot precision)  Secondly, A mature APRS net involved in a special 
event or activity, can probably NOT handle the QRM from 30 second RTCM 
transmissions.  In the long term, the DGPS data should probably be 
transmitted MORE OFTEN and on another frequency, OR be remotely controlled 
such that it can be requested by a mobile user on demand, but silenced most 
of the time.  Transmitting less often is meaningless due to latency of the 
data.  


DGPS TRANSMITTER SET UP:  Set your TNC to transmit TO DGPS instead of the
usual TO APRS and set up whatever UNPROTO path is desired to cover the area.
Then enter the location of the DGPS transmitter into the TNC BText in the
usual format making sure to use the special (.) symbol in the symbol field:

  BT !3859.11N/07629.11W.RTCM data provided by TOM W3IWI...

Everything after the (.) symbol character is free text.  APRS will flash a
DGPS flag on the screen each time it hears a DGPS transmission, but will 
not add the station to the L or P-Lists unless it also sees the (.) symbol 
in the position report.  Set your beacon to every half hour or so.  Finally, 
set your TNC into CONVERSE and tell your RTCM-104 DGPS receiver to output 
once every 30 seconds.

See the new HSP mode schematic above where I added the interface wire 
between your TNC and GPS for automatic DGPS operations.

CONFIGURING FOR DGPS:  There are two options for routing the DGPS data from
your TNC to your GPS unit:  1) For ANY arrangement: run an external wire from
your TNC RXD data output over to your GPS DGPS data input.  2) For dual port
operations only:  connect your GPS DGPS input to the PC serial port TXD line
and select DGPS from the SETUP menu in order to enable DGPS data output from
APRS.

CAUTION:  This will not work if you are operating in the SPM or HSP modes or
if you are using the same serial port TXD output as a source of -V bias for
the NMEA conversion as suggested in the above paragraphs.



