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.