Arduino Stops Working after few days.

Hi to all!

I'm using an Arduino Mega R3 in a project where I use the Ethernet shield and other board which communicates with Arduino vía SPI and generates an interruption to read some data.
The data is processed in Arduino and in a fixed interval are sent to a server in the local network.
What advise will you give me for debuging in Arduino if I want to find why the system stop sending data to the server? I've already checked the conection to the network by making ping to the device IP.

Thanks a lot!

harry07:
What advise will you give me for debuging in Arduino if I want to find why the system stop sending data to the server? I've already checked the conection to the network by making ping to the device IP.

Check all the code for any possible programming mistakes!

And in case you should use dynamically allocated "String" class object in your code, avoid it! "String" may eat up all the available RAM (depends on the coding) as time goes by and dynamically allocated "String" objects of different sizes gets allocated over and over.

Also check error handling of all possible runtime errors that might occur during runtime of the sketch, such like erros with reading sensors, errors with network connections, errors with unexpected results from the server you are connected to and so on.

If nothing helps, use the watchdog timer to restart your sketch.

Thanks for your advice!

I'll take them in count, and I'll tell you how I'm going through this problem.