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

@ -1200,6 +1200,7 @@ void AmsConfiguration::print(Print* debugger)
}
debugger->printf_P(PSTR("Hostname: '%s'\r\n"), wifi.hostname);
debugger->printf_P(PSTR("mDNS: '%s'\r\n"), wifi.mdns ? "Yes" : "No");
debugger->printf_P(PSTR("802.11b: '%s'\r\n"), wifi.use11b ? "Yes" : "No");
debugger->println(F(""));
delay(10);
debugger->flush();

File diff suppressed because one or more lines are too long

View File

@ -444,11 +444,9 @@
<div class="my-3">
<label><input type="checkbox" name="wa" value="true" bind:checked={configuration.w.a} class="rounded mb-1"/> Auto reboot on connection problem</label>
</div>
{#if sysinfo.chip != 'esp8266'}
<div class="my-3">
<label><input type="checkbox" name="wb" value="true" bind:checked={configuration.w.b} class="rounded mb-1"/> Allow 802.11b legacy rates</label>
</div>
{/if}
</div>
<div class="cnt">
<strong class="text-sm">Network</strong>

View File

@ -240,11 +240,11 @@ void AmsWebServer::sysinfoJson() {
#if defined(ESP8266)
wifi_get_macaddr(STATION_IF, mac);
wifi_get_macaddr(SOFTAP_IF, apmac);
uint32_t cpu_freq = 80;
uint8_t cpu_freq = system_get_cpu_freq();
#elif defined(ESP32)
esp_wifi_get_mac((wifi_interface_t)ESP_IF_WIFI_STA, mac);
esp_wifi_get_mac((wifi_interface_t)ESP_IF_WIFI_AP, apmac);
uint32_t cpu_freq = esp_clk_cpu_freq();
uint32_t cpu_freq = esp_clk_cpu_freq() / 1000000;
#endif
sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
@ -280,7 +280,7 @@ void AmsWebServer::sysinfoJson() {
"esp8266",
#endif
chipIdStr.c_str(),
cpu_freq / 1000000,
cpu_freq,
macStr,
apMacStr,
sys.boardType,

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);