From 891827162032a03a080bca4149ff627cf9c38b94 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Thu, 19 Jan 2023 17:50:10 +0100 Subject: [PATCH] new build flag WLEDMM_WIFI_POWERON_HACK This ensures that WiFi gets powered ON (useful for boards with small "RainSun" crystal Wi-Fi antenna) --- platformio.ini | 1 + wled00/wled.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index fe947fd2..77d98a3c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1113,6 +1113,7 @@ build_flags = ${common.build_flags} ${esp32.build_flagsV4} ${esp32c3.build_flags ; -DARDUINO_USB_CDC_ON_BOOT=1 ;; enable CDC USB -> needed for debugging over serial USB -DARDUINO_USB_CDC_ON_BOOT=0 ;; disable CDC USB -D SERVERNAME='"WLED-C3"' + ;-D WLEDMM_WIFI_POWERON_HACK ;; use this _only_ if your device is not able to make a WiFI connection! ;-D WLED_DISABLE_INFRARED ;; save flash space ;-D WLED_DISABLE_ALEXA ;; save flash space -D LEDPIN=8 ;; onboard neopixel 5x5 Matrix. Attach your own LEDs to GPIO 20 diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 23427146..79c6ccca 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -784,8 +784,10 @@ void WLED::initConnection() WiFi.begin(clientSSID, clientPass); #ifdef ARDUINO_ARCH_ESP32 - // WLEDMM - if your board has issues connecting to WiFi, try uncommenting this - // WiFi.setTxPower(WIFI_POWER_5dBm); // required for ESP32-C3FH4-RGB +#ifdef WLEDMM_WIFI_POWERON_HACK + // WLEDMM - if your board has issues connecting to WiFi, try this + WiFi.setTxPower(WIFI_POWER_5dBm); // required for ESP32-C3FH4-RGB +#endif WiFi.setSleep(!noWifiSleep); WiFi.setHostname(hostname); #else