Ethernet starts blocking within 60 seconds if there is no Ethernet cable

I am building a watch. I want to set the clock by connecting an Ethernet cable to the clock. Most of the time the watch will not be connected to the Internet.

I have an Arduino board and an Ethernet shield , which can successfully connect to the time server and read the time (see the example UdpNtpClient file in the Examples> Ethernet section).

The problem is that to configure the Ethernet screen locks are Ethernet.begin()locked for 60 seconds if the screen is not connected to the Internet. I would like the clock to display the time and periodically check if an Ethernet cable is connected to it, and if so, make any adjustments on time. However, in most cases, this check will have a negative result, so I can not freeze the watch for 60 seconds each time.

Is it possible to determine if a cable is connected faster than a function Ethernet.begin()? Is it possible to write a "multithreaded" solution where it is Ethernet.begin()not blocked?

+5
source share
2 answers

Looking at the LAN library, it is impossible to prevent its blocking.

, DHCP? , . IP-?

Google , , Ethernet, .

+1

DHCP.h DHCP-. , - 60000 .

( : eclipse adruino, , F3 , Ethernet.begin, , )

, -. . , . 15 .

/

+1

All Articles