A lot of words said about Ethernet shield and it's library. Have anyone got stable version fo mere http continuos GET requests with Arduino Mega 2560 + Ethernet shield with WS5100 ?
Mine works fine on some sketches for the several first requests but finally remote web-server refuse to deal with arduino ((
I heard some people faced the same story and it was said that problem might be bad implementation of "client.stop" function and/or incorrect handling of keep-alive procedure by Ethernet shield. I checked the matter of overheating - the shield is a bit hot, but it sends data perfectly to local server in home network without any problems. So , the problem appears than i have to add "HTTP/ 1.1" and all that stuff related to HTTP transmission over real Internet.
Here's a routine that works only some time. After some successfull requests arduino still successfully connects, but getdata.php on server side do not receive any data. I've tried to approach than getdata.php via browser - it still works fine, so the problem is not in that script.
String msg = "GET /getdata.php?i="+String(i)+ "&t="+String(wv)+ " HTTP/1.1";
#define TEST_MODE 1
if(TEST_MODE)
{
Serial.println(Ethernet.localIP());
Serial.println(msg);
}
if (client.connect(server,80)) {if(TEST_MODE) Serial.println("ok, connected!");}
else {if(TEST_MODE) Serial.println("failed to connect...");}
client.println(msg);
client.println("Host: www.my-website.com");
client.println();
// if (client.available()) {char c = client.read(); Serial.println(c); }
//client.println("Connection: close");
delay (5000);
client.stop();
delay (30000);
please disregard name of site, it was changed. sorry for pure English, not my native one.