File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,7 +163,6 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
163163#ifdef ARDUINO_ARCH_ESP32
164164 WiFi.setSleep (!noWifiSleep);
165165 WiFi.setHostname (hostName);
166- WiFi.setTxPower (wifi_power_t (txPower));
167166#else
168167 WiFi.setPhyMode (force802_3g ? WIFI_PHY_MODE_11G : WIFI_PHY_MODE_11N);
169168 wifi_set_sleep_type ((noWifiSleep) ? NONE_SLEEP_T : MODEM_SLEEP_T);
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
9292 #ifdef ARDUINO_ARCH_ESP32
9393 int tx = request->arg (F (" TX" )).toInt ();
9494 txPower = min (max (tx, (int )WIFI_POWER_2dBm), (int )WIFI_POWER_19_5dBm);
95+ WiFi.setTxPower (wifi_power_t (txPower)); // must set when WiFi is already started
9596 #endif
9697
9798 force802_3g = request->hasArg (F (" FG" ));
Original file line number Diff line number Diff line change @@ -477,6 +477,9 @@ void WLED::setup()
477477 showWelcomePage = true ;
478478 WiFi.mode (WIFI_MODE_AP); // WiFi is not configured so we'll most likely open an AP
479479 }
480+ #ifdef ARDUINO_ARCH_ESP32
481+ WiFi.setTxPower (wifi_power_t (txPower)); // must set when WiFi is already started
482+ #endif
480483
481484 // all GPIOs are allocated at this point
482485 serialCanRX = !PinManager::isPinAllocated (hardwareRX); // Serial RX pin (GPIO 3 on ESP32 and ESP8266)
@@ -660,10 +663,6 @@ void WLED::initAP(bool resetAP)
660663 dnsServer.setErrorReplyCode (DNSReplyCode::NoError);
661664 dnsServer.start (53 , " *" , WiFi.softAPIP ());
662665
663- #ifdef ARDUINO_ARCH_ESP32
664- WiFi.setTxPower (wifi_power_t (txPower));
665- #endif
666-
667666 #ifndef WLED_DISABLE_ESPNOW
668667 initESPNow ();
669668 #endif
You can’t perform that action at this time.
0 commit comments