New GPSDriver library

Discussion in 'Official Updates' started by Erel, Nov 4, 2008.

  1. Erel

    Erel Administrator Staff Member Licensed User

    The GPSDriver uses Microsoft GPS Intermediate Driver to receive GPS data.
    This library can work with both internal and external GPS devices.
    Using this library is simpler than with the GPS library as there is no need to manually connect to a serial port.
    This library should be added to both the desktop and the device, however the functionality is not available on the desktop.
    Requirements are Windows Mobile 5.0 or newer devices installed with .Net Compact Framework 2.0.

    I want to thank Agraham for writing the first version of this library. :sign0188:

    Setup instructions:
    - Unzip the attached file.
    - Copy GPSDriver.cs, GPSDriver.dll and GPSDriver.chm to Basic4ppc libraries folder:
    C:\Program Files\Anywhere Software\Basic4ppc Desktop\Libraries

    Edit: V1.11 is attached. This version fixes a bug in the GPSConverter object related to conversions of negative longitude coordinates.

    An example is also included in the zip file.
    The online manual is available here: GPSDriver

    See this post about external GPS devices:

    Attached Files:

  2. agraham

    agraham Expert Licensed User

    GPSDriver.chm doesn't work on my machines, either Vista or XP. I just get "The address is not valid" errors :( Any ideas?
  3. klaus

    klaus Expert Licensed User

    On my XP machine it works !?
  4. agraham

    agraham Expert Licensed User

    Found it! - A security issue I've not come across before :sign0161: I keep the settings on my machines quite tight.

    If anyone with Vista has this problem note that you can't unblock it while it is in the "Libraries" folder owing to Vista security. You will need to copy it to a folder outside "Program Files", unblock it, delete the one in "Libraries" and copy the unblocked one back. At least that's what I had to do!
    Last edited: Nov 5, 2008
  5. agraham

    agraham Expert Licensed User

    A bug :( EllipsoidAltitude is checking the wrong flag for validity
    public float EllipsoidAltitude
    { get { 
    return SeaLevelAltitudeValid ? gpsdata.flAltitudeWRTEllipsoid : InvalidData; } }
    And a comment.

    There is inconsistent naming of "SatellitesInViewCount which is plural and SatelliteInUseCount which is singular.
  6. Mr_Gee

    Mr_Gee Active Member Licensed User

    Hi Erel, this is great news!!
    thanks for this new lib (and you too Agraham )

    Just tried your demo application, when I run it and click connect i get an error
    An error occurred on sub main.displaygps

    Line number : 

    If Satellites.shouldCalculate Then Satellites.UpdateSatellites

    Error description
    If I click yes then the error pops up again, but If I click yes and click on satellites (menu item) quickly the table shows and gets updated
    when I close the satellites form works like it should...

  7. Erel

    Erel Administrator Staff Member Licensed User

    Thank you guys. I've updated the library to version 1.01 with a fix to the validity check.
    The demo program was updated and now Satellite.shouldCalculate is first initialized to false as required.
  8. taximania

    taximania Well-Known Member Licensed User

    I will try this whilst at work tomorrow, and post my findings later on :)
  9. derez

    derez Expert Licensed User


    Erel and Agraham
    thanbks for this library, I'm already running my navigation program and it works nicely. The satellites code becomes very easy with the new structured array which includes the "Used".:)

    Still I'm not sure that EllipsoidAltitude is doing what it should - I get the same altitude all the time (usually there are variations of few meters as the gps stabilizes).

    Please explain the difference between the two types of altitudes. all altitude calculations are with reference to a specific Geoid which is defined by each country or for an area, or by using the general WGS84.(see attached list)
    What does "sealevel" use ?

    Attached Files:

  10. agraham

    agraham Expert Licensed User

    As long as you have version 1.01 then Ellipsoid altitude does what I expect on my Diamond. It appears to return (correctly) the present altitude above the WGS84 ellipsoid which when corrected using the transformation equations and parameters specified by our national mapping agency (the Ordnance Survey) give a good match to my latitude, longitude and altitude on our national standard geoid (OSGB36/ODN) on which our UK maps are drawn.

    I don't have the detailed knowledge to answer the rest of your query as I have only researched the WGS84 to UK standard transformation using the equation and data supplied by our Ordnance Survey.
  11. derez

    derez Expert Licensed User


    I used this code to display both altitudes on the same form:

    If gpsd.SeaLevelAltitude <> gpsd.InvalidData Then
    t_alt = gpsd.SeaLevelAltitude
    tb1.Text = t_alt
    If gpsd.EllipsoidAltitude<> gpsd.InvalidData Then tb2.Text = gpsd.EllipsoidAltitude Else tb2.Text = "x"
    End If

    what I see is that while the sealevel Alt is changing , as a result of non-optimized satellites reception, the ellipsoid is static. It is not functioning correctly, at least in my device and program.
    Can you please check or tell me what I'm doing wrong ?


    Attached Files:

  12. agraham

    agraham Expert Licensed User

    Your code looks OK. It looks like your device insn't returning a valid EllipsoidHeight. You didn't confirm that you are using version 1.01 of the library. On my device SealevelAltitude is always invalid.

    I really can't help any more as the driver is returning whatever you are getting. However this archive includes my test program which has an extra library "GSPDriverNMEA.dll" that can retrieve the actual NMEA sentences from the Intermediate driver. Using this you can check at a lower level what the data actually is.

    Run the app on your device (with all the libraries), select NMEA from the menu and then press Open. The textbox will fill with data. Clear will clear the textbox at any time and log will write the present textbox text to a file "NMEA.log" in the application directory. You could then check what the device is producing. The "usual" messages are documented in the NMEAsentences.txt file in the archive.

    Attached Files:

  13. derez

    derez Expert Licensed User

    Before checking the program let me tell you what I saw on the way home from work.
    I drove 40 Km north, and the Elipsoid altitude crept slowly from 16.6 to 17.1 while the real altitude travelled +- 50 meters. I thought that this may be showing that the parameter is a difference between the WGS84 and the sealevel altitude.
    When I got home I saw your post and I find this inside:

    Global Positioning System Fix Data
    eg3. $GPGGA,,llll.ll,a,yyyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh
    1 = UTC of Position
    2 = Latitude
    3 = N or S
    4 = Longitude
    5 = E or W
    6 = GPS quality indicator (0=invalid; 1=GPS fix; 2=Diff. GPS fix)
    7 = Number of satellites in use [not those in view]
    8 = Horizontal dilution of position
    9 = Antenna altitude above/below mean sea level (geoid)
    10 = Meters (Antenna height unit)
    11 = Geoidal separation (Diff. between WGS-84 earth ellipsoid and
    mean sea level. -=geoid is below WGS-84 ellipsoid)

    12 = Meters (Units of geoidal separation)
    13 = Age in seconds since last update from diff. reference station
    14 = Diff. reference station ID#
    15 = Checksum

    I believe that there must be some mix of the use of this part in the stream.
    Now I'm going to check the program...:)

    by the way - the sealevel altitude is very accurate, I compared to trig point on the map near the road !!!
  14. agraham

    agraham Expert Licensed User

    I wouldn't read too much into those descriptions. They are off just one site I found and I wouldn't trust it as a definitive description. On my device item 9 seems to really be the altitude above WGS84 and is the value being returned for EllipsoidAltitude. Item 11 is always 0. and SeaLevelAltitude is returned as Invalid.
  15. derez

    derez Expert Licensed User

    I cannot see any nmea stream in the test program. It counts the readings but no data. on the parameters display I see all.

    I tried to compile your program but it provides an error.

    As you see the accuracy I get with the sealevel is excelent so I will continue to use it, but I really would like to know how the GPS knows this sealevel altitude, and if it is accurate all over the world or just here because this is where Erel lives...

    I also wish you could supply the stream, so that it is used for debuging. I find very strange phenomena in devices that operate my program and this whould help.


    edit: I checked here NMEA data and it is the same definition.
    here: GPS - NMEA sentence information the same definition.
    And here you'll see that other people get also confused by this issue : SpringerLink - Journal Article
    Last edited: Nov 6, 2008
  16. agraham

    agraham Expert Licensed User

    Did you put the correct COM port in the textbox below the Open button? The GPSDriver library does not need a COM port but the GPSDriverNMEA library does. It is the COM port listed under Settings->System-> External GPS (on my device anyway).

    The library relies upon stuff that came in with Windows Mobile 5.0. I suspect that your computer needs the WM 5.0 SDK installed to have this stuff available. Perhaps Erel can comment if he sees this post?
  17. derez

    derez Expert Licensed User

    I have internal GPS reciever, but entering its com port didn't help either.
    Never mind, I think I understand now what is going on and it's Okay.

  18. schimanski

    schimanski Well-Known Member Licensed User

    GPSDriver and external GPS


    I have tested the new GPSDriver.dll with my Eten Glofiish X600 and a HTC Touch Diamond, and it' runs very fine!!!!:sign0188:

    Now,i have treid to use it on a Qtek S200 with WM5 and a external GPS-Bluetooth mouse. But this doesn't run. Where is the mistake?


  19. agraham

    agraham Expert Licensed User

    This is the mistake. The new library only works on internal GPS because only they have the Intermediate Driver that this library uses. This library was needed because of an incompatibility between the .NET SerialPort used by the Serial2 library and some internal GPS drivers. For an external GPS you should be able to use the exsting Serial2 and GPS libraries. I am considering writing a new GPS library for external GPS that uses the same methods and properties as the new GSPDriver library - but it will be a short while before it is available if I decide to do it and a long while if I decide not!.
  20. Mr_Gee

    Mr_Gee Active Member Licensed User

    Hi Agraham,

    Wouldn't it be a better idea to include both internal & external in the new GPS driver lib?
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice