Added option to disable 802.11b for ESP8266

This commit is contained in:
Gunnar Skjold
2023-10-14 08:44:55 +02:00
parent 2a44f89a7b
commit 6a0921a445
5 changed files with 17 additions and 20 deletions

View File

@@ -1513,16 +1513,14 @@ void WiFi_connect() {
if(!WiFi.config(ip, gw, sn, dns1, dns2)) {
debugE_P(PSTR("Static IP configuration is invalid, not using"));
}
} else {
#if defined(ESP32)
// This trick does not work anymore...
// WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE); // Workaround to make DHCP hostname work for ESP32. See: https://github.com/espressif/arduino-esp32/issues/2537
#endif
}
#if defined(ESP8266)
if(strlen(wifi.hostname) > 0) {
WiFi.hostname(wifi.hostname);
}
}
if(!wifi.use11b) {
WiFi.setPhyMode(WIFI_PHY_MODE_11G);
}
#endif
#if defined(ESP32)
WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN);