Ethernet Library bogus?

Hi all,
I'm currently working on my project which involves serving of frequent http request through an ethernet shield.
However, my program falls constantly into an unstable behavior, soon enough arduino acts like "crazy", throws "random" characters mixed together with several string literals on the screen (Serial, or ethernet client) and finally "hangs", and by hanging I mean it really crashes, the reset button is not helping, and I have to reboot it by removing the power.
Originally I thought that it might be my code's fault, but what I do isn't really that complicated, but then I started suspecting the Ethernet library.
Searching the web I found this article: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1238640832
which dates back to 2009. Describes symptoms similar to the ones I'm currently facing, but it states that the official Ethernet library is now updated and that's why I don't need to and I can't download the revised version (because it's nowadays already fixed).
To demonstrate the problem is very easy: you just need an arduino board + an ethernet shield. Then open from the examples the Ethernet -> "Webserver" example. Edit your mac address and IP , and upload to your arduino. Then hit the IP address from a browser window. You will see the values of the six analog inputs. The page refreshes automatically after 5 seconds. Then start opening new tabs on your browser, and open the url with the IP again. And again, and again, until you have a lot of tabs on your browser hitting the arduino. I tried with 15-20 tabs and then after a few seconds, I could see the garbage output, then the arduino hangs up completely.
Any ideas on how to overcome this?

Try this web server with two form fields. See how it does.

IDE v1.0.1 ethernet library is the only version I trust.

SurferTim:
Try this web server with two form fields. See how it does.
Arduino Forum
IDE v1.0.1 ethernet library is the only version I trust.

My friend, you - are - a - GENIUS !!!

I checked the example you pointed out for differences, and it seems that the key-difference is those two magic lines in setup():

pinMode(4,OUTPUT);
digitalWrite(4,HIGH);

that deselect the SD card peripheral that comes together with the Ethernet Shield.

Now I've been hitting the arduino with 20 concurrent requests per second for about 15 minutes and for now it is still stable as a horse!

I think those two lines should be also included in the webserver example that comes with the Arduino IDE, together with a comment explaining their importance.

Thank you so much! :slight_smile:

I will keep this thread update if I find something more.

I checked the example you pointed out for differences, and it seems that the key-difference is those two magic lines in setup():

Code:
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);

that deselect the SD card peripheral that comes together with the Ethernet Shield.

Good to hear the "magic pixie dust" worked for you. It does a lot better than eating salted peanuts. :slight_smile: