mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
turn off wifi nosleep
This commit is contained in:
@@ -131,7 +131,7 @@ void NetworkSettingsService::setWiFiPowerOnRSSI() {
|
||||
// 802.11ax - wifi6
|
||||
|
||||
int max_tx_pwr = MAX_TX_PWR_DBM_n; // assume wifi4
|
||||
int threshold = WIFI_SENSITIVITY_n + 70; // Margin in dBm * 10 on top of threshold
|
||||
int threshold = WIFI_SENSITIVITY_n + 120; // Margin in dBm * 10 on top of threshold
|
||||
|
||||
// Assume AP sends with max set by ETSI standard.
|
||||
// 2.4 GHz: 100 mWatt (20 dBm)
|
||||
@@ -421,10 +421,11 @@ StateUpdateResult NetworkSettings::update(JsonObject root, NetworkSettings & set
|
||||
settings.staticIPConfig = root["static_ip_config"] | false;
|
||||
settings.bandwidth20 = root["bandwidth20"] | false;
|
||||
settings.tx_power = static_cast<uint8_t>(root["tx_power"] | 0);
|
||||
settings.nosleep = root["nosleep"] | false;
|
||||
settings.nosleep = root["nosleep"] | true;
|
||||
settings.enableMDNS = root["enableMDNS"] | true;
|
||||
settings.enableCORS = root["enableCORS"] | false;
|
||||
settings.CORSOrigin = root["CORSOrigin"] | "*";
|
||||
|
||||
// extended settings
|
||||
JsonUtils::readIP(root, "local_ip", settings.localIP);
|
||||
JsonUtils::readIP(root, "gateway_ip", settings.gatewayIP);
|
||||
|
||||
@@ -1226,6 +1226,12 @@ bool System::check_upgrade(bool factory_settings) {
|
||||
});
|
||||
}
|
||||
|
||||
// force WiFi sleep to off (was default on < 3.7.0-dev-33)
|
||||
EMSESP::esp8266React.getNetworkSettingsService()->update([&](NetworkSettings & networkSettings) {
|
||||
networkSettings.nosleep = true;
|
||||
return StateUpdateResult::CHANGED;
|
||||
});
|
||||
|
||||
// Network Settings Wifi tx_power is now using the value * 4.
|
||||
EMSESP::esp8266React.getNetworkSettingsService()->update([&](NetworkSettings & networkSettings) {
|
||||
if (networkSettings.tx_power == 20) {
|
||||
|
||||
Reference in New Issue
Block a user