From 1fa5d48e747d8d0511d57ad589554fb1906eab51 Mon Sep 17 00:00:00 2001 From: 1technophile <1technophile@users.noreply.github.com> Date: Wed, 23 Oct 2019 20:53:43 +0200 Subject: [PATCH] W5100 doesn't detect linkStatus implement a bypass --- main/main.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main/main.ino b/main/main.ino index 769a8a1..2748a97 100644 --- a/main/main.ino +++ b/main/main.ino @@ -833,9 +833,13 @@ void setup_ethernet() { trc(F("Spl eth cfg")); Ethernet.begin(mac, ip); } - trc(F("ip: ")); - Serial.println(Ethernet.localIP()); - trc(F("Eth ok")); + if (Ethernet.hardwareStatus() == EthernetNoHardware) { + trc("Ethernet shield was not found."); + }else{ + trc(F("ip: ")); + Serial.println(Ethernet.localIP()); + trc(F("Eth ok")); + } } #endif @@ -886,7 +890,7 @@ void loop() #if defined(ESP8266) || defined(ESP32) if (WiFi.status() == WL_CONNECTED){ #else - if (Ethernet.linkStatus() == LinkON){ + if ((Ethernet.hardwareStatus() != EthernetW5100 && Ethernet.linkStatus() == LinkON) || (Ethernet.hardwareStatus() == EthernetW5100)){//we are able to detect disconnection only on w5200 and w5500 #endif lastNTWKReconnectAttempt = 0; if (client.connected()) {