diff --git a/src/network.cpp b/src/network.cpp index c1a78e5..b39e39e 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -54,11 +54,11 @@ void keepWiFiAlive(void *parameter) } Serial.println("[WIFI] Connecting..."); + WiFi.setHostname(HOSTNAME); // only works with DHCP.... WiFi.mode(WIFI_STA); #ifdef STATIC_IP WiFi.config(ip, gateway, subnet, dns); #endif - WiFi.setHostname(HOSTNAME); // only works with DHCP.... WiFi.begin(WIFI_SSID, WIFI_PASSWORD); unsigned long startAttemptTime = millis();