1034 Commits

Author SHA1 Message Date
Damian Schneider
76cb2e9988 Improvements to heap-memory and PSRAM handling (#4791)
* Improved heap and PSRAM handling

- Segment `allocateData()` uses more elaborate DRAM checking to reduce fragmentation and allow for larger setups to run on low heap
- Segment data allocation fails if minimum contiguous block size runs low to keep the UI working
- Increased `MAX_SEGMENT_DATA` to account for better segment data handling
- Memory allocation functions try to keep enough DRAM for segment data
- Added constant `PSRAM_THRESHOLD` to improve PSARM usage
- Increase MIN_HEAP_SIZE to reduce risk of breaking UI due to low memory for JSON response
- ESP32 makes use of IRAM (no 8bit access) for pixeluffers, freeing up to 50kB of RAM
- Fix to properly get available heap on all platforms: added function `getFreeHeapSize()`
- Bugfix for effects that divide by SEGLEN: don't run FX in service() if segment is not active
-Syntax fix in AR: calloc() uses (numelements, size) as arguments

* Added new functions for allocation and heap checking

- added `allocate_buffer()` function that can be used to allocate large buffers: takes parameters to set preferred ram location, including 32bit accessible RAM on ESP32. Returns null if heap runs low or switches to PSRAM
- getFreeHeapSize() and getContiguousFreeHeap() helper functions for all platforms to correctly report free useable heap
- updated some constants
- updated segment data allocation to free the data if it is large

- replaced "psramsafe" variable with it's #ifdef: BOARD_HAS_PSRAM and made accomodating changes
- added some compile-time checks to handle invalid env. definitions
- updated all allocation functions and some of the logic behind them
- added use of fast RTC-Memory where available
- increased MIN_HEAP_SIZE for all systems (improved stability in tests)
- updated memory calculation in web-UI to account for required segment buffer
- added UI alerts if buffer allocation fails
- made getUsedSegmentData() non-private (used in buffer alloc function)
- changed MAX_SEGMENT_DATA
- added more detailed memory log to DEBUG output
- added debug output to buffer alloc function
2025-09-16 19:46:16 +02:00
Will Miles
a0321170d0 Merge pull request #4859 from Liliputech/udp_name_sync_rework
new usermod hooks "onUdpPacket"
2025-09-04 22:29:21 -04:00
netmindz
666a59ff53 Update platformio_override configuration for esp32 2025-09-02 08:06:41 +01:00
Arthur Suzuki
c8757d45c8 fix more nitpicks comments 2025-08-30 04:12:46 +02:00
Arthur Suzuki
62fad4dcdf applied coderabbit suggestions 2025-08-30 01:52:36 +02:00
Liliputech
da7f107273 fix POV Display usermod (#4427)
* POV Display usermod

this usermod adds a new effect called "POV Image".
To get it to work:
- read the README :)
- upload a bmp image to the ESP filesystem using "/edit" url.
- select "POV Image" effect.
- set the filename (ie: "/myimage.bmp") as segment name.
- rotate the segment at approximately 20 RPM.
- enjoy the show!
* improve file extension checks
* improve README, remove PNGdec reference, clean usermod
* restrain to esp32 platform + reduce memory footprint with malloc
2025-08-29 20:42:54 +02:00
Arthur Suzuki
a60be251d2 fix nitpicks from coderabbit 2025-08-28 10:56:57 +02:00
Arthur Suzuki
4b5c3a396d applied suggestions from review 2025-08-25 22:22:51 +02:00
Arthur Suzuki
550b4d9dea fix comments for usermod hooks "onUdpPacket" 2025-08-24 15:54:45 +02:00
Liliputech
f3e3f585df usermod udp_name_sync : properly initialize packet if segment name is empty
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-24 13:52:39 +02:00
netmindz
2082b01a3c Apply suggestions from code review
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-21 08:53:11 +01:00
Arthur Suzuki
4de6656bc4 new usermod hooks "onUdpPacket"
this new hooks will help you implement new and custom protocols in
usermods.
I've provided an example (see usermods/udp_name_sync).
The example will help you share the main segment name across different
WLED instances.
The segment name can be useful to sync with some effects like GIF
image or scrolling text.

If you define new packet format in your usermod, make sure it will
either not collide with already used version of wled udp packet :
- 0 is for udp sync
- 1 is for AudioReactive data
- 2 is for udp_name_sync :)

Also, the onUdpPacket will override "parseNotification" if it returns "true".
Have fun!
2025-08-21 01:00:22 +02:00
quake1508
e2800d75f7 Typo correction (#4756)
Compiling doesn't work because it doesn't find LD2410 in usermods.
The correct usermod is LD2410_v2
2025-07-03 20:00:53 +02:00
Will Tatam
9099b13f69 Fix deps for Si7021_MQTT_HA 2025-06-28 15:11:40 +01:00
Will Tatam
a2e9e2b7d1 Update buzzer to default to 21 if GPIO 32 is not defined 2025-06-28 14:45:13 +01:00
Will Tatam
5163fbf36b Merge branch 'main' into usermod-libs-matrix 2025-06-28 14:38:28 +01:00
Will Tatam
b187f9427d use extreme_partitions 2025-06-28 14:03:06 +01:00
Will Tatam
7cc5c87a52 Fixing Si7021_MQTT_HA 2025-06-28 13:59:13 +01:00
Will Miles
e97723dcc7 Use existing board envs for usermod build 2025-06-17 08:26:36 +01:00
netmindz
a6f5080a4f Update usermods/platformio_override.usermods.ini
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-06-15 09:26:22 +01:00
netmindz
d2d5c423b7 Merge pull request #4690 from Arcitec/ar-agc-control
AR: add compile-time flag for "Automatic Gain Control" option
2025-06-14 21:17:01 +01:00
Will Tatam
b0dd9690e7 Add missing ${esp32_idf_V4.lib_deps} to usermods lib_deps 2025-06-14 20:56:17 +01:00
Will Tatam
65a79d411d Fix build_flags and lib_deps for usermods# 2025-06-14 20:52:27 +01:00
Will Tatam
7835550f1a Merge branch 'main' into usermod-libs-matrix 2025-06-14 20:17:00 +01:00
Damian Schneider
00d1fcc5fb bugfixes: grouping and missing libArchive (#4718) 2025-06-09 17:41:53 +02:00
mryndzionek
fc7d4dfcb0 Added new "effect usermod"
- Added new effect - Diffusion Fire
- UM is intended as a base / tutorial (work in progress)
2025-06-08 10:52:58 +02:00
Blaž Kristan
23a51e0982 Merge pull request #4658 from wled/layers
Segment layers and better effect transitions (blending)
2025-06-01 12:28:11 +02:00
Will Miles
4a3af814bf Merge pull request #4669 from willmmiles/4597-usermods-not-building
Correct issues with usermods not being linked.
- Explicitly set libArchive: false in usermod library.json files
- Fix up symlink path generation on Windows
- Add validation script to report usermod linkage in resulting binary
2025-05-26 22:41:45 -04:00
Will Miles
e80a7c6b75 usermod_v2_HttpPullLightControl: Add usermod object
The module instance was missing.
2025-05-24 23:15:36 -04:00
Will Miles
75c95d88e2 usermods/*/setup_deps.py: Check lib_deps for deps
Check the safest possible location for final information on what
components are actually being linked in.  This demonstrates a safe
approach that works even for out-of-tree modules.
2025-05-24 22:18:22 -04:00
Arcitec
d381108dc0 AR: add compile-time flag for "Automatic Gain Control" option
Automatic Gain Control is a very important aspect of the audioreactive plugin,
and is vitally important when the external music volume constantly changes.

It makes sense to allow users to choose their preferred AGC behavior at
compile-time, since they can already set the Gain and Squelch via flags.

Adds `SR_AGC` as a flag, which defaults to 0 (off).
2025-05-14 00:40:07 +02:00
srg74
42d9a41cf5 Fixed markdownlint errors #2 2025-05-11 12:49:32 -04:00
srg74
b5a710dbe4 Fixed markdownlint errors 2025-05-11 12:19:03 -04:00
Will Miles
849d5e6667 Add libArchive to other usermods
Not all of them were removed by the reverted commit; re-do the
rest of them.
2025-05-06 22:38:33 -04:00
Will Miles
a8dd2435ec Revert "Usermods: Remove libArchive"
This reverts commit 0d44e7ec27.
2025-05-06 22:12:01 -04:00
Will Tatam
f1c88bc38d fix envs 2025-04-26 15:54:14 +01:00
Will Tatam
92db9e0e00 fix envs 2025-04-26 15:21:22 +01:00
Will Tatam
fbb7ef7cfc fix custom_usermods setting 2025-04-26 14:52:18 +01:00
Will Tatam
7852ff558e Build for each chipset 2025-04-26 14:44:48 +01:00
Will Tatam
adb9b773b0 Merge branch 'main' into usermod-libs-matrix 2025-04-26 14:28:52 +01:00
Blaž Kristan
7f2b6a3f10 More compilation fixes. 2025-04-23 18:53:22 +02:00
Blaž Kristan
0f321bfb38 Compilation fixes 2025-04-23 18:38:34 +02:00
Blaž Kristan
ee9ac947a1 Segment layering & effect blending improvements
- Photoshop-style segment/layer blending
- return of strip ABL
- remove global LED buffer in favour of segment-local buffer
- new effect blending modes/transitions
- custom palettes moved out of WS2812FX class
- increased limits (matrix size, LED RAM)
- added "rainbow"-mode colorwheel
- replaced palettes with gamma unmodified ones
- move gamma adjustment to last step before sending to LEDs
- Segment & WS2812FX class reorganisation (mutable members, reordered members, protected members)
2025-04-22 22:37:18 +02:00
Will Miles
354a0aef52 Merge remote-tracking branch 'upstream/main' into more-usermod-fixes 2025-03-29 11:12:31 -04:00
Will Miles
7db52d794b Fix incorrect json value in all usermods
Must've been a bad search-and-replace on my part somewhere..
2025-03-28 21:35:37 -04:00
Will Miles
fbbb369fa4 Update usermods/usermod_v2_rotary_encoder_ui_ALT/library.json
Fix typo in json

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-03-28 21:21:26 -04:00
Will Miles
f719ee5b18 Update usermods/usermod_v2_four_line_display_ALT/library.json
Fix incorrect json

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-03-28 21:18:27 -04:00
Will Miles
c3ab562258 Update usermods/usermod_v2_brightness_follow_sun/library.json
Fix incorrect module name in library.json

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-03-28 21:17:59 -04:00
Will Miles
62d3e155bd usermod/SN_Photoresistor: Fix invalid initializer 2025-03-28 20:15:36 -04:00
Will Miles
fab80f4e4e Fix up usermod dep checking scripts 2025-03-28 20:15:36 -04:00