How can we get rid of the long-term program NETMF, which stops working?

Situtation

I have a FEZ Cobra II NET using test code. It sends data every second to a server on the local network. The server writes the data to a text file. After 27 hours and 97,200 successful shipments, Cobra stops sending. It is clear that I will not be debugging for 27 hours, and I'm not sure how else to deal with the problem, since standard approaches to troubleshooting software are not applied.

Question

  • If I were to write magazine errors in Cobra, how could I get them?
  • Does NETMF have application logs? How can we access them?
  • Is there an event viewer?
  • What other troubleshooting / debugging steps exist here?

the 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

+1
source share
1 answer

Since Fez has a slot for a memory card, you can register sending errors:

private void TimerCallback_SendSbcData(object stateInfo)
{
    try
    {
        SbcData data = new SbcData();
        this.network.Send(data);
    }
    catch (Exception ex)
    {
        MyLogToCardMethod(ex.ToString());
    }
}

Installation of the card instructions is on the manufacturer's website:

https://www.ghielectronics.com/docs/51/netmf-file-system

+1

Source: https://habr.com/ru/post/1535631/


All Articles