Buffer OVFLW error when using GPS module with Spider

I’m using a FEZ Spider with a Seed GPS module and after about a minute or so outside with the folloing code running im getting a Buffer OVFLW error displayed on the LCD.

This error doesnt occur if I run the code inside my house, so I suspect that I’m getting this error when the module starts to receive commands from satelites?


	public class Program : Gadgeteer.Program
	{
		private GPS gps;
		private Timer timer;
		private Bitmap lcd;
		private Font font;

		private void Initialize()
		{
			font = Resources.GetFont(Resources.FontResources.small);
			lcd = new Bitmap(SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);
			lcd.Clear();
			lcd.Flush();
			gps = new GPS(8);
			//gps.DebugPrintEnabled = true;
			gps.NMEASentenceReceived += NMEASentenceReceived;
			gps.InvalidPositionReceived += InvalidPositionReceived;
			gps.PositionReceived += PositionReceived;
			timer = new Timer(5000);
			timer.Tick += Tick;
			timer.Start();
		}

                private void NMEASentenceReceived(GPS sender, string nmeaSentence)
		{
			DisplayPosition(nmeaSentence);
			Debug.Print(nmeaSentence);
		}

		private void Tick(Timer timer)
		{
			DisplayPosition("GPS last position " + gps.LastPosition + " age " + gps.LastValidPositionAge);
			Debug.Print("GPS last position " + gps.LastPosition + " age " + gps.LastValidPositionAge);
		}

		private void PositionReceived(GPS sender, GPS.Position position)
		{
			DisplayPosition(position);
			Debug.Print(position);
		}

		private void InvalidPositionReceived(GPS sender)
		{
			DisplayPosition("Invalid position");
			Debug.Print("Invalid position");
		}

		void DisplayPosition(string position)
		{
			lcd.Clear();
			lcd.DrawText(position, font, Color.White, 0, 0);
			lcd.Flush();
		}

		public static void Main()
		{
			Mainboard = new FEZSpider();
			var program = new Program();
			program.Initialize();
			program.Run();
		}
	}

Edit:

Im running the 4.2.4.0 version of the framework.

I traced the source of the error message to usart.cpp file in the NETMF code.

I suggest you start with a standard Gadgeteer project, using the designer, and compare the. generated code with your code.

Please use the gadgeteer designer GHI Electronics – Where Hardware Meets Software

I’ve rebuilt using the designer, and while it can now get a gps lock, as soon as you move into an area where the receiver is covered I still get the Buffer OVFLW error.

Still, this is working better than before. I’m going to pick apart the project an see where I went wrong with my original code – at first glance they appear to be identical. I’ve probably missed some references…

One other thing to Check

Make sure are using GT.Timer for your timer.