Google
  Web www.gpspassion.com


GpsPasSion LIVE!
www.flickr.com
This is a Flickr badge showing public photos from GpsPasSion Live !. Make your own badge here.

www.NaviBlog.com



Versions

Links/Liens




Portal/Portail
Rechercher

- -

Polls/Sondages
Sondage
Pour vous guider sur la Route :
GPS Mobile (SEM)
GPS Intégré
Smartphone
Autre
Voter  -  Résultat des votes
Votes : 1361




Club GpsPasSion
Soutenez le site!

USA: (US$)
EUROPE: (€)
Guide Paypal


GpsPasSion Forums
Home | Profile | Register/Enregist. | Active Topics | Search/Recherche | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 English Forums - Hardware
 Mio AIO Forums - www.mionav.com
 Help required - Mortscript - Date & Time From GPS

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

  Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
StormyKnight Posted - 31 janv. 2009 : 06:45:40
I written a script that when run will scan the NMEA codes from the GPS, work out the date & time & then set the PNA to that date & Time.

Current Limitations (If you can remove any of these please post your updates)
*The script doesn't get the GPS to lock on its own, but if we use a port splitter it will - this is a limitation with mortscript, the ReadFile function closes the port after each read which resets the GPS.

A very good free port splitter that works can be found here...
http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=60900&whichpage=1

*NMEA communication only, sorry no Sirf - Most GPS's can be switched to NMEA
*TimeZone must be a whole hour
*FIXED* Thanks to Osprey - Leap Years are not taken into account on the conversion
*The current year is assumed to be between 2000 & 2099 - This can be avoided if we read the $GPZDA sentence, but it is not outputed by default on every device

V1.3 http://www.savefile.com/files/1994188 basically the same as V1.2 but Com Port changed to Com3 (rather than Com2) by default. This version works as designed if a port splitter is used as an intermedary.
V1.2 http://www.savefile.com/files/1990020 This version will continously try to get a time lock. It doesn't work unless the GPS has already been locked by another program. (Same as V1.0, V1.1)
V1.1 http://www.megaupload.com/?d=M0VVDAF4 Thanks Osprey - This version will request the time once & then exit. If the time is not valid it will advise you of that.
V1.0 http://www.savefile.com/files/1988754

Please test & provide feedback/suggestions for improvement

Thanks
15   L A T E S T    R E P L I E S    (Newest First)
sucro Posted - 24 oct. 2011 : 16:06:16
Man thank you very much for very nice and clear explanation, now i understand why on some of sirfatlas devices isn't added localy time, instead of UTC time :) ....

I'll try with your suggestion on my chinese device to fix showing local time zone ;)!

jwoegerbauer Posted - 08 oct. 2011 : 10:32:28
@sucro,

regarding coding a GPS NMEA date time stamp reader in MortScript which is subject of this thread: IMO the scripts you are looking for are only limited usable, because StormyKnight only decodes the $GPRMC sentence. We know there generally are 3 NMEA sentences that deliver date/time information (but probably not all SiRF chips support those three - must be investigated with an extra utility such as freeware SiRFTech):


$GPZDA

A string that starts with $GPZDA contains the date and time in UTC, and local time zone.

Synthax: $GPZDA,hhmmss.ss,dd,mm,yyyy,lzd,lzm

The 'decoding' is obvious: The 2nd field is HHMMSS.SS
hhmmss.ss = UTC
dd = Day, 01 to 31
mm = Month, 01 to 12
yyyy = Year
lzd = Local zone description, 00 to +/- 13 hours
lzm = Local zone minutes description (same sign as hours)

Example: $GPZDA,173357.00,28,04,2007,,*69

UTC= 173357.00
UTC day = 28
UTC month = 04
UTM year = 2007
Local zone hours = null
Local zone minutes = null
Checksum = *69



$GPRMC

A string that starts with $GPRMC contains the date and time in UTC, when last fix occured.
Note that this strings appears every few seconds, with a granularity of +/-2 seconds.

Synthax:$GPRMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,ddmmyy,x.x,a*hh

The 'decoding' is obvious. The 2nd field is HHMMSS, the 11th field is DDMMYY.

Example: $GPRMC,134058,A,3850.1234,N,12230.5678,W,0.0,71.4,010904,15.0,E,A*0D

FYI: This example is from September 1, 2004, at 13:40:58 UTC

Be aware, that before satellite lock is found, there is no position, and no time.
The ",V," indicates that the fix is no good.
$GPRMC,,V,,,,,,,010904,15.0,E,N*00



$PSRF151

A string that starts with $PSRF151 contains (in encrypted manner) the date and time in UTC, this undependent of last fix.

Synthax: $PSRF151,(GPS_TIME_VALID_FLAG),(GPS Week),(GPS TOW),(EPH_REQ_MASK_HEX)*(checksum)

The 'decoding' is obvious. The 2nd field is number of week since 00:00:19 TAI on August 22, 1999, the 3rd field is number of seconds within week.

Example: "$PSRF151,3,1656,38871,0xffffffff*6B"



Only sentence $GPZDA holds date and time in UTC, and additionally local time zone informations, the other 2 provide UTC, not local time, so you must convert if decoding these 2 sentences.

A rudimentary $GPRMC parser you find here: http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=132727&whichpage=51#975298
sucro Posted - 28 août 2011 : 14:52:18
quote:
Originally posted by StormyKnight

I written a script that when run will scan the NMEA codes from the GPS, work out the date & time & then set the PNA to that date & Time.


V1.3 http://www.savefile.com/files/1994188 basically the same as V1.2 but Com Port changed to Com3 (rather than Com2) by default. This version works as designed if a port splitter is used as an intermedary.




Hello Stormy,

can you reupload your v1.3 script, cause all links are dead...

Thanks !
dem1980 Posted - 16 juin 2010 : 20:52:02
could you repost 1.3 please ?
thank you
jacedi Posted - 15 nov. 2009 : 15:07:19
quote:
Originally posted by Osprey

StormyKnight, awesome script! I love it! I wish that I had thought of it, myself, a long time ago. I'd love to include it in MioPocket, if you don't mind.

Also, I hope that you don't mind that I modified it some. I...
...fixed a bug with decreasing the month for negative time zones. It was pretty coincidental and fortunate, actually, since I tested the script a few hours before midnight on Jan 31st while it was just after midnight on Feb 1st UTC. It gave me Feb 1st before; now, it gives me Jan 31st.
...added leap year support.
...added detection for an invalid (pre-2009) date.
...cleaned up the syntax a little so that it's easier to read and looks more like the rest of MioPocket's scripting.
...added a silent mode, so that the script can be called without displaying the status window.
...added automatic time zone detection when using MioPocket.
...added a call, when using MioPocket, to MoovGPSModeToggle.mscr in R39 to switch the GPS mode to NMEA.

Finally, I hope that you don't mind that I've called this version 1.1.

Here are the files: http://www.megaupload.com/?d=M0VVDAF4

It contains GPSTimeSync2.mscr and GPSTimeSync2Auto.mscr. The latter simply launches GPSTimeSync2.mscr silently. Also, if you wish to enable the MioPocket features, you will need to open up the main script and un-comment the MioPocket variables at the top, then run the script from the MioPocket's MioAutoRun\Scripts folder.



@StormyKnight and Osprey

I have tried your script on my WinCE 5. It works fine. Thanks.

Can you perhaps help with a script (MortScript) to only change the device Time Zone in the Control Panel / Date & Time settings to a preferred GMT time zone on start up? Or where I could find examples of such scripts?

Would really appreciate help with this.
StormyKnight Posted - 07 févr. 2009 : 01:57:55
OK finaly i have worked out why Mortscript won't work. The Readfile command actually opens & then closes the GPS port on each read. This resets the GPS also on each read. At the moment there is no alternate method however the command ReadLine may be adjusted to work with com ports in the future.

Thanks to all who assisted, it all helped to find the final answer.
StormyKnight Posted - 05 févr. 2009 : 11:30:36
OK I have found a freeware port splitter that works! As a bonus it is a single file & 1 single dll. It also saves its settings in an ini file (so no registry issues), it also has an autostart function - the only thing I need to do was put a shortcut in the MioAutorun\Windows\StartUp so that after a reset OR a HARD RESET....it would run automatically!

I set it up to read Com 2 & Output to Com 3 - ***** YOU THEN NEED TO EXIT SO THAT IS SAVES THE INI FILE! *****

Then you can restart it.

I then run my script V1.3 & the time is found in a matter of seconds...even after a hard reset!

The port Splitter can be found here...

http://www.gpsmeter.com/index.php?page=portsplitter & the forum discussing it can be found here

http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=60900&whichpage=17
Helen Posted - 04 févr. 2009 : 18:30:49
Hello StormyKnight,

My programming skills are below zero at the moment, but searching goes as a rocket.
After trying many, many appl. I found this: http://w5.nuinternet.com/s660100031/SirfTech.htm via this page: http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=45904 (what else)
You can find the download files about half way the SirfTech page.

Installation is simple, easy to select the right COM and I got a fix. Now it's time to find out more about all the options in the menu.

Cross my fingers that this is really helpfull.

Added --->
Ha, ha, ha and continued reading the topic about Sirftech and jah, there can only be one Stormyknight
StormyKnight Posted - 04 févr. 2009 : 08:17:31
OK so that works.....

V1.3 - set to com 3, will continue to try & get the time...

http://www.savefile.com/files/1994188

I have changed my script to look at com 3 & after a reset reloading GPSGATE since its settings are lost after a reset, I run GPSGATE & then run my script, a short time later the time is found because we have communication from at least 1 satellite although there is no lock yet & then soon after GPSGATE indicates a lock as well.

Unfortunately GPSGATE is not free....but maybe there is a free alternative?

Cheers
StormyKnight Posted - 04 févr. 2009 : 04:40:27
Further testing has shown that if I connect to the GPS using GPSGate, it can indicate if it has found NMEA data which it does. It also indicated if a valid lock has been found...which it also does....so....

I think there may be an issue with the way that I am reading the data......I know for instance that several scripts read the data at 1 character at a time & wait for the ^cr^^lf^ which indicates that that particular sentence is finished....

When I try that with my script I keep getting only the first character repeated indefinately...

I'm not sure where the issue is....maybe mortscript....maybe my code i.e. the interface settings....

Tonight I will be testing my code using the output from the gpsgate & see if that works....Also I will see if there is some other ce scripting language to see if that is the issue & lastly, I will try mortscript on the PC as you can do that too.

Cheers
StormyKnight Posted - 03 févr. 2009 : 13:32:17
OK Thanks Helen, just been playing with GPSGate, & whilst I can get it to record the NMEA stream, there is nothing seemingly coming from the apps to the GPS.....
Helen Posted - 03 févr. 2009 : 12:54:44
StormyKnight,

Some source code that I found is on http://www.codeproject.com/KB/mobile/GPSController.aspx and http://msdn.microsoft.com/en-us/library/ms881362.aspx, both in C#.
On http://forum.ppcgeeks.com/showthread.php?t=21248 I found a GPS plugin for Today. It seems to get a lock very fast but I guess it's useless without Today installed.

Other GPS appl that I found either don't work or take a long time to lock. I hope the code is helpful.

Regards

I am looking forward
StormyKnight Posted - 03 févr. 2009 : 01:18:39
@Helen, Thanks I will have a look at these....I hoping to find something with the source code as well so i can have a look....but the only program I found with code also doesn't work! It runs but no NMEA data is shown!

http://www.geocities.com/cmathiaz/


Also I found this site to calculate the checksums for the NMEA sentences that you may want to send to the GPS... http://www.hhhh.org/wiml/proj/nmeaxor.html

I'm going to try & get a port splitter program running so I can intercept the codes sent to the gps & log them...perhaps that will shed some light!

I will set it up to that the GPS will be on the input (Com2) & say OziCE will point to Com 3. The splitter will redirect the commands for me but hopefully also be able to log the traffic.

Cheers

Helen Posted - 02 févr. 2009 : 17:44:54
Maybe the following is of more use. Found: http://users.skynet.be/hofinger/GPS2Blue.html

Funny enough there is a (French) topic about this on:
http://www.gpspassion.com/FORUMSEN/topic.asp?TOPIC_ID=56979
Helen Posted - 02 févr. 2009 : 15:01:09
Hello,

StormyKnight: what a good idea!

Since I am also interested in this subject I have been searching the internet so now and then.
Yesterday finally found something that was looking interesting on SourceForge, named Whiskers - see also http://forum.xda-developers.com/showthread.php?t=475005
I asked the developer for some docu and he mailed me that http://www.yesmobile.net/en/index.asp might be the solution (30 days trial )
See also the faq tab. I didn't get it working on my Falk yet.
Hopefully this info is helpful......

Best regards,
Helen

GpsPasSion Forums © 2002-2013_GpsPasSion/Manzanite Go To Top Of Page
This page was generated in 0,34 seconds. Powered By: Snitz Forums 2000 Version 3.4.05