diff --git a/platformio.ini b/platformio.ini index bb12fa45..e46b9ec5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -573,6 +573,9 @@ build_unflags = ${common.build_unflags} -DARDUINO_USB_CDC_ON_BOOT=1 build_flags = ${common.build_flags} ${esp32s2.build_flags} #-D WLED_RELEASE_NAME=LolinS2 -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 + -DARDUINO_USB_MSC_ON_BOOT=0 + -DARDUINO_USB_DFU_ON_BOOT=0 + -DLOLIN_WIFI_FIX ; seems to work much better with this -D WLED_USE_PSRAM -D WLED_WATCHDOG_TIMEOUT=0 -D CONFIG_ASYNC_TCP_USE_WDT=0 diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 9e915218..22297503 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -505,6 +505,9 @@ void WLED::initAP(bool resetAP) DEBUG_PRINTLN(apSSID); WiFi.softAPConfig(IPAddress(4, 3, 2, 1), IPAddress(4, 3, 2, 1), IPAddress(255, 255, 255, 0)); WiFi.softAP(apSSID, apPass, apChannel, apHide); + #if defined(LOLIN_WIFI_FIX) && (defined(ARDUINO_ARCH_ESP32C3) || defined(ARDUINO_ARCH_ESP32S2)) + WiFi.setTxPower(WIFI_POWER_8_5dBm); + #endif if (!apActive) // start captive portal if AP active { @@ -662,8 +665,10 @@ void WLED::initConnection() #endif WiFi.begin(clientSSID, clientPass); - #ifdef ARDUINO_ARCH_ESP32 + #if defined(LOLIN_WIFI_FIX) && (defined(ARDUINO_ARCH_ESP32C3) || defined(ARDUINO_ARCH_ESP32S2)) + WiFi.setTxPower(WIFI_POWER_8_5dBm); + #endif WiFi.setSleep(!noWifiSleep); WiFi.setHostname(hostname); #else diff --git a/wled00/wled_server.cpp b/wled00/wled_server.cpp index 9fd64b55..8741255c 100644 --- a/wled00/wled_server.cpp +++ b/wled00/wled_server.cpp @@ -219,7 +219,7 @@ void initServer() } } request->send(200, "application/json", F("{\"success\":true}")); - }); + }, JSON_BUFFER_SIZE); server.addHandler(handler); server.on("/version", HTTP_GET, [](AsyncWebServerRequest *request){