Subject: GPS
From: rotaryeng
Date: 1/9/2012, 9:07 AM
To: AAAA Put this in the To box



(update to previous  GPS/GlassPanel emails)

As mentioned in earlier emails... I acquired a Canmore USB dongle to
connect to my HomeBrewedGlassPanel display which I am developing using
Ubuntu 10.04 and the TCL scripting language.

Reading a byte of data from the GPS does not require a terminal program;
reading data can be accomplished with only 4 lines of TCL code.

Since TCL is new to me, I have struggled with organizing the
data-stream from the GPS; I have not been able to configure my program
to read a datablock of predictable size from the USB port; sometimes
data is received only a byte at a time, other times several bytes are
read. TCL sort of invisibly wants to take care of
line-feed/carriage-return characters even though I tried to handle
these characters myself.  So I finally decided to use brute force in
processing the NMEA data.

The attached sample script:
 - Configures the port
 - Jumps into an infinite-loop which reads variable sized data-packets
from the GPS.
 - The data packets are glued together to form a long GPS-string of
information.
 - The program searches for the '*' character, which is near the end of
each NMEA data line
 - Program looks for the occurance of the characters 'GPMRC'
   which identifies a line of data which contains both latitude and
longitude information
 - Uses a substring-command to pick out characters according to position
in line, each field representing desired data according to NMEA format
 - Displays data on screen
 - Loops around and does it again

I don't know whether the record layout is absolutely identical to that
provided by other GPS units or not.
If anyone is interested, attached is the code.

(note: Occasionally the GPS unit does not want to self-start,  I have on
rare occasions had to run the script 2 or 3 times  ... tell the GPS to
'wake up and get to work')
The program can be terminated by pressing a Control-C key combination.

R Berglund


Robin, did you get the FAA airport data base I sent?

Paul Lamar


-- 
The Rotary Engine NewsLetter. Powered by Linux.
ACRE NL web site. http://www.rotaryeng.net
Youtube key word PaulLamar2
Copyright 1998-2012 All world wide rights reserved.