diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 592ecc32..ef8742f8 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -578,6 +578,15 @@ #define WIFI_GRATUITOUS_ARP_INTERVAL_MAX 30000 #endif +// ref: https://github.com/esp8266/Arduino/issues/6471 +// ref: https://github.com/esp8266/Arduino/issues/6366 +// +// Issue #6366 turned out to be high tx power causing weird behavior. Lowering tx power achieved stability. +#ifndef WIFI_OUTPUT_POWER_DBM +#define WIFI_OUTPUT_POWER_DBM 20.0 +#endif + + // ----------------------------------------------------------------------------- // WEB // ----------------------------------------------------------------------------- diff --git a/code/espurna/wifi.ino b/code/espurna/wifi.ino index 355ce554..993e7bbf 100644 --- a/code/espurna/wifi.ino +++ b/code/espurna/wifi.ino @@ -104,6 +104,9 @@ void _wifiConfigure() { )).toInt(); #endif + const auto tx_power = getSetting("wifiTxPwr", WIFI_OUTPUT_POWER_DBM).toFloat(); + WiFi.setOutputPower(tx_power); + } void _wifiScan(uint32_t client_id = 0) {