Web Server and watchdog timer

Hi,
I have been working on a webserver using an UNO and Ethernet shield. I decided to utilise the new DHCP and DNS libraries available in 1.0 and found they work pretty well.

This project has to operate unattend for many days and so I am using the watchdog timer which again works fine. The problem is when the arduino reboots following a watchdog timeout it cannot restablish a connection with the router. reporting "Failed to configure Ethernet using DHCP restart arduino". The only way I can get it to work is by removing power waiting and then reconnecting.

Can anybody make any suggestions as to how I might overcome this problem.

The code for ethernet startup is as follows:

if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP restart arduino");
delay(10000);
//watchdog timer set at 8s
}
else
{
Serial.println("Ethernet configured using DHCP");
Serial.println(Ethernet.localIP());
}

Thanks

RogerA

My suggestions are:

  1. An external watchdog could power cycle it
  2. Do not use an Arduino but a hacked router. Routers make much better webservers than Arduinos

Can anybody make any suggestions as to how I might overcome this problem.

What issue is requiring you to use a watchdog timer in the first place? That is probably what needs fixing.

zoomkat,
I agree about power cycling it is a concern. I was having problems with either arduino or ethernet shield freezing and it was a convenient way to overcome that. It usually freezes whilst connected to a server and I am not sure why. I could start to investigate this but it would probably be a long job isolating the fault.

Your suggestion of using a hacked router is a good one especially as I have an old one lying around. Can you point me to any useful links?

RogerA