Developing apps to use GPS in Windows

16 Mar 2020

Some basic sample code is provided at the following web page.

https://www.junipersys.com/support/article/14674

There are many methods that a software developer could use to access GPS and other location data in Microsoft Windows 10 such as on the Mesa 3 and Mesa 2 or from the Geode. This article describes some of the various methods.

For newer software or web applications, it is recommended to use the Microsoft Windows.Devices.Geolocation or the W3C Geolocation programming functions (API). Additional information is provided at the following web page.

https://msdn.microsoft.com/en-us/library/windows/hardware/dn614612(v=vs.85).aspx

If doing this, make sure your app appears in and can be enabled under Start > Settings > Privacy > Location in the list to "Choose apps that can use your precise location". Some apps which used previous versions of these functions may not appear in this list, but should still be able to access "precise location" (GPS) information. Though using this method, your Windows app won’t have true accuracy data, or raw NMEA stream, just the location data provided through the Windows location manager (basically, Lat/Long, Altitude, Velocity, Heading, and HDOP/VDOP/PDOP which only provide a rough accuracy indication).

Alternatively, you can possibly gain access to COM/Serial ports in UWP (Universal Windows Platform) to obtain the raw NMEA stream (instead of using a Location Sensor driver) as described in the following web articles.

https://github.com/runceel/VirtualCOMPortApp

https://docs.microsoft.com/en-us/uwp/api/windows.devices.serialcommunication

You may need to interop with a Win32 process as described at this web page.

https://blogs.windows.com/windowsdeveloper/2017/12/04/extend-desktop-application-windows-10-features-using-new-visual-studio-application-packaging-project/

If using the built-in U-Blox NEO M8N or M8T receiver in one of our rugged handheld computers, you can find location sensor by tapping and holding on Start, selecting Device Manager, and then looking under "Sensors" for "U-Blox GNSS Location Sensor". Or if needed, we also provide an alternative "legacy" virtual serial port interface as can similarly be seen in Device Manager under "Ports (COM & LPT)" as "U-Blox Virtual COM Port" which should be able to support any standard baud rate.

By default, the Geode (Hemisphere P206) as well as the Mesa built-in (u-Blox NEO M8) GPS receivers follow the NMEA-0183 version 4.1 standard as described at this web page.

https://www.nmea.org/content/STANDARDS/NMEA_0183_Standard

Once you have direct access to NMEA data, you can then use RMS data such as from the GST string to achieve a better indication of statistical location accuracy. If you have limited or no access to real-time data from a physical GNSS receiver such as the Geode, some previously recorded samples are as follows. The first sample shows the default NMEA-0183 version 4.1 data that comes out from the Geode with the default settings applied. The second sample shows only the GST and RRE messages enabled for statistical accuracy information. Both samples end with the custom battery level message.

Geode-NMEA-Messages-sample.txt

Geode-GST-RRE-only-sample.txt

The Geode contains the Hemisphere P206 receiver. The following Hemisphere GNSS Technical Reference Manual shows the parsing for all of the components of each NMEA message, including GST and RRE such as for possibly deriving a better indication of when achieving sub-meter horizontal positioning accuracies.

https://www.hemispheregnss.com/wp-content/uploads/2020/02/hemispheregnss_technicalreferencemanual_v3.0_12302019.pdf

Most legacy GPS software applications were written for receivers which followed the NMEA-0183 version 2.3 standard. If your GPS software will not fully recognize NMEA 4.1 sentences, please see the following web page.

GPS software can not see all NMEA sentences

Further details for the u-Blox NEO M8 receivers are provided in this document.

https://www.u-blox.com/sites/default/files/products/documents/u-blox7-to-u-blox8-M8-FW301-SWMigrationGuide_AN_(UBX-15031124).pdf

If needing to make more extensive changes to the default settings of the u-Blox GPS receivers, please refer to the following utility.

https://www.u-blox.com/en/product/u-center-windows