diff --git a/Network.cpp b/Network.cpp index 8fe5c93..af54a44 100644 --- a/Network.cpp +++ b/Network.cpp @@ -231,18 +231,12 @@ bool Network::connectWired() { if(!this->ethStarted) { this->ethStarted = true; WiFi.mode(WIFI_OFF); - if(!settings.IP.dhcp) { - if(!ETH.config(settings.IP.ip, settings.IP.gateway, settings.IP.subnet, settings.IP.dns1, settings.IP.dns2)) - ETH.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE); - } - else - ETH.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE); WiFi.onEvent(this->networkEvent); if(settings.hostname[0] != '\0') ETH.setHostname(settings.hostname); Serial.print("Set hostname to:"); Serial.println(ETH.getHostname()); - if(!ETH.begin(settings.Ethernet.phyAddress, settings.Ethernet.PWRPin, settings.Ethernet.MDCPin, settings.Ethernet.MDIOPin, settings.Ethernet.phyType, settings.Ethernet.CLKMode)) { + Serial.println("Ethernet Begin failed"); if(settings.connType == conn_types::ethernetpref) { this->wifiFallback = true; @@ -251,6 +245,14 @@ bool Network::connectWired() { return false; } else { + if(!settings.IP.dhcp) { + if(!ETH.config(settings.IP.ip, settings.IP.gateway, settings.IP.subnet, settings.IP.dns1, settings.IP.dns2)) + Serial.println("Unable to configure static IP address...."); + ETH.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE); + } + else + ETH.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE); + uint32_t wait = millis(); while(millis() - wait < 7000) { if(this->connected()) return true; diff --git a/SomfyController.ino.esp32.bin b/SomfyController.ino.esp32.bin index 6ce0f47..cc20c14 100644 Binary files a/SomfyController.ino.esp32.bin and b/SomfyController.ino.esp32.bin differ diff --git a/SomfyController.ino.esp32s3.bin b/SomfyController.ino.esp32s3.bin index f0c25b9..f63e93b 100644 Binary files a/SomfyController.ino.esp32s3.bin and b/SomfyController.ino.esp32s3.bin differ diff --git a/SomfyController.littlefs.bin b/SomfyController.littlefs.bin index 2bc9a4a..b19796f 100644 Binary files a/SomfyController.littlefs.bin and b/SomfyController.littlefs.bin differ diff --git a/data/index.html b/data/index.html index e04b3d8..9f6c202 100644 --- a/data/index.html +++ b/data/index.html @@ -3,11 +3,11 @@
- - - + + + - +