Developing iOS Apps for Use with Geode GNS3 and GNS2

2 May 2022

The easiest method is to just connect Geode GNS3 and GNS2 over Bluetooth in iOS settings and access the data through the Core Location API as described at the following web page. The Geode takes the place of the integrated location sensor for access via the Core Location API as soon as it is paired via Bluetooth and is still turned on and in range.

https://developer.apple.com/documentation/corelocation/

Though using this method, your iOS app won’t have true accuracy data, or raw NMEA stream, just the location data provided through the iOS location manager (basically, Lat/Long, Altitude, Velocity, Heading, and HDOP/VDOP/PDOP which only provide a rough accuracy indication). This method also has limitations as described at the following web page.

Location Service vs Direct Connect to Geode

The best method is to become an authorized Geode external accessory developer. To do so, follow the instructions in this web document.

https://www.junipersys.com/data/support/documentation/Geode/Connecting-iOS-apps-to-Geode.pdf

Once authorized, developers can communicate directly with the Geode via an EASession using the EAAccessoryManager, as follows.

  1. Find the Geode device in the accessory manager (should match the protocol we provide).
    https://developer.apple.com/documentation/externalaccessory/eaaccessorymanager
  2. Get the EAAccessory instance from the manager.
    https://developer.apple.com/documentation/externalaccessory/eaaccessory
  3. Use the EAAccessory instance to connect via an EASession.
    https://developer.apple.com/documentation/externalaccessory/easession
  4. Sample code in Objective C:
    https://github.com/rvndios/EADemo

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 Geode GNSS receiver, 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 GNS3 contains the Hemisphere OEM P34 receiver and the Geode GNS2 contains the Hemisphere OEM 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://junipersys.com/data/support/geode/hemisphere-gnss-technical-reference-manual-v4.2.pdf

The following is some sample code from Geode Connect showing how EHE (Estimated Horizontal Error) is determined based on the NMEA RRE string data (or fallback to GST) from the Geode.

if (LatitudeErrorEstimation != null && LongitudeErrorEstimation != null)
{
      return Math.Sqrt(Math.Pow(LongitudeErrorEstimation.Value, 2) + Math.Pow(LatitudeErrorEstimation.Value, 2));
}