LCDInfo.com

http://www.lcdinfo.com
It is currently Thu Nov 21, 2024 23:59

All times are UTC + 2 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: GPS plugin
PostPosted: Tue Oct 05, 2004 9:04 
Offline

Joined: Tue Oct 05, 2004 8:58
Posts: 9
Location: [Ruoho]Lahti
hi,

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?

thanks

Bret


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 05, 2004 10:04 
Offline
User avatar

Joined: Sat Apr 17, 2004 17:42
Posts: 467
Location: The Netherlands
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 :?

_________________
My Plexeon-Insane LCD!-Or this one!-LCDinfo-LCDStudio


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 05, 2004 10:55 
Offline

Joined: Tue Oct 05, 2004 8:58
Posts: 9
Location: [Ruoho]Lahti
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...

Bret


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 06, 2004 10:34 
Offline

Joined: Tue Dec 02, 2003 12:03
Posts: 107
Location: South Africa
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...

_________________
Rudi Grobler


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 06, 2004 17:07 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 06, 2004 21:14 
Offline

Joined: Tue Oct 05, 2004 8:58
Posts: 9
Location: [Ruoho]Lahti
that would be excellent: decent display and cool software ;) :D
henri:
i have a decent enough "GPS-hiiri" from navilock - got it on line from germany for 100 euronen inkl. software.
just checked: reichelt.de has them for 89,90 now...

the perl script i found last night to take everything apart:
Quote:
# 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 "PGRMM";
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 "HPE,VPE,SPE,"; # PGRME
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>) {
chomp($line);
@field = split /[,*]/, $line;
SWITCH: {

# 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;
$sat++;
}
# 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: http://www.commlinx.com.au/NMEA_sentences.htm

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

thanks

Bret


Top
 Profile  
 
 Post subject: Any progress...?
PostPosted: Wed Dec 29, 2004 20:58 
Offline
User avatar

Joined: Thu Dec 09, 2004 16:01
Posts: 218
Location: NH, USA
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 30, 2004 21:07 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
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:
http://www.visualgps.net/Papers/NMEAPar ... Design.htm


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 25, 2005 9:37 
Offline

Joined: Tue Oct 05, 2004 8:58
Posts: 9
Location: [Ruoho]Lahti
hi,

any news?

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

thanks

Bret


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 15:01 
Offline
User avatar

Joined: Thu Dec 09, 2004 16:01
Posts: 218
Location: NH, USA
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group