mirror of
https://github.com/wled/WLED.git
synced 2025-11-09 11:09:10 +00:00
Compare commits
38 Commits
copilot/ad
...
V5-C6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa5aa586ec | ||
|
|
db65e30ad5 | ||
|
|
cf195af7c8 | ||
|
|
0f1055826b | ||
|
|
96491255f1 | ||
|
|
36eaca6cb2 | ||
|
|
0653854904 | ||
|
|
51e1f4fc04 | ||
|
|
2af23fc0cd | ||
|
|
ce84a57a0d | ||
|
|
8cad34e14a | ||
|
|
93821efb90 | ||
|
|
c5e2ec72bd | ||
|
|
86679edd1f | ||
|
|
7a0325f88f | ||
|
|
44a483f454 | ||
|
|
41878f01f9 | ||
|
|
906d4560a7 | ||
|
|
5205110960 | ||
|
|
2f8882ee56 | ||
|
|
d4bafec0f3 | ||
|
|
446c04380e | ||
|
|
7daada1f3e | ||
|
|
68dff2d392 | ||
|
|
ec22c50813 | ||
|
|
80c97076ae | ||
|
|
c3f394489f | ||
|
|
ce172df91a | ||
|
|
91baa34071 | ||
|
|
81c92257da | ||
|
|
e4815d1ff5 | ||
|
|
bc19133e73 | ||
|
|
03a9d9e56f | ||
|
|
2c0259f214 | ||
|
|
1de8c2e79b | ||
|
|
07ab6aa3ea | ||
|
|
ba2b182bb3 | ||
|
|
965e794094 |
@@ -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
|
||||
@@ -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
|
||||
230
platformio.ini
230
platformio.ini
@@ -10,7 +10,27 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# 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, esp32dev, esp32_eth, lolin_s2_mini, esp32c3dev, esp32s3dev_16MB_opi, esp32s3dev_8MB_opi, esp32s3_4M_qspi, esp32_wrover, usermods
|
||||
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 ;; TODO: disabled NeoEsp32RmtMethodIsr
|
||||
;esp32c3dev
|
||||
; esp32s3dev_16MB_opi ;; TODO: disabled NeoEsp32RmtMethodIsr
|
||||
; esp32s3dev_8MB_opi ;; TODO: disabled NeoEsp32RmtMethodIsr
|
||||
;esp32s3_4M_qspi ;; TODO: disabled NeoEsp32RmtMethodIsr
|
||||
esp32c6dev_4MB
|
||||
; usermods
|
||||
|
||||
src_dir = ./wled00
|
||||
data_dir = ./wled00/data
|
||||
@@ -100,6 +120,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 =
|
||||
|
||||
@@ -108,6 +129,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_version.py
|
||||
@@ -139,10 +162,12 @@ upload_speed = 115200
|
||||
# ------------------------------------------------------------------------------
|
||||
lib_compat_mode = strict
|
||||
lib_deps =
|
||||
fastled/FastLED @ 3.6.0
|
||||
IRremoteESP8266 @ 2.8.2
|
||||
; fastled/FastLED @ 3.10.1
|
||||
https://github.com/softhack007/FastLED.git#ESP32-C6 ;; patched version needed for -C6
|
||||
; IRremoteESP8266 @ 2.8.2
|
||||
makuna/NeoPixelBus @ 2.8.3
|
||||
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.4.2
|
||||
; https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.4.2
|
||||
https://github.com/softhack007/ESPAsyncWebServer.git#ESP32-C6 ;; patched version needed for -C6
|
||||
marvinroger/AsyncMqttClient @ 0.9.0
|
||||
# for I2C interface
|
||||
;Wire
|
||||
@@ -194,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
|
||||
@@ -214,6 +240,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
|
||||
@@ -235,7 +262,7 @@ 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
|
||||
build_flags =
|
||||
@@ -244,11 +271,11 @@ build_flags =
|
||||
-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_flags = ${esp32_idf_V5.build_flags}
|
||||
lib_deps = ${esp32_idf_V5.lib_deps}
|
||||
|
||||
tiny_partitions = tools/WLED_ESP32_2MB_noOTA.csv
|
||||
default_partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
|
||||
@@ -263,28 +290,28 @@ AR_build_flags = ;; -fsingle-precision-constant ;; forces ArduinoFFT to use floa
|
||||
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
|
||||
;;
|
||||
;; please note that you can NOT update existing ESP32 installs with a "V4" build. Also updating by OTA will not work properly.
|
||||
;; You need to completely erase your device (esptool erase_flash) first, then install the "V4" build from VSCode+platformio.
|
||||
|
||||
;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)
|
||||
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.06.02/platform-espressif32.zip ;; Tasmota Arduino Core 2.0.9 with IPv6 support, based on IDF 4.4.4
|
||||
[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
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = -g
|
||||
-Wshadow=compatible-local ;; emit warning in case a local variable "shadows" another local one
|
||||
-DARDUINO_ARCH_ESP32 -DESP32
|
||||
${esp32_all_variants.build_flags}
|
||||
-D WLED_ENABLE_DMX_INPUT
|
||||
-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
|
||||
lib_deps =
|
||||
${esp32_all_variants.lib_deps}
|
||||
https://github.com/someweisguy/esp_dmx.git#47db25d
|
||||
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 = ${esp32_idf_V5.platform}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = -g
|
||||
-DARDUINO_ARCH_ESP32
|
||||
@@ -295,14 +322,14 @@ 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}
|
||||
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 = ${esp32_idf_V5.platform}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = -g
|
||||
-DARDUINO_ARCH_ESP32
|
||||
@@ -312,15 +339,85 @@ 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}
|
||||
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 =
|
||||
;;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
|
||||
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 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
|
||||
lib_deps =
|
||||
;;https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
|
||||
https://github.com/softhack007/AsyncTCP.git#ESP32-C6 ;; patched version needed for -C6
|
||||
makuna/NeoPixelBus @ 2.8.0 ;; latest version neeeded for -C6
|
||||
${env.lib_deps}
|
||||
|
||||
|
||||
[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 = ${common.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)
|
||||
upload_speed = 460800
|
||||
lib_deps = ${esp32c6.lib_deps}
|
||||
lib_ignore =
|
||||
IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
|
||||
|
||||
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 = ${esp32_idf_V5.platform}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = -g
|
||||
-DESP32
|
||||
@@ -331,9 +428,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
|
||||
|
||||
|
||||
@@ -359,6 +456,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]
|
||||
@@ -366,7 +465,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
|
||||
@@ -387,6 +486,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
|
||||
@@ -394,7 +495,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
|
||||
@@ -406,6 +507,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]
|
||||
@@ -416,6 +519,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
|
||||
@@ -424,27 +529,34 @@ 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 = ${esp32_idf_V5.platform}
|
||||
build_unflags = ${common.build_unflags}
|
||||
custom_usermods = audioreactive
|
||||
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_V4\" #-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_unflags = -D WLED_RELEASE_NAME=\"ESP32_V4\"
|
||||
build_flags = ${env:esp32dev.build_flags}
|
||||
-D WLED_DEBUG
|
||||
-D WLED_RELEASE_NAME=\"ESP32_DEBUG\"
|
||||
|
||||
[env:esp32dev_8M]
|
||||
board = esp32dev
|
||||
platform = ${esp32_idf_V4.platform}
|
||||
custom_usermods = audioreactive
|
||||
platform = ${esp32_idf_V5.platform}
|
||||
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
|
||||
lib_deps = ${esp32_idf_V4.lib_deps}
|
||||
build_flags = ${common.build_flags} ${esp32_idf_V5.build_flags} -D WLED_RELEASE_NAME=\"ESP32_8M\" #-D WLED_DISABLE_BROWNOUT_DET
|
||||
lib_deps = ${esp32_idf_V5.lib_deps}
|
||||
monitor_filters = esp32_exception_decoder
|
||||
board_build.partitions = ${esp32.large_partitions}
|
||||
board_upload.flash_size = 8MB
|
||||
@@ -454,11 +566,11 @@ board_build.flash_mode = dio
|
||||
|
||||
[env:esp32dev_16M]
|
||||
board = esp32dev
|
||||
platform = ${esp32_idf_V4.platform}
|
||||
custom_usermods = audioreactive
|
||||
platform = ${esp32_idf_V5.platform}
|
||||
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
|
||||
lib_deps = ${esp32_idf_V4.lib_deps}
|
||||
build_flags = ${common.build_flags} ${esp32_idf_V5.build_flags} -D WLED_RELEASE_NAME=\"ESP32_16M\" #-D WLED_DISABLE_BROWNOUT_DET
|
||||
lib_deps = ${esp32_idf_V5.lib_deps}
|
||||
monitor_filters = esp32_exception_decoder
|
||||
board_build.partitions = ${esp32.extreme_partitions}
|
||||
board_upload.flash_size = 16MB
|
||||
@@ -468,28 +580,28 @@ board_build.flash_mode = dio
|
||||
|
||||
[env:esp32_eth]
|
||||
board = esp32-poe
|
||||
platform = ${esp32_idf_V4.platform}
|
||||
platform = ${esp32_idf_V5.platform}
|
||||
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
|
||||
; -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\"
|
||||
-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
|
||||
@@ -512,7 +624,7 @@ board = esp32-s3-devkitc-1 ;; generic dev board; the next line adds PSRAM suppor
|
||||
board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB
|
||||
platform = ${esp32s3.platform}
|
||||
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 CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
|
||||
@@ -533,7 +645,7 @@ board = esp32-s3-devkitc-1 ;; generic dev board; the next line adds PSRAM suppor
|
||||
board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB
|
||||
platform = ${esp32s3.platform}
|
||||
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 CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
|
||||
@@ -553,7 +665,7 @@ platform = ${esp32s3.platform}
|
||||
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 CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
|
||||
@@ -576,7 +688,7 @@ monitor_filters = esp32_exception_decoder
|
||||
board = lolin_s3_mini ;; -S3 mini, 4MB flash 2MB PSRAM
|
||||
platform = ${esp32s3.platform}
|
||||
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")
|
||||
@@ -595,7 +707,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
|
||||
@@ -616,11 +728,11 @@ lib_deps = ${esp32s2.lib_deps}
|
||||
|
||||
[env:usermods]
|
||||
board = esp32dev
|
||||
platform = ${esp32_idf_V4.platform}
|
||||
platform = ${esp32_idf_V5.platform}
|
||||
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
|
||||
|
||||
@@ -541,12 +541,15 @@ build_flags = ${common.build_flags}
|
||||
-D WLED_ENABLE_HUB75MATRIX -D NO_GFX
|
||||
-D WLED_DEBUG_BUS
|
||||
; -D WLED_DEBUG
|
||||
-D SR_DMTYPE=-1 -D I2S_SDPIN=-1 -D I2S_CKPIN=-1 -D I2S_WSPIN=-1 -D MCLK_PIN=-1 ;; Disable to prevent pin clash
|
||||
|
||||
lib_deps = ${esp32_idf_V4.lib_deps}
|
||||
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#3.0.11
|
||||
|
||||
monitor_filters = esp32_exception_decoder
|
||||
board_build.partitions = ${esp32.default_partitions}
|
||||
board_build.flash_mode = dio
|
||||
custom_usermods = audioreactive
|
||||
|
||||
[env:esp32dev_hub75_forum_pinout]
|
||||
extends = env:esp32dev_hub75
|
||||
@@ -555,10 +558,10 @@ build_flags = ${common.build_flags}
|
||||
-D WLED_ENABLE_HUB75MATRIX -D NO_GFX
|
||||
-D ESP32_FORUM_PINOUT ;; enable for SmartMatrix default pins
|
||||
-D WLED_DEBUG_BUS
|
||||
-D SR_DMTYPE=-1 -D I2S_SDPIN=-1 -D I2S_CKPIN=-1 -D I2S_WSPIN=-1 -D MCLK_PIN=-1 ;; Disable to prevent pin clash
|
||||
; -D WLED_DEBUG
|
||||
|
||||
|
||||
|
||||
[env:adafruit_matrixportal_esp32s3]
|
||||
; ESP32-S3 processor, 8 MB flash, 2 MB of PSRAM, dedicated driver pins for HUB75
|
||||
board = adafruit_matrixportal_esp32s3
|
||||
@@ -575,6 +578,7 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=
|
||||
-D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips
|
||||
-D ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3
|
||||
-D WLED_DEBUG_BUS
|
||||
-D SR_DMTYPE=-1 -D I2S_SDPIN=-1 -D I2S_CKPIN=-1 -D I2S_WSPIN=-1 -D MCLK_PIN=-1 ;; Disable to prevent pin clash
|
||||
|
||||
|
||||
lib_deps = ${esp32s3.lib_deps}
|
||||
@@ -584,6 +588,7 @@ board_build.partitions = ${esp32.default_partitions}
|
||||
board_build.f_flash = 80000000L
|
||||
board_build.flash_mode = qio
|
||||
monitor_filters = esp32_exception_decoder
|
||||
custom_usermods = audioreactive
|
||||
|
||||
[env:esp32S3_PSRAM_HUB75]
|
||||
;; MOONHUB HUB75 adapter board
|
||||
@@ -601,6 +606,8 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=
|
||||
-D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips
|
||||
-D MOONHUB_S3_PINOUT ;; HUB75 pinout
|
||||
-D WLED_DEBUG_BUS
|
||||
-D LEDPIN=14 -D BTNPIN=0 -D RLYPIN=15 -D IRPIN=-1 -D AUDIOPIN=-1 ;; defaults that avoid pin conflicts with HUB75
|
||||
-D SR_DMTYPE=1 -D I2S_SDPIN=10 -D I2S_CKPIN=11 -D I2S_WSPIN=12 -D MCLK_PIN=-1 ;; I2S mic
|
||||
|
||||
lib_deps = ${esp32s3.lib_deps}
|
||||
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#aa28e2a ;; S3_LCD_DIV_NUM fix
|
||||
@@ -609,3 +616,4 @@ board_build.partitions = ${esp32.default_partitions}
|
||||
board_build.f_flash = 80000000L
|
||||
board_build.flash_mode = qio
|
||||
monitor_filters = esp32_exception_decoder
|
||||
custom_usermods = audioreactive
|
||||
@@ -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
|
||||
|
||||
@@ -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."));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -34,12 +34,7 @@
|
||||
function SetVal(){switch(parseInt(d.Sf.EP.value)){case 5568: d.Sf.DI.value = 5568; break; case 6454: d.Sf.DI.value = 6454; break; case 4048: d.Sf.DI.value = 4048; break; }; SP();FC();}
|
||||
function S(){
|
||||
getLoc();
|
||||
loadJS(getURL('/settings/s.js?p=4'), false, ()=>{
|
||||
d.um_p = [];
|
||||
d.rsvd = [];
|
||||
d.ro_gpio = [];
|
||||
d.max_gpio = 50;
|
||||
}, ()=>{SetVal();pinDropdowns();}); // If we set async false, file is loaded and executed, then next statement is processed
|
||||
loadJS(getURL('/settings/s.js?p=4'), false, undefined, ()=>{SetVal();}); // If we set async false, file is loaded and executed, then next statement is processed
|
||||
if (loc) d.Sf.action = getURL('/settings/sync');
|
||||
}
|
||||
function getURL(path) {
|
||||
@@ -47,88 +42,6 @@
|
||||
}
|
||||
function hideDMXInput(){gId("dmxInput").style.display="none";}
|
||||
function hideNoDMXInput(){gId("dmxInputOff").style.display="none";}
|
||||
function pinDropdowns() {
|
||||
let fields = ["IDMR","IDMT","IDME"]; // DMX input pins
|
||||
for (let i of d.Sf.elements) {
|
||||
if (i.type === "number" && fields.includes(i.name)) { //select all pin select elements
|
||||
let v = parseInt(i.value);
|
||||
let sel = addDropdown(i.name);
|
||||
for (var j = -1; j < d.max_gpio; j++) {
|
||||
if (d.rsvd.includes(j)) continue;
|
||||
let foundPin = d.um_p.indexOf(j);
|
||||
let txt = (j === -1) ? "unused" : `${j}`;
|
||||
if (foundPin >= 0 && j !== v) txt += ` used`; // already reserved pin
|
||||
if (d.ro_gpio.includes(j)) txt += " (R/O)";
|
||||
let opt = addOption(sel, txt, j);
|
||||
if (j === v) opt.selected = true; // this is "our" pin
|
||||
else if (d.um_p.includes(j)) opt.disabled = true; // someone else's pin
|
||||
}
|
||||
}
|
||||
}
|
||||
// update select options
|
||||
d.Sf.querySelectorAll("select.pin").forEach((e)=>{pinUpd(e);});
|
||||
}
|
||||
function pinUpd(e) {
|
||||
// update changed select options across DMX pins
|
||||
let oldV = parseInt(e.dataset.val);
|
||||
e.dataset.val = e.value;
|
||||
let txt = e.name;
|
||||
let selects = d.Sf.querySelectorAll("select.pin");
|
||||
for (let sel of selects) {
|
||||
if (sel == e) continue;
|
||||
Array.from(sel.options).forEach((i)=>{
|
||||
if (!(i.value==oldV || i.value==e.value)) return;
|
||||
if (i.value == -1) {
|
||||
i.text = "unused";
|
||||
return;
|
||||
}
|
||||
i.text = i.value;
|
||||
if (i.value==oldV) {
|
||||
i.disabled = false;
|
||||
}
|
||||
if (i.value==e.value) {
|
||||
i.disabled = true;
|
||||
i.text += ` ${txt}`;
|
||||
}
|
||||
if (d.ro_gpio.includes(parseInt(i.value))) i.text += " (R/O)";
|
||||
});
|
||||
}
|
||||
}
|
||||
function addDropdown(field) {
|
||||
let sel = cE('select');
|
||||
sel.classList.add("pin");
|
||||
let inp = d.getElementsByName(field)[0];
|
||||
if (inp && inp.tagName === "INPUT" && (inp.type === "text" || inp.type === "number")) {
|
||||
let v = inp.value;
|
||||
let n = inp.name;
|
||||
// copy the existing input element's attributes to the new select element
|
||||
for (var i = 0; i < inp.attributes.length; ++ i) {
|
||||
var att = inp.attributes[i];
|
||||
// type and value don't apply, so skip them
|
||||
if (att.name != 'type' && att.name != 'value' && att.name != 'class' && att.name != 'style') {
|
||||
sel.setAttribute(att.name, att.value);
|
||||
}
|
||||
}
|
||||
sel.setAttribute("data-val", v);
|
||||
sel.setAttribute("onchange", "pinUpd(this)");
|
||||
// finally, replace the old input element with the new select element
|
||||
inp.parentElement.replaceChild(sel, inp);
|
||||
return sel;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function addOption(sel,txt,val) {
|
||||
if (sel===null) return; // select object missing
|
||||
let opt = cE("option");
|
||||
opt.value = val;
|
||||
opt.text = txt;
|
||||
sel.appendChild(opt);
|
||||
for (let i=0; i<sel.childNodes.length; i++) {
|
||||
let c = sel.childNodes[i];
|
||||
if (c.value == sel.dataset.val) sel.selectedIndex = i;
|
||||
}
|
||||
return opt;
|
||||
}
|
||||
</script>
|
||||
<style>@import url("style.css");</style>
|
||||
</head>
|
||||
|
||||
@@ -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,46 +48,53 @@ 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");
|
||||
|
||||
const std::string versionString = "WLED_V" + std::to_string(VERSION);
|
||||
strncpy(config.software_version_label, versionString.c_str(), 32);
|
||||
config.software_version_label[32] = '\0'; // zero termination in case versionString string was longer than 32 chars
|
||||
|
||||
config.personalities[0].description = "SINGLE_RGB";
|
||||
config.personalities[0].footprint = 3;
|
||||
config.personalities[1].description = "SINGLE_DRGB";
|
||||
config.personalities[1].footprint = 4;
|
||||
config.personalities[2].description = "EFFECT";
|
||||
config.personalities[2].footprint = 15;
|
||||
config.personalities[3].description = "MULTIPLE_RGB";
|
||||
config.personalities[3].footprint = std::min(512, int(strip.getLengthTotal()) * 3);
|
||||
config.personalities[4].description = "MULTIPLE_DRGB";
|
||||
config.personalities[4].footprint = std::min(512, int(strip.getLengthTotal()) * 3 + 1);
|
||||
config.personalities[5].description = "MULTIPLE_RGBW";
|
||||
config.personalities[5].footprint = std::min(512, int(strip.getLengthTotal()) * 4);
|
||||
config.personalities[6].description = "EFFECT_W";
|
||||
config.personalities[6].footprint = 18;
|
||||
config.personalities[7].description = "EFFECT_SEGMENT";
|
||||
config.personalities[7].footprint = std::min(512, strip.getSegmentsNum() * 15);
|
||||
config.personalities[8].description = "EFFECT_SEGMENT_W";
|
||||
config.personalities[8].footprint = std::min(512, strip.getSegmentsNum() * 18);
|
||||
config.personalities[9].description = "PRESET";
|
||||
config.personalities[9].footprint = 1;
|
||||
|
||||
config.personality_count = 10;
|
||||
// rdm personalities are numbered from 1, thus we can just set the DMXMode directly.
|
||||
config.current_personality = DMXMode;
|
||||
config.software_version_label = versionString.c_str();
|
||||
|
||||
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 +111,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 +125,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 +166,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 +262,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()
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -876,9 +876,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
wled00/mbedtls_sha1_shim.cpp
Normal file
50
wled00/mbedtls_sha1_shim.cpp
Normal 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
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -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;
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -109,7 +109,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);
|
||||
@@ -726,7 +726,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];
|
||||
@@ -812,7 +812,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
|
||||
@@ -821,7 +821,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."));
|
||||
@@ -865,7 +865,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);
|
||||
@@ -887,7 +887,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)
|
||||
@@ -901,7 +901,7 @@ void WLED::handleStatusLED()
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Network.isConnected()) {
|
||||
if (WLEDNetwork.isConnected()) {
|
||||
c = RGBW32(0,255,0,0);
|
||||
ledStatusType = 2;
|
||||
} else if (WLED_MQTT_CONNECTED) {
|
||||
|
||||
@@ -1028,7 +1028,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 { \
|
||||
|
||||
@@ -44,7 +44,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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user