Arduino uno with ethernet hangs?

Goodevening,
i am using arduino uno. This device is programmed as an http server that services requests that i send from a pc through the web. The problem is that i need the arduino to work constantly and steadily. Unfortunately it seems that after a period of some days i can no longer make requests.
What i mean is that if i send the request i must wait until a timeout occurs. If i remove the power from the arduino board and i re-power it then everything works fine. Unfortunately this is a problem that i confront very often and in various arduino uno boards. Is this a bug concerning the arduino board? Is this a power problem? I mean is it possible that the arduino board hangs because the voltage is under a certain threshold and if this is the occasion what is the threshold that makes the arduino usable?

As far as the code is concerned is working perfectly.

Any suggestions are very welcome. I should point out that the arduino board is powered through a usb port.

Thanx in advance,
ioigoume

You are probably running out of sockets. Without seeing the code you are using, I would be guessing. My crystal ball is still in the shop for repairs. :wink:

Thanx for the quick reply.

Unfortunately, this can not be the situation. The requests i am sending are very few.

ioigoume

What do you mean by "very few"? More or less than than 4?

ioigoume:
As far as the code is concerned is working perfectly.

Code that hangs after a couple of days would suggest otherwise.

It is very easy to corrupt your ram/stack/heap when dealing with Ethernet, which leads to unexpected behavior.

Post your code otherwise, there isn't much people will be able to do to help you.

ioigoume:
Unfortunately, this can not be the situation. The requests i am sending are very few.

You've successfully verified this to be true through what means?

Goodevening,
i verified the problem and i want to report back. It seems that a custom pcb that i am using is causing the problem. To be more precise the relay i am using seemed to be faulty. On the other hand a question arises on what should we do if my arduino crashes and i can not be there?
Is there a way to time out my ethernet connection and report an error. I tried to implement a service doing this while using the timer library but i had no luck!

As far as the code is concerned i have checked it through serial console and it works ok.

ioigoume

As far as the code is concerned i have checked it through serial console and it works ok.

Then you shouldn't have any crashes.

I use a Mikrotik RB433UAH as the router for remote monitoring. I use the usb port for power and connect the ethernet shield to an ethernet port. I can log in by ssh to the router with a special user/password, and connect to the Arduino serial port, which reboots the Arduino. It isn't easy and it isn't cheap.

edit: If you doubt me, search the forum for zoomkat's testing of these services. He has racked up thousands of connections without a fail.

Goodevening,
the crashes are not often and the goal i have is to find all the possible solutions that will imporve the QoS of the infrastructure i am developing. Furthermore, i also have no doubt that the arduino device is well developed and works perfectly. As far as the previous crash is concerned i found a very small but crucial error. If you have not pointed out that, statistically, ethernet shield is steady i would have thought that it was the arduino.

As far as the the way that the connection to the serial port is being created and the reboot of the Arduino is triggered can you, SurferTim, give more details. I understand what you are suggesting but i want to see the details of your implementation.

Thank you all for your help and your support
ioigoume