Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:23 24 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : GPS

     Page 2 of 2    
Author Message
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 08:26am 10 Sep 2011
Copy link to clipboard 
Print this post

Be aware that in 2.4F (and later versions) the EOF() function changed from the notes included with the earlier hex file. See this thread.
Geoff Graham - http://geoffg.net
 
devigan
Newbie

Joined: 11/08/2011
Location: Australia
Posts: 26
Posted: 02:02pm 10 Sep 2011
Copy link to clipboard 
Print this post

Hi guys, still blank line. confirm GPS working - it is spitting NMEA stream on console mode. Just can not grap the data. Any idea please
 
devigan
Newbie

Joined: 11/08/2011
Location: Australia
Posts: 26
Posted: 12:34pm 11 Sep 2011
Copy link to clipboard 
Print this post

Hi Geoff, I really could use your advise here. I still cannot capture GPS Data. Although I see it on console mode? Dave
 
aargee
Senior Member

Joined: 21/08/2008
Location: Australia
Posts: 255
Posted: 09:55pm 11 Sep 2011
Copy link to clipboard 
Print this post

Devigen,

It's been quite a while since I've played with GPRS streams and NMEA data but why are you printing to the GPS? NMEA streams are output in a continuous stream from the GPS device, the GPS does not generally respond to commands in this mode.

I used to use the $GPRMC sentence (have a look at this ), I'd input each string and look for the "RMC" part of the string to identify the sentence I was looking for.

Each piece of data is comma separated and use the checksum asterisk indicator as an end of sentence marker.

You should be able to use INPUT #5, A$,B$,C$,..... and then PRINT A$,B$,C$,... to the screen as a quick test. Talbit, your code is a bit strange for INPUT, the INPUT command for serial works just like it would from the keyboard (that's the way I currently use it).

What code are you using? Still the one from the original post?
For crying out loud, all I wanted to do was flash this blasted LED.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 12:00am 12 Sep 2011
Copy link to clipboard 
Print this post

Hi devigen, persistence has its rewards !!

The following is an example of how to parse the NMEA strings.

Disclamer: All my GPS modules are installed in things that I do not want to pull apart so I tested this with a simulation.

10 max = 20 ' maximum nbr of params
30 '
40 DIM arg$(max) ' used to hold the data items
50 '
60 OPEN "COM1:4800" AS #1
70 '
200 DO ' loop forever
210 GOSUB 1000 ' get the next line
220 IF arg$(0) = "GPRMC" THEN ' GPRMC contains lat/long
230 IF arg$(2) = "A" THEN ' A means locked on to satellites
240 PRINT "Latitude = "; arg$(3); " "; arg$(4);
250 PRINT " longitude = "; arg$(5); " "; arg$(6)
260 ELSE
270 PRINT "GPS searching..."
280 ENDIF
290 ENDIF
300 LOOP
310 '
320 ''''''''''''''''''''''''''''''''''''''''''''''''''''''
330 ' subroutine to load the GPS data items into
340 ' the array arg$(). returns with the array full
1000 DO ' subroutine start
1005 DO WHILE INPUT$(1, #1) <> "$" : LOOP ' wait for the start
1010 FOR i = 0 TO max
1020 arg$(i) = "" ' clear ready for data
1030 DO ' loops until a specific exit
1040 x$ = INPUT$(1, #1) ' get the character
1050 IF x$ = "," THEN EXIT ' new data item, increment i
1060 IF x$ = "*" THEN RETURN ' we have all the data so return
1070 arg$(i) = arg$(i) + x$ ' add to the data
1080 LOOP ' keep going
1090 NEXT i ' increment i
1100 PRINT "Corrupt data..." ' exceeded max data items
1110 LOOP


The final version would need a time out (use the TIMER function) and a few other frills but this is the core. The rest, as they say, is "left as an exercise for the reader".

Geoff
Geoff Graham - http://geoffg.net
 
devigan
Newbie

Joined: 11/08/2011
Location: Australia
Posts: 26
Posted: 09:15am 12 Sep 2011
Copy link to clipboard 
Print this post

Thanks Geoff it work.
 
Talbit
Senior Member

Joined: 07/06/2011
Location: Australia
Posts: 210
Posted: 08:05pm 12 Sep 2011
Copy link to clipboard 
Print this post

Geoff,
Thanks for helping out. I can certainly use your code.
Dave, I'm still keen to know why your code didn't work.
Working from iPod I don't know how the kids do it!
Can't sleep. 2:30am here. I need help. What the hell am I doing on the MM forum at 2:30 in the morning? I'm as bad as Sparkey !!!
Talbit

Talbit
 
Talbit
Senior Member

Joined: 07/06/2011
Location: Australia
Posts: 210
Posted: 11:41pm 20 Sep 2011
Copy link to clipboard 
Print this post

Devigan,
Do you have an answer for me?
Can you tell me why your code didn't work.
Talbit
Talbit
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024