-
Notifications
You must be signed in to change notification settings - Fork 267
Ethernet Shield presence detection #6
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
From @mikaelpatel on January 7, 2016 22:37 The W5100 Ethernet controller has a very specific SPI protocol which actually makes it easy to detect if a shield is present. Please see the product data-sheet for more details. Cheers! Mikael |
From @PaulStoffregen on January 7, 2016 23:36 You should check the return value from Ethernet.begin(). If it returns false, you should never call any of the other functions! Of course you can expect them to hang or have unpredictable results if you got a false from Ethernet.begin(). |
From @ibantxo on January 8, 2016 14:14 Umm... If "Ethernet.begin" could be outside "setup", another way I am thinking about is a "reconnect" function (called from main loop): boolean reconnect(void) { Serial.println("RECONNECT!"); and test with "status" value to return... Thanks mikaelpatel. I am newbie. I will try to test "SPI way" as well. But I think is a "deeper code" for my skill level. |
From @mikaelpatel on January 8, 2016 20:44 @ibantxo |
From @ibantxo on January 8, 2016 22:32 That could be great, Mikael. Knowing the "status" of the device:
Many thanks!!! |
Version 2.0.0 will have Ethernet.linkStatus() and Ethernet.hardwareStatus(). |
Fixed |
The W6100 IPv4 Arduino Example.(For W6100 Ethernet Shield)
From @ibantxo on January 7, 2016 21:6
Hi,
I want that my code works in 3 cases:
The third scenario works well. But the first one "hangs" in this code line (waiting forever...):
ethClient.connect(server, port);
Is there any way to detect presence of ethernet shield or to insert a timeout in connection attempt?
Many thanks
Iban
Copied from original issue: arduino/Arduino#4400
The text was updated successfully, but these errors were encountered: