My ethernetshield on an Arduino UNO has lame behaviours. Typically after I failed to upload a sketch, e.g. if i altered some wires and the cable fell out (could be other things). Last time it took me a day to get it back online again, not doing anything else than spamming it with the WebServer example and the WebClient example respectively.
You all know how the normal WebServer sketch shows analog input in the browser like:
analog input 1 is 252
analog input 2 is 278
analog input 3 is 274
analog input 4 is 291
analog input 5 is 0
When it have troubles connecting the same sketch looks a little more like this:
Regarding the client library, it can't connect at all (even not the initialization message "connecting to host"). Sometimes it gives me "Failed to configure Ethernet using DHCP", which is where I would make it connect to the mac and IP that I provided Ethernet.begin(mac, ip) - but nothing happens. Now I'm tired of just waiting and working on nothing, so I would use some time to ask if anybody have had issues alike, and maybe had a solution to the problem? Else I'll just do the std routine: wait wait wait patience....
I am testing a new, mostly SD file driven server now. It has been working great. If it continues to work good for a while, I'll post it in the playground also.
Combining both posts, here is what you are saying.
pakken:
Now I'm tired of just waiting and working on nothing, so I would use some time to ask if anybody have had issues alike, and maybe had a solution to the problem?
I'm not sure you read my post at all?
I had issues with the standard examples, so I wrote my own. I don't think you understood my response.
Ahh okay But the examples are fine for me, when it works. But it doesn't even want to connect. Now I've been going steadily for 7 hours Only happens when disconnecting or something goes wrong in uploading. It's like i knock it over for a period of time, and then suddenly it slowly wake up
The phrase "when it works" is the key. Without the timeout stuff in my sketches, they will freeze (lock up). Maybe not right now, maybe not for an hour. Maybe not for a day or two. But they do freeze up just like your subject says. Unstable.
// connectLoop controls the hardware fail timeout
int connectLoop = 0;
while(client.connected())
{
while(client.available())
{
inChar = client.read();
Serial.write(inChar);
// set connectLoop to zero if a packet arrives
connectLoop = 0;
}
connectLoop++;
// if more than 10000 milliseconds since the last packet
if(connectLoop > 10000)
{
// then close the connection from this end.
Serial.println();
Serial.println(F("Timeout"));
client.stop();
}
// this is a delay for the connectLoop timing
delay(1);
}
Serial.println();
Serial.println(F("disconnecting."));
// close client end
client.stop();
I run mine days at a time without a fail. I haven't had a sketch freeze (lockup) in quite a while, maybe months. I'm testing my new server code now. Here is the info with ip address if you want to try it. http://forum.arduino.cc/index.php?topic=197103.0
You can DoS it by requesting the pages with the pictures too often, but it recovers. At least it has so far.