.Net Gadgeteer: GPS Module

Seeed Studio has released a GPS module for .Net Gadgeteer. In this simple demonstration I am using Seeed Studio’s modules with the GHI’s mainboard with no issues to report. This is one of the really cool things about .Net Gadgeteer; it plays well with others. Gadgeteer is like cross vendor hardware glue that forms an eco-system. I will be talking more about that in later posts.

I am using Seeed Studio’s OLED display and showing off its vibrant colors.
Also note, I was too lazy to formet the latitude and longitude but in debug I verified it was accurate. According to the modules spec it is accurate to 2.5m. The Seeed Studio GPS module is based on the U-Blox Neo-6M GPS module.

The code is very simple:

public partial class Program
GTM.Seeed.GPS gps = new GTM.Seeed.GPS(8);
GTM.Seeed.OledDisplay oled = new GTM.Seeed.OledDisplay(6);

void ProgramStarted()
gps.InvalidPositionReceived += new GTM.Seeed.GPS.InvalidPositionReceivedHandler(gps_InvalidPositionReceived);
gps.PositionReceived += new GTM.Seeed.GPS.PositionReceivedHandler(gps_PositionReceived);
GT.Timer timer = new GT.Timer(5000);
timer.Tick += new GT.Timer.TickEventHandler(timer_Tick);

void timer_Tick(GT.Timer timer)
Debug.Print("GPS last position " + gps.LastPosition + " age " + gps.LastValidPositionAge);
oled.SimpleGraphics.DisplayRectangle(GT.Color.Black, 0, GT.Color.Black, 10, 10, 120, 50);
oled.SimpleGraphics.DisplayText("GPS last position: " , Resources.GetFont(Resources.FontResources.small), GT.Color.Magenta, 10, 10);
oled.SimpleGraphics.DisplayText(" " + gps.LastPosition , Resources.GetFont(Resources.FontResources.small), GT.Color.Orange, 10, 20);
oled.SimpleGraphics.DisplayText("GPS age (days): " , Resources.GetFont(Resources.FontResources.small), GT.Color.Cyan, 10, 30);
oled.SimpleGraphics.DisplayText(" " + gps.LastValidPositionAge.Days, Resources.GetFont(Resources.FontResources.small), GT.Color.Blue, 10, 40);

void gps_InvalidPositionReceived(GTM.Seeed.GPS sender)
Debug.Print("Invalid position");
oled.SimpleGraphics.DisplayText("GPS Threw: Invalid Position", Resources.GetFont(Resources.FontResources.small), GT.Color.Red, 10, 10);

void gps_PositionReceived(GTM.Seeed.GPS sender, GTM.Seeed.GPS.Position position)
oled.SimpleGraphics.DisplayRectangle(GT.Color.Black, 0, GT.Color.Black, 10, 50, 120, 20);
oled.SimpleGraphics.DisplayText("GPS position: " , Resources.GetFont(Resources.FontResources.small), GT.Color.White, 10, 50);
oled.SimpleGraphics.DisplayText(" "+ position, Resources.GetFont(Resources.FontResources.small), GT.Color.Yellow, 10, 60);

That is all there is to it.


6 thoughts on “.Net Gadgeteer: GPS Module

  1. Did you have to go out of doors to get the position? All I’m getting is the following, which I gather is a report of failure to get position.

  2. The GPS is seeing no satellites. So you need to move the antenna near a window that can see the sky. I was able to get a connection from inside the house by putting the antenna on a window seal.

    The data you are seeing is National Marine Electronics Association formatted data. http://www.gpsinformation.org/dale/nmea.htm
    So in the GPGGA “sentence” the fifth word “00” is number of satellites being tracked. So you have none. 😦

    So this is the serial interface data used to communicate between GPS hardware. How did you get that? I didn’t see that. Could be very useful.

    Is the InvalidPositionReceived event firing? What I experienced was that if InvalidPositionReceived fired the PositionReceived event would be silent until there was a good signal. I only had to move the antenna near a window to get a signal. Took just a few minutes to connect.

  3. I found that I needed to be outside with a clear southward view (I’m in Seattle and suspect the closest GPS satellite is to the south of me). It took 60-90 seconds to acquire a fix, and it was quite stable after acquisiton.

    The assistive GPS technology in phones really speeds the GPS satellite acquisition time. A non-assisted chip can take a while to connect but is usually good at holding the connection as long as line of sight is maintained.

  4. Hi, I am constantly getting NO POSITION FIX as my message. And I tried standing out under clear sky, tried couple of other places (like my office, home). Nothing seems to be working. I would like to understand what exactly this message means and what I got to do for getting the correct GPS position?

    • What is the visible satellite count? If its less than 3 you will often see this message. There are probably other reasons but this is one common reason to get this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s