Compare commits

...

122 Commits

Author SHA1 Message Date
Will Tatam 4beef70e95 Merge branch 'main' into V5 2026-06-20 12:38:56 +01:00
Will Tatam 2457ea27f0 Merge commit 'bf948fadb' into V5
# Conflicts:
#	platformio.ini
#	wled00/util.cpp
2026-06-20 12:38:23 +01:00
Will Tatam d36701cb72 Merge commit 'd00dbacca' into V5
# Conflicts:
#	platformio.ini
2026-06-20 12:35:23 +01:00
Will Tatam fa5d1e0e36 Merge commit 'dd397fe67' into V5
# Conflicts:
#	wled00/wled.h
2026-06-20 12:17:02 +01:00
Frank 0fe9e3d3a2 (experimental) two usermods that _do_ compile with V5 2026-04-20 20:08:57 +02:00
Frank cd0b85a8a2 Merge branch 'main' into V5 2026-04-20 19:44:07 +02:00
Frank 848f188bf6 restore lost build_flag for esp32dev_debug 2026-03-30 11:57:41 +02:00
Frank 2f402818a5 Merge branch 'main' into V5 2026-03-30 11:52:08 +02:00
Frank b36ff623fb Merge branch 'main' into V5 2026-03-30 00:44:31 +02:00
Frank 795c6893be ensure consistent inheritance of lib_ignore 2026-03-29 14:19:47 +02:00
Frank 97e1b8ee05 typo's in comments 2026-03-29 14:08:44 +02:00
Frank be92bacc87 post-merge fixes 2026-03-29 13:49:38 +02:00
Frank e04a156e78 Merge branch 'main' into V5 2026-03-29 13:30:21 +02:00
Frank Möhle 39335675c1 Clarify instruction on gathering information when unsure 2026-03-28 11:06:49 +01:00
Frank Möhle 8f951f5068 Update copilot instructions for clarity and guidance
Added instructions for handling uncertainty and providing references.
2026-03-28 11:06:49 +01:00
Will Tatam 0f538eb155 do not keep prompting if there was an error, e.g no wifi 2026-03-28 11:06:49 +01:00
Frank 3cb3ff5223 V5 build 2603281 2026-03-28 02:20:31 +01:00
Frank c312f51050 revive device fingerprint in V5
* mbedtls_sha1_... functions have different names
* use CONFIG_SOC_ADC_RTC_MAX_BITWIDTH
* legacy adc calibration API is not supported on new MCUs (-C5, -C6, -C61, -P4)
2026-03-28 01:25:43 +01:00
Will Tatam 7670246a3b do not keep prompting if there was an error, e.g no wifi 2026-03-28 00:22:46 +00:00
Frank 758bdd537c replace preprocessor #error with static_assert
ensures that constexpr constants are handled properly.
2026-03-27 13:27:35 +01:00
Frank e834de2212 make WLED_MAX_BUSSES constexpr
prevent macro expansion problems, because  WLED_MAX_ANALOG_CHANNELS is a constexpr now.
2026-03-27 13:20:23 +01:00
Frank 3a2674a1f1 toDO: clarify if the ipv6 DNS workaround is still necessary 2026-03-27 12:26:07 +01:00
Frank eeeb93cdc5 Merge branch 'main' into V5 2026-03-27 12:19:56 +01:00
Will Miles 58239ced02 Fix RMT bus drivers for v5
Use a simpler shim in bus wrapper, and clean up the HI driver to
indicate that it's not v5 compatible (yet).
2026-03-26 18:43:04 -04:00
Will Miles 4f7b574d22 dynarray: Directly apply linker fix
Rather than append a linker file, we edit the upstream supplied ones to
add our section to the binaries.  Works better on all platforms.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-26 18:41:59 -04:00
Will Miles b222940ad1 Env cleanup 2026-03-26 18:41:59 -04:00
Will Miles 0d539c524c Merge branch 'main' into V5 2026-03-25 19:29:45 -04:00
Frank 02fc15ffd1 Merge branch 'main' into V5 2026-03-11 18:15:09 +01:00
Frank 541eb72d67 Merge branch 'main' into V5 2026-03-10 21:19:30 +01:00
Frank Möhle e0164fc502 Add esp32-C61 bootloader offset
C61 uses the same offset as C6
2026-03-10 20:05:45 +01:00
Frank Möhle 9e6c927d50 Fix preprocessor directive syntax for ESP32 2026-03-10 19:11:50 +01:00
Frank 49f2208a4e Merge branch 'main' into V5 2026-03-10 19:07:06 +01:00
Frank Möhle bae62d2caf Use C3 defaults for all new MCUs (C5, C6, P4) 2026-03-10 19:06:14 +01:00
Will Tatam 493f0fe952 Merge branch 'main' into V5 2026-03-08 16:21:55 +00:00
Frank e3bebc0674 build_unflags should always come from same origin as platform
fixes inconsistencies
2026-03-02 11:51:57 +01:00
Frank 1f4cadc629 -alpha-V5 --> -alphaV5
version tag renaming
2026-03-01 23:31:04 +01:00
Frank 1a91db1f01 bugfix: prevent array bounds violations due to short WS payload data
Guard against zero-length binary payloads before dereferencing data[0] or data[1]
2026-03-01 22:35:41 +01:00
Frank 80e81eeccc bugfix: right shift on signed char is unsafe
Fix signed-byte handling in SHA256 hex conversion.

When bootloaderSHA256Cache bytes >= 0x80 are assigned to a signed char, they sign-extend to negative values. Right-shifting negative values produces incorrect results (e.g., 0xFF becomes -1, which shifts incorrectly). This causes wrong hex digit output for non-ASCII hash bytes.
2026-03-01 22:10:11 +01:00
Frank 8f44f1b395 bump build number to 2603011 2026-03-01 21:30:22 +01:00
Frank 19f7cb19a9 AsyncTCP @ 3.4.7 2026-03-01 21:29:52 +01:00
Frank b4194b3a32 upgrade to latest V5 tasmota platform
solves "Don't know how to build from a source file with suffix `.o'." build errors
2026-03-01 21:05:44 +01:00
Will Tatam 6b7ecb969b Merge pull request #5401 from wled/dependabot/npm_and_yarn/minimatch-10.2.4
Bump minimatch from 10.2.2 to 10.2.4
2026-03-01 20:52:46 +01:00
Will Tatam f1fe20d73e Merge pull request #5128 from willmmiles/cleanup-bootloader-sha
Cleanup bootloader SHA256 calculation from #4984
2026-03-01 20:52:09 +01:00
Will Tatam 4e81f272b8 Merge pull request #5393 from wled/dependabot/npm_and_yarn/multi-8e762eef80
Bump minimatch and nodemon
2026-03-01 20:52:09 +01:00
Will Tatam b3e7e7e8c0 Merge pull request #5357 from netmindz/idf_4_4_8
Upgrade platform to 4.4.8
2026-03-01 20:52:09 +01:00
Frank 82723a03aa Update package-lock.json
align version with package.json
2026-02-28 21:23:17 +01:00
Frank Möhle dcf0a2aaea Update package.json with SemVer compliant version string
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-02-28 21:08:55 +01:00
Frank 85cff89bf0 dependancies update
* switch to FastLED "no fastled" fork - removes RMT driver conflicts, reduces firmware size
* update to latest "CORE3" NeoPixelBus
2026-02-28 20:53:45 +01:00
Frank 908e17bbfc 16.0-V5alpha --> 16.0-alpha-V5 2026-02-24 11:24:24 +01:00
Frank 6c0c2b3ff8 version bump 16.0-V5alpha
for V5 branch binaries
2026-02-14 23:39:52 +01:00
Frank fb8c575def change version scheme to Major.minor, drop leading "0."
as agreed in #5249
2026-02-14 23:35:49 +01:00
Frank Möhle dfcec5c94b use correct function
Update ledcAttach to ledcAttachChannel
2026-02-12 18:16:44 +01:00
Frank Möhle f2cbf0cc50 Add channel parameter to ledcAttach function
keep same behaviour as in previous V4 code
2026-02-12 18:10:40 +01:00
Frank 993ab49b15 Merge branch 'main' into V5 2026-02-12 11:07:36 +01:00
Frank Möhle f3f736d399 espalexa: Cleanup dummy macro for 8266 2026-02-11 17:19:26 +01:00
Frank c96e28924f espalexa: better handling of fake ESP_IDF_VERSION_VAL 2026-02-11 16:39:03 +01:00
Frank 4117d31cc0 add esp-idf managed folders to .gitignore 2026-02-11 10:53:26 +01:00
Frank a8f9573fc3 nitpick
* remove duplicated -D WLED_DISABLE_INFRARED
* fix indentation in WLED::initConnection()
2026-02-10 21:40:43 +01:00
Frank 3243c88055 Merge branch 'main' into V5 2026-02-10 21:26:18 +01:00
Frank Möhle 7b99f65341 Fix lost build_unflags in esp32dev_debug 2026-02-09 22:20:37 +01:00
Frank 21d0af1094 Merge branch 'main' into V5 2026-02-09 00:56:41 +01:00
Frank 4069260e61 remove double WLED_USE_SHARED_RMT in V5 core buildenv 2026-02-08 03:44:12 +01:00
Frank 1c09d34d12 bugfix 2026-02-08 03:39:32 +01:00
Frank 692c812934 buxfixes for generic S3 buildenv 2026-02-08 03:34:12 +01:00
Frank 9484b42b40 adding 8266 regression testing build
to check if 8266 code was broken accidentally
2026-02-08 03:26:22 +01:00
Frank 6dff1d2cb1 more V4 vs V5 compatibility fixes 2026-02-08 03:25:20 +01:00
Frank 929777507c 8266 dummy macro ESP_IDF_VERSION_VAL 2026-02-08 02:23:47 +01:00
Frank d76bd5fe59 fix esp32dev_V4 build
* disable "temporary shim for NeoPixelBus CORE3" for V4
* better way to prevent compiling NeoEsp32RmtHIMethod
2026-02-08 01:54:47 +01:00
Frank 1b5f10ff6d temporarily remove esp_dmx from V4 2026-02-08 01:40:55 +01:00
Frank 97b2c7a44f bugfix:implicit capture of 'this' via '[=]' is deprecated in C++20 2026-02-08 01:40:05 +01:00
Frank 56beb3795e add esp32dev_V4, fix compatibility issues with V4, fix for deprecated udp.flush()
* add esp32dev_V4 for regression checking w.r.t. V4 framework
* bring back lost V4 code
* udp.flush() is deprecated --> udp.clear()
2026-02-08 01:24:47 +01:00
Frank 68a8812942 adding WLED_USE_SHARED_RMT for all V5 builds
plus
- re-enabled one S3 and one S2 build
- disabled c++20 deprecation warnings
- minor indentation fix
2026-02-08 00:35:59 +01:00
Will Tatam 0b248abd3b TODO: disabled NeoEsp32RmtMethodIsr 2026-02-07 19:36:34 +00:00
Will Tatam a57e895bb9 Merge branch 'main' into V5 2026-02-07 19:28:12 +00: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
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 e891c5c36a Merge branch 'main' into V5 2025-12-01 20:26:44 +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 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
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
36 changed files with 566 additions and 214 deletions
@@ -29,6 +29,7 @@ License along with NeoPixel. If not, see
#pragma once
#if defined(ARDUINO_ARCH_ESP32)
#if !defined(WLED_USE_SHARED_RMT) // V5 fix: don't compile this file on unsupported platforms
// Use the NeoEspRmtSpeed types from the driver-based implementation
#include <NeoPixelBus.h>
@@ -467,3 +468,4 @@ typedef NeoEsp32RmtHI7Ws2805InvertedMethod NeoEsp32RmtHI7Ws2814InvertedMethod;
#endif // !defined(CONFIG_IDF_TARGET_ESP32C3)
#endif
#endif
+6 -5
View File
@@ -5,14 +5,16 @@
*
*/
#if defined(__XTENSA__) && defined(ESP32) && !defined(CONFIG_BTDM_CTRL_HLI)
#if defined(__XTENSA__) && defined(ESP32)
#include <freertos/xtensa_context.h>
#include "esp_idf_version.h"
#include "sdkconfig.h"
#include "soc/soc.h"
/* If the Bluetooth driver has hooked the high-priority interrupt, we piggyback on it and don't need this. */
#ifndef CONFIG_BTDM_CTRL_HLI
#if !defined(CONFIG_BTDM_CTRL_HLI) && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
#include <freertos/xtensa_context.h>
#include "soc/soc.h"
/*
Select interrupt based on system check level
@@ -258,6 +260,5 @@ _highint_stack_switch:
.global ld_include_hli_vectors_rmt
ld_include_hli_vectors_rmt:
#endif // CONFIG_BTDM_CTRL_HLI
#endif // XTensa
@@ -29,7 +29,7 @@ License along with NeoPixel. If not, see
#include <Arduino.h>
#if defined(ARDUINO_ARCH_ESP32)
#if defined(ARDUINO_ARCH_ESP32) && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
#include <algorithm>
#include "esp_idf_version.h"
@@ -504,4 +504,4 @@ esp_err_t NeoEsp32RmtHiMethodDriver::WaitForTxDone(rmt_channel_t channel, TickTy
return rv;
}
#endif
#endif
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "wled",
"version": "17.0.0-dev",
"version": "17.0.0-devV5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "wled",
"version": "17.0.0-dev",
"version": "17.0.0-devV5",
"license": "ISC",
"dependencies": {
"clean-css": "^5.3.3",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "wled",
"version": "17.0.0-dev",
"version": "17.0.0-devV5",
"description": "Tools for WLED project",
"main": "tools/cdata.js",
"directories": {
+12
View File
@@ -0,0 +1,12 @@
# FastLED exports some weak cxx symbols as a way of managing integration with C-only
# projects that cause it to be preferentially linked instead of unused code being
# discarded like other libraries. This causes not only bloat of the final binaries
# but can incorrectly invoke some of their driver framework on some platforms.
#
# Solve this problem by moving the cxx library up in the linker command line, so
# that it will be chosen over FastLED's.
Import("env")
if "-lcxx" in env["LIBS"]:
env["LIBS"].remove("-lcxx")
env["LIBS"].insert(0, "-lcxx")
+204 -94
View File
@@ -10,29 +10,34 @@
# ------------------------------------------------------------------------------
# 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 ;; 8266 regression test build
; esp8266_2m_160
; esp01_1m_full_160
; nodemcuv2_compat
; esp8266_2m_compat
; esp01_1m_full_compat
esp32dev_V4 ;; V4 regression test build
esp32dev
esp32dev_debug
esp32_eth
esp32_wrover
lolin_s2_mini
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
esp32c3dev_qio
esp32S3_wroom2
esp32s3dev_16MB_opi
esp32s3dev_8MB_opi
esp32s3dev_8MB_qspi
esp32s3dev_8MB_none
esp32s3_4M_qspi
usermods
; esp32S3_wroom2 ;; TODO: disabled NeoEsp32RmtMethodIsr
; esp32s3dev_16MB_opi ;; TODO: disabled NeoEsp32RmtMethodIsr
esp32s3dev_8MB_opi ;; TODO: disabled NeoEsp32RmtMethodIsr
; esp32s3dev_8MB_qspi ;; TODO: disabled NeoEsp32RmtMethodIsr
; esp32s3dev_8MB_none ;; TODO: disabled NeoEsp32RmtMethodIsr
; esp32s3_4M_qspi ;; TODO: disabled NeoEsp32RmtMethodIsr
; usermods ;; TODO: disabled until the core is building
src_dir = ./wled00
data_dir = ./wled00/data
@@ -98,6 +103,9 @@ 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
;; default_usermods = wizlights animartrix ;; for testing
[scripts_defaults]
extra_scripts =
pre:pio-scripts/set_metadata.py
@@ -107,6 +115,7 @@ extra_scripts =
pre:pio-scripts/user_config_copy.py
pre:pio-scripts/load_usermods.py
pre:pio-scripts/build_ui.py
;;post:pio-scripts/fastled_cxx_workaround.py
post:pio-scripts/validate_modules.py ;; double-check the build output usermods
; post:pio-scripts/obj-dump.py ;; convenience script to create a disassembly dump of the firmware (hardcore debugging)
@@ -129,33 +138,15 @@ upload_speed = 115200
# ------------------------------------------------------------------------------
lib_compat_mode = strict
lib_deps =
IRremoteESP8266 @ 2.8.2
https://github.com/Makuna/NeoPixelBus.git#a0919d1c10696614625978dd6fb750a1317a14ce
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.4.2
crankyoldgit/IRremoteESP8266 @ 2.9.0
;; neopixelbus dependancy moved into [8266] and [esp32_all_variants] sections
ESPAsyncWebServerWLED = git+https://github.com/Aircoookie/ESPAsyncWebServer#ac44e32abf2a69ae650412fb6bc193c59ccac38a
marvinroger/AsyncMqttClient @ 0.9.0
# for I2C interface
;Wire
# ESP-NOW library
;gmag11/QuickESPNow @ ~0.7.0
https://github.com/blazoncek/QuickESPNow.git#optional-debug
#For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line
#TFT_eSPI
#For compatible OLED display uncomment following
#olikraus/U8g2 #@ ~2.33.15
#For Dallas sensor uncomment following
#paulstoffregen/OneWire @ ~2.3.8
#For BME280 sensor uncomment following
#BME280 @ ~3.0.0
;adafruit/Adafruit BMP280 Library @ 2.1.0
;adafruit/Adafruit CCS811 Library @ 1.0.4
;adafruit/Adafruit Si7021 Library @ 1.4.0
#For MAX1704x Lipo Monitor / Fuel Gauge uncomment following
; https://github.com/adafruit/Adafruit_BusIO @ 1.14.5
; https://github.com/adafruit/Adafruit_MAX1704X @ 1.0.2
#For MPU6050 IMU uncomment follwoing
;electroniccats/MPU6050 @1.0.1
# SHT85
;robtillaart/SHT85@~0.3.3
extra_scripts = ${scripts_defaults.extra_scripts}
@@ -219,7 +210,6 @@ 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
lib_deps =
#https://github.com/lorol/LITTLEFS.git
ESPAsyncTCP @ 1.2.2
@@ -227,6 +217,7 @@ lib_deps =
ESP8266PWM
https://github.com/tignioj/ArduinoUZlib.git#20aff95cd80c141f80bdbf66895409a0046d2c2f
${env.lib_deps}
https://github.com/Makuna/NeoPixelBus.git#a0919d1c10696614625978dd6fb750a1317a14ce ;; standard NPB version used in main branch
monitor_filters = esp8266_exception_decoder
@@ -263,20 +254,22 @@ lib_deps_compat =
[esp32_all_variants]
lib_deps =
esp32async/AsyncTCP @ 3.4.7
esp32async/AsyncTCP @ 3.4.10
bitbank2/AnimatedGIF@^1.4.7
https://github.com/Aircoookie/GifDecoder.git#bc3af189b6b1e06946569f6b4287f0b79a860f8e
NeoPixelBus = git+https://github.com/Makuna/NeoPixelBus#76afe832f74b0738a3fa1bba0caf389ade9e7693
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_unflags}
build_flags = ${esp32_idf_V5.build_flags}
lib_deps = ${esp32_idf_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
monitor_filters = esp32_exception_decoder
tiny_partitions = tools/WLED_ESP32_2MB_noOTA.csv
@@ -291,7 +284,6 @@ board_build.partitions = ${esp32.default_partitions} ;; default partioning for
AR_build_flags = ;; -fsingle-precision-constant ;; forces ArduinoFFT to use float math (2x faster)
AR_lib_deps = ;; for pre-usermod-library platformio_override compatibility
[esp32_idf_V4]
;; build environment for ESP32 using ESP-IDF 4.4.x / arduino-esp32 v2.0.5
;; *** important: build flags from esp32_idf_V4 are inherited by _all_ esp32-based MCUs: esp32, esp32s2, esp32s3, esp32c3
@@ -321,12 +313,45 @@ lib_deps =
${esp32_all_variants.lib_deps}
https://github.com/someweisguy/esp_dmx.git#47db25d8c515e76fabcf5fc5ab0b786f98eeade0
${env.lib_deps}
lib_ignore =
[esp32_idf_V5]
;; build environment for ESP32 using ESP-IDF 5.3.4 / arduino-esp32 v3.1.10
platform = https://github.com/tasmota/platform-espressif32/releases/download/2026.02.30/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
;;-Wno-deprecated ;; disables a ton of warnings: implicit capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
-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_USE_SHARED_RMT ;; ToDO: check if NeoESP32RmtHI is still needed with V5 (see discussion in PR#4838)
-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 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
[v5_pioarduino_workaround]
# This is a disgusting workaround for a pioarduino "feature": if you don't ever mention lib_archive in your platformio.ini
# it forces it off globally, causing unused code from all libraries to be included even if you don't use it.
# This causes FastLED to activate its driver framework, stealing hardware resources we want to use.
# To work around this, all that we have to do is mention lib_archive in any section, even if it's never used; then
# pioarduino believes we know what we're doing, and lets us do what we want.
lib_archive = yes
[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
@@ -336,17 +361,18 @@ 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
monitor_filters = esp32_exception_decoder
[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
@@ -355,20 +381,21 @@ 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
monitor_filters = esp32_exception_decoder
[esp32s3]
;; generic definitions for all ESP32-S3 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
-DESP32
;; -DESP32 ;; disabled to avoid compiler warning: "ESP32" redefined
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32S3
-DCONFIG_IDF_TARGET_ESP32S3=1
@@ -376,14 +403,14 @@ 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}
lib_ignore = ${esp32_idf_V5.lib_ignore}
board_build.partitions = ${esp32.large_partitions} ;; default partioning for 8MB flash - can be overridden in build envs
upload_speed = 921600
monitor_filters = esp32_exception_decoder
# ------------------------------------------------------------------------------
# WLED BUILDS
# ------------------------------------------------------------------------------
@@ -411,7 +438,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]
extends = esp8266
@@ -438,7 +465,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:esp8266_2m_min]
;; Minimal-feature build for ESP02 (2MB flash).
@@ -492,35 +519,76 @@ build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=
-D WLED_DISABLE_PIXELFORGE
custom_usermods = audioreactive
[env:esp32dev]
extends = esp32
[env:esp32dev_V4]
;; uses V4 framework - for checking that the code still builds in V4
board = esp32dev
custom_usermods = audioreactive
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32\" #-D WLED_DISABLE_BROWNOUT_DET
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
build_unflags = ${esp32_idf_V4.build_unflags}
-D WLED_ENABLE_DMX_INPUT ;; TODO: fix lots of compile errors in dmx_input.cpp
custom_usermods = ${common.default_usermods}
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_V4\" #-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
-D WLED_USE_ETHERNET -D RLYPIN=-1 -D BTNPIN=-1 ;; TODO: this is just for testing - remove before merging to main
lib_deps = ${esp32_idf_V4.lib_deps}
lib_ignore = ${esp32_idf_V4.lib_ignore}
esp_dmx ;; TODO: fix lots of compile errors in dmx_input.cpp
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}
board_build.flash_mode = dio
[env:esp32dev]
board = esp32dev
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
build_unflags = ${esp32_idf_V5.build_unflags}
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_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
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 = ${esp32_idf_V5.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\"
-DARDUINO_USB_CDC_ON_BOOT=0
[env:esp32dev_8M]
extends = env:esp32dev
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_8M\" #-D WLED_DISABLE_BROWNOUT_DET
board = esp32dev
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
custom_usermods = ${common.default_usermods}
build_unflags = ${esp32_idf_V5.build_unflags}
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_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.large_partitions}
board_upload.flash_size = 8MB
board_upload.maximum_size = 8388608
; board_build.f_flash = 80000000L
[env:esp32dev_16M]
extends = env:esp32dev
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_16M\" #-D WLED_DISABLE_BROWNOUT_DET
board = esp32dev
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
custom_usermods = ${common.default_usermods}
build_unflags = ${esp32_idf_V5.build_unflags}
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_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.extreme_partitions}
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
@@ -529,28 +597,36 @@ board_build.f_flash = 80000000L
[env:esp32_eth]
extends = esp32
board = esp32-poe
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
upload_speed = 921600
custom_usermods = audioreactive
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_Ethernet\" -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1
-D SR_DMTYPE=-1 -D AUDIOPIN=-1 -D I2S_SDPIN=-1 -D I2S_WSPIN=-1 -D I2S_CKPIN=-1 -D MCLK_PIN=-1 ;; force AR to not allocate any PINs at startup
-D DATA_PINS=4 ;; default led pin = 16 conflicts with pins used for ethernet
; -D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only => uncomment if your board uses ETH_CLOCK_GPIO0_OUT, ETH_CLOCK_GPIO16_OUT, ETH_CLOCK_GPIO17_OUT
-DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
custom_usermods = ${common.default_usermods}
build_unflags = ${esp32_idf_V5.build_unflags}
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
-D SR_DMTYPE=-1 -D AUDIOPIN=-1 -D I2S_SDPIN=-1 -D I2S_WSPIN=-1 -D I2S_CKPIN=-1 -D MCLK_PIN=-1 ;; force AR to not allocate any PINs at startup
-D DATA_PINS=4 ;; default led pin = 16 conflicts with pins used for ethernet
; -D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only => uncomment if your board uses ETH_CLOCK_GPIO0_OUT, ETH_CLOCK_GPIO16_OUT, ETH_CLOCK_GPIO17_OUT
-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_idf_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
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
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_WROVER\"
custom_usermods = ${common.default_usermods}
build_unflags = ${esp32_idf_V5.build_unflags}
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_V5.lib_deps}
[env:esp32c3dev]
extends = esp32c3
board = esp32-c3-devkitm-1
@@ -561,6 +637,8 @@ build_flags = ${common.build_flags} ${esp32c3.build_flags} -D WLED_RELEASE_NAME=
-DARDUINO_USB_CDC_ON_BOOT=1 ;; for virtual CDC USB
;-DARDUINO_USB_CDC_ON_BOOT=0 ;; for serial-to-USB chip
upload_speed = 460800
build_unflags = ${esp32c3.build_unflags}
lib_deps = ${esp32c3.lib_deps}
board_build.flash_mode = dio ; safe default, required for OTA updates to 0.16 from older version which used dio (must match the bootloader!)
[env:esp32c3dev_qio]
@@ -573,12 +651,18 @@ board_build.flash_mode = qio ; qio is faster and works on almost all boards (som
extends = esp32s3
board = esp32-s3-devkitc-1 ;; generic dev board; the next line adds PSRAM support
board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB
custom_usermods = audioreactive
platform = ${esp32s3.platform}
platform_packages = ${esp32s3.platform_packages}
upload_speed = 921600
custom_usermods = ${common.default_usermods}
build_unflags = ${esp32s3.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_16MB_opi\"
-D WLED_WATCHDOG_TIMEOUT=0
;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
-D ARDUINO_USB_CDC_ON_BOOT=1 ;; -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
-DBOARD_HAS_PSRAM
lib_deps = ${esp32s3.lib_deps}
lib_ignore = ${esp32s3.lib_ignore}
board_build.partitions = ${esp32.extreme_partitions}
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
@@ -590,12 +674,19 @@ board_build.flash_mode = qio
extends = esp32s3
board = esp32-s3-devkitc-1 ;; generic dev board; the next line adds PSRAM support
board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB
custom_usermods = audioreactive
platform = ${esp32s3.platform}
platform_packages = ${esp32s3.platform_packages}
upload_speed = 921600
custom_usermods = ${common.default_usermods}
build_unflags = ${esp32s3.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_8MB_opi\"
-D WLED_WATCHDOG_TIMEOUT=0
;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
-D ARDUINO_USB_CDC_ON_BOOT=1 ;; -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
-DBOARD_HAS_PSRAM
lib_deps = ${esp32s3.lib_deps}
lib_ignore = ${esp32s3.lib_ignore}
board_build.partitions = ${esp32.large_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = qio
@@ -630,7 +721,9 @@ board_build.flash_mode = qio
extends = esp32s3
board = esp32s3camlcd ;; this is the only standard board with "opi_opi"
board_build.arduino.memory_type = opi_opi
custom_usermods = audioreactive
upload_speed = 921600
custom_usermods = ${common.default_usermods}
build_unflags = ${esp32s3.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_WROOM-2\"
-D WLED_WATCHDOG_TIMEOUT=0
-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
@@ -640,6 +733,9 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=
-D BTNPIN=0 -D RLYPIN=16 -D IRPIN=17 -D AUDIOPIN=-1
;;-D WLED_DEBUG
-D SR_DMTYPE=1 -D I2S_SDPIN=13 -D I2S_CKPIN=14 -D I2S_WSPIN=15 -D MCLK_PIN=4 ;; I2S mic
lib_deps = ${esp32s3.lib_deps}
lib_ignore = ${esp32s3.lib_ignore}
board_build.partitions = ${esp32.extreme_partitions}
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
@@ -663,13 +759,17 @@ board_upload.maximum_size = 33554432
[env:esp32s3_4M_qspi]
;; ESP32-S3, with 4MB FLASH and <= 4MB PSRAM (memory_type: qio_qspi)
extends = esp32s3
board = lolin_s3_mini ;; -S3 mini, 4MB flash 2MB PSRAM
custom_usermods = audioreactive
board = lolin_s3_mini ;; -S3 mini, 4MB flash 2MB PSRAM
upload_speed = 921600
custom_usermods = ${common.default_usermods}
build_unflags = ${esp32s3.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")
-DBOARD_HAS_PSRAM
-DLOLIN_WIFI_FIX ; seems to work much better with this
-D WLED_WATCHDOG_TIMEOUT=0
lib_deps = ${esp32s3.lib_deps}
lib_ignore = ${esp32s3.lib_ignore}
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = qio
@@ -694,7 +794,8 @@ extends = esp32s2
board = lolin_s2_mini
board_build.flash_mode = qio
board_build.f_flash = 80000000L
custom_usermods = audioreactive
custom_usermods = ${common.default_usermods}
build_unflags = ${esp32s2.build_unflags}
build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S2\"
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MSC_ON_BOOT=0
@@ -709,13 +810,22 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME=
-D HW_PIN_DATASPI=11
-D HW_PIN_MISOSPI=9
; -D STATUSLED=15
lib_deps = ${esp32s2.lib_deps}
lib_ignore = ${esp32s2.lib_ignore}
[env:usermods]
extends = env:esp32dev
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\"
board = esp32dev
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
build_unflags = ${esp32_idf_V5.build_unflags}
build_flags = ${common.build_flags} ${esp32_idf_V5.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\"
-DTOUCH_CS=9
custom_usermods = * ; Expands to all usermods in usermods folder
lib_deps = ${esp32_idf_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
monitor_filters = esp32_exception_decoder
board_build.flash_mode = dio
;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
+11 -13
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
+5 -2
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."));
}
+1 -1
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) ||
@@ -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;
@@ -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);
}
+1 -3
View File
@@ -29,9 +29,7 @@
19, 18, 17, 16, 15, 20, 21, 22, 23, 24, 29, 28, 27, 26, 25]}
*/
#if MAX_NUM_SEGMENTS < WLED_MAX_BUSSES
#error "Max segments must be at least max number of busses!"
#endif
static_assert(MAX_NUM_SEGMENTS >= WLED_MAX_BUSSES, "Max segments must be at least max number of busses!");
///////////////////////////////////////////////////////////////////////////////
+10 -1
View File
@@ -452,8 +452,13 @@ BusPwm::BusPwm(const BusConfig &bc)
pinMode(_pins[i], OUTPUT);
#else
unsigned channel = _ledcStart + i;
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
ledcSetup(channel, _frequency, _depth - (dithering*4)); // with dithering _frequency doesn't really matter as resolution is 8 bit
ledcAttachPin(_pins[i], channel);
#else
ledcAttachChannel(_pins[i], _frequency, _depth - (dithering*4), channel);
// LEDC timer reset credit @dedehai
#endif
// 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)
@@ -623,7 +628,11 @@ void BusPwm::deallocatePins() {
#ifdef ESP8266
digitalWrite(_pins[i], LOW); //turn off PWM interrupt
#else
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
if (_ledcStart < WLED_MAX_ANALOG_CHANNELS) ledcDetachPin(_pins[i]);
#else
if (_ledcStart < WLED_MAX_ANALOG_CHANNELS) ledcDetach(_pins[i]);
#endif
#endif
}
#ifdef ARDUINO_ARCH_ESP32
@@ -744,7 +753,7 @@ size_t BusNetwork::getPins(uint8_t* pinArray) const {
#ifdef ARDUINO_ARCH_ESP32
void BusNetwork::resolveHostname() {
static std::shared_ptr<AsyncDNS> DNSlookup; // TODO: make this dynamic? requires to handle the callback properly
if (Network.isConnected()) {
if (WLEDNetwork.isConnected()) {
IPAddress clnt;
if (strlen(cmDNS) > 0) {
clnt = MDNS.queryHost(_hostname);
+4 -1
View File
@@ -5,6 +5,7 @@
//#define NPB_CONF_4STEP_CADENCE
#include "NeoPixelBus.h"
//Hardware SPI Pins
#define P_8266_HS_MOSI 13
#define P_8266_HS_CLK 14
@@ -245,7 +246,9 @@
#endif
// RMT driver selection
#if !defined(WLED_USE_SHARED_RMT) && !defined(__riscv)
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
#define NeoEsp32RmtMethod(x) NeoEsp32RmtX ## x ## Method
#elif !defined(WLED_USE_SHARED_RMT) && !defined(__riscv)
#include <NeoEsp32RmtHIMethod.h>
#define NeoEsp32RmtMethod(x) NeoEsp32RmtHIN ## x ## Method
#else
+20 -6
View File
@@ -73,7 +73,13 @@ constexpr size_t WLED_MAX_USERMOD_PALETTES = WLED_USERMOD_PALETTE_ID_BASE -
#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)
// define -> constexpr to avoid preprocessor errors and enum arithmetic warnings from newer compilers
#ifdef WLED_MAX_ANALOG_CHANNELS
#undef WLED_MAX_ANALOG_CHANNELS // avoid clash between macro name and constexpr constant
#endif
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) // 2 RMT, 6 LEDC, only has 1 I2S but NPB does not support it ATM
#define WLED_MAX_RMT_CHANNELS 2 // ESP32-C3 has 2 RMT output channels
#define WLED_MAX_I2S_CHANNELS 0 // I2S not supported by NPB
@@ -90,10 +96,17 @@ constexpr size_t WLED_MAX_USERMOD_PALETTES = WLED_USERMOD_PALETTE_ID_BASE -
//#define WLED_MAX_ANALOG_CHANNELS 8
#define WLED_PLATFORM_ID 3 // used in UI to distinguish ESP type in UI, needs a proper fix!
#else
#define WLED_MAX_RMT_CHANNELS 8 // ESP32 has 8 RMT output channels
#define WLED_MAX_I2S_CHANNELS 8 // I2S parallel output supported by NPB
//#define WLED_MAX_ANALOG_CHANNELS 16
#define WLED_PLATFORM_ID 4 // used in UI to distinguish ESP type in UI, needs a proper fix!
#if defined(CONFIG_IDF_TARGET_ESP32) // classic esp32
#define WLED_MAX_RMT_CHANNELS 8 // ESP32 has 8 RMT output channels
#define WLED_MAX_I2S_CHANNELS 8 // I2S parallel output supported by NPB
//#define WLED_MAX_ANALOG_CHANNELS 16
#define WLED_PLATFORM_ID 4 // used in UI to distinguish ESP type in UI, needs a proper fix!
#else // all other risc-v based boards: same as C3
#define WLED_MAX_RMT_CHANNELS 2 // ESP32-C3 has 2 RMT output channels
#define WLED_MAX_I2S_CHANNELS 0 // I2S not supported by NPB
//#define WLED_MAX_ANALOG_CHANNELS 6
#define WLED_PLATFORM_ID 1 // used in UI to distinguish ESP types - falls back to "C3" until we have a proper fix!
#endif
#endif
#define WLED_MAX_TIMERS 64 // maximum number of timers
#define WLED_MAX_DIGITAL_CHANNELS (WLED_MAX_RMT_CHANNELS + WLED_MAX_I2S_CHANNELS)
@@ -103,7 +116,8 @@ constexpr size_t WLED_MAX_USERMOD_PALETTES = WLED_USERMOD_PALETTE_ID_BASE -
#ifdef WLED_MAX_BUSSES
#undef WLED_MAX_BUSSES
#endif
#define WLED_MAX_BUSSES (WLED_MAX_DIGITAL_CHANNELS+WLED_MAX_ANALOG_CHANNELS)
// define -> constexpr to align with definition of WLED_MAX_ANALOG_CHANNELS
constexpr size_t WLED_MAX_BUSSES = WLED_MAX_DIGITAL_CHANNELS + WLED_MAX_ANALOG_CHANNELS;
static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
// Maximum number of pins per output. 5 for RGBCCT analog LEDs.
+67 -20
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(int8_t rxPin, int8_t txPin, int8_t enPin, uint8_t inputPortN
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
+4 -4
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.
+2 -2
View File
@@ -457,7 +457,7 @@ static 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];
}
@@ -532,7 +532,7 @@ static 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];
+11
View File
@@ -3,6 +3,13 @@
#define WLED_FCN_DECLARE_H
#include <dynarray.h>
// dummy macro for 8266
#ifndef ARDUINO_ARCH_ESP32
#ifndef ESP_IDF_VERSION_VAL
#define ESP_IDF_VERSION_VAL(n1,n2,n3) 500
#endif
#endif
#include "colors.h"
/*
@@ -451,8 +458,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 !defined(ARDUINO_ARCH_ESP32) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)) // ToDO: verify that this works correctly in V5
String computeSHA1(const String& input);
String getDeviceId();
#endif
uint16_t beat88(uint16_t beats_per_minute_88, uint32_t timebase = 0);
uint16_t beat16(uint16_t beats_per_minute, uint32_t timebase = 0);
uint8_t beat8(uint16_t beats_per_minute, uint32_t timebase = 0);
+3 -3
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};
+4 -2
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 !defined(ARDUINO_ARCH_ESP32) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)) // ToDO: verify that this works correctly in V5
root[F("deviceId")] = getDeviceId();
#endif
JsonObject leds = root.createNestedObject(F("leds"));
leds[F("count")] = strip.getLengthTotal();
@@ -900,9 +902,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;
+50
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
+16 -5
View File
@@ -148,10 +148,10 @@ const ethernet_settings ethernetBoards[] = {
// Gledopto Series With Ethernet
{
1, // eth_address,
5, // eth_power,
23, // eth_mdc,
33, // eth_mdio,
1, // eth_address,
5, // eth_power,
23, // eth_mdc,
33, // eth_mdio,
ETH_PHY_LAN8720, // eth_type,
ETH_CLOCK_GPIO0_IN // eth_clk_mode
},
@@ -257,6 +257,16 @@ bool initEthernet()
}
#endif
#if defined(ESP_IDF_VERSION) && (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0))
if (!ETH.begin( // parameter order in V5 has changed
(eth_phy_type_t) es.eth_type,
(int32_t) es.eth_address,
(int) es.eth_mdc,
(int) es.eth_mdio,
(int) es.eth_power,
(eth_clock_mode_t) es.eth_clk_mode
)) {
#else
if (!ETH.begin(
(uint8_t) es.eth_address,
(int) es.eth_power,
@@ -265,6 +275,7 @@ bool initEthernet()
(eth_phy_type_t) es.eth_type,
(eth_clock_mode_t) es.eth_clk_mode
)) {
#endif
DEBUG_PRINTLN(F("initE: ETH.begin() failed"));
// de-allocate the allocated pins
for (managed_pin_type mpt : pinsToAllocate) {
@@ -430,7 +441,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
+10 -2
View File
@@ -197,7 +197,11 @@ void handleNetworkTime()
if (millis() - ntpPacketSentTime > 10000)
{
#ifdef ARDUINO_ARCH_ESP32 // I had problems using udp.flush() on 8266
while (ntpUdp.parsePacket() > 0) ntpUdp.flush(); // flush any existing packets
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
while (ntpUdp.parsePacket() > 0) ntpUdp.clear(); // flush() is deprecated in arduino-esp32 3.x.y
#else
while (ntpUdp.parsePacket() > 0) ntpUdp.flush(); // flush any existing packets
#endif
#endif
if (!ntpServerIP.fromString(ntpServerName)) // check if server is IP or domain
{
@@ -286,7 +290,11 @@ static bool checkNTPResponse()
int cb = ntpUdp.parsePacket();
if (cb < NTP_MIN_PACKET_SIZE) {
#ifdef ARDUINO_ARCH_ESP32 // I had problems using udp.flush() on 8266
if (cb > 0) ntpUdp.flush(); // this avoids memory leaks on esp32
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
if (cb > 0) ntpUdp.clear(); // flush() is deprecated in arduino-esp32 3.x.y
#else
if (cb > 0) ntpUdp.flush(); // this avoids memory leaks on esp32
#endif
#endif
return false;
}
+2 -2
View File
@@ -13,8 +13,8 @@ constexpr size_t METADATA_OFFSET = 256; // ESP32: metadata appears afte
// Bootloader is at fixed offset 0x1000 (4KB), 0x0000 (0KB), or 0x2000 (8KB), and is typically 32KB
// Bootloader offsets for different MCUs => see https://github.com/wled/WLED/issues/5064
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6)
constexpr size_t BOOTLOADER_OFFSET = 0x0000; // esp32-S3, esp32-C3 and (future support) esp32-c6
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C61)
constexpr size_t BOOTLOADER_OFFSET = 0x0000; // esp32-S3, esp32-C3 and (future support) esp32-c6, esp32-c61
constexpr size_t BOOTLOADER_SIZE = 0x8000; // 32KB, typical bootloader size
#define BOOTLOADER_OTA_UNSUPPORTED // still needs validation on these platforms.
#elif defined(CONFIG_IDF_TARGET_ESP32P4) || defined(CONFIG_IDF_TARGET_ESP32C5)
@@ -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)
+28 -8
View File
@@ -18,6 +18,14 @@
#include "Arduino.h"
// dummy macro for 8266
#ifndef ARDUINO_ARCH_ESP32
#ifndef ESP_IDF_VERSION_VAL
#define ESP_IDF_VERSION_VAL(n1,n2,n3) 500
#define ESPALEXA_DEFINED_ESP_IDF_VERSION_VAL 1 // remember to undef this later
#endif
#endif
//you can use these defines for library config in your sketch. Just use them before #include <Espalexa.h>
//#define ESPALEXA_ASYNC
@@ -216,7 +224,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];
@@ -252,10 +260,10 @@ private:
#ifdef ESPALEXA_ASYNC
if (serverAsync == nullptr) {
serverAsync = new AsyncWebServer(80);
serverAsync->onNotFound([=](AsyncWebServerRequest *request){server = request; serveNotFound();});
serverAsync->onNotFound([this](AsyncWebServerRequest *request){server = request; serveNotFound();}); // fix: implicit capture of "this"
}
serverAsync->onRequestBody([=](AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total){
serverAsync->onRequestBody([this](AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total){ // fix: implicit capture of "this"
char b[len +1];
b[len] = 0;
memcpy(b, data, len);
@@ -264,9 +272,9 @@ private:
EA_DEBUGLN(body);
});
#ifndef ESPALEXA_NO_SUBPAGE
serverAsync->on("/espalexa", HTTP_GET, [=](AsyncWebServerRequest *request){server = request; servePage();});
serverAsync->on("/espalexa", HTTP_GET, [this](AsyncWebServerRequest *request){server = request; servePage();});
#endif
serverAsync->on("/description.xml", HTTP_GET, [=](AsyncWebServerRequest *request){server = request; serveDescription();});
serverAsync->on("/description.xml", HTTP_GET, [this](AsyncWebServerRequest *request){server = request; serveDescription();}); // fix: implicit capture of "this"
serverAsync->begin();
#else
@@ -290,7 +298,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]);
@@ -350,7 +358,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){
@@ -385,7 +393,11 @@ public:
espalexaUdp.read(packetBuffer, packetSize);
packetBuffer[packetSize] = 0;
espalexaUdp.flush();
#if defined(ARDUINO_ARCH_ESP32) && (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0))
espalexaUdp.clear(); // flush() is deprecated in arduino-esp32 3.x.y
#else
espalexaUdp.flush();
#endif
if (!discoverable) return; //do not reply to M-SEARCH if not discoverable
const char* request = (const char *) packetBuffer;
@@ -633,4 +645,12 @@ public:
~Espalexa(){} //note: Espalexa is NOT meant to be destructed
};
// dummy macro cleanup
#ifndef ARDUINO_ARCH_ESP32
#ifdef ESPALEXA_DEFINED_ESP_IDF_VERSION_VAL
#undef ESP_IDF_VERSION_VAL
#undef ESPALEXA_DEFINED_ESP_IDF_VERSION_VAL
#endif
#endif
#endif
+7 -7
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;
+2 -2
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
+3 -3
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();
@@ -517,7 +517,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
@@ -701,7 +701,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
+35 -2
View File
@@ -14,6 +14,11 @@
#endif
#include "mbedtls/sha1.h" // for SHA1 on ESP32
#include "esp_efuse.h"
#include "esp_chip_info.h"
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
#include "SHA1Builder.h"
#include <esp_mac.h> // V5 requirement
#endif
#endif
@@ -1268,6 +1273,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 !defined(ARDUINO_ARCH_ESP32) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)) // ToDO: validate behaviour in V5
// Platform-agnostic SHA1 computation from String input
String computeSHA1(const String& input) {
#ifdef ESP8266
@@ -1277,11 +1284,19 @@ String computeSHA1(const String& input) {
unsigned char shaResult[20]; // SHA1 produces 20 bytes
mbedtls_sha1_context ctx;
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
mbedtls_sha1_init(&ctx);
mbedtls_sha1_starts_ret(&ctx);
mbedtls_sha1_update_ret(&ctx, (const unsigned char*)input.c_str(), input.length());
mbedtls_sha1_finish_ret(&ctx, shaResult);
mbedtls_sha1_free(&ctx);
#else
mbedtls_sha1_init(&ctx);
mbedtls_sha1_starts(&ctx);
mbedtls_sha1_update(&ctx, (const unsigned char*)input.c_str(), input.length());
mbedtls_sha1_finish(&ctx, shaResult);
mbedtls_sha1_free(&ctx);
#endif
// Convert to hexadecimal string
char hexString[41];
@@ -1295,20 +1310,32 @@ String computeSHA1(const String& input) {
}
#ifdef ESP32
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
#include "esp_adc_cal.h" // deprecated API
//#include "esp_adc/adc_cali.h" // new API
//#include "esp_adc/adc_cali_scheme.h" // new API
#else
#include "esp_adc_cal.h"
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(4,4,7) // backwards compatibility patch
#define ADC_ATTEN_DB_12 ADC_ATTEN_DB_11
#endif
#endif
String generateDeviceFingerprint() {
uint32_t fp[2] = {0, 0}; // create 64 bit fingerprint
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
esp_efuse_mac_get_default((uint8_t*)fp);
fp[1] ^= ESP.getFlashChipSize();
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
fp[0] ^= chip_info.full_revision | (chip_info.model << 16);
// mix in ADC calibration data:
#else
fp[0] ^= chip_info.revision | (chip_info.model << 16);
#endif
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3
// mix in ADC calibration data - legacy adc calibration API is not supported on new MCUs (-C5, -C6, -C61, -P4)
esp_adc_cal_characteristics_t ch;
#if SOC_ADC_MAX_BITWIDTH == 13 // S2 has 13 bit ADC
#if (SOC_ADC_MAX_BITWIDTH == 13) || (CONFIG_SOC_ADC_RTC_MAX_BITWIDTH == 13) // S2 has 13 bit ADC
constexpr auto myBIT_WIDTH = ADC_WIDTH_BIT_13;
#else
constexpr auto myBIT_WIDTH = ADC_WIDTH_BIT_12;
@@ -1326,6 +1353,11 @@ String generateDeviceFingerprint() {
fp[1] ^= ch.high_curve[i];
}
}
#else
// some extra salt, instead of ADC calibration
fp[0] ^= chip_info.features | chip_info.cores << 16;
fp[1] ^= ESP.getFlashSourceFrequencyMHz() | ESP.getFlashClockDivider() << 8 ;
#endif
char fp_string[17]; // 16 hex chars + null terminator
sprintf(fp_string, "%08X%08X", fp[1], fp[0]);
return String(fp_string);
@@ -1363,4 +1395,5 @@ String getDeviceId() {
return cachedDeviceId;
}
#endif // V5/V6 workaround
+19 -11
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();
@@ -312,7 +312,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);
@@ -590,7 +590,9 @@ void WLED::setup()
#endif
#if defined(ARDUINO_ARCH_ESP32) && defined(LWIP_IPV6)
#if ESP_IDF_VERSION_MAJOR < 5 // ToDO: clarify if esp-idf v5.x still needs this patch
installIPv6RABlocker(); // Work around unsolicited RA overwriting IPv4 DNS servers
#endif
#endif
#if WLED_WATCHDOG_TIMEOUT > 0
@@ -718,10 +720,16 @@ void WLED::initConnection()
WiFi.setHostname(hostname);
#endif
if (multiWiFi[selectedWiFi].staticIP != 0U && multiWiFi[selectedWiFi].staticGW != 0U) {
WiFi.config(multiWiFi[selectedWiFi].staticIP, multiWiFi[selectedWiFi].staticGW, multiWiFi[selectedWiFi].staticSN, dnsAddress);
if (multiWiFi.empty()) { // guard: handle empty WiFi list safely
WiFi.config(IPAddress((uint32_t)0), IPAddress((uint32_t)0), IPAddress((uint32_t)0));
} else {
WiFi.config(IPAddress((uint32_t)0), IPAddress((uint32_t)0), IPAddress((uint32_t)0));
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();
@@ -831,7 +839,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];
@@ -917,7 +925,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
@@ -926,7 +934,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."));
@@ -970,7 +978,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());
#ifdef ARDUINO_ARCH_ESP32
esp_wifi_set_storage(WIFI_STORAGE_RAM); // disable further updates of NVM credentials to prevent wear on flash (same as WiFi.persistent(false) but updates immediately, arduino wifi deficiency workaround)
#endif
@@ -995,7 +1003,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)
@@ -1009,7 +1017,7 @@ void WLED::handleStatusLED()
}
#endif
if (Network.isConnected()) {
if (WLEDNetwork.isConnected()) {
c = RGBW32(0,255,0,0);
ledStatusType = 2;
} else if (WLED_MQTT_CONNECTED) {
+13 -1
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>
#ifdef WLED_ENABLE_WPA_ENTERPRISE
@@ -1023,7 +1035,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 { \
+1 -1
View File
@@ -60,7 +60,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) {
+3 -3
View File
@@ -295,14 +295,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