Compare commits

...

71 Commits

Author SHA1 Message Date
Frank
f88fd073a3 temporary workaround for #5145 2025-12-02 00:00:31 +01:00
Frank
9f12301128 esp32c6 inherits build_unflags and lib_ignore from V5 buildenv 2025-12-01 23:59:50 +01:00
Frank
7b54be849f Merge branch 'V5' into V5-C6 2025-12-01 23:53:35 +01:00
Frank
29c7b50727 fix stupid warning for c files 2025-12-01 23:48:15 +01:00
Frank
5d54597ffc change dependancy logic for proper inheritance of build_unflags and lib_ignore
* esp32_idf_V5 has the main build_unflags and lib_ignore
* next level (esp32, esp32s3, esp32s2, esp32c3) inherits from esp32_idf_V5
* user buildenvs _only_ inherit from (esp32, esp32s3, esp32s2, esp32c3)
2025-12-01 23:47:37 +01:00
Frank
0b27bc37bd fix compiler warning for WLED_MAX_ANALOG_CHANNELS
in V5, LEDC_CHANNEL_MAX and LEDC_SPEED_MODE_MAX are enum constants, and the compiler does not allow a macro where enums are implicitly treated as int.
Solution: change into constexpr with static type cast => still computed by the compiler and does not create any local variable.
2025-12-01 23:41:12 +01:00
Frank
bc4b6b6a2b Merge branch 'V5' into V5-C6 2025-12-01 20:58:59 +01:00
copilot-swe-agent[bot]
8ea41cf2d2 Remove push trigger, only run usermods CI for external fork PRs
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-12-01 20:53:44 +01:00
copilot-swe-agent[bot]
5ef41e7d3b Fix usermods.yml to only run for external fork PRs
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-12-01 20:53:44 +01:00
Frank
2245e0e0df optional: newer tasmota core 2025-12-01 20:53:08 +01:00
Frank
5ecf76c1aa Merge branch 'V5' into V5-C6 2025-12-01 20:30:22 +01:00
Frank
e891c5c36a Merge branch 'main' into V5 2025-12-01 20:26:44 +01:00
Frank
ae37f4268c platformio.ini: short hashes => long hashes
short hashes can cause spurious build errors, and will not be supported any more in future platform version.
2025-12-01 20:26:22 +01:00
Frank
c096c5bb8f fix for old-style WLED_RELEASE_NAME 2025-12-01 17:53:04 +01:00
Frank
c73935dd36 small fix
missing ||
2025-12-01 17:36:33 +01:00
Frank
3f441f0605 guess what ... more "C6 is like C3" ifdefs needed 2025-12-01 17:31:41 +01:00
Frank
2df4c58de8 disable touch button code on C6
similar to C3
2025-12-01 17:22:16 +01:00
Frank
1de36ca0da more "C6 is like C3" adjustments 2025-12-01 17:15:04 +01:00
Frank
70235450e8 treat C6 similar to C3
trying to reduce compile errors in bus_wrapper.h
... plus some preparation for P4 support
2025-12-01 17:03:44 +01:00
Frank
62ca377060 remove special FASTLED_NO_FASTLED hack
this was a temporary hack needed one year ago; FastLED should be compatible with -C6 now.
2025-12-01 16:29:51 +01:00
Frank
b2d659120e disable QuickEspNow - seems incompatible with -C6
also disabled some core debug flags
2025-12-01 15:56:57 +01:00
Frank
45d105ed4d Merge branch 'V5' into V5-C6 2025-12-01 15:41:07 +01:00
Frank
71920659e1 temporarily disable getDeviceId() feature for V5 builds
lots of deprecated functions and esp-idf structures ... Disabled until we find a way to make this work in V5
2025-12-01 15:18:56 +01:00
Frank
83b541e1ba fix broken indentation in platformio.ini, disable usermod builds
hoping that this will finally solve errors in the standard builds
2025-12-01 14:58:51 +01:00
Frank
2c7923e17d fix name clash in dmx_input.cpp
versionString was clashing with a structure defined in wled.h => build errors.
2025-12-01 14:43:33 +01:00
Frank
a55209415c Refactor software version label handling in DMX input
revert changes imported from main branch
2025-12-01 14:02:24 +01:00
Frank
6961059220 minor changes for consistency with other build envs 2025-12-01 01:58:12 +01:00
Frank
1bc63cac61 use the same lib_deps as the "main V5" branch 2025-12-01 01:37:57 +01:00
Frank
152bfd1543 Merge branch 'V5' into V5-C6 2025-12-01 01:23:15 +01:00
Frank
7e4661609c Merge branch 'main' into V5 2025-12-01 00:59:29 +01:00
Frank
ecfcd0da19 fix compiler warning "ESP32 redefined", add buildenv sanity check
* fix for warning: "ESP32" redefined
* wled.h: add sanity check to catch conflicting / missing defines
2025-12-01 00:41:29 +01:00
Frank
79e2128e71 add flag to disable the new arduino-esp32 RMT leds driver
causes conflicts with NeoPixelBus
2025-12-01 00:21:14 +01:00
Frank
9743775fb5 bring back lost esp_idf_v4 section (from main)
for back-to-back testing, and for compatibility with user-specific platformio_override.ini
2025-12-01 00:19:59 +01:00
Will Tatam
9f3e53a516 disable 8266 builds for now 2025-11-08 16:39:31 +00:00
Will Tatam
b51e80f5dd Safety check: ensure multiWiFi is never empty to prevent crashes during serialization 2025-11-08 16:28:19 +00:00
Will Tatam
d632cf8e8c improve esp32_dev env 2025-11-08 15:02:33 +00:00
Will Tatam
7c8b8fd0f3 NeoPixelBus CORE3 2025-11-08 15:02:09 +00:00
Frank
fa5aa586ec Update platformio.ini
* more debug output
* added my own fork of FastLED ( looks like more bugs to solve ....)
2025-11-08 14:17:43 +00:00
Will Tatam
db65e30ad5 use esp32_idf_V5.platform 2025-11-08 14:02:47 +00:00
Will Tatam
cf195af7c8 build only esp32c6dev_4MB 2025-11-08 13:54:39 +00:00
Frank
0f1055826b ESP32-C6 buildenv
due to Arduino 3.0.1, a few updated libraries are required:
* Tasmota Platform - official platfomio lacks arduino support for C6
* FastLED (latest + C6 build patches)
* AsyncTCP (latest + C6 build patches)
* AsyncWebServer (latest + C6 build patches)
* NeoPixelBus (lastest)
2025-11-08 13:41:08 +00:00
Will Tatam
96491255f1 Disable other envs to save CI build time 2025-11-08 13:33:18 +00:00
Will Tatam
36eaca6cb2 NeoEsp32RmtHI does not support V5 2025-11-08 13:24:39 +00:00
Will Tatam
0653854904 NeoEsp32RmtHI does not support V5 2025-11-08 13:03:55 +00:00
Will Tatam
51e1f4fc04 NeoEsp32RmtHI does not support V5 2025-11-08 12:49:52 +00:00
Will Tatam
2af23fc0cd AsyncTCP 3.4.7 does not support V5 2025-11-08 12:49:27 +00:00
Will Tatam
ce84a57a0d NeoEsp32RmtHI does not support V5 2025-11-08 12:44:26 +00:00
Will Tatam
8cad34e14a Merge branch 'main' into V5 2025-11-08 12:19:01 +00:00
Will Tatam
93821efb90 disable usermods build for now 2025-11-08 12:11:48 +00:00
Will Tatam
c5e2ec72bd WLED_DISABLE_INFRARED for 8266 2025-11-08 12:08:50 +00:00
Will Tatam
86679edd1f ESP-IDF fix for PWM_fan.cpp 2025-11-08 12:07:49 +00:00
Will Tatam
7a0325f88f WLED_DISABLE_INFRARED for 8266 2025-11-08 12:02:25 +00:00
Will Tatam
44a483f454 WLED_DISABLE_INFRARED for 8266 2025-11-08 11:55:01 +00:00
Will Tatam
41878f01f9 WLED_DISABLE_INFRARED for 8266 2025-11-08 11:51:08 +00:00
Will Tatam
906d4560a7 fix for pin usage logger 2025-11-08 11:43:38 +00:00
Will Tatam
5205110960 mbedtls_sha1_shim.cpp not required for 8266 2025-11-08 11:40:00 +00:00
Will Tatam
2f8882ee56 WLED_DISABLE_INFRARED for 8266 2025-11-08 11:39:02 +00:00
Will Tatam
d4bafec0f3 WLED_DISABLE_MQTT for 8266 2025-11-08 11:27:33 +00:00
Will Tatam
446c04380e fix for esp32_eth 2025-11-08 11:20:03 +00:00
Will Tatam
7daada1f3e fix for esp32_eth 2025-11-08 11:18:25 +00:00
Will Tatam
68dff2d392 mbedtls_sha1 workaround 2025-11-08 10:53:41 +00:00
Will Tatam
ec22c50813 Update DMX Input for latest esp_dmx 2025-11-08 10:38:19 +00:00
Will Tatam
81c92257da Update PlatformIO 2025-08-16 12:45:36 +01:00
Will Tatam
e4815d1ff5 Update PlatformIO 2025-08-16 12:36:41 +01:00
Will Tatam
bc19133e73 Update PlatformIO 2025-08-16 12:33:25 +01:00
Will Tatam
03a9d9e56f ledc changes for versions 2.X (based on ESP-IDF 4.4) to version 3.0 (based on ESP-IDF 5.1) - https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html 2025-08-16 12:05:41 +01:00
Will Tatam
2c0259f214 Rename Network to WLEDNetwork to prevent clash 2025-08-16 11:57:50 +01:00
Will Tatam
1de8c2e79b Remove local copy of MQTT and disable for now in build 2025-08-16 11:57:20 +01:00
Will Tatam
07ab6aa3ea Rename Network to WLEDNetwork to prevent clash 2025-08-14 18:59:06 +01:00
Will Tatam
ba2b182bb3 Update platformio.ini for V5 2025-08-14 18:26:12 +01:00
Will Tatam
965e794094 Rename Network to WLEDNetwork to prevent clash 2025-08-14 18:25:39 +01:00
35 changed files with 489 additions and 214 deletions

View File

@@ -1,10 +1,6 @@
name: Usermod CI
on:
push:
paths:
- usermods/**
- .github/workflows/usermods.yml
pull_request:
paths:
- usermods/**
@@ -12,6 +8,8 @@ on:
jobs:
get_usermod_envs:
# Only run for pull requests from forks (not from branches within wled/WLED)
if: github.event.pull_request.head.repo.full_name != github.repository
name: Gather Usermods
runs-on: ubuntu-latest
steps:
@@ -31,6 +29,8 @@ jobs:
build:
# Only run for pull requests from forks (not from branches within wled/WLED)
if: github.event.pull_request.head.repo.full_name != github.repository
name: Build Enviornments
runs-on: ubuntu-latest
needs: get_usermod_envs

View File

@@ -1,3 +1,4 @@
#if false
/*-------------------------------------------------------------------------
NeoPixel driver for ESP32 RMTs using High-priority Interrupt
@@ -467,3 +468,5 @@ typedef NeoEsp32RmtHI7Ws2805InvertedMethod NeoEsp32RmtHI7Ws2814InvertedMethod;
#endif // !defined(CONFIG_IDF_TARGET_ESP32C3)
#endif
#endif // NEOE_SP32_RMT_HI_METHODS_H

View File

@@ -1,3 +1,5 @@
#if false
/*-------------------------------------------------------------------------
NeoPixel library helper functions for Esp32.
@@ -504,4 +506,6 @@ esp_err_t NeoEsp32RmtHiMethodDriver::WaitForTxDone(rmt_channel_t channel, TickTy
return rv;
}
#endif
#endif
#endif // ARDUINO_ARCH_ESP32

View File

@@ -100,15 +100,16 @@ def add_wled_metadata_flags(env, node):
if not has_def(cdefs, "WLED_REPO"):
repo = get_github_repo()
if repo:
print(f"repo = {repo}")
cdefs.append(("WLED_REPO", f"\\\"{repo}\\\""))
cdefs.append(("WLED_VERSION", WLED_VERSION))
# This transforms the node in to a Builder; it cannot be modified again
return env.Object(
node,
CPPDEFINES=cdefs
)
# Return the node unmodified - middleware should not create new build targets
print(f"version = {WLED_VERSION}")
# Instead, modify the environment's CPPDEFINES before the file is compiled
env["CPPDEFINES"] = cdefs
return node
env.AddBuildMiddleware(
add_wled_metadata_flags,

View File

@@ -10,27 +10,29 @@
# ------------------------------------------------------------------------------
# CI/release binaries
default_envs = nodemcuv2
esp8266_2m
esp01_1m_full
nodemcuv2_160
esp8266_2m_160
esp01_1m_full_160
nodemcuv2_compat
esp8266_2m_compat
esp01_1m_full_compat
default_envs =
; nodemcuv2
; esp8266_2m
; esp01_1m_full
; nodemcuv2_160
; esp8266_2m_160
; esp01_1m_full_160
; nodemcuv2_compat
; esp8266_2m_compat
; esp01_1m_full_compat
esp32dev
esp32dev_debug
esp32_eth
esp32_wrover
lolin_s2_mini
esp32c3dev
esp32c3dev_qio
esp32S3_wroom2
esp32s3dev_16MB_opi
esp32s3dev_8MB_opi
esp32s3_4M_qspi
usermods
; esp32_eth
; esp32_wrover
; lolin_s2_mini ;; TODO: disabled NeoEsp32RmtMethodIsr
; esp32c3dev
; esp32s3dev_16MB_opi ;; TODO: disabled NeoEsp32RmtMethodIsr
; esp32s3dev_8MB_opi ;; TODO: disabled NeoEsp32RmtMethodIsr
; esp32s3_4M_qspi ;; TODO: disabled NeoEsp32RmtMethodIsr
esp32c6dev_4MB
; esp32c3dev_qio
; esp32S3_wroom2
; usermods
src_dir = ./wled00
data_dir = ./wled00/data
@@ -120,6 +122,7 @@ build_flags =
-D DECODE_SAMSUNG=true
-D DECODE_LG=true
-DWLED_USE_MY_CONFIG
-D WLED_USE_SHARED_RMT ;; Use standard RMT method instead of incompatible NeoEsp32RmtHI - until updated for V5
build_unflags =
@@ -128,6 +131,8 @@ ldscript_2m512k = eagle.flash.2m512.ld
ldscript_2m1m = eagle.flash.2m1m.ld
ldscript_4m1m = eagle.flash.4m1m.ld
default_usermods = ;; TODO: add back audioreactive once V5 compatible
[scripts_defaults]
extra_scripts =
pre:pio-scripts/set_metadata.py
@@ -158,9 +163,10 @@ upload_speed = 115200
# ------------------------------------------------------------------------------
lib_compat_mode = strict
lib_deps =
fastled/FastLED @ 3.6.0
IRremoteESP8266 @ 2.8.2
makuna/NeoPixelBus @ 2.8.3
fastled/FastLED @ 3.10.1
;; https://github.com/softhack007/FastLED.git#ESP32-C6 ;; patched version for -C6
; IRremoteESP8266 @ 2.8.2
https://github.com/netmindz/NeoPixelBus.git#2f05279a4a9f56875fb85482e6ec4e17078accc3 ;; CORE3 with log fix
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.4.2
marvinroger/AsyncMqttClient @ 0.9.0
# for I2C interface
@@ -213,7 +219,8 @@ build_flags =
-D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48 ;; in case of linker errors like "section `.text1' will not fit in region `iram1_0_seg'"
; -D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED ;; (experimental) adds some extra heap, but may cause slowdown
-D NON32XFER_HANDLER ;; ask forgiveness for PROGMEM misuse
-D WLED_DISABLE_MQTT ;; TODO: remove once we have updated library for V5
-D WLED_DISABLE_INFRARED ;; TODO: remove once we have updated for V5
lib_deps =
#https://github.com/lorol/LITTLEFS.git
ESPAsyncTCP @ 1.2.2
@@ -234,6 +241,7 @@ build_flags_compat =
-DVTABLES_IN_FLASH
-DMIMETYPE_MINIMAL
-DWLED_SAVE_IRAM ;; needed to prevent linker error
-D WLED_DISABLE_MQTT ;; TODO: remove once we have updated library for V5
;; this platform version was used for WLED 0.14.0
platform_compat = espressif8266@4.2.0
@@ -255,20 +263,21 @@ lib_deps_compat =
[esp32_all_variants]
lib_deps =
esp32async/AsyncTCP @ 3.4.7
esp32async/AsyncTCP @ 3.4.6
bitbank2/AnimatedGIF@^1.4.7
https://github.com/Aircoookie/GifDecoder#bc3af18
https://github.com/Aircoookie/GifDecoder.git#bc3af189b6b1e06946569f6b4287f0b79a860f8e
build_flags =
-D CONFIG_ASYNC_TCP_USE_WDT=0
-D CONFIG_ASYNC_TCP_STACK_SIZE=8192
-D WLED_ENABLE_GIF
[esp32]
platform = ${esp32_idf_V4.platform}
platform = ${esp32_idf_V5.platform}
platform_packages =
build_unflags = ${common.build_unflags}
build_flags = ${esp32_idf_V4.build_flags}
lib_deps = ${esp32_idf_V4.lib_deps}
build_unflags = ${esp32_idf_V5.build_flags}
build_flags = ${esp32_idf_V5.build_flags}
lib_deps = ${esp32_idf_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
tiny_partitions = tools/WLED_ESP32_2MB_noOTA.csv
default_partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
@@ -301,14 +310,40 @@ build_flags = -g
-D WLED_ENABLE_DMX_INPUT
lib_deps =
${esp32_all_variants.lib_deps}
https://github.com/someweisguy/esp_dmx.git#47db25d
https://github.com/someweisguy/esp_dmx.git#47db25d8c515e76fabcf5fc5ab0b786f98eeade0
${env.lib_deps}
[esp32_idf_V5]
;; build environment for ESP32 using ESP-IDF 5.3.3 / arduino-esp32 v3.1.3
platform = https://github.com/tasmota/platform-espressif32/releases/download/2025.08.30/platform-espressif32-2025.08.30.zip ;; Platform 2025.08.30 Tasmota Arduino Core 3.1.3.250808 based on IDF 5.3.3.250801
;; (optiona) latest tasmota core for ESP32 family, based on ESP-IDF 5.3.4.251110 and Arduino core 3.3.4
;; platform = https://github.com/tasmota/platform-espressif32/releases/download/2025.11.31/platform-espressif32.zip
platform_packages =
build_unflags = ${common.build_unflags}
-Wno-volatile ;; avoid warning on .c files: "-Wno-volatile only applies to c++ files"
build_flags = -g
-Wshadow=compatible-local ;; emit warning in case a local variable "shadows" another local one
-DARDUINO_ARCH_ESP32
; -DESP32=ESP32 ;; disabled to avoid compiler warning: "ESP32" redefined
${esp32_all_variants.build_flags}
-D WLED_DISABLE_INFRARED ;; TODO: remove once we have updated library for V5
-D WLED_DISABLE_MQTT ;; TODO: remove once we have updated library for V5
-D WLED_ENABLE_DMX_INPUT
-D WLED_USE_SHARED_RMT ;; Use standard RMT method instead of incompatible NeoEsp32RmtHI - until updated for V5
-D ESP32_ARDUINO_NO_RGB_BUILTIN ;; avoids RMT driver abort on startup "E (98) rmt(legacy): CONFLICT! driver_ng is not allowed to be used with the legacy driver"
lib_deps =
${esp32_all_variants.lib_deps}
https://github.com/netmindz/esp_dmx/#esp-idf-v5-fixes
${env.lib_deps}
lib_ignore =
NeoESP32RmtHI
[esp32s2]
;; generic definitions for all ESP32-S2 boards
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
build_unflags = ${common.build_unflags}
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
build_unflags = ${esp32_idf_V5.build_unflags}
build_flags = -g
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32S2
@@ -318,16 +353,17 @@ build_flags = -g
-DARDUINO_USB_MODE=0 ;; this flag is mandatory for ESP32-S2 !
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_CDC_ON_BOOT
${esp32_idf_V4.build_flags}
${esp32_idf_V5.build_flags}
lib_deps =
${esp32_idf_V4.lib_deps}
${esp32_idf_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
[esp32c3]
;; generic definitions for all ESP32-C3 boards
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
build_unflags = ${common.build_unflags}
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
build_unflags = ${esp32_idf_V5.build_unflags}
build_flags = -g
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32C3
@@ -336,19 +372,95 @@ build_flags = -g
-DARDUINO_USB_MODE=1 ;; this flag is mandatory for ESP32-C3
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_CDC_ON_BOOT
${esp32_idf_V4.build_flags}
${esp32_idf_V5.build_flags}
lib_deps =
${esp32_idf_V4.lib_deps}
${esp32_idf_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
board_build.flash_mode = qio
[esp32c6]
;; generic definitions for all ESP32-C6 boards
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
;;platform_packages =
;; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
;; framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
;; board = esp32-c6-devkitm-1 ;; board must be defined in the lower-level [env:*] buildenvs for C6-based boards
build_unflags = ${esp32_idf_V5.build_unflags}
build_flags = -g
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32C6
-DCONFIG_IDF_TARGET_ESP32C6=1
-D CONFIG_ASYNC_TCP_USE_WDT=0
-DCO
-DARDUINO_USB_MODE=1 ;; this flag is - most likely - mandatory for ESP32-C6
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_CDC_ON_BOOT
${esp32_idf_V5.build_flags}
lib_deps =
;;https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
; https://github.com/softhack007/AsyncTCP.git#ESP32-C6 ;; patched version needed for -C6 ;; softhack007 use default V5 libraries
; makuna/NeoPixelBus @ 2.8.0 ;; latest version neeeded for -C6 ;; softhack007 use default V5 libraries
${esp32_idf_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
[env:esp32c6dev_8MB]
;; ESP32-C6 "devkit C" with 8MB flash
extends = esp32c6
platform = ${esp32c6.platform}
platform_packages = ${esp32c6.platform_packages}
framework = arduino
board = esp32-c6-devkitc-1
build_unflags = ${esp32c6.build_unflags}
;;-D CORE_DEBUG_LEVEL=0
;;-D NDEBUG
build_flags = ${common.build_flags} ${esp32c6.build_flags} -D WLED_RELEASE_NAME=\"ESP32-C6_8MB\"
-Wno-volatile -Wno-deprecated-declarations ;; silence compiler warnings
-Wno-cpp ;; silence '#pragma warning' messages
;;-D DEBUG -g3 -ggdb
;;-D CORE_DEBUG_LEVEL=4
-D WLED_WATCHDOG_TIMEOUT=0
;; -DLOLIN_WIFI_FIX ; might be needed on "-C6 mini"
;;-DARDUINO_USB_CDC_ON_BOOT=1 ;; for virtual CDC USB
-DARDUINO_USB_CDC_ON_BOOT=0 ;; for serial-to-USB chip
-D WLED_DISABLE_INFRARED ;; library not not compatible with -C6
-D WLED_DISABLE_ESPNOW ;; not sure if this will work
-D WLED_DISABLE_ALEXA ;; compile errors
-D WLED_DISABLE_WEBSOCKETS ;; not sure if this will work (hacks needed in asyncWebserver)
-D WLED_DISABLE_ESPNOW ;; ToDO: temporarily disabled, until we find a solution for esp-now build errors with -C6
upload_speed = 460800
lib_deps = ${esp32c6.lib_deps}
lib_ignore = ${esp32c6.lib_ignore}
IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
QuickEspNow ; ToDO: disabled until we find a compatible version
board_build.partitions = ${esp32.large_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = qio
board_build.arduino.memory_type = qio_qspi
monitor_filters = esp32_exception_decoder
[env:esp32c6dev_4MB]
;; ESP32-C6 "devkit M" with 4MB flash
extends = env:esp32c6dev_8MB
board = esp32-c6-devkitm-1
board_build.partitions = ${esp32.default_partitions}
build_unflags = ${env:esp32c6dev_8MB.build_unflags} -D WLED_RELEASE_NAME=\"ESP32-C6_8MB\"
build_flags = ${env:esp32c6dev_8MB.build_flags} -D WLED_RELEASE_NAME=\"ESP32-C6_4MB\"
[esp32s3]
;; generic definitions for all ESP32-S3 boards
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
build_unflags = ${common.build_unflags}
build_flags = -g
-DESP32
;; -DESP32 ;; disabled to avoid compiler warning: "ESP32" redefined
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32S3
-DCONFIG_IDF_TARGET_ESP32S3=1
@@ -356,9 +468,9 @@ build_flags = -g
-DCO
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_MODE, ARDUINO_USB_CDC_ON_BOOT
${esp32_idf_V4.build_flags}
${esp32_idf_V5.build_flags}
lib_deps =
${esp32_idf_V4.lib_deps}
${esp32_idf_V5.lib_deps}
board_build.partitions = ${esp32.large_partitions} ;; default partioning for 8MB flash - can be overridden in build envs
@@ -384,6 +496,8 @@ platform = ${esp8266.platform_compat}
platform_packages = ${esp8266.platform_packages_compat}
build_flags = ${common.build_flags} ${esp8266.build_flags_compat} -D WLED_RELEASE_NAME=\"ESP8266_compat\" #-DWLED_DISABLE_2D
-D WLED_DISABLE_PARTICLESYSTEM2D
-D WLED_DISABLE_INFRARED ;; TODO: remove once we have updated for V5
;; lib_deps = ${esp8266.lib_deps_compat} ;; experimental - use older NeoPixelBus 2.7.9
[env:nodemcuv2_160]
@@ -391,7 +505,7 @@ extends = env:nodemcuv2
board_build.f_cpu = 160000000L
build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP8266_160\" #-DWLED_DISABLE_2D
-D WLED_DISABLE_PARTICLESYSTEM2D
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
[env:esp8266_2m]
board = esp_wroom_02
@@ -412,6 +526,8 @@ platform_packages = ${esp8266.platform_packages_compat}
build_flags = ${common.build_flags} ${esp8266.build_flags_compat} -D WLED_RELEASE_NAME=\"ESP02_compat\" #-DWLED_DISABLE_2D
-D WLED_DISABLE_PARTICLESYSTEM1D
-D WLED_DISABLE_PARTICLESYSTEM2D
-D WLED_DISABLE_INFRARED ;; TODO: remove once we have updated for V5
[env:esp8266_2m_160]
extends = env:esp8266_2m
@@ -419,7 +535,7 @@ board_build.f_cpu = 160000000L
build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP02_160\"
-D WLED_DISABLE_PARTICLESYSTEM1D
-D WLED_DISABLE_PARTICLESYSTEM2D
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
[env:esp01_1m_full]
board = esp01_1m
@@ -431,6 +547,8 @@ build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=
; -D WLED_USE_REAL_MATH ;; may fix wrong sunset/sunrise times, at the cost of 7064 bytes FLASH and 975 bytes RAM
-D WLED_DISABLE_PARTICLESYSTEM1D
-D WLED_DISABLE_PARTICLESYSTEM2D
-D WLED_DISABLE_INFRARED ;; TODO: remove once we have updated for V5
lib_deps = ${esp8266.lib_deps}
[env:esp01_1m_full_compat]
@@ -441,6 +559,8 @@ platform_packages = ${esp8266.platform_packages_compat}
build_flags = ${common.build_flags} ${esp8266.build_flags_compat} -D WLED_RELEASE_NAME=\"ESP01_compat\" -D WLED_DISABLE_OTA #-DWLED_DISABLE_2D
-D WLED_DISABLE_PARTICLESYSTEM1D
-D WLED_DISABLE_PARTICLESYSTEM2D
-D WLED_DISABLE_INFRARED ;; TODO: remove once we have updated for V5
-D WLED_DISABLE_INFRARED ;; TODO: remove once we have updated for V5
[env:esp01_1m_full_160]
extends = env:esp01_1m_full
@@ -449,37 +569,40 @@ build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=
; -D WLED_USE_REAL_MATH ;; may fix wrong sunset/sunrise times, at the cost of 7064 bytes FLASH and 975 bytes RAM
-D WLED_DISABLE_PARTICLESYSTEM1D
-D WLED_DISABLE_PARTICLESYSTEM2D
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
[env:esp32dev]
board = esp32dev
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
build_unflags = ${common.build_unflags}
custom_usermods = audioreactive
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32\" #-D WLED_DISABLE_BROWNOUT_DET
custom_usermods = ${common.default_usermods}
build_flags = ${common.build_flags} ${esp32_idf_V5.build_flags} -D WLED_RELEASE_NAME=\"ESP32\" #-D WLED_DISABLE_BROWNOUT_DET
-DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
lib_deps = ${esp32_idf_V4.lib_deps}
lib_deps = ${esp32_idf_V5.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}
board_build.flash_mode = dio
[env:esp32dev_debug]
extends = env:esp32dev
build_type = debug
monitor_filters = esp32_exception_decoder
upload_speed = 921600
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags}
build_unflags = -D WLED_RELEASE_NAME=\"ESP32\"
build_flags = ${common.build_flags} ${esp32_idf_V5.build_flags}
-D WLED_DEBUG
-D WLED_RELEASE_NAME=\"ESP32_DEBUG\"
[env:esp32dev_8M]
board = esp32dev
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
custom_usermods = audioreactive
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
custom_usermods = ${common.default_usermods}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_8M\" #-D WLED_DISABLE_BROWNOUT_DET
build_flags = ${common.build_flags} ${esp32_idf_V5.build_flags} -D WLED_RELEASE_NAME=\"ESP32_8M\" #-D WLED_DISABLE_BROWNOUT_DET
-DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
lib_deps = ${esp32_idf_V4.lib_deps}
lib_deps = ${esp32_idf_V5.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.large_partitions}
board_upload.flash_size = 8MB
@@ -489,13 +612,13 @@ board_build.flash_mode = dio
[env:esp32dev_16M]
board = esp32dev
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
custom_usermods = audioreactive
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
custom_usermods = ${common.default_usermods}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_16M\" #-D WLED_DISABLE_BROWNOUT_DET
build_flags = ${common.build_flags} ${esp32_idf_V5.build_flags} -D WLED_RELEASE_NAME=\"ESP32_16M\" #-D WLED_DISABLE_BROWNOUT_DET
-DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
lib_deps = ${esp32_idf_V4.lib_deps}
lib_deps = ${esp32_idf_V5.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.extreme_partitions}
board_upload.flash_size = 16MB
@@ -505,31 +628,31 @@ board_build.flash_mode = dio
[env:esp32_eth]
board = esp32-poe
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
upload_speed = 921600
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_Ethernet\" -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1
build_flags = ${common.build_flags} ${esp32_idf_V5.build_flags} -D WLED_RELEASE_NAME=\"ESP32_Ethernet\" -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1
-DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
; -D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only
lib_deps = ${esp32.lib_deps}
lib_deps = ${esp32_idf_V5.lib_deps}
board_build.partitions = ${esp32.default_partitions}
board_build.flash_mode = dio
[env:esp32_wrover]
extends = esp32_idf_V4
extends = esp32_idf_V5
board = ttgo-t7-v14-mini32
board_build.f_flash = 80000000L
board_build.flash_mode = qio
board_build.partitions = ${esp32.extended_partitions}
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_WROVER\"
build_flags = ${common.build_flags} ${esp32_idf_V5.build_flags} -D WLED_RELEASE_NAME=\"ESP32_WROVER\"
-DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue ;; Older ESP32 (rev.<3) need a PSRAM fix (increases static RAM used) https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/external-ram.html
-D DATA_PINS=25
lib_deps = ${esp32_idf_V4.lib_deps}
lib_deps = ${esp32_idf_V5.lib_deps}
[env:esp32c3dev]
extends = esp32c3
@@ -560,7 +683,7 @@ board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB
platform = ${esp32s3.platform}
platform_packages = ${esp32s3.platform_packages}
upload_speed = 921600
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_16MB_opi\"
-D WLED_WATCHDOG_TIMEOUT=0
@@ -582,7 +705,7 @@ board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB
platform = ${esp32s3.platform}
platform_packages = ${esp32s3.platform_packages}
upload_speed = 921600
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_8MB_opi\"
-D WLED_WATCHDOG_TIMEOUT=0
@@ -603,7 +726,7 @@ platform_packages = ${esp32s3.platform_packages}
board = esp32s3camlcd ;; this is the only standard board with "opi_opi"
board_build.arduino.memory_type = opi_opi
upload_speed = 921600
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_WROOM-2\"
-D WLED_WATCHDOG_TIMEOUT=0
@@ -644,7 +767,7 @@ board = lolin_s3_mini ;; -S3 mini, 4MB flash 2MB PSRAM
platform = ${esp32s3.platform}
platform_packages = ${esp32s3.platform_packages}
upload_speed = 921600
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_4M_qspi\"
-DARDUINO_USB_CDC_ON_BOOT=1 ;; -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
@@ -664,7 +787,7 @@ board = lolin_s2_mini
board_build.partitions = ${esp32.default_partitions}
board_build.flash_mode = qio
board_build.f_flash = 80000000L
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S2\"
-DARDUINO_USB_CDC_ON_BOOT=1
@@ -685,13 +808,14 @@ lib_deps = ${esp32s2.lib_deps}
[env:usermods]
board = esp32dev
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\"
build_flags = ${common.build_flags} ${esp32_idf_V5.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\"
-DTOUCH_CS=9
lib_deps = ${esp32_idf_V4.lib_deps}
lib_deps = ${esp32_idf_V5.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.flash_mode = dio
custom_usermods = * ; Expands to all usermods in usermods folder
;custom_usermods = * ; Expands to all usermods in usermods folder
custom_usermods = ; ToDO: fix usermods build once the main V5 build works without errors and warnings
board_build.partitions = ${esp32.extreme_partitions} ; We're gonna need a bigger boat

View File

@@ -1,20 +1,20 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile requirements.in
# pip-compile
#
ajsonrpc==1.2.0
# via platformio
anyio==4.8.0
anyio==4.10.0
# via starlette
bottle==0.13.2
bottle==0.13.4
# via platformio
certifi==2025.1.31
certifi==2025.8.3
# via requests
charset-normalizer==3.4.1
charset-normalizer==3.4.3
# via requests
click==8.1.8
click==8.1.7
# via
# platformio
# uvicorn
@@ -30,9 +30,9 @@ idna==3.10
# requests
marshmallow==3.26.1
# via platformio
packaging==24.2
packaging==25.0
# via marshmallow
platformio==6.1.17
platformio==6.1.18
# via -r requirements.in
pyelftools==0.32
# via platformio
@@ -44,15 +44,13 @@ semantic-version==2.10.0
# via platformio
sniffio==1.3.1
# via anyio
starlette==0.45.3
starlette==0.46.2
# via platformio
tabulate==0.9.0
# via platformio
typing-extensions==4.12.2
# via anyio
urllib3==2.5.0
# via requests
uvicorn==0.34.0
uvicorn==0.34.3
# via platformio
wsproto==1.2.0
# via platformio

View File

@@ -129,11 +129,14 @@ class PWMFanUsermod : public Usermod {
if (pwmChannel == 255) { //no more free LEDC channels
deinitPWMfan(); return;
}
// configure LED PWM functionalitites
// configure LED PWM functionalitites - ESP-IDF 5.x API
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
ledcAttach(pwmPin, 25000, 8); // New API: ledcAttach(pin, freq, resolution)
#else
ledcSetup(pwmChannel, 25000, 8);
// attach the channel to the GPIO to be controlled
ledcAttachPin(pwmPin, pwmChannel);
#endif
#endif
DEBUG_PRINTLN(F("Fan PWM sucessfully initialized."));
}

View File

@@ -196,7 +196,7 @@ class St7789DisplayUsermod : public Usermod {
// Check if values which are shown on display changed from the last time.
if ((((apActive) ? String(apSSID) : WiFi.SSID()) != knownSsid) ||
(knownIp != (apActive ? IPAddress(4, 3, 2, 1) : Network.localIP())) ||
(knownIp != (apActive ? IPAddress(4, 3, 2, 1) : WLEDNetwork.localIP())) ||
(knownBrightness != bri) ||
(knownEffectSpeed != strip.getMainSegment().speed) ||
(knownEffectIntensity != strip.getMainSegment().intensity) ||

View File

@@ -234,11 +234,11 @@ class QuinLEDAnPentaUsermod : public Usermod
bool oledCheckForNetworkChanges()
{
if (lastKnownNetworkConnected != Network.isConnected() || lastKnownIp != Network.localIP()
if (lastKnownNetworkConnected != WLEDNetwork.isConnected() || lastKnownIp != WLEDNetwork.localIP()
|| lastKnownWiFiConnected != WiFi.isConnected() || lastKnownSsid != WiFi.SSID()
|| lastKnownApActive != apActive || lastKnownApSsid != apSSID || lastKnownApPass != apPass || lastKnownApChannel != apChannel) {
lastKnownNetworkConnected = Network.isConnected();
lastKnownIp = Network.localIP();
lastKnownNetworkConnected = WLEDNetwork.isConnected();
lastKnownIp = WLEDNetwork.localIP();
lastKnownWiFiConnected = WiFi.isConnected();
lastKnownSsid = WiFi.SSID();
lastKnownApActive = apActive;

View File

@@ -264,7 +264,7 @@ void FourLineDisplayUsermod::setup() {
// interfaces here
void FourLineDisplayUsermod::connected() {
knownSsid = WiFi.SSID(); //apActive ? apSSID : WiFi.SSID(); //apActive ? WiFi.softAPSSID() :
knownIp = Network.localIP(); //apActive ? IPAddress(4, 3, 2, 1) : Network.localIP();
knownIp = WLEDNetwork.localIP(); //apActive ? IPAddress(4, 3, 2, 1) : WLEDNetwork.localIP();
networkOverlay(PSTR("NETWORK INFO"),7000);
}

View File

@@ -1161,7 +1161,7 @@ void WS2812FX::finalizeInit() {
BusManager::removeAll();
unsigned digitalCount = 0;
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3)
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
// determine if it is sensible to use parallel I2S outputs on ESP32 (i.e. more than 5 outputs = 1 I2S + 4 RMT)
unsigned maxLedsOnBus = 0;
unsigned busType = 0;
@@ -1191,7 +1191,7 @@ void WS2812FX::finalizeInit() {
unsigned memB = bus.memUsage(Bus::isDigital(bus.type) && !Bus::is2Pin(bus.type) ? digitalCount++ : 0); // does not include DMA/RMT buffer
mem += memB;
// estimate maximum I2S memory usage (only relevant for digital non-2pin busses)
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(ESP8266)
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4) && !defined(ESP8266)
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S3)
const bool usesI2S = ((useParallelI2S && digitalCount <= 8) || (!useParallelI2S && digitalCount == 1));
#elif defined(CONFIG_IDF_TARGET_ESP32S2)

View File

@@ -12,7 +12,7 @@
#if !(defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3))
#define LEDC_MUTEX_LOCK() do {} while (xSemaphoreTake(_ledc_sys_lock, portMAX_DELAY) != pdPASS)
#define LEDC_MUTEX_UNLOCK() xSemaphoreGive(_ledc_sys_lock)
extern xSemaphoreHandle _ledc_sys_lock;
extern SemaphoreHandle_t _ledc_sys_lock;
#else
#define LEDC_MUTEX_LOCK()
#define LEDC_MUTEX_UNLOCK()
@@ -467,8 +467,7 @@ BusPwm::BusPwm(const BusConfig &bc)
pinMode(_pins[i], OUTPUT);
#else
unsigned channel = _ledcStart + i;
ledcSetup(channel, _frequency, _depth - (dithering*4)); // with dithering _frequency doesn't really matter as resolution is 8 bit
ledcAttachPin(_pins[i], channel);
ledcAttach(_pins[i], _frequency, _depth - (dithering*4));
// LEDC timer reset credit @dedehai
uint8_t group = (channel / 8), timer = ((channel / 2) % 4); // same fromula as in ledcSetup()
ledc_timer_rst((ledc_mode_t)group, (ledc_timer_t)timer); // reset timer so all timers are almost in sync (for phase shift)
@@ -632,7 +631,7 @@ void BusPwm::deallocatePins() {
#ifdef ESP8266
digitalWrite(_pins[i], LOW); //turn off PWM interrupt
#else
if (_ledcStart < WLED_MAX_ANALOG_CHANNELS) ledcDetachPin(_pins[i]);
if (_ledcStart < WLED_MAX_ANALOG_CHANNELS) ledcDetach(_pins[i]);
#endif
}
#ifdef ARDUINO_ARCH_ESP32
@@ -754,7 +753,7 @@ size_t BusNetwork::getPins(uint8_t* pinArray) const {
#ifdef ARDUINO_ARCH_ESP32
void BusNetwork::resolveHostname() {
static unsigned long nextResolve = 0;
if (Network.isConnected() && millis() > nextResolve && _hostname.length() > 0) {
if (WLEDNetwork.isConnected() && millis() > nextResolve && _hostname.length() > 0) {
nextResolve = millis() + 600000; // resolve only every 10 minutes
IPAddress clnt;
if (strlen(cmDNS) > 0) clnt = MDNS.queryHost(_hostname);

View File

@@ -8,6 +8,20 @@
#include <NeoEsp8266DmaMethodFix.h>
#endif
// --- temporary shim for NeoPixelBus CORE3 / RMT driver_v2 ------------------
#if __has_include(<NeoPixelBus.h>)
#define NeoEsp32RmtNWs2812xMethod NeoEsp32RmtXWs2812xMethod
#define NeoEsp32RmtNSk6812Method NeoEsp32RmtXSk6812Method
#define NeoEsp32RmtN800KbpsMethod NeoEsp32RmtX800KbpsMethod
#define NeoEsp32RmtN400KbpsMethod NeoEsp32RmtX400KbpsMethod
#define NeoEsp32RmtNTm1814Method NeoEsp32RmtXTm1814Method
#define NeoEsp32RmtNTm1829Method NeoEsp32RmtXTm1829Method
#define NeoEsp32RmtNTm1914Method NeoEsp32RmtXTm1914Method
#define NeoEsp32RmtNApa106Method NeoEsp32RmtXApa106Method
#define NeoEsp32RmtNWs2805Method NeoEsp32RmtXWs2805Method
#endif
// ---------------------------------------------------------------------------
//Hardware SPI Pins
#define P_8266_HS_MOSI 13
#define P_8266_HS_CLK 14
@@ -234,7 +248,7 @@
typedef NeoEsp32I2s0Apa106Method X1Apa106Method;
typedef NeoEsp32I2s0Ws2805Method X1Ws2805Method;
typedef NeoEsp32I2s0Tm1914Method X1Tm1914Method;
#elif !defined(CONFIG_IDF_TARGET_ESP32C3)
#elif !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
// regular ESP32 will use I2S1
typedef NeoEsp32I2s1Ws2812xMethod X1Ws2812xMethod;
typedef NeoEsp32I2s1Sk6812Method X1Sk6812Method;
@@ -450,7 +464,7 @@ class PolyBus {
case I_32_RN_TM1914_3: beginTM1914<B_32_RN_TM1914_3*>(busPtr); break;
case I_32_RN_SM16825_5: (static_cast<B_32_RN_SM16825_5*>(busPtr))->Begin(); break;
// I2S1 bus or parellel buses
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
case I_32_I2_NEO_3: if (_useParallelI2S) (static_cast<B_32_IP_NEO_3*>(busPtr))->Begin(); else (static_cast<B_32_I2_NEO_3*>(busPtr))->Begin(); break;
case I_32_I2_NEO_4: if (_useParallelI2S) (static_cast<B_32_IP_NEO_4*>(busPtr))->Begin(); else (static_cast<B_32_I2_NEO_4*>(busPtr))->Begin(); break;
case I_32_I2_400_3: if (_useParallelI2S) (static_cast<B_32_IP_400_3*>(busPtr))->Begin(); else (static_cast<B_32_I2_400_3*>(busPtr))->Begin(); break;
@@ -482,7 +496,7 @@ class PolyBus {
static void* create(uint8_t busType, uint8_t* pins, uint16_t len, uint8_t channel) {
// NOTE: "channel" is only used on ESP32 (and its variants) for RMT channel allocation
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3)
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
if (_useParallelI2S && (channel >= 8)) {
// Parallel I2S channels are to be used first, so subtract 8 to get the RMT channel number
channel -= 8;
@@ -562,7 +576,7 @@ class PolyBus {
case I_32_RN_TM1914_3: busPtr = new B_32_RN_TM1914_3(len, pins[0], (NeoBusChannel)channel); break;
case I_32_RN_SM16825_5: busPtr = new B_32_RN_SM16825_5(len, pins[0], (NeoBusChannel)channel); break;
// I2S1 bus or paralell buses
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
case I_32_I2_NEO_3: if (_useParallelI2S) busPtr = new B_32_IP_NEO_3(len, pins[0]); else busPtr = new B_32_I2_NEO_3(len, pins[0]); break;
case I_32_I2_NEO_4: if (_useParallelI2S) busPtr = new B_32_IP_NEO_4(len, pins[0]); else busPtr = new B_32_I2_NEO_4(len, pins[0]); break;
case I_32_I2_400_3: if (_useParallelI2S) busPtr = new B_32_IP_400_3(len, pins[0]); else busPtr = new B_32_I2_400_3(len, pins[0]); break;
@@ -661,7 +675,7 @@ class PolyBus {
case I_32_RN_TM1914_3: (static_cast<B_32_RN_TM1914_3*>(busPtr))->Show(consistent); break;
case I_32_RN_SM16825_5: (static_cast<B_32_RN_SM16825_5*>(busPtr))->Show(consistent); break;
// I2S1 bus or paralell buses
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
case I_32_I2_NEO_3: if (_useParallelI2S) (static_cast<B_32_IP_NEO_3*>(busPtr))->Show(consistent); else (static_cast<B_32_I2_NEO_3*>(busPtr))->Show(consistent); break;
case I_32_I2_NEO_4: if (_useParallelI2S) (static_cast<B_32_IP_NEO_4*>(busPtr))->Show(consistent); else (static_cast<B_32_I2_NEO_4*>(busPtr))->Show(consistent); break;
case I_32_I2_400_3: if (_useParallelI2S) (static_cast<B_32_IP_400_3*>(busPtr))->Show(consistent); else (static_cast<B_32_I2_400_3*>(busPtr))->Show(consistent); break;
@@ -757,7 +771,7 @@ class PolyBus {
case I_32_RN_TM1914_3: return (static_cast<B_32_RN_TM1914_3*>(busPtr))->CanShow(); break;
case I_32_RN_SM16825_5: return (static_cast<B_32_RN_SM16825_5*>(busPtr))->CanShow(); break;
// I2S1 bus or paralell buses
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
case I_32_I2_NEO_3: if (_useParallelI2S) return (static_cast<B_32_IP_NEO_3*>(busPtr))->CanShow(); else return (static_cast<B_32_I2_NEO_3*>(busPtr))->CanShow(); break;
case I_32_I2_NEO_4: if (_useParallelI2S) return (static_cast<B_32_IP_NEO_4*>(busPtr))->CanShow(); else return (static_cast<B_32_I2_NEO_4*>(busPtr))->CanShow(); break;
case I_32_I2_400_3: if (_useParallelI2S) return (static_cast<B_32_IP_400_3*>(busPtr))->CanShow(); else return (static_cast<B_32_I2_400_3*>(busPtr))->CanShow(); break;
@@ -879,7 +893,7 @@ class PolyBus {
case I_32_RN_TM1914_3: (static_cast<B_32_RN_TM1914_3*>(busPtr))->SetPixelColor(pix, RgbColor(col)); break;
case I_32_RN_SM16825_5: (static_cast<B_32_RN_SM16825_5*>(busPtr))->SetPixelColor(pix, Rgbww80Color(col.R*257, col.G*257, col.B*257, cctWW*257, cctCW*257)); break;
// I2S1 bus or paralell buses
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
case I_32_I2_NEO_3: if (_useParallelI2S) (static_cast<B_32_IP_NEO_3*>(busPtr))->SetPixelColor(pix, RgbColor(col)); else (static_cast<B_32_I2_NEO_3*>(busPtr))->SetPixelColor(pix, RgbColor(col)); break;
case I_32_I2_NEO_4: if (_useParallelI2S) (static_cast<B_32_IP_NEO_4*>(busPtr))->SetPixelColor(pix, col); else (static_cast<B_32_I2_NEO_4*>(busPtr))->SetPixelColor(pix, col); break;
case I_32_I2_400_3: if (_useParallelI2S) (static_cast<B_32_IP_400_3*>(busPtr))->SetPixelColor(pix, RgbColor(col)); else (static_cast<B_32_I2_400_3*>(busPtr))->SetPixelColor(pix, RgbColor(col)); break;
@@ -976,7 +990,7 @@ class PolyBus {
case I_32_RN_TM1914_3: col = (static_cast<B_32_RN_TM1914_3*>(busPtr))->GetPixelColor(pix); break;
case I_32_RN_SM16825_5: { Rgbww80Color c = (static_cast<B_32_RN_SM16825_5*>(busPtr))->GetPixelColor(pix); col = RGBW32(c.R/257,c.G/257,c.B/257,max(c.WW,c.CW)/257); } break; // will not return original W
// I2S1 bus or paralell buses
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
case I_32_I2_NEO_3: col = (_useParallelI2S) ? (static_cast<B_32_IP_NEO_3*>(busPtr))->GetPixelColor(pix) : (static_cast<B_32_I2_NEO_3*>(busPtr))->GetPixelColor(pix); break;
case I_32_I2_NEO_4: col = (_useParallelI2S) ? (static_cast<B_32_IP_NEO_4*>(busPtr))->GetPixelColor(pix) : (static_cast<B_32_I2_NEO_4*>(busPtr))->GetPixelColor(pix); break;
case I_32_I2_400_3: col = (_useParallelI2S) ? (static_cast<B_32_IP_400_3*>(busPtr))->GetPixelColor(pix) : (static_cast<B_32_I2_400_3*>(busPtr))->GetPixelColor(pix); break;
@@ -1091,7 +1105,7 @@ class PolyBus {
case I_32_RN_TM1914_3: delete (static_cast<B_32_RN_TM1914_3*>(busPtr)); break;
case I_32_RN_SM16825_5: delete (static_cast<B_32_RN_SM16825_5*>(busPtr)); break;
// I2S1 bus or paralell buses
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
case I_32_I2_NEO_3: if (_useParallelI2S) delete (static_cast<B_32_IP_NEO_3*>(busPtr)); else delete (static_cast<B_32_I2_NEO_3*>(busPtr)); break;
case I_32_I2_NEO_4: if (_useParallelI2S) delete (static_cast<B_32_IP_NEO_4*>(busPtr)); else delete (static_cast<B_32_I2_NEO_4*>(busPtr)); break;
case I_32_I2_400_3: if (_useParallelI2S) delete (static_cast<B_32_IP_400_3*>(busPtr)); else delete (static_cast<B_32_I2_400_3*>(busPtr)); break;
@@ -1188,7 +1202,7 @@ class PolyBus {
case I_32_RN_TM1914_3: size = (static_cast<B_32_RN_TM1914_3*>(busPtr))->PixelsSize()*2; break;
case I_32_RN_SM16825_5: size = (static_cast<B_32_RN_SM16825_5*>(busPtr))->PixelsSize()*2; break;
// I2S1 bus or paralell buses (front + DMA; DMA = front * cadence, aligned to 4 bytes)
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
case I_32_I2_NEO_3: size = (_useParallelI2S) ? (static_cast<B_32_IP_NEO_3*>(busPtr))->PixelsSize()*4 : (static_cast<B_32_I2_NEO_3*>(busPtr))->PixelsSize()*4; break;
case I_32_I2_NEO_4: size = (_useParallelI2S) ? (static_cast<B_32_IP_NEO_4*>(busPtr))->PixelsSize()*4 : (static_cast<B_32_I2_NEO_4*>(busPtr))->PixelsSize()*4; break;
case I_32_I2_400_3: size = (_useParallelI2S) ? (static_cast<B_32_IP_400_3*>(busPtr))->PixelsSize()*4 : (static_cast<B_32_I2_400_3*>(busPtr))->PixelsSize()*4; break;
@@ -1267,7 +1281,7 @@ class PolyBus {
case I_32_RN_2805_5 : size = (size + 2*count)*2; break; // 5 channels
case I_32_RN_SM16825_5: size = (size + 2*count)*2*2; break; // 16bit, 5 channels
// I2S1 bus or paralell I2S1 buses (1x front, does not include DMA buffer which is front*cadence, a bit(?) more for LCD)
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
case I_32_I2_NEO_3 : // fallthrough
case I_32_I2_400_3 : // fallthrough
case I_32_I2_TM2_3 : // fallthrough
@@ -1354,7 +1368,7 @@ class PolyBus {
if (num > 4) return I_NONE;
if (num > 3) offset = 1; // only one I2S0 (use last to allow Audioreactive)
}
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32P4)
// On ESP32-C3 only the first 2 RMT channels are usable for transmitting
if (num > 1) return I_NONE;
//if (num > 1) offset = 1; // I2S not supported yet (only 1 I2S)

View File

@@ -109,7 +109,7 @@ bool isButtonPressed(uint8_t b)
break;
case BTN_TYPE_TOUCH:
case BTN_TYPE_TOUCH_SWITCH:
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3)
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
#ifdef SOC_TOUCH_VERSION_2 //ESP32 S2 and S3 provide a function to check touch state (state is updated in interrupt)
if (touchInterruptGetLastStatus(pin)) return true;
#else

View File

@@ -165,7 +165,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
uint8_t cctBlending = hw_led[F("cb")] | Bus::getCCTBlend();
Bus::setCCTBlend(cctBlending);
strip.setTargetFps(hw_led["fps"]); //NOP if 0, default 42 FPS
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3)
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
CJSON(useParallelI2S, hw_led[F("prl")]);
#endif
@@ -933,7 +933,7 @@ void serializeConfig(JsonObject root) {
hw_led[F("cb")] = Bus::getCCTBlend();
hw_led["fps"] = strip.getTargetFps();
hw_led[F("rgbwm")] = Bus::getGlobalAWMode(); // global auto white mode override
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3)
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
hw_led[F("prl")] = BusManager::hasParallelOutput();
#endif

View File

@@ -61,8 +61,13 @@ constexpr size_t FIXED_PALETTE_COUNT = DYNAMIC_PALETTE_COUNT + FASTLED_PALETTE_C
#if !defined(LEDC_CHANNEL_MAX) || !defined(LEDC_SPEED_MODE_MAX)
#include "driver/ledc.h" // needed for analog/LEDC channel counts
#endif
#define WLED_MAX_ANALOG_CHANNELS (LEDC_CHANNEL_MAX*LEDC_SPEED_MODE_MAX)
#if defined(CONFIG_IDF_TARGET_ESP32C3) // 2 RMT, 6 LEDC, only has 1 I2S but NPB does not support it ATM
// define -> constexpr to avoid preprocessor errors and enum arithmetic warnings from newer compilers
constexpr size_t WLED_MAX_ANALOG_CHANNELS = static_cast<size_t>(LEDC_CHANNEL_MAX) * static_cast<size_t>(LEDC_SPEED_MODE_MAX);
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)
// 2 RMT, 6 LEDC, only has 1 I2S but NPB does not support it ATM
#define WLED_MAX_DIGITAL_CHANNELS 2
//#define WLED_MAX_ANALOG_CHANNELS 6
#define WLED_MIN_VIRTUAL_BUSSES 4 // no longer used for bus creation but used to distinguish S2/S3 in UI
@@ -472,7 +477,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define MAX_LEDS 1536 //can't rely on memory limit to limit this to 1536 LEDs
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
#define MAX_LEDS 2048 //due to memory constraints S2
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)
#define MAX_LEDS 4096
#else
#define MAX_LEDS 16384
@@ -485,7 +490,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#else
#if defined(ARDUINO_ARCH_ESP32S2)
#define MAX_LED_MEMORY 16384
#elif defined(ARDUINO_ARCH_ESP32C3)
#elif defined(ARDUINO_ARCH_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)
#define MAX_LED_MEMORY 32768
#else
#define MAX_LED_MEMORY 65536

View File

@@ -1,6 +1,7 @@
#include "wled.h"
#ifdef WLED_ENABLE_DMX_INPUT
#pragma message "DMX physical input driver enabled"
#ifdef ESP8266
#error DMX input is only supported on ESP32
@@ -9,8 +10,8 @@
#include "dmx_input.h"
#include <rdm/responder.h>
void rdmPersonalityChangedCb(dmx_port_t dmxPort, const rdm_header_t *header,
void *context)
void rdmPersonalityChangedCb(dmx_port_t dmxPort, rdm_header_t *request_header,
rdm_header_t *response_header, void *context)
{
DMXInput *dmx = static_cast<DMXInput *>(context);
@@ -19,7 +20,7 @@ void rdmPersonalityChangedCb(dmx_port_t dmxPort, const rdm_header_t *header,
return;
}
if (header->cc == RDM_CC_SET_COMMAND_RESPONSE) {
if (response_header->cc == RDM_CC_SET_COMMAND_RESPONSE) {
const uint8_t personality = dmx_get_current_personality(dmx->inputPortNum);
DMXMode = std::min(DMX_MODE_PRESET, std::max(DMX_MODE_SINGLE_RGB, int(personality)));
configNeedsWrite = true;
@@ -27,8 +28,8 @@ void rdmPersonalityChangedCb(dmx_port_t dmxPort, const rdm_header_t *header,
}
}
void rdmAddressChangedCb(dmx_port_t dmxPort, const rdm_header_t *header,
void *context)
void rdmAddressChangedCb(dmx_port_t dmxPort, rdm_header_t *request_header,
rdm_header_t *response_header, void *context)
{
DMXInput *dmx = static_cast<DMXInput *>(context);
@@ -37,7 +38,7 @@ void rdmAddressChangedCb(dmx_port_t dmxPort, const rdm_header_t *header,
return;
}
if (header->cc == RDM_CC_SET_COMMAND_RESPONSE) {
if (response_header->cc == RDM_CC_SET_COMMAND_RESPONSE) {
const uint16_t addr = dmx_get_start_address(dmx->inputPortNum);
DMXAddress = std::min(512, int(addr));
configNeedsWrite = true;
@@ -47,14 +48,13 @@ void rdmAddressChangedCb(dmx_port_t dmxPort, const rdm_header_t *header,
static dmx_config_t createConfig()
{
dmx_config_t config;
config.pd_size = 255;
config.dmx_start_address = DMXAddress;
dmx_config_t config = DMX_CONFIG_DEFAULT;
config.model_id = 0;
config.product_category = RDM_PRODUCT_CATEGORY_FIXTURE;
config.software_version_id = VERSION;
strcpy(config.device_label, "WLED_MM");
#if 0
// softhack007: ToDO: current code from main does not work in V5 yet
const std::string dmxWledVersionString = "WLED_V" + std::to_string(VERSION);
strncpy(config.software_version_label, dmxWledVersionString.c_str(), 32);
config.software_version_label[32] = '\0'; // zero termination in case versionString string was longer than 32 chars
@@ -83,10 +83,51 @@ static dmx_config_t createConfig()
config.personality_count = 10;
// rdm personalities are numbered from 1, thus we can just set the DMXMode directly.
config.current_personality = DMXMode;
#else
// fallback code
const std::string DmxVersionString = "WLED_V" + std::to_string(VERSION);
config.software_version_label = DmxVersionString.c_str();
#endif
return config;
}
static dmx_personality_t personalities[10];
static void createPersonalities()
{
// Initialize personalities array
strncpy(personalities[0].description, "SINGLE_RGB", 32);
personalities[0].footprint = 3;
strncpy(personalities[1].description, "SINGLE_DRGB", 32);
personalities[1].footprint = 4;
strncpy(personalities[2].description, "EFFECT", 32);
personalities[2].footprint = 15;
strncpy(personalities[3].description, "MULTIPLE_RGB", 32);
personalities[3].footprint = std::min(512, int(strip.getLengthTotal()) * 3);
strncpy(personalities[4].description, "MULTIPLE_DRGB", 32);
personalities[4].footprint = std::min(512, int(strip.getLengthTotal()) * 3 + 1);
strncpy(personalities[5].description, "MULTIPLE_RGBW", 32);
personalities[5].footprint = std::min(512, int(strip.getLengthTotal()) * 4);
strncpy(personalities[6].description, "EFFECT_W", 32);
personalities[6].footprint = 18;
strncpy(personalities[7].description, "EFFECT_SEGMENT", 32);
personalities[7].footprint = std::min(512, strip.getSegmentsNum() * 15);
strncpy(personalities[8].description, "EFFECT_SEGMENT_W", 32);
personalities[8].footprint = std::min(512, strip.getSegmentsNum() * 18);
strncpy(personalities[9].description, "PRESET", 32);
personalities[9].footprint = 1;
}
void dmxReceiverTask(void *context)
{
DMXInput *instance = static_cast<DMXInput *>(context);
@@ -103,10 +144,11 @@ void dmxReceiverTask(void *context)
bool DMXInput::installDriver()
{
const auto config = createConfig();
createPersonalities();
DEBUG_PRINTF("DMX port: %u\n", inputPortNum);
if (!dmx_driver_install(inputPortNum, &config, DMX_INTR_FLAGS_DEFAULT)) {
if (!dmx_driver_install(inputPortNum, &config, personalities, 10)) {
DEBUG_PRINTF("Error: Failed to install dmx driver\n");
return false;
}
@@ -116,8 +158,14 @@ bool DMXInput::installDriver()
DEBUG_PRINTF("DMX enable pin is: %u\n", enPin);
dmx_set_pin(inputPortNum, txPin, rxPin, enPin);
// Set initial DMX start address and personality
dmx_set_start_address(inputPortNum, DMXAddress);
dmx_set_current_personality(inputPortNum, DMXMode);
// Register RDM callbacks for start address and personality changes
rdm_register_dmx_start_address(inputPortNum, rdmAddressChangedCb, this);
rdm_register_dmx_personality(inputPortNum, rdmPersonalityChangedCb, this);
rdm_register_dmx_personality(inputPortNum, 10, rdmPersonalityChangedCb, this);
initialized = true;
return true;
}
@@ -151,9 +199,9 @@ void DMXInput::init(uint8_t rxPin, uint8_t txPin, uint8_t enPin, uint8_t inputPo
const bool pinsAllocated = PinManager::allocateMultiplePins(pins, 3, PinOwner::DMX_INPUT);
if (!pinsAllocated) {
DEBUG_PRINTF("DMXInput: Error: Failed to allocate pins for DMX_INPUT. Pins already in use:\n");
DEBUG_PRINTF("rx in use by: %s\n", PinManager::getPinOwner(rxPin));
DEBUG_PRINTF("tx in use by: %s\n", PinManager::getPinOwner(txPin));
DEBUG_PRINTF("en in use by: %s\n", PinManager::getPinOwner(enPin));
DEBUG_PRINTF("rx in use by: %hhd\n", PinManager::getPinOwner(rxPin));
DEBUG_PRINTF("tx in use by: %hhd\n", PinManager::getPinOwner(txPin));
DEBUG_PRINTF("en in use by: %hhd\n", PinManager::getPinOwner(enPin));
return;
}
@@ -247,12 +295,11 @@ void DMXInput::enable()
bool DMXInput::isIdentifyOn() const
{
uint8_t identify = 0;
bool identify = false;
const bool gotIdentify = rdm_get_identify_device(inputPortNum, &identify);
// gotIdentify should never be false because it is a default parameter in rdm
// but just in case we check for it anyway
return bool(identify) && gotIdentify;
return identify && gotIdentify;
}
void DMXInput::checkAndUpdateConfig()
@@ -277,4 +324,4 @@ void DMXInput::checkAndUpdateConfig()
}
}
#endif
#endif

View File

@@ -42,12 +42,12 @@ private:
void updateInternal();
// is invoked whenver the dmx start address is changed via rdm
friend void rdmAddressChangedCb(dmx_port_t dmxPort, const rdm_header_t *header,
void *context);
friend void rdmAddressChangedCb(dmx_port_t dmxPort, rdm_header_t *request_header,
rdm_header_t *response_header, void *context);
// is invoked whenever the personality is changed via rdm
friend void rdmPersonalityChangedCb(dmx_port_t dmxPort, const rdm_header_t *header,
void *context);
friend void rdmPersonalityChangedCb(dmx_port_t dmxPort, rdm_header_t *request_header,
rdm_header_t *response_header, void *context);
/// The internal dmx task.
/// This is the main loop of the dmx receiver. It never returns.

View File

@@ -415,7 +415,7 @@ void prepareArtnetPollReply(ArtPollReply *reply) {
reply->reply_opcode = ARTNET_OPCODE_OPPOLLREPLY;
IPAddress localIP = Network.localIP();
IPAddress localIP = WLEDNetwork.localIP();
for (unsigned i = 0; i < 4; i++) {
reply->reply_ip[i] = localIP[i];
}
@@ -490,7 +490,7 @@ void prepareArtnetPollReply(ArtPollReply *reply) {
// A DMX to / from Art-Net device
reply->reply_style = 0x00;
Network.localMAC(reply->reply_mac);
WLEDNetwork.localMAC(reply->reply_mac);
for (unsigned i = 0; i < 4; i++) {
reply->reply_bind_ip[i] = localIP[i];

View File

@@ -401,8 +401,12 @@ uint8_t extractModeSlider(uint8_t mode, uint8_t slider, char *dest, uint8_t maxL
int16_t extractModeDefaults(uint8_t mode, const char *segVar);
void checkSettingsPIN(const char *pin);
uint16_t crc16(const unsigned char* data_p, size_t length);
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)// ToDO: find a solution to make this work in V5
String computeSHA1(const String& input);
String getDeviceId();
#endif
uint16_t beatsin88_t(accum88 beats_per_minute_88, uint16_t lowest = 0, uint16_t highest = 65535, uint32_t timebase = 0, uint16_t phase_offset = 0);
uint16_t beatsin16_t(accum88 beats_per_minute, uint16_t lowest = 0, uint16_t highest = 65535, uint32_t timebase = 0, uint16_t phase_offset = 0);
uint8_t beatsin8_t(accum88 beats_per_minute, uint8_t lowest = 0, uint8_t highest = 255, uint32_t timebase = 0, uint8_t phase_offset = 0);

View File

@@ -94,7 +94,7 @@ void handleImprovPacket() {
case ImprovRPCType::Request_State: {
unsigned improvState = 0x02; //authorized
if (WLED_WIFI_CONFIGURED) improvState = 0x03; //provisioning
if (Network.isConnected()) improvState = 0x04; //provisioned
if (WLEDNetwork.isConnected()) improvState = 0x04; //provisioned
sendImprovStateResponse(improvState, false);
if (improvState == 0x04) sendImprovIPRPCResult(ImprovRPCType::Request_State);
break;
@@ -178,10 +178,10 @@ void sendImprovRPCResult(ImprovRPCType type, uint8_t n_strings, const char **str
}
void sendImprovIPRPCResult(ImprovRPCType type) {
if (Network.isConnected())
if (WLEDNetwork.isConnected())
{
char urlStr[64];
IPAddress localIP = Network.localIP();
IPAddress localIP = WLEDNetwork.localIP();
unsigned len = sprintf(urlStr, "http://%d.%d.%d.%d", localIP[0], localIP[1], localIP[2], localIP[3]);
if (len > 24) return; //sprintf fail?
const char *str[1] = {urlStr};

View File

@@ -699,7 +699,9 @@ void serializeInfo(JsonObject root)
root[F("cn")] = F(WLED_CODENAME);
root[F("release")] = releaseString;
root[F("repo")] = repoString;
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)// ToDO: find a solution to make this work in V5
root[F("deviceId")] = getDeviceId();
#endif
JsonObject leds = root.createNestedObject(F("leds"));
leds[F("count")] = strip.getLengthTotal();
@@ -809,7 +811,7 @@ void serializeInfo(JsonObject root)
wifi_info[F("txPower")] = (int) WiFi.getTxPower();
wifi_info[F("sleep")] = (bool) WiFi.getSleep();
#endif
#if !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#if !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
root[F("arch")] = "esp32";
#else
root[F("arch")] = ESP.getChipModel();
@@ -885,9 +887,9 @@ void serializeInfo(JsonObject root)
root[F("product")] = F(WLED_PRODUCT_NAME);
root["mac"] = escapedMac;
char s[16] = "";
if (Network.isConnected())
if (WLEDNetwork.isConnected())
{
IPAddress localIP = Network.localIP();
IPAddress localIP = WLEDNetwork.localIP();
sprintf(s, "%d.%d.%d.%d", localIP[0], localIP[1], localIP[2], localIP[3]);
}
root["ip"] = s;

View File

@@ -0,0 +1,50 @@
#include "wled.h"
#ifdef ESP32
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
#include "mbedtls/sha1.h"
#include "SHA1Builder.h"
// Wrapper functions to map mbedtls SHA1 calls to Arduino SHA1Builder
// This is needed because ESP-IDF 5.x disables SHA1 in mbedtls by default
struct mbedtls_sha1_context_wrapper {
SHA1Builder builder;
};
extern "C" {
void mbedtls_sha1_init(mbedtls_sha1_context *ctx) {
// Allocate wrapper
auto* wrapper = new mbedtls_sha1_context_wrapper();
*(void**)ctx = wrapper;
}
int mbedtls_sha1_starts(mbedtls_sha1_context *ctx) {
auto* wrapper = *(mbedtls_sha1_context_wrapper**)ctx;
wrapper->builder.begin();
return 0;
}
int mbedtls_sha1_update(mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen) {
auto* wrapper = *(mbedtls_sha1_context_wrapper**)ctx;
wrapper->builder.add((const uint8_t*)input, ilen);
return 0;
}
int mbedtls_sha1_finish(mbedtls_sha1_context *ctx, unsigned char output[20]) {
auto* wrapper = *(mbedtls_sha1_context_wrapper**)ctx;
wrapper->builder.calculate();
wrapper->builder.getBytes(output);
return 0;
}
void mbedtls_sha1_free(mbedtls_sha1_context *ctx) {
auto* wrapper = *(mbedtls_sha1_context_wrapper**)ctx;
delete wrapper;
}
} // extern "C"
#endif
#endif

View File

@@ -222,11 +222,11 @@ bool initEthernet()
#endif
if (!ETH.begin(
(uint8_t) es.eth_address,
(int) es.eth_power,
(eth_phy_type_t) es.eth_type,
(int32_t) es.eth_address,
(int) es.eth_mdc,
(int) es.eth_mdio,
(eth_phy_type_t) es.eth_type,
(int) es.eth_power,
(eth_clock_mode_t) es.eth_clk_mode
)) {
DEBUG_PRINTLN(F("initC: ETH.begin() failed"));
@@ -358,7 +358,7 @@ void WiFiEvent(WiFiEvent_t event)
DEBUG_PRINTF_P(PSTR("WiFi-E: AP Client Connected (%d) @ %lus.\n"), (int)apClients, millis()/1000);
break;
case ARDUINO_EVENT_WIFI_STA_GOT_IP:
DEBUG_PRINT(F("WiFi-E: IP address: ")); DEBUG_PRINTLN(Network.localIP());
DEBUG_PRINT(F("WiFi-E: IP address: ")); DEBUG_PRINTLN(WLEDNetwork.localIP());
break;
case ARDUINO_EVENT_WIFI_STA_CONNECTED:
// followed by IDLE and SCAN_DONE
@@ -396,7 +396,7 @@ void WiFiEvent(WiFiEvent_t event)
if (!apActive) {
WiFi.disconnect(true); // disable WiFi entirely
}
if (multiWiFi[0].staticIP != (uint32_t)0x00000000 && multiWiFi[0].staticGW != (uint32_t)0x00000000) {
if (multiWiFi[0].staticIP != IPAddress(0,0,0,0) && multiWiFi[0].staticGW != IPAddress(0,0,0,0)) {
ETH.config(multiWiFi[0].staticIP, multiWiFi[0].staticGW, multiWiFi[0].staticSN, dnsAddress);
} else {
ETH.config(INADDR_NONE, INADDR_NONE, INADDR_NONE);

View File

@@ -155,7 +155,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
Bus::setCCTBlend(cctBlending);
Bus::setGlobalAWMode(request->arg(F("AW")).toInt());
strip.setTargetFps(request->arg(F("FR")).toInt());
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3)
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
useParallelI2S = request->hasArg(F("PR"));
#endif

View File

@@ -76,7 +76,7 @@ bool ESPAsyncE131::initMulticast(uint16_t port, uint16_t universe, uint8_t n) {
ip4_addr_t ifaddr;
ip4_addr_t multicast_addr;
ifaddr.addr = static_cast<uint32_t>(Network.localIP());
ifaddr.addr = static_cast<uint32_t>(WLEDNetwork.localIP());
for (uint8_t i = 1; i < n; i++) {
multicast_addr.addr = static_cast<uint32_t>(IPAddress(239, 255,
(((universe + i) >> 8) & 0xff), (((universe + i) >> 0)

View File

@@ -215,7 +215,7 @@ private:
void serveDescription()
{
EA_DEBUGLN("# Responding to description.xml ... #\n");
IPAddress localIP = Network.localIP();
IPAddress localIP = WLEDNetwork.localIP();
char s[16];
snprintf(s, sizeof(s), "%d.%d.%d.%d", localIP[0], localIP[1], localIP[2], localIP[3]);
char buf[1024];
@@ -289,7 +289,7 @@ private:
//respond to UDP SSDP M-SEARCH
void respondToSearch()
{
IPAddress localIP = Network.localIP();
IPAddress localIP = WLEDNetwork.localIP();
char s[16];
sprintf(s, "%d.%d.%d.%d", localIP[0], localIP[1], localIP[2], localIP[3]);
@@ -344,7 +344,7 @@ public:
#ifdef ARDUINO_ARCH_ESP32
udpConnected = espalexaUdp.beginMulticast(IPAddress(239, 255, 255, 250), 1900);
#else
udpConnected = espalexaUdp.beginMulticast(Network.localIP(), IPAddress(239, 255, 255, 250), 1900);
udpConnected = espalexaUdp.beginMulticast(WLEDNetwork.localIP(), IPAddress(239, 255, 255, 250), 1900);
#endif
if (udpConnected){

View File

@@ -1,6 +1,6 @@
#include "Network.h"
IPAddress NetworkClass::localIP()
IPAddress WLEDNetworkClass::localIP()
{
IPAddress localIP;
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET)
@@ -17,7 +17,7 @@ IPAddress NetworkClass::localIP()
return INADDR_NONE;
}
IPAddress NetworkClass::subnetMask()
IPAddress WLEDNetworkClass::subnetMask()
{
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET)
if (ETH.localIP()[0] != 0) {
@@ -30,7 +30,7 @@ IPAddress NetworkClass::subnetMask()
return IPAddress(255, 255, 255, 0);
}
IPAddress NetworkClass::gatewayIP()
IPAddress WLEDNetworkClass::gatewayIP()
{
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET)
if (ETH.localIP()[0] != 0) {
@@ -43,7 +43,7 @@ IPAddress NetworkClass::gatewayIP()
return INADDR_NONE;
}
void NetworkClass::localMAC(uint8_t* MAC)
void WLEDNetworkClass::localMAC(uint8_t* MAC)
{
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET)
// ETH.macAddress(MAC); // Does not work because of missing ETHClass:: in ETH.ccp
@@ -71,12 +71,12 @@ void NetworkClass::localMAC(uint8_t* MAC)
return;
}
bool NetworkClass::isConnected()
bool WLEDNetworkClass::isConnected()
{
return (WiFi.localIP()[0] != 0 && WiFi.status() == WL_CONNECTED) || isEthernet();
}
bool NetworkClass::isEthernet()
bool WLEDNetworkClass::isEthernet()
{
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET)
return (ETH.localIP()[0] != 0) && ETH.linkUp();
@@ -84,4 +84,4 @@ bool NetworkClass::isEthernet()
return false;
}
NetworkClass Network;
WLEDNetworkClass WLEDNetwork;

View File

@@ -8,7 +8,7 @@
#ifndef Network_h
#define Network_h
class NetworkClass
class WLEDNetworkClass
{
public:
IPAddress localIP();
@@ -19,6 +19,6 @@ public:
bool isEthernet();
};
extern NetworkClass Network;
extern WLEDNetworkClass WLEDNetwork;
#endif

View File

@@ -196,7 +196,7 @@ void notify(byte callMode, bool followUp)
#endif
{
DEBUG_PRINTLN(F("UDP sending packet."));
IPAddress broadcastIp = ~uint32_t(Network.subnetMask()) | uint32_t(Network.gatewayIP());
IPAddress broadcastIp = ~uint32_t(WLEDNetwork.subnetMask()) | uint32_t(WLEDNetwork.gatewayIP());
notifierUdp.beginPacket(broadcastIp, udpPort);
notifierUdp.write(udpOut, WLEDPACKETSIZE); // TODO: add actual used buffer size
notifierUdp.endPacket();
@@ -516,7 +516,7 @@ void handleNotifications()
}
}
localIP = Network.localIP();
localIP = WLEDNetwork.localIP();
//notifier and UDP realtime
if (!packetSize || packetSize > UDP_IN_MAXSIZE) return;
if (!isSupp && notifierUdp.remoteIP() == localIP) return; //don't process broadcasts we send ourselves
@@ -698,7 +698,7 @@ void sendSysInfoUDP()
{
if (!udp2Connected) return;
IPAddress ip = Network.localIP();
IPAddress ip = WLEDNetwork.localIP();
if (!ip || ip == IPAddress(255,255,255,255)) ip = IPAddress(4,3,2,1);
// TODO: make a nice struct of it and clean up

View File

@@ -633,7 +633,7 @@ int32_t hw_random(int32_t lowerlimit, int32_t upperlimit) {
// PSRAM compile time checks to provide info for misconfigured env
#if defined(BOARD_HAS_PSRAM)
#if defined(IDF_TARGET_ESP32C3) || defined(ESP8266)
#if defined(IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C61) || defined(ESP8266)
#error "ESP32-C3 and ESP8266 with PSRAM is not supported, please remove BOARD_HAS_PSRAM definition"
#else
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3) // PSRAM fix only needed for classic esp32
@@ -694,7 +694,7 @@ static void *validateFreeHeap(void *buffer) {
void *d_malloc(size_t size) {
void *buffer;
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32P4)
// the newer ESP32 variants have byte-accessible fast RTC memory that can be used as heap, access speed is on-par with DRAM
// the system does prefer normal DRAM until full, since free RTC memory is ~7.5k only, its below the minimum heap threshold and needs to be allocated explicitly
// use RTC RAM for small allocations to improve fragmentation or if DRAM is running low
@@ -1132,6 +1132,8 @@ uint8_t perlin8(uint16_t x, uint16_t y, uint16_t z) {
return (((perlin3D_raw((uint32_t)x << 8, (uint32_t)y << 8, (uint32_t)z << 8, true) * 2015) >> 10) + 33168) >> 8; //scale to 16 bit, offset, then scale to 8bit
}
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) // ToDO: find a solution to make this work in V5
// Platform-agnostic SHA1 computation from String input
String computeSHA1(const String& input) {
#ifdef ESP8266
@@ -1224,4 +1226,5 @@ String getDeviceId() {
return cachedDeviceId;
}
#endif // V5 workaround

View File

@@ -110,7 +110,7 @@ void WLED::loop()
{
if (apActive) dnsServer.processNextRequest();
#ifdef WLED_ENABLE_AOTA
if (Network.isConnected() && aOtaEnabled && !otaLock && correctPIN) ArduinoOTA.handle();
if (WLEDNetwork.isConnected() && aOtaEnabled && !otaLock && correctPIN) ArduinoOTA.handle();
#endif
handleNightlight();
yield();
@@ -284,7 +284,7 @@ void WLED::loop()
lastWifiState = WiFi.status();
DEBUG_PRINTF_P(PSTR("State time: %lu\n"), wifiStateChangedTime);
DEBUG_PRINTF_P(PSTR("NTP last sync: %lu\n"), ntpLastSyncTime);
DEBUG_PRINTF_P(PSTR("Client IP: %u.%u.%u.%u\n"), Network.localIP()[0], Network.localIP()[1], Network.localIP()[2], Network.localIP()[3]);
DEBUG_PRINTF_P(PSTR("Client IP: %u.%u.%u.%u\n"), WLEDNetwork.localIP()[0], WLEDNetwork.localIP()[1], WLEDNetwork.localIP()[2], WLEDNetwork.localIP()[3]);
if (loops > 0) { // avoid division by zero
DEBUG_PRINTF_P(PSTR("Loops/sec: %u\n"), loops / 30);
DEBUG_PRINTF_P(PSTR("Loop time[ms]: %u/%lu\n"), avgLoopMillis/loops, maxLoopMillis);
@@ -659,11 +659,17 @@ void WLED::initConnection()
WiFi.setPhyMode(force802_3g ? WIFI_PHY_MODE_11G : WIFI_PHY_MODE_11N);
#endif
if (multiWiFi[selectedWiFi].staticIP != 0U && multiWiFi[selectedWiFi].staticGW != 0U) {
if (multiWiFi.empty()) { // guard: handle empty WiFi list safely
WiFi.config(IPAddress((uint32_t)0), IPAddress((uint32_t)0), IPAddress((uint32_t)0));
} else {
if (selectedWiFi >= multiWiFi.size()) selectedWiFi = 0; // guard: ensure valid index
if (multiWiFi[selectedWiFi].staticIP != IPAddress((uint32_t)0) &&
multiWiFi[selectedWiFi].staticGW != IPAddress((uint32_t)0)) { // guard: compare as IPAddress to avoid pointer overload
WiFi.config(multiWiFi[selectedWiFi].staticIP, multiWiFi[selectedWiFi].staticGW, multiWiFi[selectedWiFi].staticSN, dnsAddress);
} else {
WiFi.config(IPAddress((uint32_t)0), IPAddress((uint32_t)0), IPAddress((uint32_t)0));
}
}
lastReconnectAttempt = millis();
@@ -727,7 +733,7 @@ void WLED::initInterfaces()
DEBUG_PRINTLN(F("Init STA interfaces"));
#ifndef WLED_DISABLE_HUESYNC
IPAddress ipAddress = Network.localIP();
IPAddress ipAddress = WLEDNetwork.localIP();
if (hueIP[0] == 0) {
hueIP[0] = ipAddress[0];
hueIP[1] = ipAddress[1];
@@ -813,7 +819,7 @@ void WLED::handleConnection()
if (stac != stacO) {
stacO = stac;
DEBUG_PRINTF_P(PSTR("Connected AP clients: %d\n"), (int)stac);
if (!Network.isConnected() && wifiConfigured) { // trying to connect, but not connected
if (!WLEDNetwork.isConnected() && wifiConfigured) { // trying to connect, but not connected
if (stac)
WiFi.disconnect(); // disable search so that AP can work
else
@@ -822,7 +828,7 @@ void WLED::handleConnection()
}
}
if (!Network.isConnected()) {
if (!WLEDNetwork.isConnected()) {
if (interfacesInited) {
if (scanDone && multiWiFi.size() > 1) {
DEBUG_PRINTLN(F("WiFi scan initiated on disconnect."));
@@ -866,7 +872,7 @@ void WLED::handleConnection()
} else if (!interfacesInited) { //newly connected
DEBUG_PRINTLN();
DEBUG_PRINT(F("Connected! IP address: "));
DEBUG_PRINTLN(Network.localIP());
DEBUG_PRINTLN(WLEDNetwork.localIP());
if (improvActive) {
if (improvError == 3) sendImprovStateResponse(0x00, true);
sendImprovStateResponse(0x04);
@@ -888,7 +894,7 @@ void WLED::handleConnection()
}
// If status LED pin is allocated for other uses, does nothing
// else blink at 1Hz when Network.isConnected() is false (no WiFi, ?? no Ethernet ??)
// else blink at 1Hz when WLEDNetwork.isConnected() is false (no WiFi, ?? no Ethernet ??)
// else blink at 2Hz when MQTT is enabled but not connected
// else turn the status LED off
#if defined(STATUSLED)
@@ -902,7 +908,7 @@ void WLED::handleStatusLED()
}
#endif
if (Network.isConnected()) {
if (WLEDNetwork.isConnected()) {
c = RGBW32(0,255,0,0);
ledStatusType = 2;
} else if (WLED_MQTT_CONNECTED) {

View File

@@ -75,6 +75,18 @@
// Library inclusions.
#include <Arduino.h>
// buildenv sanity check
#if !defined(ESP32) && !defined(ESP8266)
#error neither ESP32 nor ESP8266 defined. Please fix your build environment.
#endif
#if defined(ESP8266) && (defined(ARDUINO_ARCH_ESP32) || defined(ESP32))
#error both ESP8266 and ESP32/ARDUINO_ARCH_ESP32 defined. Please fix your build environment.
#endif
#if (defined(ARDUINO_ARCH_ESP32) && !defined(ESP32)) || (defined(ESP32) && !defined(ARDUINO_ARCH_ESP32))
#error either ESP32 or ARDUINO_ARCH_ESP32 not defined. Please fix your build environment.
#endif
#ifdef ESP8266
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
@@ -142,7 +154,7 @@
#endif
#ifdef WLED_ENABLE_DMX
#if defined(ESP8266) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2)
#if defined(ESP8266) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32S2)
#include "src/dependencies/dmx/ESPDMX.h"
#else //ESP32
#include "src/dependencies/dmx/SparkFunDMX.h"
@@ -315,7 +327,7 @@ WLED_GLOBAL bool rlyOpenDrain _INIT(RLYODRAIN);
#define IRTYPE 0
#endif
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2) || (defined(RX) && defined(TX))
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32P4) || defined(CONFIG_IDF_TARGET_ESP32S2) || (defined(RX) && defined(TX))
// use RX/TX as set by the framework - these boards do _not_ have RX=3 and TX=1
constexpr uint8_t hardwareRX = RX;
constexpr uint8_t hardwareTX = TX;
@@ -376,7 +388,7 @@ WLED_GLOBAL bool noWifiSleep _INIT(false);
WLED_GLOBAL bool force802_3g _INIT(false);
#endif // WLED_SAVE_RAM
#ifdef ARDUINO_ARCH_ESP32
#if defined(LOLIN_WIFI_FIX) && (defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3))
#if defined(LOLIN_WIFI_FIX) && (defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3))
WLED_GLOBAL uint8_t txPower _INIT(WIFI_POWER_8_5dBm);
#else
WLED_GLOBAL uint8_t txPower _INIT(WIFI_POWER_19_5dBm);
@@ -403,7 +415,7 @@ WLED_GLOBAL byte bootPreset _INIT(0); // save preset to load
WLED_GLOBAL bool useGlobalLedBuffer _INIT(false); // double buffering disabled on ESP8266
#else
WLED_GLOBAL bool useGlobalLedBuffer _INIT(true); // double buffering enabled on ESP32
#ifndef CONFIG_IDF_TARGET_ESP32C3
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32P4)
WLED_GLOBAL bool useParallelI2S _INIT(false); // parallel I2S for ESP32
#endif
#endif
@@ -457,7 +469,7 @@ WLED_GLOBAL bool arlsDisableGammaCorrection _INIT(true); // activate if
WLED_GLOBAL bool arlsForceMaxBri _INIT(false); // enable to force max brightness if source has very dark colors that would be black
#ifdef WLED_ENABLE_DMX
#if defined(ESP8266) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2)
#if defined(ESP8266) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32S2)
WLED_GLOBAL DMXESPSerial dmx;
#else //ESP32
WLED_GLOBAL SparkFunDMX dmx;
@@ -1034,7 +1046,7 @@ WLED_GLOBAL volatile uint8_t jsonBufferLock _INIT(0);
WLED_GLOBAL unsigned loops _INIT(0);
#endif
#define WLED_CONNECTED (Network.isConnected())
#define WLED_CONNECTED (WLEDNetwork.isConnected())
#ifndef WLED_AP_SSID_UNIQUE
#define WLED_SET_AP_SSID() do { \

View File

@@ -51,7 +51,7 @@ static bool inSubnet(const IPAddress &ip, const IPAddress &subnet, const IPAddre
}
static bool inSameSubnet(const IPAddress &client) {
return inSubnet(client, Network.localIP(), Network.subnetMask());
return inSubnet(client, WLEDNetwork.localIP(), WLEDNetwork.subnetMask());
}
static bool inLocalSubnet(const IPAddress &client) {

View File

@@ -251,14 +251,14 @@ void getSettingsJS(byte subPage, Print& settingsScript)
settingsScript.print(F("gId('ethd').style.display='none';"));
#endif
if (Network.isConnected()) //is connected
if (WLEDNetwork.isConnected()) //is connected
{
char s[32];
IPAddress localIP = Network.localIP();
IPAddress localIP = WLEDNetwork.localIP();
sprintf(s, "%d.%d.%d.%d", localIP[0], localIP[1], localIP[2], localIP[3]);
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET)
if (Network.isEthernet()) strcat_P(s ,PSTR(" (Ethernet)"));
if (WLEDNetwork.isEthernet()) strcat_P(s ,PSTR(" (Ethernet)"));
#endif
printSetClassElementHTML(settingsScript,PSTR("sip"),0,s);
} else