Reducing W5100 module Ethernet Timeout when using DHCP?



i've read bits on reducing ethernet timeout in arduino 1.0 using:

w5100.setretransmissiontime(0x07d0);
w5100.setretransmissioncount(3);

unfortunately, not seem work arduino 1.0 , dhcp ethernet call like:

  if (ethernet.begin(mac) == 0) {

instead, no ethernet cable inserted in rj45 jack, have wait several mintues timeout....not :d.
i've tracked through ethernet libs , looks i'm stuck in loop inside of sendudp (in socket.cpp) waiting ok or timeout which, unfortunately, seems take several minutes (!) when there's no ethernet connection.

the call trace ethernet.begin like:

w5100.setmacaddress()
w5100.setipaddress()
dhcp.beginwithdhcp()
dhcpupdsocket.begin()
send_dhcp_message()
sendudp()

(i've messed values passed timeouts beginwithdhcp too, no avail)

how others dealing apparent lack of functioning timeout on ethernet.begin when using dhcp?   it nice if there instant way tell if, say, there's not ethernet cable inserted in jack....

i bump this, because big problem me now.

for me, takes between minute , minute , half timeout.

essentially code needs work either direct connected pc or through switch, need timeout occur around 30 seconds or reasonable.  


edit: think solved myself. inside dhcp.h, there response timeout constant of 60,000. changed 10,000 (10 seconds), , timeout occurs 12-13 seconds af
ter reset.

public:
  ipaddress getlocalip();
  ipaddress getsubnetmask();
  ipaddress getgatewayip();
  ipaddress getdhcpserverip();
  ipaddress getdnsserverip();

  int beginwithdhcp(uint8_t *, unsigned long timeout = 10000, unsigned long responsetimeout = 4000);
};


Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Reducing W5100 module Ethernet Timeout when using DHCP?


arduino

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

listen to event