I've read some bits on reducing Ethernet timeout in Arduino 1.0 using:
W5100.setRetransmissionTime(0x07D0);
W5100.setRetransmissionCount(3);
Unfortunately, this does not seem to work with Arduino 1.0 and a DHCP ethernet call like:
if (Ethernet.begin(mac) == 0) {
Instead, with no Ethernet cable inserted in my RJ45 jack, I have to wait several mintues for a timeout....not good :D.
I've tracked through the Ethernet libs and it looks like I'm stuck in a loop inside of sendUDP (in socket.cpp) waiting for an OK or a TIMEOUT which, unfortunately, seems to take several minutes (!) when there's no ethernet connection.
The call trace from my Ethernet.begin look like:
w5100.setMACAddress()
w5100.setIPAddress()
dhcp.beginWithDHCP()
dhcpUpdSocket.begin()
send_DHCP_MESSAGE()
sendUDP()
(I've messed with the values passed for timeouts into beginWithDHCP too, to no avail)
How are others dealing with the apparent lack of functioning timeout on Ethernet.begin when using DHCP? It would be very nice if there was some instant way to tell if, say, there's not Ethernet cable even inserted in the jack....