Skip to content

Commit

Permalink
Merge pull request #43 from pimlie/patch-1
Browse files Browse the repository at this point in the history
fix: set hostname before mode
  • Loading branch information
lanrat authored Jul 24, 2024
2 parents 5ee5660 + 0629f54 commit 99ac34c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 99ac34c

Please sign in to comment.