Situtation
I have a FEZ Cobra II NET running test code. It sends data every second to a server on the LAN. The server writes the data to a text file. After 27 hours and 97,200 successful sends, the Cobra stops sending. Clearly I am not going to debug for 27 hours, and I am not sure how else to trouble shoot, because standard software trouble shooting approaches do not apply.
Question
Code
public class Program
{
private static Timer timer;
private Network network;
public static void Main()
{
Program p = new Program();
p.network = new Network();
p.RepeatedlySendDataToWcfService();
Thread.Sleep(Timeout.Infinite);
}
private void RepeatedlySendDataToWcfService()
{
Program.timer =
new Timer(this.TimerCallback_SendSbcData, new object(), 0, 1000);
}
private void TimerCallback_SendSbcData(object stateInfo)
{
SbcData data = new SbcData();
this.network.Send(data);
}
}
Search and Research
As the Fez has a memory card slot, you could log send errors to that:
private void TimerCallback_SendSbcData(object stateInfo)
{
try
{
SbcData data = new SbcData();
this.network.Send(data);
}
catch (Exception ex)
{
MyLogToCardMethod(ex.ToString());
}
}
Mounting the card instructions are on the manufacturer site: