GPS plugin
Page 1 of 1

Author:  bretti_kivi [ Tue Oct 05, 2004 9:04 ]
Post subject:  GPS plugin


first post, and it's a request...;)

i'm trying to find something which will take information from my GPS receiver and dump it onto my display (HD44870, 4x20, LPT1). at the moment i'm running lcddisplay plugin in Winamp, which gives me all sorts... but due to the amount of traffic cameras i'd really like the ability to have a "km/h" reading on the screen. is there such a thing available?

i don't have enough experience or a development environment at the moment to create something myself... or have i missed something?



Author:  coorz [ Tue Oct 05, 2004 10:04 ]
Post subject: 

Well perhaps now LCDinfo has gone open source, someone will step up and write a GPS plugin. Sounds like fun!
So you have a PC in your car? But that means you already have a speed-o-meter or do i miss something :?

Author:  bretti_kivi [ Tue Oct 05, 2004 10:55 ]
Post subject: 

i have a speedo, yes. but it's not accurate enough: there are too many cameras around the place. and lots of 80/100 limits. and big fines for exceeding them.
so, i'm fitting an old PC in the car with LAN and a smallish disk, USB GPS mouse and i've got a display for the ID3 tags...
the GPS translation is actually quite simple. baud 4800, 8 N 1, pure ASCII, there's code to decode all over the web. but: i don't know how this would fit with LCDInfo...


Author:  rudi Grobler [ Wed Oct 06, 2004 10:34 ]
Post subject: 

I just finished a project were I used a stepp gps, and it is very simple!!

Like bretti_kivi said... It is a pure ascii protocol, providing it uses the same NMEA 0183 as my stepp gps, I will implement it for you...

Author:  Henri [ Wed Oct 06, 2004 17:07 ]
Post subject: 

GPS plugin for LCDInfo that listens to serial port (usb serial too) for NMEA messages shouldn't be very difficult to make. And if Rudi has already some code and experience of parsing the NMEA messages things should be even simpler. All GPS receivers that would be used with this should support NMEA 0183 so that should not be a problem.

I don't have a GPS receiver myself but I've been thinking that I should get some cheap receiver to experiment with. Hey if someone has some receivers collecting dust you could consider donating one for the LCDInfo project. ;)
Anyway sounds like Rudi is already planning to make a GPS plugin.

Author:  bretti_kivi [ Wed Oct 06, 2004 21:14 ]
Post subject: 

that would be excellent: decent display and cool software ;) :D
i have a decent enough "GPS-hiiri" from navilock - got it on line from germany for 100 euronen inkl. software.
just checked: has them for 89,90 now...

the perl script i found last night to take everything apart:
# nmea.perl
# Convert generic NMEA output into something more spreadsheet-friendly.
# Understands some Garmin-specific sentences.
# Note: we depend on the $GPRMC sentence appearing once in every
# "data burst" from the GPS, preferably as the first sentence.
# If this is not true for a particular GPS, the code that calls
# output() must be moved to a more appropriate place.
# Dave Martindale, May 2000

$maxtrack = 12;

$infile = "<-";
$outfile = ">-";
open (INFILE, $infile) or die "couldn't open input file $infile\n";
open (OUTFILE, $outfile) or die "couldn't open output file $outfile\n";

print OUTFILE "GPRMC,,,,,,,,";
print OUTFILE "GPGGA,,,,,,,,,,";
print OUTFILE "GPGSA,,,,,,,,,,,,,,,,,";
print OUTFILE "GPGSV,", "," x (4 * $maxtrack);
print OUTFILE "GPVTG,,,,";
print OUTFILE "GPGLL,,,,";
print OUTFILE "PGRME,,,";
print OUTFILE "PGRMZ,,";
print OUTFILE "\n";

print OUTFILE "Time,Valid,Lat,Long,SOG,CMG,Date,MVar,"; # GPRMC
print OUTFILE "Time,Lat,Long,Qual,Sats,HDOP,Alt,GeoH,DGPSAge,DGPSID,"; # GPGGA
print OUTFILE "Auto,Dim,PRN,,,,,,,,,,,,PDOP,HDOP,VDOP,"; # GPGSA
print OUTFILE "View,"; # GPGSV
for ($sat = 1; $sat <= $maxtrack; $sat++) {
print OUTFILE "PRN ", $sat, ",Elev,Azim,S/N,";
print OUTFILE "CRS (T),CRS (M),SOG (Kt),SOG (km/h),"; # GPVTG
print OUTFILE "Lat,Long,Time,Valid,"; # GPGLL
print OUTFILE "Alt,Dim,"; # PGRMZ
print OUTFILE "Datum"; # PGRMM
print OUTFILE "\n";

sub output {
print OUTFILE $time_rmc, ',', $ok_rmc, ',', $lat_rmc, ',',
$long_rmc, ',', $speed, ',', $cmg, ',', $date, ',',
$mvar, ',';
print OUTFILE $time_gga, ',', $lat_gga, ',', $long_gga, ',',
$fixqual, ',', $nsat, ',', $hdop_gga, ',', $alt_gga, ',',
$gheight, ',', $DGPS_age, ',', $DGPS_ID, ',';
print OUTFILE $fixsel, ',', $fixdeg, ',',
join(',', @satsused), ',', $pdop, ',', $hdop, ',',
$vdop, ',';
print OUTFILE $nsiv, ',';
for ($sat = 0; $sat < $maxtrack; $sat++) {
if ($sat < $nsiv) {
print OUTFILE $prn[$sat], ',', $elev[$sat], ',',
$azim[$sat], ',', $signal[$sat], ',';
} else {
print OUTFILE ",,,,";
print OUTFILE $crs_t, ',', $crs_m, ',', $sog_kt, ',', $sog_km, ',';
print OUTFILE $lat_gll, ',', $long_gll, ',', $time_gll, ',',
$ok_gll, ',';
print OUTFILE $hpe, ',', $vpe, ',', $epe, ',';
print OUTFILE $alt_rmz, ',', $alt_type, ',';
print OUTFILE $datum;
print OUTFILE "\n";

sub latitude {
my ($deg, $min) = unpack "a2a*", $_[0];
my $lat = $deg + $min / 60;
$lat = - $lat if $_[1] =~ /[Ss]/;
return $lat;

sub longitude {
my ($deg, $min) = unpack "a3a*", $_[0];
my $long = $deg + $min / 60;
$long = - $long if $_[1] =~ /[Ww]/;
return $long;

$first = 1;
while ($line = <INFILE>) {
@field = split /[,*]/, $line;

# recommended minimum specific GPS/Transit data
if ($field[0] eq '$GPRMC') {

# We don't know exactly what sentences to expect
# from an arbitrary GPS, but we assume that RMC
# will always be included. Each time we see this
# sentence, print out the accumulated information
# from the previous burst.
output() unless ($first) ;
$first = 0;

# Now process the new RMC record
$time_rmc = join ':', unpack "a2" x 3, $field[1];
$ok_rmc = $field[2];
$lat_rmc = latitude(@field[3..4]);
$long_rmc = longitude(@field[5..6]);
$speed = $field[7];
$cmg = $field[8];
$date = join '/', unpack "a2" x 3, $field[9];
$mvar = $field[10] . $field[11];
# field[12] is checksum
last SWITCH;

# GPS fix data
if ($field[0] eq '$GPGGA') {
$time_gga = join ':', unpack "a2" x 3, $field[1];
$lat_gga = latitude(@field[2..3]);
$long_gga = longitude(@field[4..5]);
$fixqual = $field[6];
$nsat = $field[7];
$hdop_gga = $field[8];
$alt_gga = $field[9];
# $field[10] is altitude units (always M)
$gheight = $field[11];
# $field[12] is geoid height units (always M)
$DGPS_age = $field[13];
$DGPS_ID = $field[14];
# field[15] is checksum;
last SWITCH;

# GPS DOP and active satellites
if ($field[0] eq '$GPGSA') {
$fixsel = $field[1]; # A for auto selection, M for manual
$fixdeg = $field[2]; # 2 or 3 for 2D or 3D fix
@satsused = @field[3..14];
$pdop = $field[15];
$hdop = $field[16];
$vdop = $field[17];
# field[18] is checksum;
last SWITCH;

# satellites in view
if ($field[0] eq '$GPGSV') {
# $field[1] is total number of sentences for full data
# $field[2] is current sentence number
$nsiv = $field[3];
# Unpack next 16 fields as PRN, elevation, azimuth, and
# signal quality for next 4 satellites
$sat = ($field[2] - 1) * 4;
$lim = $sat + 4;
if ($nsiv < $lim) {
$lim = $nsiv;
$f = 4;
while ($sat < $lim) {
$prn[$sat] = $field[$f++];
$elev[$sat] = $field[$f++];
$azim[$sat] = $field[$f++];
$sig = $field[$f++];
$sig = '' if $sig == 0;
$signal[$sat] = $sig;
# field[20] is checksum;
last SWITCH;

# track/ground speed
if ($field[0] eq '$GPVTG') {
$crs_t = $field[1];
# $field[2] is reference (always T);
$crs_m = $field[3];
# $field[4] is reference (always M);
$sog_kt = $field[5];
# $field[6] is units (always N);
$sog_km = $field[7];
# $field[8] is units (always K);
# $field[9] is checksum;
last SWITCH;

# position error info
if ($field[0] eq '$PGRME') {
$hpe = $field[1];
# $field[2] is units (always M)
$vpe = $field[3];
# $field[4] is units (always M)
$epe = $field[5];
# $field[6] is units (always M)
# field[7] is checksum;
last SWITCH;

# latitude/longitude
if ($field[0] eq '$GPGLL') {
$lat_gll = latitude(@field[1..2]);
$long_gll = longitude(@field[3..4]);
$time_gll = join ':', unpack "a2" x 3, $field[5];
$ok_gll = $field[6];
# field[7] is checksum;
last SWITCH;

# altitude
if ($field[0] eq '$PGRMZ') {
$alt_rmz = $field[1];
# $field[2] is units (always F)
$alt_type = $field[3]; # 2: user alt, 3: 3D fix
# field[4] is checksum;
last SWITCH;

# datum
if ($field[0] eq '$PGRMM') {
$datum = $field[1];
# field[2] is checksum;
last SWITCH;

i haven't tested this yet (my perl's a bit rusty) but it seems to tie up with this link here:

if you need testing or more info, let me know!



Author:  One~Zero [ Wed Dec 29, 2004 20:58 ]
Post subject:  Any progress...?

I was wondering if there was any progress on getting data from a gps receiver module yet. I would be interested in getting this on a display! Henri, if you are still in need of a gps receiver, let me know. I just got one off of ebay (it's a Rockwell Jupiter Model), and might be able to part with it to get the ball rolling on this. Thanks

Author:  Henri [ Thu Dec 30, 2004 21:07 ]
Post subject: 

I recently got some nice Fastrax uPatch02 modules so I have a GPS receiver now waiting to be used.

I haven't yet done any coding to receive NMEA messages but I should try that some evening.

Based on what Rudi wrote earlier in this topic I was under the impression that he was planning to make something like GPS plugin for LCDInfo. Don't know if he has made any progress there yet.

Hmm, maybe I should just see if there is some open source NMEA parser available and use that.

This might help: ... Design.htm

Author:  bretti_kivi [ Fri Mar 25, 2005 9:37 ]
Post subject: 


any news?

the snow's starting to melt so i can start taking my car apart again :)



Author:  One~Zero [ Thu Aug 04, 2005 15:01 ]
Post subject: 

Just thought I would revive this thread. I don't know if Rudi is still monitoring this thread (hopefully is). Would really like to see this implemented somehow. :D

Page 1 of 1 All times are UTC + 2 hours
Powered by phpBB® Forum Software © phpBB Group