* Removed memory manager from PS
- reverted all changes related to memory manager
- moved local buffer into effect data memory
- some RAM issues may occur on larger setups: tested on S3 it works fine up to 32x32 but runs into memory issues at 64x32
* fixed ifdef, improved readability, add optimize "o2" flags to improve speed
- added struct for x and y coordinates, thx to @blazoncek
* cleanup and minor improvements
- removed local buffer for ESP8266 in 1D system to save on RAM
- increased particle brightness in PS Impact
- minor tweak in collision binning (might improve speed)
- removed comments and some other unused stuff
- fixed a few compiler wranings
* fixed init sequence bug
* added Sonic Boom AR FX, some tweaks to Sonic Stream
* added white color option to Sonic Stream
* improvements to collisions (speed look-ahead)
* code prettified
* added "playful" mode to PS Chase plus some minor speed optimizations
* Adding new FX: PS Springy with many config options
Rather than reading the file off disk, have the json/cfg endpoint
return the live config from system state data. This can improve
UI behaviour as it can never be out of date or include values that
do not apply to the current firmware install.
Break the actual JSON assembly apart from the file writing code. This
permits calling it in other contexts, allowing us to pull the live
config data even if the filesystem is out of date.
Part of the ongoing quest to migrate macro definitions to typed
language constructs. This actually yields a small improvement in
code size, likely from the byte->int conversion.
* cleanup
* added collision handling back in
update from another commit that got lost
* reformat
* added latest version of functions
this somehow also got lost from an earlier commit
* Update platformio.ini
* updated particle box and firework effects
particle box now is more random in random mode (still a work in progress)
firework is now more configurable by sliders
* added preliminary functions and FX
* added particle attractor, added two new FX but still buggy
particle attractor animation does not work, somthing wrong with pointer allocation, it worked with static variables
* bugfixes, attracot now works
still unknown, why more than 256 particles are needed in memory allocation to not make it crash, but it works for now
* added angle emitter, added fireworks effect using it
* Added saturation to be set for each particle individually
at the expense of more ram usage, animations now have more options for color control (already used in fireworks now)
* bugfixes in impact animation
* added option to use fast color add, may improve performance a little
also fixed a bug in fire animation
* collision detection is now a function plus some improvements & fixes
* improved collision efficiency
improved efficiency for stackup (pushback), added code to correctly determine direction if particles meed (probably overkill but now its there)
* added fix for piling oscillations
untested, need to verify it works
* Improved collision handling (faster, less oscillations), changed variables to 32bit for faster calculation
32bit variables are faster on ESP32, so use them whenever a variable is used a lot, it saves one instruction per access.
* removed option for fastcolor add
it made very little difference in performance, but for ESP8266 it may matter so it is set permanently there. graphically the difference is also very small (sometimes a particle gets brighter or less saturated)
* Fixed some bugs in particle system, runs much smoother now
also tweaked some of the FX
* Bugfix in particle push, now piling is working again
particle pile-up did not work correctly, now fixed
* changed particle pile demo into waterfall plus some tweaks
* lots of bugfixes
* updated particle attractor animation parameters and added more user options to perlin noise
* removed TODOs
* added particle WrapUpdate function, added spray FX, some bugfixes
* fixed touch buttons for ESP32 S2 and S3
touch is implemented differently on S2 and S3, these changes make touch buttons work on S2 and S3
* some tuning for touch buttons on S2/S3
now better fits the default threshold value of 32
* updated rotating particle spray with more user options
* chaned rotating spray default parameters
* add todo
* Revert "some tuning for touch buttons on S2/S3"
This reverts commit d21ad8e7d1651a96f879d43ef1146a72a6ed8271.
* Revert "fixed touch buttons for ESP32 S2 and S3"
This reverts commit 09041551862361cd8c7444ca25403f5f96a9077b.
* removed comments, added comments
* cleanup
-removed wrap_update function, now integrated into move_update
-added more 'out of bounds' checking in fire functions, may speed it up a little
* cleanup session
-removed particle box 'rocking boat' (buggy) and replaced with random sloshing.
-removed comments
-changed some variables into 32bit for speed boost on ESP32
-added link to KB at the top of FX.cpp
* cleanup
removed / added comments
* added particle GEQ effect (untested)
* Particle GEQ fixes, it now actually works
* GEQ FX parameter tuning
* added rotating GEQ, work in progress
-animation works but sliders are too sensitive. need to adjust the ranges
* FX update
- changed firework exhaust to low saturation
- updated rotating particle spray animation
* Cleanup & Bugfixes plus major improvements for ESP8266
-added particle reductions for ESP8266 for all FX
-Removed collisions from Particle Perlin Noise FX, slows things down and does not contribute to a better effect experience
-lots of optimizations for ESP8266, all FX now work (at least on 160MHz but still slow)
-Some bugfixes
-removed unused variables to make compiler happy
* Particle FX Rename, default parameter tuning, bugfix
-Now shorter names, 'PS' in front to filter the list
-Tuned default parameters to make them look better by default
-Bugfix in particle system (removed duplicate application of velocity)
-reduced PS fire RAM usage (less particles, less base flames, no noticeable difference)
-some variable renaming
* slight speed improvements in fire, like 1-2FPS
* Big update: lots of little fixes and big speed boost on fire animation
-fixed fire burning more on the left side
-fixed crash in particle attractor
-added many improvements for ESP8266
-improved particle rendering efficiency
-efficiency improvements in general
-changed the way fire is rendered, now more than 2x faster
-re-tuned fire to new rendering, also seperately tuned it for ESP8266
-changed all random8() to random16() as it runs faster on ESPs
-some reformating
-some renaming of effect stuff
-fine tuning on falling particle effect
-improvements to collision handling (faster and better)
-added a (temporary) function for speed tests, will be removed again
* bugfix
* updated PS Fireworks with many changes and fine-tuning of parameters
-removed spiral explosions
-added more versatility to circular explosions
-removed user selectable amount of rockets
-tuned explosion size of circular explosions to match random explosions (more or less, may need improvement)
-changed order of sliders in volcano animation
* put particle system in a class. work in progress.
another huge update to the particle system.
went through the whole code, rewrote many of the functions. many improvements over the previous code. fixed many bugs (and even an ancient one in rendering function). spent many hours optimizing the code for speed and usability.
still a work in progress, debugging is ongoing. more updates to come.
* many (many!) bugfixes, added fire FX back in (and improved it a lot) added local renderbuffer for huge speed boost
-lots of bugfixes in Particle system
-added local rendering buffer (renders to buffer in heap)
-added fast and accurate color-add function
-bugfixes in render function
-added improved 'sticky' particles in collision (unfinished business)
-added ballpit animation back
-lots of tweaks to fire FX and fire rendering functions, looks even better now (still unfinished)
-added palette render option to fire
still many debug print outputs around, needs cleanup at one point
* More Bugfixes, more converted FX
* more bugfixes, some animation tuning, added volcano back in
- fixed animation transitions with proper pointer setting in each FX call
- added color by age setting to particle system
- maybe fixed collision having a tendency to go to the left
- fixed bugs in fireworks FX
- added fire spread width as a slider
- changed max number of particles and sprays based on some ram calculations
- some other random fixes
* updated fire, added some functions to PS, ported attractor FX
- added turbulance to fire (after hours of fine-tuning) it now looks even more awesome
- added attractor animation back in and improved it with more functionality
- fixed the attractor function in the PS
- renamed FX: 'candy' is now called 'vortex'
- added new force function to apply a force immediately (and handle the timing in the FX)
- added update function to PS for size update to handle dynamic segment size change
- made waterfall width dynamic on segment width
- removed some debug stuff
- added #defines for maximum number of particles/sprays
- updated fire parameter to make it look better on ESP8266
- some little bugfixes
* another huge update, many improvements, fine-tune collision, fire and some other FX
-removed classic fire render as palette now looks much better
-tweaked fire parameters to more awesome
-added (optional) turbulence to fire using perlin-noise
-ported spray FX to use PS-class
-now definitely fixed asymmetrical collision issue: do not use bitshifts on negative numbers!
-changed piling behaviour of particles, full rework. looks way more natural now and works much better
-changed bouncing behavour: they now bounce at full diameter, making them stay fully in frame when laying on the floor
-replaced all relevant bitshifts with divisions for higher accuracy throughout the PS
-added new modes to particle box FX
-changed a lot of FX parameters (finetuning)
-changed all config strings to proper settings (matrix only)
-fixed newly introduced bugs
-added speedup/slowdown to vortex FX (aka candy, aka rotating sprays)
-some renaming
-fixed bugs… lots of bugs
-merged rendering functions, removed obsolete stuff
* Fixed Speed limit
limiting speed was incorrect, leading to overflows. fixed this.
also fixed bugs in GEQ, removed some debug stuff, added FPS limit to fire (just en experiment)
* work in progress, added motion blur and line attracto (non working)
* work in progress, added test function to increase particle size, also added wobbling test
* added more tests, non compiling at the moment
* in the middle of fixing FX to use new PS functions
* debugging going on
* bugfix in wrap function and firwork FX
* added local render blurring, boosting FPS, work in progress
- changed fast-add function to use pointers
- added fast-scaling function
- added simple (but fast) 2D blurring function
test shows that local blurring of full frame is almost double the speed (40FPS now is 80FPS).
lots of comments still there
* Bugfixes, improvements and added wall roughness setting
- fixed bug in PS fuzzy noise which made it asymmetric for some reason, seems to work better now
- added particle size option to attractor but had to remove speed setting (now fixed emit speed)
- some parameter tuning of FX
- improvements to code size in render function
- added smear option to blurring (not tested much, may be buggy without smear)
- speed improvement to caldForce_dv, added zero checking.
* removed zero inits
- removed zero initialisations in FX, segment.data is set to zero by alloc function
* added individual size particle rendering plus some fixes
- advanced particles can now be rendered to individual sizes. It is computationally intensive but it works well for up to 15 very large particles and more smaller ones
- added collision handling for individual sizes (walls and collisions)
- fixed bugs in particlebox
- fixed fire not transitioning properly (flickering) when frame skip is active
- removed 'wraparound' function as it can easily be done by casting to an unsigned and then modulo
- fixed ballpit particles wandering left and right very fast if wrapX is set
* Fixed some nasty memory bugs, fixed some FX parameters
- fixed memory alignment bug in PS pointer assignment by making sure only multiples of 4 are allowed for particles and sources
- added saturation back to particle struct, as it was aligned to 10 bytes anyway.
- fixed a bug where a null pointer could be accessed
- fixed rendering out of frame particles if buffer allocation failed
- improvements on ESP8266
* Replaced Ghost Rider FX with PS version
- new FX is kept close to original animation but added more user settings
* added walls to ghostride, fixed some bugs
* added 'perpetual' flag to particles
* Fixed another memory / pointer bug, but there is still one left...
-also some minor fixes
* Found and fixed crashes, it was wrongly assigned pointers
* Added advanced particle size control and new Blob FX
- advanced size control allows for growing, shrinking, wobbling
- render function updated to support asymmetric rendering
- various code improvements and bugfixes
- some FX parameter tuning
- bugfix: removed sli() sei() calls in render function that caused random flickering on S3/C3 (may add that back in but only for ESP8266 to reduce fragmentation)
- removed some debug / test stuff
* code cleanup, removed some unused stuff
* bugfix, sprayEmit() would not return and get stuck
- forgot default return value...
* remove esp_random() as it is not supported on ESP8266
* small bugfix for ESP32, cleanup / reformatting
* added WLED_DISABLE_PARTICLESYSTEM option, fixed volcano movement
use '-D WLED_DISABLE_PARTICLESYSTEM' to disable compiling
* a line got lost in the last commit
* - added WLED_DISABLE_PARTICLESYSTEM option & cleanup & bugfixes
- cleanup / reformatting
- fixed volcano movement
- small bugfix for ESP32 (random() does not work, using random16() )
* Added PS source option to emit more than one particle, addes AR to Blobs and Spray
* added center GEQ back in, changed AR behaviour of spray a little
center GEQ is a mix between the PS equalizer and vortex, tuned for AR. some more tuning may be needed, it can probably be extended and improved a little.
* Bugfix and minor improvements
- fixed bug in center GEQ
- added '2D washing machine' mode for particle box
- improved color-change rate in ghostrider
- added AR to attractor (experimental, may remove again)
* hacked in a 1D port of the 2D PS, untested code
* fixed first bugs in 1D system, added test FX
* fixed bug in wrapping (also was wrong for 2D system)
* fixed collisions, added bouncing ball replacement (work in progress)
* replaced more FX, some tweaks to 1D PS
- changed virtual particle size from 64 to 32, making them able to move faster
- added 'rolling balls' option to bouncing balls (i.e. no gravity plus some tweaks)
- added dancing shadows with PS (work in progress)
- temporarily removed native FX: bouncing balls, rolling balls, popcorn, dancing shadows
-and of course some bugfixes
* updated dancing shadows to more closely mimic original
* added drip FX, added #ifdefs, removed some common functions
#ifdefs to individually disable 1D and 2D system.
* fixed compile issue, removed replaced FX (again)
* added Fireworks1D replacement (unfinished)
also fixed a bug in `applyForce()` using uninitialized variable.
* added sparkler and hourglass (both work in progress) tried fixing 1D collisions
* many improvements in 1D collisions (fine tuned), hour glass FX is almost done
spent A LOT of time in fine-tuning collisions for best stacking without collipsing, ringing, oscillations or particle flips. still not perfect but probably as good as it can be with the limited time-resolution
* many bugfixes in PS and FX
* minor FX adjustments
* Improved 1D collisions, added 2 new 1D FX (work in progress)
* bugfixes
* added 'color by position' as a PS setting
-made settings struct for 1D and 2D version to be different
-added setting 'color by position' as that is used by multiple FX now
* added large size rendering to 1D PS, work in progress
* bugfix (forgot to free memory)
also: made random size a permanent option in 1D fireworks as it looks kind of cool
* Added PS based Chase, fixed some bugs
* minor update
* two new FX: Starburst and 1D GEQ
* Added more advanced (and proper) size handling in collisions, work in progress
- copied and adapted some stuff from 2D system (out of bounds size rendering, dynamic collision detection distance, dynamic wall bounce distance)
* fixed some parameters in 1D FX
* added #ifndef to disable FX replaced by PS
- define DISABLE_1D_PS_REPLACEMENTS or DISABLE_2D_PS_REPLACEMENTS
* bugfixes
* default parameter change
* explicit cast to fix compile error
* Bugfixes
* added color-waves to PS chase, some parameter tuning plus bugfixes
* FX update and bugfixes
- fixed wall collisions on larger particle sizes
- update to bouncing balls:
- added size setting
- added proper updating on parameter change
- bugfixes
added support for 'colorwaves' and 'pride' to PS Chase to save on code size. currently broken...
* minor update to rolling balls, fixed stuff in Chase, pride option still not working
* update on 'pride' now working again but needs finetuning
* SEGMENT -> SEGENV on data, aux0, aux1, step
also removed debug outputs
* added pride and colorwaves to 1D replacement list
* removed unused variables
* added variable to set number of particles if not all are required (saves ram) also fixed a nasty render bug
* added preliminary 1D fire function, unfinished
* added fractal FX test, fixed bugs in emit function
* tweaked 1D fire a little, still work in progress
* minor tuning on 1D fire to avoid 'oscillation' at start
* improved 1D particle fire, much more natural now.
* updated 2D fire, fixed init bug
- source init was wrong making fire init weirdly
- changed parameters on 2D fire making it look better and improving flame height for larger setups
* fixed 'nervours' fire
* slight improvements and some cleanup
* removed douplicate code for fire emit (tradeoff for some speed), removed unfinished fractal FX
- with the duplicate code removed, the fire particle emits are a bit slower but it saves on code. it is not really noticeable, its slower by about 1FPS
* Re-license from MIT to EUPL
* Started cleanup, speed improvement to rendering, renamed class
- removed 'smar' parameter in blur functions as smear is always used
- improved particle rendering (passing by reference, passing wrap parameters for faster access)
- renamed class to ParticleSystem2D
- removed some whitespaces
- some reformating, removed some comments
- minor tweaks
- removed non-working line-attractor function
* Optimization and bugfixes
- added out of bounds checking function
- fixed rendering at boundaries
- various small changes and cleanup
- bugfixes with comparing ints of different signeness
- fixed bounce radius
* Cleanup, bugfixes, speed improvements, refactoring
- lots of code refactoring / reformating
- fixed bug in fire particle update and improved speed a bit
- refactoring of pixel rendering
- removed 2D buffers, replaced with 1D buffer for faster access
- bugfix in blur2D
- many small improvements to 2D system
* Refactoring and cleanup of 1D PS, removed debug printouts
- code reformating for consistency and readability
- replaced "'?" operator with min / max (produces the same code, more readable)
- minor changes for speed (random16 used, can later be replaced with hardware random function)
- renamed PS Equalizer to PS 2D GEQ
* Cleanup and some refactoring of particle FX
- moved 2D / length check to PS initi
- code reformating
- removed some comments
* missed a spot
* minor tweaks to fast_color_add()
* Work in progress: update to fireworks, needs more testing & finetuning
also bugs fixed and some minor cleanup
* Work in Progress: added particle memory manager for transitions
- uses only one, persistant buffer to render all present particle systems
- Buffer for particles is shared for one segment (may allow interacitng systems in the future)
- updated some of the FX to handle the new transfer, 1D FX still not done
- updated parameters for particle impact FX
* work in progress: lots of changes & fixes, transitions now work correctly in 2D
- still fragile code with lots of cleanup to do
* added transitions for big-size rendering
- transitions now work with FX that use global large size rendering. this is done by handling the buffer correctly. to avoid creating a second buffer, it is transferred back and forth to the segment. this is a bit slow but a compromise solution.
- multiple segment handling is still untested
* speed improvement to fast_color_add, added preliminary buffer transfer function
* merge fixes
* bugfix in setCurrentPalette, corrected order of 2D memory allocation, increased max particles/sources
- fixed timing for vortex
* fixed particle buffer handover, added 2D blur option, increased particle limits, various fixes
- fixed bug in memory watchdog, now works and also works when freezing segments
- fixed PS Box to work again with particle handover
- added smear blurring to waterfall
- added smear blurring to vortex, fixed color distribution, removed random color distribution option
- replaced all random() calls with hw_random()
- transitions now work but only if FX transitions are enabled and not when chaning segment size
* implemented correct 1D<->2D buffer handover+bugfixes
work in progress
* added smear to fuzzy noise, some cleanup
* added blurring option to PS 2D fireworks, work in progress in finding that nasty bug that crashes all
* BUGFIX: finally found and squased the memory bug, no more random crashes
also: removed debug outputs and minor cleanup
* minor cleanup and fixed a bug
1D system had a lot of crashes, some out of bounds memory issue. fixed it but I have no idea which change did that, maybe the order in 1D initialization
* BUGFIX: out of bounds checking was wrong, leading to crashes
* better handling of used particles in transitions
for FX that do not use all particles, transitions were constantly shifting the pointer, resulting in newly generated particles and weird particle flickering, this is not fixed by keeping the pointer constant once the number of used particles is reached.
* improved particle transition for low-count FX, updated 1D FX
now most 1D FX work again, still needs some fine-tuning
* Rework on Fireworks 1D, some minor fixes
- fireworks 1D now matches as closely as possible to the old FX
still not identical but as good as it gets.
* bugfix in PS Chase, increased brightness of 1D fireworks
* replaced sin16/cos16 with new versions
* bugfixes
* fixed hourglass init, rearranged PS FX init
* speed optimization
- moved out of bounds calculation to proper spot
- removed repeated allocation attempts if initial buffer alloc fails
* Added Sonic Stream FX, some cleanup, bugfix in emitter
* changed TTL to brightness calculation, added collision binning
- brightness is now doubled as some FX were really dim due to low TTL
- added binning in x-direction giving a huge speed advantage on larger matrix sizes
* collision binning bugfix, made particles less sticky, update to waterfall
- updated waterfall intensity and blurring
* WIP: fixed 1D system for over 1000 pixels, added collision binning for 1D
- making x coordinate 32bit allows for larger strips but uses a lot of ram due to struct memory alignment (12bytes instead of 8 bytes), this needs some more work to properly fix.
- adding collision binning significantly speeds things up, about a factor of 2 on most FX using collision
- there are still some bugs in FX or 1D memory handling (or both) on large setups
* moved particle flags to seperate array to save on RAM, refactoring
- moving the flags optimizes ram alignment, saving memory for each particle
- changed lots of parameters to `const`
- moved fire intensity to a variable instead of passing it to every render() call
- changed passing pointers to passing reference where possible
- saves a total of 340 bytes of flash
* removed todos after some checks, minor improvements
* inverted y axis in 2D render, 1D collision improvements, cleanup and fixes
- inverting the y-axis in the buffer instead of in buffer transfer fixes the FX flipping when transitiononing 1D<->2D
- improved particle binning for collisions
- added hard-pushing also when not using gravity so piles close to an edge dont collapse
- some improvments to "balance" FX
- renaming and cleanup
* FX fixes and minor tweaks
* increased min rockets
* fixed #ifdefs
* another fix
* revert unnecessary changes to base code
* merge fix
* minor tweak
* tweaked sparkler FX, some cleanup
* Fix in volcano FX, changed blurring of volcano and waterfall
* added ifdefs
* minor tweaks, increased 1D minsurfacehardness
* improved sparkler FX, made overlay possible (1D not yet), cleanup
* cleanup, now using new hsv2rgb/rgb2hsv, add overlay rendering to 1D
- new hsv2rgb is a tiny bit faster
- removed redundant code (using transferBuffer instead)
- tweked parameters in vortex, removed unneeded slider defaults
* fix for non or partially overlapping segments
- can not use overlay rendering if no segment clears the buffer, it will all add up to white eventually
- now additive transfer i.e. overlay mode is only activated if the segment is fully overlapping an underlying segment
* change got lost...
* increased sparkler intensity, some cleanup
* replaced #ifdefs, removed 1D replacements that have 2D version, removed notes
* cleanup, improvements to PS bouncing ball, replaced multicomet
- bouncing balls is now named pinball and has settings/parameters updated to be a replacement for multicomet
* cleanup, improvements, bugfixes
- large size rendering now works without framebuffer
- background adding is now done on buffer (if avilable) instead of segment
- fixed overflow bug in 2D large particle rendering (it worked only for powers of 2 size)
* potential bugfix, compiler warning fix
* removed colorwaves and pride option from chase (not worthy replacements)
* updated #defines, removed PS from 1M and 2M builds
* Adding Particle System and PS FX
Adding all 187 commits from particle system dev branch
* reverted some accidental changes
* reverted some accidental changes
* merge fixes
* changed replacement: multicomet instead of comet (lighthouse)
* changed replacement: multicomet instead of comet (lighthouse)
* disable 2D PS for ESP8266, some cleanup, improved pinball FX parameters, bugfixes
* Improved collision binning for large particles, improved pinball FX
* improved speed handling in pinball FX - rolling
* disable 2D PS for ESP8266, some cleanup, improved pinball FX parameters, bugfixes
* improved hourglass: millis instead of frame timing, better stacking. and cleanup.
* revert whitespaces
* simplified 1D collisions, improved binning for larger particles
- ran a lot of experiments with collisions in 1D, the new much simpler approach seems to be a good compromise with regards to stacking and normal collisions.
* Improved collision binning for large particles, improved pinball FX
* improved speed handling in pinball FX - rolling
* improved hourglass: millis instead of frame timing, better stacking. and cleanup.
* revert whitespaces
* prohibit use of 1D and 2D system simultaneously on ESP8266
* prohibit use of 1D and 2D system simultaneously on ESP8266
* update to handle blending styles
* fixed bugs, improved new transition handling
* updated 1D system to work with new transitions, replaced NULL with nullptr
* merge fixes
* added single pixel particle rendering for 2D system, adjusted FX to work with it
* improved collisions in 1D and 2D, some bugfixes in radius calculation, minor tweaks
- collisions are now also velocity based in 1D, there was a bug that prevented that from working well (wrong collision distance calculation)
- improvement and bugfix in 2D collision distance calculation
- added distance based pushing in 2D (instead of only using the dotproduct)
the combination of improved distance calculation and proper pushing make collisions a lot better in all tested FX
* minor fix
* fixed overlay detection, checking for partial overlay
if a PS FX is partially overlapping, it will render in overlay mode
* better blur range in PS Firworks
* minor code consolidation
* updated 1D collisions (yet again), improved 2D collision speed
- slight improvement to 2D collision code efficiency
- added faster "division" to C3/ESP8266 by using a right shift trick (biasing towards 0 also for negative numbers by applying proper rounding)
* minor tweak in PS balance
* fix for #4153
* only load touch/mouse events for touch/mouse devices
* undid formating changes
* undid more formating changes
* undid all formating changes
* use pointerover and pointerout eventlisteners
- moved local variables into function
- made coordinates an array
- amplitude can now be changed by user (default setting is a slight increase to original which cannot be avoided without complicated logic or default slider setting)
- fixed issue: blending was also done when color was on a key-index-color which is now skipped
- speed improvement: conversion is skipped if color is key-color
This mod includes a header from the Adafruit Unified Sensor library
inherited by its target sensor libraries. This isn't reliably
picked up by PlatformIO's dependency finder. Add an explicit dep to
ensure build stability.
Use a custom setup script to check for the dependencies and pass along
the required compile flags to the module; also split the object
definitions for the target modules from their source so as to allow
#including them.
Enable the new concurrent request and queue size limit features
of AsyncWebServer. This should improve the handling of burst
traffic or many clients, and significantly reduce the likelihood
of OOM crashes due to HTTP requests.
* added bitwise operation based sqrt16
- replacement for fastled, it is about 10% slower for numbers smaller 128 but faster for larger numbers. speed difference is irrelevant to WLED but it saves some flash.
* updated to 32bit, improved for typical WLED use
- making it 32bits allows for larger numbers
- added another initial condition check for medium sized numbers
- increased the "small number" optimization to larger numbers: the function is currently only used to calculate sqrt(x^2+y^2) which even for small segments is larger than the initially used 64, so optimizing for 1024 makes more sense, although the value is arbitrarily chosen
- Implement vector in bus manager
- Memory calculation according to explanation from @Makuna
- Prefer 8 RMT before 8 I2S on ESP32 (fixes#4380)
- speed improvements in ABL
- verbose debugging
- get bus size from NPB (prototype)
- Parallel I2S output bugfix
- automatic selection of appropriate I2S bus (`X1xxxxxxMethod`)
- removed I2S0 on ESP32 (used by AudioReactive)
- renumbered internal bus numbers (iType)
- added buffer size reporting
* removed unneeded initializations in blur() and blur2D()
* remove check for _t in progress()
* code readability: if (_t) --> if(isInTransition())
* add `isInTransition()` checks to currentBri() and currentMode()
* added missing `_transitionprogress = 0xFFFFU` in stopTransition()
This is purely a "clean code" thing, no impact on function - it helps to avoid confusion when reading the code.
C++ allows declaration and implementation to use different variable names.
* changed some parameters to "pointer to const", so compiler can better optimize code size and performance - because data behind a const pointer will never be modified by the called function.
* made setPixelColor `const`
* fixed a few potentially uninitialized local vars (the may have random values if not initialized)
* avoid shadowing "state" in handleSerial()
* plus a few very minor improvements
* make XY() and _setPixelColorXY_raw() const (minor speedup)
* segment is a struct not a class: friend class Segment --> friend struct Segment
* fix missing braces around two macros
* use non-throwing "new" where possible
* improve robustness of transition code
This fixes a crash in the dmx receiver. The dmx receiver cannot work while cache is disabled. For some reason activating wifi disables the cache. In theory, the driver is placed in iram and should work, but it doesn't. This might be a bug in the driver.
Monkey-patch PlatformIO to intercept the build process after library
dependencies are loaded, but before the build is fully analyzed. This
lets us enforce libArchive=False for usermods without making that
setting global across all libraries.
The rest of the fixup code is integrated at the same call site for
simplicity.
Redesign the usermod system so that usermods are implemented as
PlatformIO libraries instead of headers. This permits them to call for
dependencies, and eliminates the compiler flags for enabling each one,
allowing the build cache to behave better.
The usermod list is built using some linker magic to construct a static
list in ROM memory. This eliminates the need for wasting SRAM on
something fixed at build time.
* DeepSleep Usermod
- sleep delay is now 1 by default, disabling sleep at powerup
- renamed bootup variable to powerup
- using delay counter for proper bootup
- changed power-up and bootup logic
- added fallback to always power-on at boot except at powerup
- fixed bug in settings page
same issue as with https://github.com/Aircoookie/WLED/pull/4386
waiting on bus to finish updating before file access fixes the glitches.
this issue is only present on S2 and C3, not on ESP8266 or dual-core ESPs, the fix is only applied for these two.
Both ESP8266 and ESP32 have a hardware random register. This update makes use of that. It is slightly faster than the fastled variants but mostly it is truly random, even when the timing limitations stated in the datasheet are disregarded. Also saves a bit on code size.
- Replaced all random8() and random16() calls with new hw_random() versions
- Not replaced in FX where PRNG is required
Improvements & merges of FX
- Scrolling Text: Gradient Palette support added
- Waving Cell: Improved with higher temporal resolution (smoother at lower speeds) and added additional mode setting and optional blurring
- Julia: added blur option
- Squared Swirl: added fade option
- Added smearing option to:
- DNA
- DNA Spiral
- Drift
- Drift Rose
- Crazy Bees
- Ripple
- Colored Bursts
- Frizzles
- Lissajous
- Sindots
- Spaceships
- Added palette support to:
- Crazy Bees
- Polar Lights
- Drift Rose
- Changed default palette handling (no more special treatment for some FX)
- Merged puddles and puddlepeak
- Merged Gravcenter, Gravcentric, Gravfreq and Gravimeter (saves 1.2k of flash)
- Merged meteor and meteor smooth
- Renamed police_base into mode_two_dots as that was just an alias
- Added 'Traffic Light' palette (originally defined in Polar Lights FX)
- Firenoise: removed local palette, use fire palette -> slight change in looks (+bugfix)
- Some code cleanup (removed unused / commented stuff)
- Moved dev info for AR to the top so ist easier to find as a reference, also added link to KB there
Removing the bool saves on code size and makes the function a tiny bit faster. Also this is a cleaner solution IMHO.
-updated blend function to optimized 8bit calculation
- efficient color blend calculation in fews operations possible
- omitting min / max checks makes it faster on average
- using 8bit for "blend" variable does not significantly influence the resulting color, just transition points are slightly shifted but yield very good results (and better than the original 16bit version using the old fastled math with improper rounding)
- updated drawCircle and drawLine to use 8bit directly instead of 16bit with a shift
to ensure that build_unflags and board_build.partitions are always having a useful default value. Values can be overridden in custom buildenvs.
saves us a few lines lin platformio_override.sample.ini.
this one is actually for https://github.com/srg74/WLED-ESP32-pico
Its a simple example how to configure WLED for a custom board with build-in microphone and special purpose pins.
progress() is called in setPixelColor(), calculating the transition progress for each pixel. Replaced that call with an inline function to get the new segment variable.
The progress is updated in service() when handleTransition() is called.
The new variable is in a spot where padding is added, so this should not use more RAM.
Result: over 10% increase in FPS on 16x16 matrix
* removed IRAM_ATTR: `updateTransitionProgress()` is called only once per frame, no need to put it in RAM.
* changed transitionprogress to static, private variable, this is now more aligned with other variables using the same logic
* added inline: the function is only used in one place
Processing of received button command is no longer processed in the callback, instead the value is saved to a variable and processed in the main loop.
The actual fix is to not access the file system while data is being sent out: even just trying to open a non-existing file causes glitches on the C3. Waiting for the bus to finish fixes this BUT it causes a frame-delay which is the lesser evil than random color flashes.
- previous fix worked but there was still an overflow after some time passed. there were still missing roll-overs apparently: reverting these two variables back to 16bit/8bit should fix it for good.
When adding a new bus, the numeric current limit field was not being
initialized; this was causing it to save 0 when saved instead of the
default 55mA value.
- sin/cos calls with incrementing numbers can lead to bad outcomes, the functions (_approx or original sinf/cosf) return bad values for very large float inputs
- code is a bit cleaner and faster as well
- chaning array access to pointer access in bus_manager makes it a few instructions faster
- changed getNumberOfPins and getNumberOfChannels to return 32bit values, saving the unnecessary 8bit conversion
NeoPixelBus requires that all parallel I2S bus members be constructed
before any of them call Begin(). Implement this by deferring the
call to the end of bus construction.
Fixes#4301.
- all palettes are defined in palettes.h
- access to fastled palettes as an array to remove the switch cases
- palette createn in json.cpp in a loop instead of repeaded calls to save flash
- rotation scale is now exactly 180° (divide slider input by 255 instead of 256)
- removed shift offset: offset is now zero at slider 0, to hit 128 on touch input devices is really hard
- added a 90° shift to input rotation, enabling to rotate from 0 to 180° instead of +90 to -90 (which is not useful in 1D)
- changed default settings values to more closely match the old 1D effect
Fixed point calculation for improved accuracy, dithering in debug builds only.
Averaging and optional multiplier can be set as compile flags, example for speed testing with long averaging and a 10x multiplier:
-D FPS_CALC_AVG=200
-D FPS_MULTIPLIER=10
The calculation resolution is limited (9.7bit fixed point) so values larger than 200 can hit resolution limit and get stuck before reaching the final value.
If WLED_DEBUG is defined, dithering is added to the returned value so sub-frame accuracy is possible in post-processingwithout enabling the multiplier.
* keep FRAMETIME_FIXED as a fixed value
* remove WLED_FPS_SLOW and FRAMETIME_FIXED_SLOW
* explicit test "(_targetFps != FPS_UNLIMITED)" for debug messages
* don't modify _lastServiceShow in show()
* test for "fps == FPS_UNLIMITED" explicitly, so we could pick a different
magic number later
* separate fps calculation (strip.show) from framerate control (strio.service)
* improved condition for early exit in strip.show
* make MIN_SHOW_DELAY depend on target fps
* strip.show consideres complete time for effect calculation + show; old code wrongly used the time between completion of last show and start of next effect drawing, causing unexpected slowdown
* add "unlimited FPS mode" for testing
* increase warning limits for "slow strip" and "slow effects"
- increase WLED_MAX_BUSSES for C3 (fixes#4215)
- fix for #4228
- fix for very long running effect (strip.now, strip.timebase)
- C++ API change to allow `seg.setColor().setOpacity()`
Fix for LED and Scenes uncontrollable using Alexa.
Weird behavior regarding to the device names and shared scenes fixed with this.
Seen in issue Aircoookie/Espalexa#228 and fixed from @ams-hh
Tested by myself and works just fine. Created second pull request here because the library seems to be a bit different from the official Espalexa repo.
---------
Co-authored-by: Frank <91616163+softhack007@users.noreply.github.com>
Co-authored-by: Blaz Kristan <blaz@kristan-sp.si>
This is a platform feature that asks forgiveness for PROGMEM misuse:
it adds a handler such that incorrectly used PROGMEM will work without
crashing, just really, *really* inefficiently.
Given that most of our real-world use cases for PROGMEM strings are
relatively infrequent text calls, we can err on the side of developer
convenience and address performance problems if and when they arise.
-replaced all PI references with M_PI version
-there is no need to do the angle-modulo in float, casting it to an integer does the same BUT it has to be cast to an `int` first, see comment.
* fixed the positioning of the download button
* fixed space after "Download the latest binary:" disapering after building
* fixed typo
---------
Co-authored-by: maxi4329 <maxi4329>
- `sin16_t() / cos16_t()` are faster and more accurate than fastled versions
- `sin_approx() / cos_approx()` are float wrappers for `sin16_t() / cos16_t()` and are accurate enough to replace `sinf()/cosf()`
- `atan2()` is used only in octopus to calculate center offset, new approximated version saves flash
- `tan(), atan(), asin(), acos(), floor(), fmod()` are used only for sunrise/sunset calculation, using wled_math version saves flash
- `beatsinx()` replacements are to make use of new `sin16_t()/sin8_t()` functions to reduce flash size
- Extensively tested surnise/sunset calculation: deviation is 1min. max
- Tested some of the relevant FX and found no visual difference: Julia, 2D Drift, Drift Rose, Ghost rider, Rotozoomer, Palette, Arc 1D expansion
- total flash savings: 7.4k
- changes to `setPixelColorXY` give an extra FPS, some checks and the loops are only done when needed, additional function call is still faster (force inlining it gives negligible speed boost but eats more flash)
- commented out the unused `boxBlur` function
- code size improvemnts (also faster) in `moveX()` and `moveY()` by only copying whats required and avoiding code duplications
- consolidated the `blur()` functions by enabling asymmetrical blur2D() to replace `blurRow` and `blurCol`
- compiler warning fixes (explicit unsigned casts)
- removing WS2812FX::setMode()
- removing WS2812FX::setColor()
- removing floating point in transition
- color handling modification in set.cpp
- replaced uint8_t with unsigned in function parameters
- inlined WS2812FX::isUpdating()
- (MAY BE BREAKING) alexa & smartnest update
* adding missing flash size flags that were lost between 0.14 and 0.15
(necessary if you don't flash using esptool)
* adding env:esp32dev_16M for 16MB flash (serg74 esp32-16M, twilightlord esp32 16M)
- Added pre-calculation for segment brightness: stored in _segBri. The impact on FPS is not huge but measurable (~1-2FPS in my test conditions)
- Removed `bool unScaled` from `setPixelColor()` function again (it has no/minimal impact on speed but huge impact on flash usage: +850 bytes)
- Removed negative checking in `setPixelColorXY()` and replaced it with a local typecast to unsigned, saves a few instructions (tested and working)
- Changed int8_t to int in `moveX()` and `moveY()`
- Removed a few functions from IRAM as they are now not called for every pixel but only once per segment update
- Removed a `virtualWidth()` call from `ripple_base()`
- Bugfix in `mode_colortwinkle()`
Use the phase-locked soft PWM from the Arduino core to implement the
same PWM phase management as ESP32s are using. The soft PWM code is
vendored in, as it was previously, to add the NMI workaround from #4035.
Completes #4034
uint16_t to unsigned to make it consisten throughout the hand-down.
colorFromPaletteWLED now returns uint32_t which saves the conversion to CRGB and back to uint32_t (in most uses at least).
also added (preliminary) CRGBW struct. I tried to use it in place of uint32_t colors but it adds a lot of overhead when passing the struct so reverted to uint32_t in most places.
updated a few FX to use the CRGBW struct and also cleaned some code to improve flash useage.
- also added a struct to handle HSV with 16bit hue better (including some conversions, can be extended easily)
- the functions are optimized for speed and flash use. They are faster and more accurate than what fastled offers (and use much less flash).
- replaced colorHStoRGB() with a call to the new hsv2rgb() function, saving even more flash (new function is untested!)
- the 16bit hue calculations result in an almost perfect conversion from RGB to HSV and back, the maximum error was 1/255 in the cases I tested.
- blurring now uses desaturated adding: it is faster most of the times and blurring adds scaled colors so should rarely (ever?) saturate, I saw no visual difference in tests.
- formatting
Remove the large stack buffer as we're just going to copy it in to a
heap buffer anyways. Later we can refine the length estimation or use a
rope-style dynamic data structure like DynamicBufferList.
- optimized color_add() again: now it is as fast with preserved ratio scaling than the "fast" variant was before (if no scaling is needed, it is even faster). plus it saves 250 bytes of flash
- bugfix in `color_fade()`
- removed a lot of whitespaces
- gamma correction only where needed
- paletteIndex should be uint8_t (it is only used as that)
note: integrating the new `ColorFromPaletteWLED()` into this would require a whole lot of code rewrite and would result in more color conversions from 32bit to CRGB. It would be really useful only if CRGB is replaced with native 32bit colors.
- there already is a method to calculate the table on the fly, there is no need to store it in flash, it can just be calculated at bootup (or cfg change)
inlining getMappedPixelIndex gets rid of function entry instructions (hopefully) so it should be faster.
also added the 'multi color math' trick to color_add function (it will not make much difference but code shrinks by a few bytes)
uses less flash so it should be faster (did not notice any FPS difference though)
also cleaned code in ColorFromPaletteWLED (it is not faster, same amount of code)
This change ensures that the dates are displayed on their own lines.
Without the blank lines, many Markdown renderers will append the dates
to the previous bullet point.
- Renamed LEDPIN to DEFAULT_LED_PIN.
- Removed ability to override DEFAULT_LED_PIN, DEFAULT_LED_TYPE and DEFAULT_LED_COUNT. Use DATA_PINS, LED_TYPES and PIXEL_COUNTS instead.
* only reject invalid ranges when array access will be actually performed
* fixed another stupid pointer arithmetic error
Hint: I AM NOT THE MAINTAINER of this usermod. I'm just fixing an obvious coding error without knowing what the usermod really does.
some users have reported that releases after 0.14.0 are not working reliably. So we add a few "compat" for 8266 that try to reproduce the buildenv of 0.14.0 as much as possible.
* platform and platform_packages from 0.14.0
* not using PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48
* due to smaller IRAM, we had to move some functions back from IRAM to normal flash (may cause slowdown)
some users have reported that releases after 0.14.0 are not working reliably. So we add a few "compat" for 8266 that try to reproduce the buildenv of 0.14.0 as much as possible.
* platform and platform_packages from 0.14.0
* not using PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48
* due to smaller IRAM, we had to move some functions back from IRAM to normal flash (may cause slowdown)
* added #include <Arduino.h> - this is basically what the preprocessing tool (wled.ino -> wled00.ino.cpp) does
* added a comment that Arduino IDE is not supported, use platformIO.
Setup is really easy, after first boot and WiFi/LEDs setup:
go to wled.local/edit and upload a couple image to WLed's filesystem.
Only PNG is supported right now, further support for GIF is planned.
The image should be as wide as the 1D segment you want to apply to.
When done, go to the Effect page on the UI, select "POV Image" effect.
You could also update the image with a post to the JSON-API like this:
curl -X POST http://[wled]/json/state -d '{"seg":{"id":0,"fx":114,"f":"/axel.png"}}'
The segment should move at around 120RPM (that's 2revolutions per seconds) for an image to showup.
More informations and pictures here : https://lumina.toys
* speedup: add functions to only blur rows or columns (50% faster)
* fire2012: tinkering with bur options. Vertical blur only when slider < 64 (faster); extra blur for slider values >192 (bush burn)
On ESP8266, it isn't permissible to call delay() in system context;
ensure this is legal before waiting.
On ESP32, use an operating system mutex to ensure consistent variable
state in a multicore environment, and manage the wait without needing
to loop.
before a x=32 (n times of 16) had not equal sized bars, but first was
a single pixel and later a bar had 3 pixel width. This solves it to
have always 2 pixel sized bars.
I have to admit that I did not test with other pixel dimensions.
boot-up delay to fix wifi not starting in some setups
use
`-D WLED_BOOTUPDELAY=500` (or some other delay you want, in milliseconds)
in platformio env definition to add 500ms of delay before hardware init.
* fixed a few typo's in comments
* fixed 8266 specific warning about 'comparison of integer expressions of different signedness'
based on recommendations made by @willmmiles:
* make sure that audioSyncPacket is the same size (44bytes) on all platforms
* use static buffer for receiving (avoids heap fragmentation)
* copy receive buffer to local audioSyncPacket struct - avoids alignment problems
* esp32 only: to stay in sync with UDP, Udp.flush() is needed when Udp.parsePacket() is _not_ followed by Udp.read()
Simplified the code by removing an unnecessary function definition and instead using direct assignment in the place where the function was previously called.
Vendor in the ESP8266 Arduino core PWM library, with a fix for a nasty
NMI crash bug. Sometimes the NMI return instruction seems to fail,
resulting in an infinite loop as the PC gets stuck. Work around this
by backing up and restoring the PC if needed.
# Added high temperature indicator/action...
- A configurable preset is activated when the internal temperature raises above a configurable threshold temperature.
- When the internal temperature falls back below the threshold, the previously active preset is re-activated.
- To prevent frequent toggling between states when the temperature is close to the threshold, the reset threshold is slightly lower than the activation threshold to provide a small buffer.
- Reset threshold is automatically calculated to be two degrees lower than whatever the activation threshold is set to.
- To prevent the user setting the loop interval too low, a minimum allowable interval has been added.
- edit WiFi TX power (ESP32)
- keep current ledmap ID in UI
- limit outputs in UI based on length
- wifi.ap addition to JSON Info
- relay pin init bugfix
- file editor button in UI
- update NeoPixelBus to v2.8.0
- use single/mono I2S + 4x RMT for 5 outputs or less
- use parallel x8 I2S + 8x RMT for >5 outputs (limit of 300 LEDs per output)
- replace uint8_t and uint16_t with unsigned
- replace in8_t and int16_t with int
- reduces code by 1kB
- WARNING may break effects that rely on overflow/narrow width (most fixed)
* setPixelColor: ensure that 0/0 is used
* getPixelColor: accuracy improvements
unfortunately, "scrolling" audioreactive effects are still not working properly - they end after 1/4 of the circle. Could be due to limited resolution of getPixelColor.
fixing holes that appeared during testing
* at 52x52 (big 296 -> 304)
* at 24x32 (medium 192 -> 208)
* at 12x16 (small 72 -> 82)
... there is still one hole at 14x16 ... well wtf
- increased outputs to 17
- increased max possible color order overrides
- use WLED_USE_PARALLEL_I2S during compile
WARNING: Do not set up more than 256 LEDs per output when using parallel I2S with NeoPixelBus less than 2.9.0
The BME280 usermod uses a multiply-round-divide approach to cap the temperature/humidity/pressure values to some number of decimals. But the divide-part was missing in a few instances.
Issue:
When taking the initial voltage reading after first powering on, voltage hasn't had chance to stabilize so the reading can be inaccurate, which in turn may incorrectly trigger the low-power preset. (Manifests when the user has selected a low read interval and/or is using a capacitor).
Resolution:
A non-blocking, fixed 10 second delay has been added to the initial voltage reading to give the voltage time to stabilize.
This is a reworked version of the (now closed) PR here:
https://github.com/Aircoookie/WLED/pull/3959
- Rebased the update for 0_15.
- Added a constant so the delay can be modified via my_config.h.
- Small adjustments to make the PR compatible again after the recent restructuring in this PR: (https://github.com/Aircoookie/WLED/pull/3003).
Thankyou!
Script update based on latest version from Tasmota
* add support for all esp32 variants
* add "-C" : Decode (demangle) low-level symbol names into user-level C++ names.
The build script was not looking into the right place, so there was never a .map file dropped into build_output/map/
Builds with the newer arduino-esp32 v2.0.x framework actually generate a .map file that is placed directly next to firmware.bin
* trying to make the caching mechanism bulletproof.
`cacheInvalidate` is changed when
- autosave usermod updates presets
- a file was upload
* (coding style) fixed some unitialized variables
- several compile warning fixes
- multipin LED compile config
- release info (update page, JSON "info")
- WiFi scan fix if no networks found
- UI glitch when no presets are found fix
With multipin LED config it is now possible to assign GPIO to PWM RGB outputs.
Achieved by having length of DATA_PINS be divisble by lengt of PIXEL_COUNTS.
-changes save roughly 600bytes of flash
-made blurring faster by not writing the color and then reading it back but keeping it as a variable: on a C3, FX black hole goes from 55FPS to 71FPS
-added optional parameter to blur (smear) that can be used in combination with SEGMENT.clear(), blurring the frame without dimming the current frame (repeated calls without clearing will result in white). this is useful to blur without 'motion blurring' being added
-scale8 is inlined and repeated calls uses flash, plus it is slower than native 32bit, so I added 'color_scale' function which is native 32bit and scales 32bit colors (RGBW).
- transitions always enabled (use delay 0 to disable)
- optimisation in on/off fade
- fix for palette/color blend when blending style is not fade
- various tweaks and optimisations
Fix use-after-free issue and slightly improve code size. Note that the
version is changed to a hard pin, so future updates can be validated
before getting picked up by new clones, and old version builds
are reproducible.
By explicitly listing an unversioned framework dependency in
'platform_packages', we were overriding the selection via the 'platform'
specification, allowing PlatformIO to select any random version.
Remove this line to allow 'platform' to add the framework dependency
with the expected version.
use latest platformIO package, to avoid build errors due to missing 'scons'
> Tool Manager: Installing platformio/tool-scons @ ~4.40400.0
> Error: Could not find the package with 'platformio/tool-scons @ ~4.40400.0' requirements for your system 'linux_x86_64'
> Error: Process completed with exit code 1.
If the source never sends the push flag, WLED buffers the update but
never publishes it to the LEDs. This causes the confusing case where
the peek display shows one thing but the LEDs themselves something else.
Add a static flag that tracks if we've seen a push from the source;
until we do, apply every update as soon as it's received, per the DDP
specification.
There were three problems here:
- AsyncWebServer is going to copy to a heap buffer anyways, so we might
as well just pass it one it can use
- The buffer size estimate was wrong -- we need 9 bytes per pixel
("RRGGBB",), so the buffer could overflow, and it was not
considering the extra 2D requirements
- On ESP8266, the stack allocation was overflowing the stack, causing
corruption and crashes.
-added minimum threshold, had some crashes when setting threshold to zero before
-moved interrupt detach to GPIO deallocation where it belongs
-added check for touchbutton before detaching interrupt
-moved thochThreshold readout up so it gets updated before passing it to the system call
Release the json buffer lock as soon as we've finished serializing.
This should slightly reduce the number of lock collisions as the
response class isn't destructed until after the last packet is ack'd.
Release the json buffer lock as soon as we've finished serializing.
This should slightly reduce the number of lock collisions as the
response class isn't destructed until after the last packet is ack'd.
-added fully random palette function ('the old way', currently just used for initialization)
-changed randomness values to make it a little less random
-added 10% chance for pastel color palette
-now using swap() from std library for shuffeling
-changed function name
-moved update check from loadPalette() to handleRandomPalette() saving CPU cycles
There is a version of the Olimex ESP32-POE board with an ESP32-WROVER
module which has a the ethernet clock connected to a different IO than
the version with an ESP32-WROOM module.
This commit adds a new runtime selectable variant for the WROVER version.
Due to the midi interface being difficult/impossible to increment on
values of 1 because it has 7-bits of granularity, this commit moves all
the bitfields for configuring segment options left by one which
guarantees that every option has 2 values next to each other.
This allows midi controllers to more easily select an individual segment
option for 2D arrays.
Before this commit it was only possible to control mirror and reverse on
a 1d segment. All of the other options for 2d effects could not be set
and thus they would be kept disabled.
This commit replaces the Effect Option dmx channel with a bitfield which
allows for each segment option to be individually toggled depending on
which bit is set in the field. Backwards compatibility has been
maintained with existing 1d segment options.
Upgrade the MPU6050 usermod to provide configuration settings for
interrupt pin selection and calibration, a polled mode, and data
output for consumption by other usermods.
The MPU6050 library happens to choose the same defines as WLED, which
collide and result in nothing printing. Un- and re-define the macros
to work around this.
Add JSONBufferGuard, an RAII lock guard class for JSONBufferLock
analogous to std::lock_guard. This permits binding the guard to a scope,
such as an object life cycle or function body, guaranteeing that the
lock will be released when the scope exits.
Allows for "pixel perfect" liveview instead of diffused view, to better match what's shown at https://kno.wled.ge/features/effects/. This will make it easier to see what the LEDs are doing, although it may not be as accurate a representation for installations with diffused LEDs. Includes fallback to CSS gradient method for browsers that don't support canvas.
sunset = 0 is a valid result, as the function result is in UTC and not local time .
Example: local time is UTC-8, local sunrise = 08:00am => getSunriseUTC() = 0.
So we cannot use "0" for "invalid". Using UINT16_MAX resolves the problem, and even allows to simplify calculateSunriseAndSunset() a bit.
According to the technical manual, GPIO 16 + 17 are used for onboard flash, so cannot be used by WLED.
example buildenv:
[env:esp32_pico]
extends = env:esp32dev_qio80
board = pico32
I've found a code spellchecker, so this is what can be corrected easily. Changes are only affecting comments, readme and a few user-visible strings. So no functional impact expected.
* purge old (not yet processes) NTP responses
* validate server responses before updating WLED time
* purge receive buffer when package is rejected (avoids mem leak on esp32)
By setting the response header "Cache-Control" to "no-store" and setting "Expires" to 0, we make sure the browsers and place calling this never store it in cache.
- CSS adjustments
- Removal of some html
- Correction of CORS error when using the file locally, it was unable to generate the images that are saved in WLED
- Among others that I don't remember now
- Correction in animation generation that was actually breaking
- Button to return to WLED if pxmagic.htm is accessed via url (http://), if accessed via external (file://) the button will not show
- Adjustments to CSS and some features
Since PXM will not open internally but on another page from the button, I decided to add the logo again if it's not a problem of course.. Just so I don't run out of information
commit 1dab26bcbcac051f2b7be47a2d5c757a9938bf1f
Author: Christian Schwinne <dev.aircoookie@gmail.com>
Date: Thu Oct 19 13:29:46 2023 +0200
Update Discord invite links to point to guidelines channel
I added the possibility of using the tooltip on buttons (.btn) with the span inside the button;
Adjusted the tooltip css to center 100% in the middle
Some cleaning and correction of sele
Having the wrong pin would result in a server error (500). The more appropriate error code for that would be 401.
This also changes the page that asks for users to login from 200 to 401.
audioSyncPacket contains four "invisible" padding bytes added by the compiler. These need to be initialized to zero, as future versions of the protocol will make use of these fields.
Topic 1, 2
I made the change, took it off the website and put it in the Preset section under the +Preset, +Playlist buttons, it was in a good location.
Topic 3, 4
It reloads because it needs the updated information so that it can create the preset correctly with all the information generated from the selected image.
Topic 5
The change has already been made, it just hasn't gone up yet, it's default upload
Topic 6, 7
Fixed
Many bad quality analog mics are not centered properly at 1.6V, but stuck at 0V or stuck at 3.3V in silence. The bandpass filter removes DC offsets and improve signal quality.
* debug messages added to different initializers
* SPH0654::initialize() was having a wrong signature: uint8 instead of int8.
C++ can be a real bastard ;-)
* improves robustness of the Matrix effect, by dynamically adjusting the "reference color" used to identify "falling code" head pixels.
* a bit faster, as I've removed the need to scan all pixels a second time for "black screen" detection.
Its still not perfect, and the main loop could be simplified a lot by leveraging on the fact that all changes actually happen in the top row, and "falling" is actually just moving everything down by one pixel.
Update ES8388Source::initialize and ES7243::initialize method signatures to match I2SSource::initialize so that when initialize is called on a AudioSource pointer the child class's method is used.
Remove sync receive
Disallow 2D effects on non-2D segments
Optimisations
Sync clarification
AR palettes
Return of 2 audio simulations
Bugfix in sync #3344
- remove excessive segments
- ignore inactive segments if not syncing bounds
- send UDP/WS on segment change
- pop_back() when removing last segment
Add pairing support for ESP-NOW sync
Reduce string RAM footprint
UDP parse optimisation
Make WizMote work with sync.
ESP-NOW wireless sync POC.
- caveat: devices have to be on the same channel
- clashes with WizMote handling ATM
To make it better readable and prevent copy&paste errors, all needed flags can be referenced from the "esp32" buildenv:
${esp32.AR_build_flags}
${esp32.AR_lib_deps}
* remove "not supported" warning on -S2
* minor tweaking of beat detector
* optimized parameters for arduinoFFT
* fixed a few implicit "double" promotions
* minor UDP protocol optimizations
* small optimization for fft task create / suspend
* completely remove analogmic settings for -S3/-S2/-C3 where analog is not supported
changes were already tested extensively in the MM fork.
this is a band-aid fix for random crashes when switching between presets with multiple segments - crossfade disabled.
!! adding type initializers fixed it for me on -S3, however I still see (less frequent) crashes on esp32, due to heap corruption.
It took me hours to get a meaningful stackdump:
assert failed: heap_caps_free heap_caps.c:360 (heap != NULL && "free() target pointer is outside heap areas")
Backtrace: 0x40084ee1:0x3ffb2570 0x4008e341:0x3ffb2590 0x40094709:0x3ffb25b0 0x4008534a:0x3ffb26e0 0x40094739:0x3ffb2700 0x400e9037:0x3ffb2720 0x400e917c:0x3ffb2740 0x400eaeeb:0x3ffb2760 0x40117ec5:0x3ffb27c0 0x401184ea:0x3ffb2800 0x4013509d:0x3ffb2820
#0 0x40084ee1:0x3ffb2570 in panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:402
#1 0x4008e341:0x3ffb2590 in esp_system_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/esp_system.c:128
#2 0x40094709:0x3ffb25b0 in __assert_func at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/assert.c:85
#3 0x4008534a:0x3ffb26e0 in heap_caps_free at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/heap/heap_caps.c:360
(inlined by) heap_caps_free at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/heap/heap_caps.c:345
#4 0x40094739:0x3ffb2700 in free at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/heap.c:39
#5 0x400e9037:0x3ffb2720 in Segment::deallocateData() at wled00/FX_fcn.cpp:189
#6 0x400e917c:0x3ffb2740 in Segment::resetIfRequired() at wled00/FX_fcn.cpp:206
(inlined by) Segment::resetIfRequired() at wled00/FX_fcn.cpp:203
#7 0x400eaeeb:0x3ffb2760 in WS2812FX::service() at wled00/FX_fcn.cpp:1216 (discriminator 2)
#8 0x40117ec5:0x3ffb27c0 in WLED::loop() at wled00/wled.cpp:115 (discriminator 3)
#9 0x401184ea:0x3ffb2800 in loop() at C:/src/wled00/wled00.ino:20
#10 0x4013509d:0x3ffb2820 in loopTask(void*) at C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50
ELF file SHA256: 18c20b536f4c6ef4
commit 84148ad07a7ac94993dc9dfd0bdc6d7a8d9e47ac
Author: Blaz Kristan <blaz@kristan-sp.si>
Date: Sun Sep 3 12:34:17 2023 +0200
Implement palette colors
commit af3c8f66f7e77dd6306ceadf2cea26a41336e439
Author: Blaz Kristan <blaz@kristan-sp.si>
Date: Tue Aug 1 18:18:41 2023 +0200
revert wled00.ino
commit 3097a1b17efa06b78d52611b3a9d3c519a15ed17
Author: Blaz Kristan <blaz@kristan-sp.si>
Date: Tue Aug 1 18:13:37 2023 +0200
minor aesthetic fixes
commit 54b80f74b2dc8766951d55438c6bc560b33e505b
Author: Blaz Kristan <blaz@kristan-sp.si>
Date: Tue Aug 1 18:09:32 2023 +0200
remove unused variable
commit 9a78d28cd71da998cdd76ba826946f54ee2044bd
Merge: 56a74bc5 1ed81793
Author: Blaz Kristan <blaz@kristan-sp.si>
Date: Tue Aug 1 18:08:29 2023 +0200
Merge branch 'main' into PJH_ADD_Linearbounce
commit 56a74bc54c5bbf189b1f98c6cd216956b4f6bd6c
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date: Sat Aug 15 12:34:13 2020 -0500
Update FX.cpp
Added the improvements suggested by Gregor Hartmann
commit a20358b61bf0c38356438c87e5c59663524e038e
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date: Sun Jul 12 08:33:48 2020 -0500
Adding 2 ball track modes
With and without collisions
commit 341d9d1697e9af4fdf2fbd5b4c1de935d0b5a229
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date: Sun Jul 5 14:55:14 2020 -0500
Update FX.cpp
Still 1 bug to fix - this was a test.
commit 9cee4243837f35431302814cc7ace13a72ab5fed
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date: Sun Jul 5 14:53:14 2020 -0500
Update FX.cpp
commit 37cb51cfd6991f6041d663de72debfdcf349c1da
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date: Thu Jul 2 14:16:25 2020 -0500
Adding Collision
A couple of bugs still need sorting
commit 84b7bfb989e662e37a47d78e381105b3951311a6
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date: Sun Jun 28 19:59:46 2020 -0500
update for lost balls
Added some protection - so that when intensity is lowered and raised some time later balls that have moved way off the track are recovered.
commit 04d17e483956b74754002da4cb4dfcddaf932f7b
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date: Sun Jun 28 19:43:56 2020 -0500
Added Ball Track V1
In this version the balls bounce of the edges and do not interact with one another.
bracket was on wrong position, resulting in this warning:
wled00/set.cpp:357:79: warning: value computed is not used [-Wunused-value]
strlcpy(mqttGroupTopic, request->arg(F("MG")).c_str(), MQTT_MAX_TOPIC_LEN)+1;
oappend() silently discards strings when the buffer is full, leading to strange effects like half-working UI pages.
The new debug message will help developers to understand what could be wrong.
- breaking change
- remove leading 0 checkmark
- add reverse scroll checkmark
- add vertical scroll if text fits into segment (intensity ==0 or ==255)
- rotated characters
- leading 0 check added to short texts (i.e. #DDMM0)
Fixes#3322
* Blurz and a few other effects would crash (or behave unexpectedly) for single pixel segments
* replaced a few "MAX" by "max", because MAX will evaluate its arguments twice so its very inefficient.
changes from 3.50 to 3.6.0:
* bugfixes
* removed "register" keyword
* some speedups
* explicit bool() and uint32_t() operators, see https://github.com/FastLED/FastLED/issues/819
FX.cpp: bugfix for "wled00/FX.cpp:4906:36:
error: cannot convert 'CRGB' to 'uint32_t' {aka 'unsigned int'} in initialization"
platform 5.3.0 = arduino-esp32 v2.0.6 + esp-idf v4.4.3
--> you will need new bootloader files for arduino-esp32 v2.0.6
--> coredumps are supported now, if you leave 64Kb of flash at the end of your partitions file (see example in wled_esp32_8MB.csv)
turns out that fastLED 3.6.0 has an explicit uint32_t operator that returns RGBA, however 3.5.0 does not have this and the conversion returned only the "red" component".
turns out that fastLED 3.6.0 has an explicit uint32_t operator that returns RGBA, however 3.5.0 does not have this and the conversion returned only the "red" component".
it seems that SEGMENT.blur() is the main bottleneck for many 2D effects.
This change optimizes performance of the function:
* avoid to re-write unchanged pixels
* early exit when blur_amount == 0 (=nothing to do)
* use _fast_ types where possible
I've seen up to 20% speedup with this change.
power estimation results from estimateCurrentAndLimitBri() were too low (example: estimated 1.3Amp, measured 1.6Amp). This change corrects the power calculation. Due to the changed behavior of getPixelColor, powerSum must be used as-is, not scaled down again by brightness.
minor optimizations that give up to 10% speedup in my tests
* use "fast" integer types (where possible)
* replaced _bri with _restaurationBri (no use of globals)
this optimization avoids to apply brightness two times .
NeoPixelBusLg has already applied global brightness at sPC. Due to internal working of the Lg bus, its sufficient to only post-apply scaling, and set the new (scaled) brightness for the next frame.
I still see strange crashes in setPixelColor/GetpixelColor, which ssem to come from race conditions between async_tcp (change presets) and looptask (strip.service).
To make the situation better, its important that any global pointers are reset to NULL immediately after free().
* Avoid uint16 underflow in width() and height(): stop > start is possible, and means "inactive segment".
Without these checks, it was possible that width() and height() produce VERY large values due to underflow.
due to `if (strip.isUpdating()) return;` reading the encoder did not happen in time if the strip was active - with high number of LEDs, this means "always updating". Similar observation that we had with the audioreactive usermod, and similar solution.
* adding an optional parameter to setBrightness(). ApplyPostAdjustments() will only be called if `immediate=true`. Only ABL will use immediate=true, to ensure electrical safety of equipment.
This allows some optimizations of performance, as ApplyPostAdjustments() is time consuming.
* busses.setBrightness(bri) --> applied to all future pixels (fast, lossless)
* busses.setBrightness(bri, true) --> applied directly to all previously set pixels (slower, lossy)
* Adding Pixel Magic Tool to WLED
* Revert "Adding Pixel Magic Tool to WLED"
This reverts commit b4f08fa8d5e75893d1a76ac0ec82ed1503d24460.
* Adding Pixel Magic Tool to WLED
* Corrections and performance improvements
* Remove IE compatibility tag
(saves a few bytes and IE10 is over 10 years old and unsupported)
Correct HTML language attribute
(Chrome would show a popup asking to translate from Portugese)
* Corrections and performance improvements
* Enable pxmagic by default
---------
Co-authored-by: Aircoookie <21045690+Aircoookie@users.noreply.github.com>
Co-authored-by: Christian Schwinne <cschwinne@gmail.com>
* Initial checkin for ESP-NOW remote feature
* cleanup irrelevant comment
* don't bring in espnow package includes when feature disabled
* Formatting and removing inaccurate call mode hardcoding
* Fork ESP Now code by platform (8266 v. esp32)
* compiled html update
* Disable ESP-NOW remote by default on ESP32 until tested
* Enable ESP-NOW remote for ESP32
* Rename ESP NOW define
---------
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
(saves a few bytes and IE10 is over 10 years old and unsupported)
Correct HTML language attribute
(Chrome would show a popup asking to translate from Portugese)
* allow user to control rotation speed (c3 slider)
* preserve accuracy by performing division _after_ multiplication: " (i * speed) / 32", instead of " i * (speed / 32)"
* proper rounding of "map" results, for better visual appearance
* avoid division by zero in map() function
* Buttons: Trigger when pressing if all configured presets are the same
* Add debounce for immediate rising-edge short press
---------
Co-authored-by: Aircoookie <21045690+Aircoookie@users.noreply.github.com>
* Changes for allowing Alexa to change light color to White when auto-calculating from RGB
* Update alexa.cpp
Indention
* Do not rely on global auto white override
(gets white mode from segment light capabilities)
* alexa.cpp: Removed unnecessary whitespaces
---------
Co-authored-by: Aircoookie <21045690+Aircoookie@users.noreply.github.com>
Fix repeat segment button remaining hidden
Fix third segment row (offset) alignment in 1D mode
Keep disabled sound simulation modes as comment for reference
New local var for 2D seg UI, improves code legibility
* fix DDP spec
* Adjust DDP type byte to latest spec
Allow receiving of RGBW DDP with either old or new bits per channel value
---------
Co-authored-by: Aircoookie <21045690+Aircoookie@users.noreply.github.com>
* PSRAM_Allocator was missing the "reallocate" method, which lead to undefined behaviour when dynamic JSON doc needed to grow/shrink
* Segment::setUpLeds() quickfix for length() == 0 (should not happen, but it did happen for me once)
* leds in PSRAM causes major slowdown on wrover boards - disabled.
* prevent string buffer overflows (stack corruption)
* avoid division by zero (program might crash)
* avoid log(0) which is undefined, too
* use faster math routines for float (logf, powf)
* use size_t instead of uint16_t -> prevents random behaviour (corruption) in case that JSON files get larger than 64Kbytes.
* use a constant for max large file space (was UINT16_MAX)
* reduced the scope of some functions and variables to "static" - avoids name clashes and may support better optimization by the compiler
fix for "Error: Invalid environment name 'codm-controller-0.6-rev2'. The name can contain alphanumeric, underscore, and hyphen characters (a-z, 0-9, -, _)"
* Improve indent
Improve indent, so its more allignend and correctly indented according to logic groups
* Spaces to tabs
---------
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
* Add UCS890x support.
* Fixes
* Update NeoPixelBus to 2.7.3 for UCS8904 support.
Update ESP8266 core to 4.1.0
* ESP8266 compile fixes.
- use PlatformIO framework and toolchain
- add compiler warning suppression
- remove IRAM_ATTR to fit in IRAM
* Replace NeoPixelBrightnessBus with NeoPixelBusLg
Resolves#3087
* Update to NPB 2.7.4
* Internal NPB color conversions.
* Fix errors due to merge with SPI Hz methods
Regenerate settings page HTML
---------
Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
* Soap, new 2D effect
* Fix Soap FX on matrices with edges < 8 LEDs
* Add palette support to Soap FX
---------
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
* - fix word clock for "viertel vor" and "viertel nach"
- adjust wording of parameters
* - revert changes for parameter names
* enclose JSON property strings in F() macro to reduce RAM usage.
* add parameter info for "norddeutsch" and "LedOffset"
art-net transmit was not sending out LEDs, but only transmitted headers repeatedly (thanks @troyhacks for noticing).
Actually such problems can be found by newer compilers, so i've added the warning option to [esp32_idf_V4].
wled00/udp.cpp: In function 'uint8_t realtimeBroadcast(uint8_t, IPAddress, uint16_t, uint8_t*, uint8_t, bool)':
wled00/udp.cpp:824:40: warning: declaration of 'byte buffer [12]' shadows a parameter [-Wshadow=compatible-local]
byte buffer[ART_NET_HEADER_SIZE];
^
wled00/udp.cpp:720:85: note: shadowed declaration is here
uint8_t realtimeBroadcast(uint8_t type, IPAddress client, uint16_t length, uint8_t *buffer, uint8_t bri, bool isRGBW) {
- fixed a few typos, trailing spaces and bad alignments
- added the previous 8266 platform packages as a comment, just in case
- [env:esp32dev_V4_qio80] is actually "dio" --> renamed to [env:esp32dev_V4_dio80]
- all esp32dev targets use the same ${esp32.platform} now (3.2.0 would not compile any more)
- corrected some broken references
- added `platform_package =` --> use default packages
- renamed env:esp32c3 to env:esp32c3dev to avoid confusion
- added lolin_s2_mini to CI builds
Like DDP, this allows WLED to address network systems using the Art-Net protocol.
Universe starts at zero, because that's the first universe in Art-Net.
Works with RGB. It's coded to also work with RGBW, but I couldn't find a great place to enable it without mucking with things I don't understand.
* xml.cpp: correct type for checkbox global led buffer" (was not shown correctly)
* fx.cpp: 2D floating blobs - correct swapped x/y coordinates (did not render correctly on non-square matrix)
One pixel segment handling.
- added 0D FX metadata (1 pixel effects)
- ignore palettes for White only segment
- ignore color for non-RGB & non-White segment (on/off)
Bugfix
- proper auto segment creation
- hide palettes for non RGB segments
- some tweaks for #2984
- force Solid for some FX (causing crash) on 1 pixel segment
UI Optimisations
- slider tooltips
- tiny bit smaller tooltips
- hide segment power if only one segment
- gap between sliders
* Support white addressable LED strips
* Various white handling tweaks
Allow RGB controls for white-only busses depending on AWM (makes palette-only FX work on non-RGB addressable busses)
Fixed RGB controls hidden if segment contained any non-RGB bus (even though there is also an RGB bus in that segment)
New Max auto white mode
Added hasCCT() bus method
Rename methods to be clearer
WS2811 White getPixelColor fix()
* Fix merge conflict (bus manager cpp)
* Refactor bus manager.
* Fix for net debug
* Fix 8266 compile
* Move bus static members to proper cpp
---------
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
* pulser bugfix: " % cols" was missing so the effect would simply run out of visible range
* float math: use optimized functions: sqrtf, fabsf
* two more comments where code could be optimized, but I'm not sure what is thecorrect solution
- Ripple (2D & no Bg)
- Glitter (no Bg)
- Sparkle (no Bg)
- Scan (no Bg)
- Two dots (no Bg)
- ICU (no Bg)
- Lightning (no Bg)
- Halloween eyes (no Bg)
- Spots (no Bg)
- Bouncing Balls (no BG)
- Popcorn (no Bg)
- Starburst (no Bg)
- Drip (no Bg)
- Whitespace cleanup
- draw_circle()
"no Bg" will allow overlapping segments if checked.
* added missing pinMode(.., INPUT) on esp32
* do not try reading from pin = -1 (ESP32-S2 shows very allergic reactions to this)
* Info page - show "n/a" when pin = -1
* readme: esp32 default pin = 35
Fixes build error on linux:
wled00/usermods_list.cpp:15:54: fatal error: ../usermods/battery/usermod_v2_battery.h: No such file or directory
compilation terminated.
.. overlooked this one when reviewing the PR.
@blazoncek, @ctjet : three questions on the new code remain, because its not clear to me if its correct. Please check.
Retrieving the config in `readFromConfig()` results in defaults being set to both `hourMarksEnabled` (`false`) and `hourMarkColor` (`#0000FF`) due to differences in capitalization compared to how they're saved in `addToConfig()`
I was wondering why sometimes the new MCUs still work better in Arduino IDE, so compared our build flags to what is used in Arduino IDE:
-S2 always has -DARDUINO_USB_MODE=0
-C3 always has -DARDUINO_USB_MODE=1
-S3 supports all possible modes
- switch off debug messages to USBCDC, if WLED_DEBUG is not set
- ensure that analogread pins are valid - invalid pins cause lots of error messages and finally lead to watchdog reset on some MCUs.
* make SparlFunDMX driver more robust:
- made variables static (so they don't overlap with other global variables)
- made sure all valriables are properly initialized
- do not apply pinMode and digitalRead to invalid pins (as this creates problems on -S3, -C3 and -S2)
* disable DMX sending code (unneeded code that may case troubles)
unfortunately this breaks build for -C3 and -S3
/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32c3/include/riscv/include/riscv/semihosting.h:75:19: warning: ignoring asm-specifier for non-static local variable 'a0'
register long a0 asm ("a0") = id;
^~
.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32c3/include/riscv/include/riscv/semihosting.h:76:19: warning: ignoring asm-specifier for non-static local variable 'a1'
register long a1 asm ("a1") = (long) data;
pinmanager ran out out array bounds on -S2 and -S3, as these MCUs have more than 40 GPIO. As consequence, memory was overwriten, and pins > 39 were reported as "allocated" but not "owned".
Thisfixes the problem, by extending internal arrays so that up to 50 pins can be managed.
* audioreactive driver update
- Better handling of PDM and I2S Line-in
- Bugfixes for ES7243 (allocateMultiplePins)
- More error messages for ES7243
- sample scaling (needed for sources that use full scale of samples)
* audiorective update
* align SR_DEBUG with WLED_DEBUG
* optional bandpass filter (needed for PDM mics)
* sample scaling for PDM and Line-In
* small improvements for analog input
* bugfixes and small performance improvements
* code for FFT task refactored, for better readablity. Introduces separate functions for filtering and post-processing
* small improvement for beat detection
* default mic settings can be configured at compile time
* correct mic type if MCU does not support PDM or ADC
* hide analog PIN config if not supported by MCU
* audioreactive updates
- minor updates to source code (see discussion in PR #2907)
- usermod readme improvements
* small readme update
* one think I overlooked
* ok, another edit. Now its final. Hopefully.
* small upps
wrong parameter order in debug message.
* Do not require commas between ! in fxdata
* Updating fxdata: Halfway through the FX list
* fxdata flags and optimizations
* Revert optional commas after !
* Grouping um settings, add pre and post Info, update SR & 4LD settings
Settings_um.htm:
- modify addField (grouping)
- addInfo (pre and post texts)
Add preInfo to audio reactive and 4ld usermod
Extra:
platformio: wemos_shield: add audio reactive usermod and update to alt display
* um settings: cpp: lowercase, js: initcap
* um settings: txt only pre, txt2 only post and initCap as function
* Fix rotary encoder info string
Co-authored-by: Blaž Kristan <blaz@kristan-sp.si>
* Update missing package for ESP32-S3
There was a missing package version for env:esp32s3dev_8MB. platformio/framework-arduinoespressif32@3.20004.220825 doesn't exist any more
* Fixes Compiling error for ESP32 S3 with octal (qspi_opi) memory mode
For details: platformio/platform-espressif32#912 and platformio/platform-espressif32#914
* Added env:esp32s3dev_8MB_PSRAM to platformio.ini
Also, reverted back to espressif32@5.1.1 for env:esp32s3dev_8MB
* small maintainer edit
Co-authored-by: Frank <91616163+softhack007@users.noreply.github.com>
* feat(json): add wifi scanning
Adds wifi scanning to the JSON api at `/json/networks`. The initial
request will trigger a scan, subsequent requests will scan or return the
results depending on the state of the `WiFiScan`.
Add a `Scan` button next to the client ssid input, on click, scan for
networks, and change the input to a select with the found ssids.
Fixes: #1964
* Added option to go back to manual SSID input
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
* feat(wifi): add compile time configurtation
Add `WLED_AP_SSID` and `WLED_AP_PASS` defines to allow configuring the
SoftAP SSID and Password at compile time. Default to existing values.
Add `WLED_AP_SSID_UNIQUE` flag to append the device portion of the mac
address to `WLED_AP_SSID`.
Exampleof all flags (note the quoting to preserve
"stringification"):
```
build_flags =
-D WLED_AP_SSID='"MyAP"'
-D WLED_AP_PASS='"MyPassword"'
-D WLED_AP_SSID_UNIQUE
```
* Removed two error defines
Co-authored-by: Christian Schwinne <cschwinne@gmail.com>
* Implement optional hour marks
Time offset did not work
* removed undefined error int in hexstringtocolor
* revert cosmetic changes
* minor cosmetic changes
Co-authored-by: mdegraaf <mdegraaf@proxsys.nl>
* Effect ID's back to 0.13 numbering
Needed for sync between versions and allow 0.13 presets to work in 0.14
* Effect ID's back to 0.13 numbering (part2)
* Add network debug printer
* hide settings for disabled features
If not enabled at compile time, this change hides "Sync interfaces" settings for Alexa, MQTT, Blynk, HueSync.
The html sections are just hidden by a <div> with style display:none.
* Update Animated Staircas for 0.14
* Faster strip updates.
* Add ESP32 variant display in update page.
* Net debug optimizations
Fix ESP8266 (unaligned progmem flash string reads)
Do not send an extra package for \n in println
Only resolve IP/hostname once
* Compile time option for PIR sensor off timer
* Fix Gitpod compiling (#2875)
* Install Platformio not in Gitpod Image
* Install platformio at runtime
remove outdated extensions
* Bugfix for color transitioning.
Return palette option for Candle.
Fix for "* Color..." palette hiding.
Comment out debug output.
* Optimization & bugfix for net debug.
- Inherited from Print class.
- Added UI option to disable net debug output.
* Reduce fxdata size by about 200 bytes
Removed redundant commas before semicolon delimiter (`,;` -> `;`)
No need to transmit `@` in /json/fxdata
* NetworkDebugPrinter packet optimization.
* Revert NetworkDebugPrinter changes.
* Remove flush() in bus manager.
* Optimizations.
Co-authored-by: Shaheen Gandhi <shaheen@fb.com>
Co-authored-by: Blaz Kristan <blaz@kristan-sp.si>
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com>
* Automatically set PC Mode if unset
based on the UserAgent
* slight reduction
Reduce flash usage a bit.
Co-authored-by: Blaž Kristan <blaz@kristan-sp.si>
* add 9 further alexa devices for calling presets 1-9
* use preset names from WLED for Alexa preset device names instead of hardcoded names
* update readme and version
* call alexaInit() at end of savePreset() to keep Alexa in sync with the preset IDs and names
* This reverts commit f8db06c7c5cfe159f9fc03ebc08547fa3c9e9ebd.
* change order to configured Alexa WLED name first, preset names afterwards
* fix status of devices when shown within Alexa, i.e. switching one preset on switches others off (except for alexaInvocationName)
* re-add getPresetName() after merge with master
* restore original readme for pull request
* restore original platformio.ini for pull request
* Logic simplification
* Pass string by reference
* Added number of presets check
* fix alexaInit() in case of alexaNumPresets==0
Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
* Create usermod_word_clock_matrix.h
Tried using the old usermod on the new build, found out a lot has changed since then. My best attempt to update it. Still needs some help, but it is working. I would like to preconfigure some of the default settings. I am also having an issue with Error 12: Preset Not Found
* Update readme.md
* BH1750 upgrades
Moved the definitions into the main usermods_list.cpp instead of having a section to copy across.
Added Home Assistant Discovery topic for light sensor. This is toggleable from the usermod menu.
* Configure pin, other enhancements, readme
Implemented pin manager
Made pins configurable at runtime
Improved info screen outputs
Added F() around strings
Updated readme
* Resolve conflict
* Merge branch 'main'
* Missing comma
Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
Co-authored-by: Christian Schwinne <cschwinne@gmail.com>
* Add ESP32_DATA_IDLE_HIGH to enable data pin to go HIGH when relay is off
* forgot to remove Serial.print for ESP32_DATA_IDLE_HIGH
* forgot another ifdef preventing compilation on non-esp32 boards
* Extra checks that the bus is actually an RMT bus
Could still blow on new ESP32 variants, but now in a mergable state.
Co-authored-by: Christian Schwinne <cschwinne@gmail.com>
* Starting on Ping Pong Clock Usermod, still having to check the led indices and test the stuff out of it
* Adding some attributes to be configured, Added platformio_override
* Fixed LED Numbering, Changed Color to RGB to Work with Settings
* Removing LED Positions from Config
* Some documenting
* Removed example comments to make ping pong clock mod more readable
Co-authored-by: Schmailzl, Sebastian <sebastian.schmailzl@wk-it.com>
Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
Co-authored-by: Christian Schwinne <cschwinne@gmail.com>
* implement analog clock as a usermod
* fix some bugs, use toki for time measurement, implement fading seconds
* added timezone handling to analog clock
* fixed looping second pointer, lower refresh rate
* removed mqtt debug code
* implement seconds effect choice
* adapt to 0_14 branch
Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
* Release of WLED v0.13.3
* Fixed a type in the file name (#2781)
* Fixed the dependency (#2782)
* Usermod Wordclock update to use an alternatve wiring pattern (#2757)
* Update
* update readme file
* readme update
* Update readme.md
* Update readme.md
* Update readme.md
* Update readme.md
* Update platformio.ini
* Add number of UDP retries
Add a configurable number of retries to the UDP WLED sync function.
* Add migration from old eeprom settings
* Revert some accidental carry overs
* Correct issues found in pull request
Change default number of retries
Fix migration from old settings
* Make the minimum number of retries 0
* Import notify twice setting
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
Co-authored-by: Soren Singh Dary <67230851+sorensd@users.noreply.github.com>
Co-authored-by: Patrick <40436536+paeppi88@users.noreply.github.com>
it's possible that volume samples become negative. In this scenario, our simple noise gate does stupid things, and it looks like "effects temporarily lost the sound".
This fix improves the situation, and makes sure that volume samples are always >= 0.
This fixes a "division by zero" in WLED_DEBUG code.
LittleFS init seems to take some time, so we can arrive at "Loops/sec" with 0 loops executed --> crash.
16kHz might be a good compromise on small MCU's:
- GEQ will show frequencies up to ~6Khz
- FFT process may use up to 32millis (-> 100% CPU load). Try to stay below <60% so FreeRTOS can schedule all tasks properly.
- more CPU time is left for other WLED, so it maintains LED FPS and stays responsive on web UI.
Only run FFT when the result will be used.
Please note that this also means that `FFTTime` shown in Info is only meaningful when there is sound input and not silence.
--> To get exact FFT times, the optimization can be disabled by compiling with `-D SR_DEBUG`
I2S microphones were not working any more in with the newest framework - only delivers silence.
Ther reason is stupid bug in espressif I2S "compatibility" driver: RIGHT and LEFT channel are swapped, so when only asking for LEFT, we get silence from RIGHT.
Workaround: simply change LEFT to RIGHT, until the problem is fixed in ESP-IDF --> Fix tested on "classic ESP32", but still need to check behavior on -S3.
Code compiles also on -S3, -S2, and -C3.
smaller changes:
- a few changes to use new APIs (MCLK, rouing and sample resolution)
- a few additional debug messages
- put correct value into _pinConfig.mck_io_num
- adding USB-OTG to reserved GPIO
- no read-only GPI
- if PSRAM found, add pins for "octal" PSRAM to unusable list (octal PSRAM seems to common on S3)
- ESP32: 37 and 38 are read-only
Fixed no new 2D segments creatable in UI
Fixed brightness not applied if `"on":true` present in the same JSON api call
Fixed CJK text upside down in namelabel (rotate to nicer direction only if no CJK characters)
Gamma correction color enabled by default
Encapsulated all parts with #ifdef that will not compile on newer ESP32 variants.
It's still a long way to go before we have a working version on -S3 and -C3, bus this should help to get us started.
From MoonModule/WLED repo.
- the connected() method only get called once a Wifi STA connection is established. UDP Sound Sync should also work when sender is in AP Mode.
- added a few comments that should help to understand the code structure.
- Info Page: add a small horizontal line below usermod specific part. Improves readability.
- updated 2D mapping mode of some 1D soundreactive effects
- alllow some effects to fade slowly, even slower that possible with SEGMENT.fade_out(). Looks nice.
not sure why - most effects only fade when using SEGMENT.fade_out(), while some need SEGMENT.fadeToBlackBy().
- Un-F() most segment JSON keys, decreases JSON doc usage by 47 B (increases static RAM usage by 32 B),
makes `extractModeDefaults` work without strstr_P
- Removed String from serializeModeData and serializeModeNames
- Set 0.14 version name "Hoshi"
- save 1K of RAM by optimizing out
fftBin[].
- moved several copies of the peak reset code into a single function
- moved peak detection out of getSample().
- call peak detection function as last step of FFTcode. More optimal, and we can be sure that fresh FFT result are available.
Peak detection/reset are now called from both tasks, so I had to move some peak-related vars out of AudioReactive class and make them global (static).
also when user wants less than 16 bands.
Previously when users selected fewer bands (like 4 instead of 16), only the lowest freq channels were displayed.
- put variables with same context next to each other.
- removed a few vars that are not needed any more.
- replaced "16" by a more descriptive constant
... found that stupid commit messages get more attention ;-)
- use 22050 Hz for sampling, as it is a standard frequency. I think this is the best choise.
- redesigned the GEQ channels (fftResult[]) for 22Khz, based on channels found on old HiFi equalizer equipment. 1Kzh is now at the center; Bass/Trebble channels are using 1/4 on left/right side respectively - similar to real equalizers. Looks nice :-)
- adjusted effects that use FFT_MajorPeak so that the maximum frequency is supported.
- new feature: "Input Level" (info page) can be used as global "GEQ gain" - only when AGC is ON (was already possible when AGC=off)
- some parameter tweaking in FFT function
- hidden feature: FFT decay is slower when setting a high "dynamics Limiter Fall time" (steps: <1000, <2000, <3000, >3000)
- FFT_MajorPeak default 1.0f (as log(0.0) is invalid)
- FX.cppp: ensure that fftResult[] is always used inside array bounds
- removed broken FFTResult "squelch" feature. It was completely broken, and caused flashes in GEQ.
- added Frequency scaling options: linear and logarithmic
- fixed a few numerical accidents in FX.cpp (bouncing_balls, ripplepeak, freqmap, gravfreq, waterfall)
- On/Off controls the complete feature
- Rise Time and Fall Time are the minimum times (in milliseconds) for "volume" to go from 0% to 80% and back.
- when "On" we also use some filtering to smooth FFTResults[]. Rise and Fall Times do not affect Frequency reactive effects otherwise.
- fade_out() appears to finally do something meaning. Old fade_out values were too high. Adjusted so effects in 1D look similar "classic" SR WLED
- frequency reactive effects: max FFT frequency of 5120 Hz is hard-coded in most effects. Updated ranges to 10240 Hz
* Header checking for sound sync receiver: removed wrong "!"
* make sure all member vars have initial values
* some robustness improvements in case of receiving bad UDP data.
improved ADCsample processing, including replacement of "rogue" samples from other channels (this happens at least once in 5 seconds !!).
It compiles, don't ship it yet - needs more testing.
- smoothing FFTResult (don't have a matrix to test)
- UDP sound sync improvements
- some bugfixes from SR WLED
- button.cpp: avoid starvation: strip.isUpdating() can be true for a long time.
work in progress - still needs testing!!
-new methods: getType(), isInitailized(), postProcessSample()
- allow users to compile for RIGHT audio channel (-D I2S_USE_RIGHT_CHANNEL)
- better handling in case audio input driver failed to initialize
- removed some unneeded code and unneeded parameters
UDP audio sync: introduced new header version, because the new struct (without myvals[]) is not compatible with the previous struct. Also optimized structure size.
UDP audio sync: sender decides is AGC or non-AGC samples are transmitted.
getsamples: move volumeSmth/volumeRaw code out of AGC core function.
- Remove CRGB* leds from utility functions
- GameOfLife: fill_solid for prevLeds to for loop
- Remove if !fftResult
- Funky Plank: toggle src and dst
- Comment drawLine as not used
- Duplicate FadeToBlack, call one FadeToBlackOld
- add addPixelColor overloads
- remove setPixels function
- sPC/gPC move leds check to beginning
- refactor wu_pixel work without leds
- remove leds out of effects and replace by sPC/gPC/aPC/nullptr
- workaround %=
- refactor game of life (but need to check patterns / history, see SR)
- refactor fill_circle to work without leds
- remove leds out of SEGMENT.data (remove if no other use of data)
- use strip.leds
- refactor XY to make segment relative to the whole matrix
- use RGBW32
- in case of 1D also use XY in leds[]: XY(i%width, i/width)]
- add ps_malloc
- leds array from uint32_t to CRGB for fastled compatibility
- reading and writing leds from strip to segment sPC/gPC so it has logical instead of physical indexes so it can be used in effects
- change mode_2DBlackHole as showcase how it can both work with leds or with sPC/gPC
Implemented PinManager and rerun setup of usermod after updating pins/
Registered in const.h and pin_manager.h I tried to follow the existing formatting/numbering in these files.
Wrapped any strings I could in F()
Added public variables to the BME280 usermod based on those in the Temperature usermod. Only complication is that this usermod utilises different function calls depending on whether user defines celsius or not. I have handled this for the temperature, but the Dew Point and Heat Index are relative to the temperature.
I've also addressed some areas where I'd previously assumed Celsius for reporting purposes as my test case is using Farenheit.
I added a Usermod interface for key settings. I used a PinArray for the SDA/SCL pins, but you can't name these individually.
I have also made a display to show the temperature/humidity values in the web interface's Info screen.
I had to change the definition of those items in order to allow these new functions to work. I have not noticed any negative side effects to this change.
At the moment, I've not figured out how to make Celsius/Farenheit toggleable due to the way the #define setup works.
Finally, I have added a routine to publish MQTT Discovery Topics for Home Assistant (toggleable in the Usermod screen).
I've been testing this on the only suitable device I have for a few months and haven't noticed any problems.
gain =1 does not make much senses, at it means "0.0825"; 40 internally translates to "1". 60 seems to be a good start.
- Don't use ADC analog microphone as default, to avoid well-known conflicts with other stuff hooked up onto ADC1,
- re-enabled a forgotten delay (overlooked that in my last commit)
- same fix as in SR-WLED upstream
- if strip.isupdating() is true for more than 12ms, run audio filter loop regardlessly. The userloop is very fast, so I'm expect no bad side-effects from this.
- add to segment: mapping 1D2D and Sound Simulation (WIP!)
- Add sound simulation WeWillRockYou
- All audio effects use segment soundSim
- Redefine SEGLEN: strip.getMappingLength (depending on mapping12)
- make setPixelColor aware of mapping12
- change arduinoFFT to float (custom)
- update audioreactive to use float
- update effects to use float
- info slider (usermod)
- hide Peek in 2D
- minor bugfixes
Added:
- introduced addEffect() and setupEffectData()
- conditional compile for audio effects
- introduced getModeData() and getModeDataSrc() instead of public var
- changed _modeData[] to private non-static
Fixes:
- DMTYPE use
- add reboot info to DMTYPE
- transpose & reverse with mirroring
Use the ESP watchdog to detect hanging ESP and reset the firmware.
Can be disable by defining WLED_WATCHDOG_TIMOUT 0
Default timeout is 3 seconds on ESP32 and 8 seconds on ESP2688
* added SparkFunDMX library dependencies
* changed variable names to avoid conflicts with SparkFunDMX library
* board version checks
* minor changes to DMX
* fix brightness when no shutter DMX channel is set
* fix compile issue on newer ESP32 variants
* Update wizlights.h
adds new features and options for wizlights usermod
* Update wizlights.h
Change how IPs are numbered.
Non-programmers incorrectly start counting at 1
* Update wizlights.h
updated default cold white enhanced white setting to a lower value.
* Update wizlights.h
added logic for connection check before UDP sending.
Seems more important for ESP32
* Update readme.md
handleImprovPacket() unconditionally gobbles serial data which a problem
if we want another feature to consume it. This patch uses the same guard
as the existing call in `handleSerial()`.
Co-authored-by: Thomas Fubar <FUB4R@users.noreply.github.com>
* added first version (work in progress)
* added some sensors to publish
* typo
* added dependency
* mqtt si7021_* names + don't retain
* timer to 60 s
* some changes to HA auto discovery
* added config entries (no function yet)
* renaming
* made configs work
* added getId()
* refactoring + wrong mqtt topics fixed
* retain HA auto discovery
* do not spam serial console on each sensor update
* added readme
* add update interval info
Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
* - implement V2 Usermod to handle wordclocks with 11x10 pixels and 4 additional dots for the minutes
* - fix wording issue for "six"
-
* - add some more comments
* - fix issue with "zwölf"
* Added option to set the name of the module at runtime.
* added example how to set number of LEDs at runtime
* Example to enable/set IR remote type at runtime
* Clarification on how to use platformio_overrides
* Example for setting abl milliamp limit at runtime
* Corrected example set LED count
* Added digit dimming and support for .clk format (see https://github.com/aly-fly/EleksTubeHAX)
* Small fixes and improvements, dimming optional
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
* Dynamic hiding of unused color controls in UI
(e.g. a PWM white bus with no auto white mode will not display the color wheel or palette list)
* Store segment capabilities
Don't use palettes if no RGB supported
Make it safe to update busses using `/json/cfg`
mainseg is not highlighted by default, but can be enabled by CSS only
Simplify some CSS (new segment box, segment brightness slider)
Started labeling CSS classes
* IR rewrite.
- added CCT (WW/CW) support
- support for applying change to main segment or all selected segments
* Remove extra setValuesFromFirstSelectedSeg()
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
* Added: CSS hover effect on buttons within modal dialogs, e.g. Info,
Nodes
* Update index.css
Co-authored-by: Tom D'Roza <Tom.D'Roza>
Co-authored-by: Christian Schwinne <cschwinne@gmail.com>
* define as float (not double)
* Avoid #define of 1 or 2 char symbols
Having this file define 'A' and 'C' pollutes
the global namespace, and causes conflicts
with other libraries that also pollute the
global namespace with short #defines.
It's easier to fix this header.
* unused variable warning
* Binary Websockets for Peek
* No IRAM_ATTR here
* Use builtin LittleFS for all ESP32 builds
* Attempt LittleFS compilation fix
* Use tasmota zip for all ESP32 builds
* Revert to Arduino Core 1 for the time being
- optimized setPixelSegment()
- moved extractModeName() to util.cpp
- optimized extractModeName()
- removed SR extensions from /json/effects endpoint (compatibility estabished)
Adds serial functionality
Can now change baud rate during runtime to be faster
Retrieve LED strip data as JSON blob
Retrieve LED strip data as BYTES (fast!)
* Overridable color order
- Use `ColorOrderMap` to hold optional color order overrides for ranges
of LEDs.
- Serialization of config to/from filesystem is complete.
- Back-end configuration is complete.
- TODO: front-end changes to the LED settings page.
* Add Color order override settings
- Adds color order override section to settings page.
* PR Feedback
- Limit max number of color order overrides to 5 on ESP8266
- Only append color overrides if they were provided in the POST of LED
settings.
* Use arduino-esp32 2.0.2 for ESP32-S2
LittleFS is merged into it.
* Fix filesystem error for ESP32-S2
Use platform of tasmota until upstream released it and
use board_build.flash_mode = qio
* Fix empty disk usage
* Add esp32s2_saola to default_envs
* Remove lorol LITTLEFS for esp32dev, too
* Revert "Remove lorol LITTLEFS for esp32dev, too"
This reverts commit 3586d5eef7affa3390bd057232600f6189145706.
- Use `ColorOrderMap` to hold optional color order overrides for ranges
of LEDs.
- Serialization of config to/from filesystem is complete.
- Back-end configuration is complete.
- TODO: front-end changes to the LED settings page.
* Date controlled timed presets.
* C/P fix for sunset.
* Fixed % escape character
* Date range support
* Date logic fix
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
Line 526: "now - lastRedraw" equates to a negative number and forces the screen into sleep mode
Line 646, 660: if the array size isn't at least the length of the longest name of an effect or palette, then it will not fully print. "Fireworks Starburst" is the longest one at 19 characters. this it kinda a bandaid fix because a longer name may come in the future.
* UM QuinLED-An-Penta: First version
* UM QuinLED-An-Penta: Made OLED seconds a setting; small improvements
* UM QuinLED-An-Penta: Fixed unique ID
* Merge branch 'master' of https://github.com/Aircoookie/WLED
* UM QuinLED-An-Penta: Fixed config loading
* UM QuinLED-An-Penta: Replaced ledcRead() with calculating the percentage
* UM QuinLED-An-Penta: Fixed temp sensor readings
* UM QuinLED-An-Penta: Removing OLED bus clk setting
* UM QuinLED-An-Penta: ETH support, lots of OLED improvements
* UM quinled-an-penta: v1r1 adjustments
color_blend() function only generates 256 colors from the palette before repeating. Improved the function to use either 256 max or the segment length if shorter.
settings.js for pasting data into HTML.
Reduced simple & classic flash footprint.
Split iro.js and rangetouch.js into separate requests (instead of embedding)
Fixed ESP32 crash on Colortwinkles brightness change
Fixed setting picker to black resetting hue and saturation
Fixed auto white mode not saved to config
* Multirelay button support.
Added button hook for usermods.
* Added MultiRelay relay states to JSON state object
* Move button timings to constants
No delay waiting for double press on button 0 if no macro set
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
* UM QuinLED-An-Penta: First version
* UM QuinLED-An-Penta: Made OLED seconds a setting; small improvements
* UM QuinLED-An-Penta: Fixed unique ID
* Merge branch 'master' of https://github.com/Aircoookie/WLED
* UM QuinLED-An-Penta: Fixed config loading
* UM QuinLED-An-Penta: Replaced ledcRead() with calculating the percentage
* UM QuinLED-An-Penta: Fixed temp sensor readings
* UM QuinLED-An-Penta: Removing OLED bus clk setting
* UM QuinLED-An-Penta: ETH support, lots of OLED improvements
* Add strip off refresh option in LED settings.
New strip initialization logic.
Minor code clen-up.
* Dev code removal.
* Missing ethernet include
* Renamed mainseg to selseg
* Fix for preset cycling bounds.
* "Preset 0" bugfix.
* Auto segments only if segments were not modified
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
* Avoid redundant localIP calls, each call takes 0.700 us on ESP32 240Mhz
* Fall through to check Wifi local ip if not connected to ETH
* Changed local var from ipAddress to localIP to better reflect content
* Added UDP sync groups.
* Shortened string.
* Changed sync default to group 1 only.
* Make packets with version < 9 group 1
* Send sync group options as bytes, parse in JS
Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
* Improved pin manager, ethernet config
* Ethernet is configured prior even to LED pins
* Pin Manager allocation / deallocation functions
now take an "ownership" tag parameter, helping
avoid accidentally free'ing pins that were allocated
by other code
* Pin Manager now has ability to allocate multiple
pins at once; Simplifies error handling
* Fix operator precedence error
Bitwise AND has lower precedence than the
relational "greater than" operator.
* PinManager update for some user modules
* don't build everything...
* Final step to reduce RAM overhead
* update comment
* remove macros
* Remove leftover allocated
* Init ethernet after settings saved
Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
* added ui changes for saturation in sync
* added setters/getters for hsv settings
* added color correction logic
* faster algorithm for color conversion
* added save/load config to fs
* adjusted value scale
* move color functions to colors.cpp
* remove unchecked file
* Various small changes
Moved settings location in sync settings
Changed wording from hyperion to live
Moved code into setRealtimePixel(), reducing duplication and enabling the functionality for DMX streams
Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
Version bump to 0.13.0-b2 "Toki"
Fixed transition property not applying unless power/bri/color changed next
Moved transition field below segments (temporarily)
* Fix 2063 - Do not free pins unless allocated
* Fix 2064: Allocate pins used for Ethernet
* Fix obvious compilation errors.
* Fix multiple bugs...
* pinsAllocated[2] set twice due to copy/paste bug.
* wrong pin allocated for ETH_CLOCK_GPIO17_OUT due to copy/paste bug
* Stylistic change per PR review
* Stylistic change per PR review
* attempt to allocate pin for "default" button
* remove extra local variable
* check return value from ETH.begin()
Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
* Testing new wrapper functions to read Usermod config
* Usermod Settings polishing
- remove getBoolFromJsonKey() (no longer needed), fix getValueFromJsonKey(element, destination, defaultvalue)
- Update Usermod Settings html "number" field to use step="any", and make wider to make maximum values fully visible
- step="any" allows viewing/submitting full 7/8-digit float values, and the arrow buttons step by 1 now, instead of .00001 (which wasn't good for integers or floats)
- html wasn't generated/compressed yet
* Update usermod_v2_example.h with more complete example and documentation for Usermod Settings
- readFromConfig() has three options for how to load values from the config JSON, we need to pick one
* Update/rename usermode_rotary_brightness_color, to be used as an example of more robust parsing Usermod Settings values
* Update Usermod example, rename getValueFromJsonKey() to getJsonValue()
- chose single readFromConfig() pattern
- demonstrating 3-argument getJsonValue()
- remove leftover printf in getJsonValue()
Co-authored-by: Louis Beaudoin <louis@embedded-creations.com>
* add decodeIRJson and JSON remote option
* handle JSON API commands also
* removed code that forced IR codes in a certain range to be decoded by decodeIR24. Generate default ir.json files for currently supported remotes.
* comment out printing API commands in IR handling
* refactor decodeIRJson to change how ir.json is loaded add support for calling several c functions
* Handle setting palette when effect is still on default solid and will not display it
* remove colorUpdated notifier that was pasted in accidentally
* Update to handle both 24-key and 24-key old remotes (#1969)
* Update readme.md
* Update ir.cpp
Handle both 24-key and 24-key old in decodeIR switch statement
* Re-add JSON remote option
Co-authored-by: Scott Bailey <scottrbailey@gmail.com>
Co-authored-by: Artacus <40248830+scottrbailey@users.noreply.github.com>
- added parsing of POST fields to use proper type
- updated readFromConfig() to reflect parsing
- added a possibility to use nested object in UM settings
- internal changes and fixes
Wled has been supported by diyHue for some time, now it also supports Hue Sync (Entertainment) under UDP in the flask branch which will be the new master branch.
https://github.com/diyhue/diyHue/pull/628
Settings cosmetic changes (spaces, smaller pin inputs, moved analog legend to wiki)
Uncommented STATUSPIN code (still defined out by default)
Removed adalight pin 3 lock
Added define for PSRAM
commit 7893cb9ebc66faa39d430148e6dd66894cd2fc90
Merge: c4086b9 4e139d7
Author: Blaž Kristan <blaz@kristan-sp.si>
Date: Fri May 21 12:57:43 2021 +0200
Merge branch 'master' of https://github.com/scottrbailey/WLED into scottrbailey-master
commit 4e139d7c0ab1ff7a82a9c386626a0461af27025c
Author: Artacus <40248830+scottrbailey@users.noreply.github.com>
Date: Tue May 18 12:57:20 2021 -0700
Update ir.cpp
Handle both 24-key and 24-key old in decodeIR switch statement
commit 9a405d374bd40e14acc45f4ae52e2a8cf1eac171
Author: Artacus <40248830+scottrbailey@users.noreply.github.com>
Date: Tue May 18 11:05:42 2021 -0700
Update readme.md
commit 94af6d0561a2a0e6b3c1106996c264e59402dedf
Merge: 1ed687a bfb27c4
Author: Artacus <40248830+scottrbailey@users.noreply.github.com>
Date: Sun May 16 22:00:15 2021 -0700
Merge branch 'Aircoookie:master' into master
commit 1ed687a51a971d53abc980ba29416b3bb1b9a5e1
Author: Scott Bailey <scottrbailey@gmail.com>
Date: Sun May 2 21:27:33 2021 -0700
remove colorUpdated notifier that was pasted in accidentally
commit 845dcabe0c6500e37038af71bef9b90cdd366609
Author: Scott Bailey <scottrbailey@gmail.com>
Date: Sat May 1 12:53:34 2021 -0700
Handle setting palette when effect is still on default solid and will not display it
commit 90e8ae1457c4423dda22a3b59cafa0c263875495
Author: Scott Bailey <scottrbailey@gmail.com>
Date: Sat May 1 02:07:47 2021 -0700
refactor decodeIRJson to change how ir.json is loaded add support for calling several c functions
commit e4f9fa311702505c8036abcfcc217a072f178a2c
Author: Scott Bailey <scottrbailey@gmail.com>
Date: Thu Apr 29 23:33:01 2021 -0700
comment out printing API commands in IR handling
commit 26247b247eb6f555b46c2f7cb67dd6a9813552f4
Author: Scott Bailey <scottrbailey@gmail.com>
Date: Thu Apr 29 23:31:30 2021 -0700
removed code that forced IR codes in a certain range to be decoded by decodeIR24. Generate default ir.json files for currently supported remotes.
commit 5acecda6a0ad863c6eb5c5e622bd74e0573950b0
Author: Scott Bailey <scottrbailey@gmail.com>
Date: Thu Apr 29 11:25:24 2021 -0700
handle JSON API commands also
commit 754e3e092a4b5e2fba4a5a0090c9d42ca7546d0d
Author: Scott Bailey <scottrbailey@gmail.com>
Date: Wed Apr 28 22:53:27 2021 -0700
add decodeIRJson and JSON remote option
Fixed potential out-of-bounds write in MQTT
Fixed IR pin not changeable if IR disabled
Fixed XML API <wv> containing -1 on Manual only RGBW mode (see #888, #1783)
* Per strip "skip first LED".
Moved skip first led into bus manager.
* Update cfg.cpp
* Do not display Skip 1st on analog types
Rename skipFirstLed() to clarify what it does
Remove RGBW override
Co-authored-by: Aircoookie <dev.aircoookie@gmail.com>
Co-authored-by: Aircoookie <cschwinne@gmail.com>
- Utilizing addToConfig() & readFromConfig()
- UM configuration Settings page
- MQTT support for usermods
- A few sample usermods including rewritten Temparature and new Multi-Relay
* Add IP Address to JsonInfo
The value is added to the JSON only if the device is connected to the network, and uses the JSON key `"sip"` to match [wled00/xml.cpp](wled00/xml.cpp#L249). The overarching goal of this is to expose the IP Address to the Home Assistant WLED Integration, so that Home Assistant can provide a link to the WLED device (either directly through the Integration/Device page 🤞 or *ad hoc* in Lovelace).
* IP in JSON info
Empty string if not connected
Co-authored-by: Aircoookie <cschwinne@gmail.com>
* version set from package.json and release bin names
* support direnv virtualenv
* versioned PlatformIO environment
* matrix support for parralel CI
* gather artifacts
* release on tagging
* minor scripts formatting
* Better handling for TM1814 strips
* Call SetPixelSettings after Begin as described on the NeoPixelBus wiki
* Use NeoTm1814Settings::MaxCurrent constant
Avoid buffer overflows with longer mqtt topics
mqtDeviceTopic in wled.h is defined with a size of 33, so this should be set to 45 to accommodate the additional 12 characters - /temperature
Increased max RAM FX usage on ESP32 to 20k.
Added relay On handling on realtime data if Off (@JDTSmith).
Added UI refreshing via websockets (@korkbaum).
Here are a few suggestions to make it easier for you to contribute!
### Describe your PR
Please add a description of your proposed code changes. It does not need to be an exhaustive essay, however a PR with no description or just a few words might not get accepted, simply because very basic information is missing.
A good description helps us to review and understand your proposed changes. For example, you could say a few words about
* what you try to achieve (new feature, fixing a bug, refactoring, security enhancements, etc.)
* how your code works (short technical summary - focus on important aspects that might not be obvious when reading the code)
* testing you performed, known limitations, open ends you possibly could not solve.
* any areas where you like to get help from an experienced maintainer (yes WLED has become big 😉)
### Target branch for pull requests
Please make all PRs against the `main` branch.
### Updating your code
While the PR is open - and under review by maintainers - you may be asked to modify your PR source code.
You can simply update your own branch, and push changes in response to reviewer recommendations.
Github will pick up the changes so your PR stays up-to-date.
> [!CAUTION]
> Do not use "force-push" while your PR is open!
> It has many subtle and unexpected consequences on our github reposistory.
> For example, we regularly lost review comments when the PR author force-pushes code changes. So, pretty please, do not force-push.
You can find a collection of very useful tips and tricks here: https://github.com/wled-dev/WLED/wiki/How-to-properly-submit-a-PR
### Code style
When in doubt, it is easiest to replicate the code style you find in the files you want to edit :)
Below are the guidelines we use in the WLED repository.
#### Indentation
We use tabs for Indentation in Web files (.html/.css/.js) and spaces (2 per indentation level) for all other files.
You are all set if you have enabled `Editor: Detect Indentation` in VS Code.
#### Blocks
Whether the opening bracket of e.g. an `if` block is in the same line as the condition or in a separate line is up to your discretion. If there is only one statement, leaving out block brackets is acceptable.
Good:
```cpp
if (a == b) {
doStuff(a);
}
```
```cpp
if (a == b) doStuff(a);
```
Acceptable - however the first variant is usually easier to read:
```cpp
if (a == b)
{
doStuff(a);
}
```
There should always be a space between a keyword and its condition and between the condition and brace.
Within the condition, no space should be between the parenthesis and variables.
Spaces between variables and operators are up to the authors discretion.
There should be no space between function names and their argument parenthesis.
Good:
```cpp
if (a == b) {
doStuff(a);
}
```
Not good:
```cpp
if( a==b ){
doStuff ( a);
}
```
#### Comments
Comments should have a space between the delimiting characters (e.g. `//`) and the comment text.
Note: This is a recent change, the majority of the codebase still has comments without spaces.
Good:
```
// This is a comment.
/* This is a CSS inline comment */
/*
* This is a comment
* wrapping over multiple lines,
* used in WLED for file headers and function explanations
*/
<!-- This is an HTML comment -->
```
There is no hard character limit for a comment within a line,
though as a rule of thumb consider wrapping after 120 characters.
Inline comments are OK if they describe that line only and are not exceedingly wide.
// Waveform generator can create tones, PWM, and servos
typedefstruct{
uint32_tnextPeriodCcy;// ESP clock cycle when a period begins.
uint32_tendDutyCcy;// ESP clock cycle when going from duty to off
int32_tdutyCcys;// Set next off cycle at low->high to maintain phase
int32_tadjDutyCcys;// Temporary correction for next period
int32_tperiodCcys;// Set next phase cycle at low->high to maintain phase
uint32_texpiryCcy;// For time-limited waveform, the CPU clock cycle when this waveform must stop. If WaveformMode::UPDATE, temporarily holds relative ccy count
WaveformModemode;
boolautoPwm;// perform PWM duty to idle cycle ratio correction under high load at the expense of precise timings
}Waveform;
namespace{
staticstruct{
Waveformpins[17];// State of all possible pins
uint32_tstates=0;// Is the pin high or low, updated in NMI so no access outside the NMI code
uint32_tenabled=0;// Is it actively running, updated in NMI so no access outside the NMI code
// Enable lock-free by only allowing updates to waveform.states and waveform.enabled from IRQ service routine
int32_ttoSetBits=0;// Message to the NMI handler to start/modify exactly one waveform
int32_ttoDisableBits=0;// Message to the NMI handler to disable exactly one pin from waveform generation
// toSetBits temporaries
// cheaper than packing them in every Waveform, since we permit only one use at a time
# Check if Node.js is installed and present in PATH if it failed, abort the build
ifnode_exisNone:
print('\x1b[0;31;43m'+'Node.js is not installed or missing from PATH html css js will not be processed check https://kno.wled.ge/advanced/compiling-wled/'+'\x1b[0m')
exitCode=env.Execute("null")
exit(exitCode)
else:
# Install the necessary node packages for the pre-build asset bundling script
board_build.partitions=${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
# additional build flags for audioreactive - must be applied globally
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]
;; experimental build environment for ESP32 using ESP-IDF 4.4.x / arduino-esp32 v2.0.5
;; very similar to the normal ESP32 flags, but omitting Lorol LittleFS, as littlefs is included in the new framework already.
;;
;; 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
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
-DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
-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_all_variants.build_flags}
lib_deps=
${esp32_all_variants.lib_deps}
${env.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}
build_unflags=${common.build_unflags}
build_flags=-g
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32C3
-DCONFIG_IDF_TARGET_ESP32C3=1
-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
${esp32_all_variants.build_flags}
lib_deps=
${esp32_all_variants.lib_deps}
${env.lib_deps}
board_build.partitions=${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
;; 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_all_variants.build_flags}
lib_deps=
${esp32_all_variants.lib_deps}
${env.lib_deps}
board_build.partitions=${esp32.large_partitions} ;; default partioning for 8MB flash - can be overridden in build envs
${esp32.AR_build_flags} ;; includes USERMOD_AUDIOREACTIVE
lib_deps=${esp32_idf_V4.lib_deps}
${esp32.AR_lib_deps} ;; needed for USERMOD_AUDIOREACTIVE
monitor_filters=esp32_exception_decoder
board_build.partitions=${esp32.default_partitions} ;; if you get errors about "out of program space", change this to ${esp32.extended_partitions} or even ${esp32.big_partitions}
build_flags=${common.build_flags} ${esp8266.build_flags} -D WLED_USE_SHOJO_PCB ;; NB: WLED_USE_SHOJO_PCB is not used anywhere in the source code. Not sure why its needed.
A fast and feature-rich implementation of an ESP8266/ESP32 webserver to control NeoPixel (WS2812B, WS2811, SK6812) LEDs or also SPI based chipsets like the WS2801 and APA102!
A fast and feature-rich implementation of an ESP32 and ESP8266 webserver to control NeoPixel (WS2812B, WS2811, SK6812) LEDs or also SPI based chipsets like the WS2801 and APA102!
## ⚙️ Features
- WS2812FX library integrated for over 100 special effects
- WS2812FX library with more than 100 special effects
- FastLED noise effects and 50 palettes
- Modern UI with color, effect and segment controls
- Segments to set different effects and colors to parts of the LEDs
- Settings page - configuration over network
- Segments to set different effects and colors to user defined parts of the LEDstring
- Settings page - configuration via the network
- Access Point and station mode - automatic failsafe AP
- Up to 10 LED outputs per instance
- [Up to 10 LED outputs](https://kno.wled.ge/features/multi-strip/#esp32) per instance
- Support for RGBW strips
- Up to 250 user presets to save and load colors/effects easily, supports cycling through them.
- Presets can be used to automatically execute API calls
- Nightlight function (gradually dims down)
- Full OTA software updatability (HTTP + ArduinoOTA), password protectable
- Configurable analog clock + support for the Cronixie kit by Diamex
- Configurable Auto Brightness limit for safer operation
- Full OTA software updateability (HTTP + ArduinoOTA), password protectable
- Configurable analog clock (Cronixie, 7-segment and EleksTube IPS clock support via usermods)
- Configurable Auto Brightness limit for safe operation
- Filesystem-based config for easier backup of presets and settings
## 💡 Supported light control interfaces
- WLED app for [Android](https://play.google.com/store/apps/details?id=com.aircoookie.WLED) and [iOS](https://apps.apple.com/us/app/wled/id1475695033)
- JSON and HTTP request APIs
- MQTT
- Blynk IoT
- MQTT
- E1.31, Art-Net, DDP and TPM2.net
- [diyHue](https://github.com/diyhue/diyHue) (Wled is supported by diyHue, including Hue Sync Entertainment under udp. Thanks to [Gregory Mallios](https://github.com/gmallios))
- Alexa voice control (including dimming and color)
@ -48,54 +48,37 @@ A fast and feature-rich implementation of an ESP8266/ESP32 webserver to control
## 📲 Quick start guide and documentation
See the [wiki](https://github.com/Aircoookie/WLED/wiki)!
See the [documentation on our official site](https://kno.wled.ge)!
[On this page](https://github.com/Aircoookie/WLED/wiki/Learning-the-ropes) you can find excellent tutorials made by the community and helpful tools to help you get your new lamp up and running!
[On this page](https://kno.wled.ge/basics/tutorials/) you can find excellent tutorials and tools to help you get your new project up and running!
Analog/non-addressable | any | Requires additional circuitry
## 🧊 Compatible PC RGB Fans and ARGB accessories
Brand | Model | Comments
|---|---|---|
Corsair | HD120 Fan | Uses WS2812B, data-in only
PCCOOLER | Moonlight 5-pack Fans | Uses WS2812B, includes Data-out connector to keep each fan uniquely addressable if wired in series like traditional LED strips
Any | 5v 3-pin ARGB for PC | Any PC RGB device that supports the 5v 3-pin ARGB motherboard header should work fine with WLED. All the major motherboard vendors support the Corsair HD120 and PCCOOLER fans listed, so we can safely assume any device that supports motherboard ARGB 5V 3-Pin standard will work with WLED.
## 💾 Compatible hardware
See [here](https://kno.wled.ge/basics/compatible-hardware)!
Check out the WLED [Discourse forum](https://wled.discourse.group)!
You can also send me mails to [dev.aircoookie@gmail.com](mailto:dev.aircoookie@gmail.com), but please only do so if you want to talk to me privately.
If WLED really brightens up your every day, you can [](https://paypal.me/aircoookie)
You can also send me mails to [dev.aircoookie@gmail.com](mailto:dev.aircoookie@gmail.com), but please, only do so if you want to talk to me privately.
If WLED really brightens up your day, you can [](https://paypal.me/aircoookie)
*Disclaimer:*
If you are sensitive to photosensitive epilepsy it is not recommended that you use this software.
In case you still want to try, don't use strobe, lighting or noise modes or high effect speed settings.
As per the MIT license, I assume no liability for any damage to you or any other person or equipment.
If you are prone to photosensitive epilepsy, we recommended you do **not** use this software.
If you still want to try, don't use strobe, lighting or noise modes or high effect speed settings.
As per the EUPL license, I assume no liability for any damage to you or any other person or equipment.
// We can avoid reporting if the change is insignificant. The threshold chosen is below the level of accuracy, but way above 0.01 which is the precision of the value provided.
// The AHT10/15/20 has an accuracy of 0.3C in the temperature readings
// default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
// setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
// default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
// setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
JsonObjecttop=root[FPSTR(_name)];
if(top.isNull()){
DEBUG_PRINT(F(_name));
DEBUG_PRINTLN(F(": No config found. (Using defaults.)"));
Hello! I have written a v2 usermod for the BME280/BMP280 sensor based on the [existing v1 usermod](https://github.com/Aircoookie/WLED/blob/master/usermods/Wemos_D1_mini%2BWemos32_mini_shield/usermod_bme280.cpp). It is not just a refactor, there are many changes which I made to fit my use case, and I hope they will fit the use cases of others as well! Most notably, this usermod is *just* for the BME280 and does not control a display like in the v1 usermod designed for the WeMos shield.
# Usermod BME280
This Usermod is designed to read a `BME280` or `BMP280` sensor and output the following:
- Temperature
- Humidity (`BME280` only)
- Pressure
- Heat Index (`BME280` only)
- Dew Point (`BME280` only)
- Requires libraries `BME280@~3.0.0` (by [finitespace](https://github.com/finitespace/BME280)) and `Wire`. Please add these under `lib_deps` in your `platform.ini` (or `platform_override.ini`).
- Data is published over MQTT so make sure you've enabled the MQTT sync interface.
- This usermod also writes to serial (GPIO1 on ESP8266). Please make sure nothing else listening on the serial TX pin of your board will get confused by log messages!
Configuration is performed via the Usermod menu. There are no parameters to set in code! The following settings can be configured in the Usermod Menu:
- The i2c address in decimal. Set it to either 118 (0x76, the default) or 119 (0x77).
- Temperature Decimals (number of decimal places to output)
- Humidity Decimals
- Pressure Decimals
- Temperature Interval (how many seconds between temperature and humidity measurements)
- Pressure Interval
- Publish Always (turn off to only publish changes, on to publish whether or not value changed)
- Use Celsius (turn off to use Fahrenheit)
- Home Assistant Discovery (turn on to sent MQTT Discovery entries for Home Assistant)
- SCL/SDA GPIO Pins
To enable, compile with `USERMOD_BME280` defined (i.e. `platformio_override.ini`)
- Data is published over MQTT - make sure you've enabled the MQTT sync interface.
- This usermod also writes to serial (GPIO1 on ESP8266). Please make sure nothing else is listening to the serial TX pin or your board will get confused by log messages!
In addition to outputting via MQTT, you can read the values from the Info Screen on the dashboard page of the device's web interface.
Methods also exist to read the read/calculated values from other WLED modules through code.
- `getTemperatureC()`
- `getTemperatureF()`
- `getHumidity()`
- `getPressure()`
- `getDewPointC()`
- `getDewPointF()`
- `getHeatIndexC()`
- `getHeatIndexF()`
# Compiling
To enable, add `BME280_v2` to your `custom_usermods` (e.g. in `platformio_override.ini`)
- Temperature and pressure have separate intervals due to pressure not frequently changing at any constant altitude
- Adjustment of number of decimal places in published sensor values
- Separate adjustment for temperature, humidity and pressure values
- Values are rounded to the specified number of decimal places
- Pressure measured in units of hPa instead of Pa
- Calculation of heat index (apparent temperature) and dew point
- These, along with humidity measurements, are disabled if the sensor is a BMP280
- 16x oversampling of sensor during measurement
- Values are only published if they are different from the previous value
- Values are published on startup (continually until the MQTT broker acknowledges a successful publication)
Adjustments are made through preprocessor definitions at the start of the class definition.
MQTT topics are as follows:
# MQTT
MQTT topics are as follows (`<deviceTopic>` is set in MQTT section of Sync Setup menu):
Measurement type | MQTT topic
--- | ---
Temperature | `<deviceTopic>/temperature`
Humidity | `<deviceTopic>/humidity`
Pressure | `<deviceTopic>/pressure`
Heat index | `<deviceTopic>/heat_index`
Dew point | `<deviceTopic>/dew_point`
Dew point | `<deviceTopic>/dew_point`
If you are using Home Assistant, and `Home Assistant Discovery` is turned on, Home Assistant should automatically detect a new device, provided you have the MQTT integration installed. The device is separate from the main WLED device and will contain sensors for Pressure, Humidity, Temperature, Dew Point and Heat Index.
# Revision History
Jul 2022
- Added Home Assistant Discovery
- Added API interface to output data
- Removed compile-time variables
- Added usermod menu interface
- Added value outputs to info screen
- Updated `readme.md`
- Registered usermod
- Implemented PinManager for usermod
- Implemented reallocation of pins without reboot
Apr 2021
- Added `Publish Always` option
Dec 2020
- Ported to V2 Usermod format
- Customizable `measure intervals`
- Customizable number of `decimal places` in published sensor values
- Pressure measured in units of hPa instead of Pa
- Calculation of heat index (apparent temperature) and dew point
- `16x oversampling` of sensor during measurement
- Values only published if they are different from the previous value
This usermod was developed for a BME680/BME68X sensor. The BME68X is not compatible with the BME280/BMP280 chip. It has its own library. The original 'BSEC Software Library' from Bosch was used to develop the code. The measured values are displayed on the WLED info page.
In addition, the values are published on MQTT if this is active. The topic used for this is: 'wled/[MQTT Client ID]'. The Client ID is set in the WLED MQTT settings.
<palign="center"><imgsrc="pics/pic2.png"></p>
If you use HomeAssistance discovery, the device tree for HomeAssistance is created. This is published under the topic 'homeassistant/sensor/[MQTT Client ID]' via MQTT.
<palign="center"><imgsrc="pics/pic3.png"></p>
A device with the following sensors appears in HomeAssistant. Please note that MQTT must be activated in HomeAssistant.
The BSEC Library calculates the following values via the gas resistance
Sensor Accuracy Scale Range
-----------------------------
IAQ value between 0 and 500
Static IAQ same as IAQ but for permanently installed devices
CO2 PPM
VOC PPM
Gas-Percentage %
In addition the usermod calculates
Sensor Accuracy Scale Range
-----------------------------
Absolute humidity g/m³
Dew point °C/°F
### IAQ (Indoor Air Quality)
The IAQ is divided into the following value groups.
<palign="center"><imgsrc="pics/pic5.png"></p>
For more detailed information, please consult the enclosed Bosch product description (BME680.pdf).
## Calibration of the device
The gas sensor of the BME68X must be calibrated. This differs from the BME280, which does not require any calibration.
There is a range of additional information for this, which the driver also provides. These values can be found in HomeAssistant under Diagnostics.
- **STABILIZATION_STATUS**: Gas sensor stabilization status [boolean] Indicates initial stabilization status of the gas sensor element: stabilization is ongoing (0) or stabilization is finished (1).
- **RUN_IN_STATUS**: Gas sensor run-in status [boolean] Indicates power-on stabilization status of the gas sensor element: stabilization is ongoing (0) or stabilization is finished (1)
Furthermore, all GAS based values have their own accuracy value. These have the following meaning:
- **Accuracy = 0** means the sensor is being stabilized (this can take a while on the first run)
- **Accuracy = 1** means that the previous measured values show too few differences and cannot be used for calibration. If the sensor is at accuracy 1 for too long, you must ensure that the ambient air is chaning. Opening the windows is fine. Or sometimes it is sufficient to breathe on the sensor for approx. 5 minutes.
- **Accuracy = 2** means the sensor is currently calibrating.
- **Accuracy = 3** means that the sensor has been successfully calibrated. Once accuracy 3 is reached, the calibration data is automatically written to the file system. This calibration data will be used again at the next start and will speed up the calibration.
The IAQ index is therefore only meaningful if IAQ Accuracy = 3. In addition to the value for IAQ, BSEC also provides us with CO2 and VOC equivalent values. When using the sensor, the calibration value should also always be read out and displayed or transmitted.
Reasonably reliable values are therefore only achieved when accuracy displays the value 3.
## Settings
The settings of the usermods are set in the usermod section of wled.
<palign="center"><imgsrc="pics/pic6.png"></p>
The possible settings are
- **Enable:** Enables / disables the usermod
- **I2C address:** I2C address of the sensor. You can choose between 0X77 & 0X76. The default is 0x77.
- **Interval:** Specifies the interval of seconds at which the usermod should be executed. The default is every second.
- **Pub Chages Only:** If this item is active, the values are only published if they have changed since the last publication.
- **Pub Accuracy:** The Accuracy values associated with the gas values are also published.
- **Pub Calib State:** If this item is active, STABILIZATION_STATUS& RUN_IN_STATUS are also published.
- **Temp Scale:** Here you can choose between °C and °F.
- **Temp Offset:** The temperature offset is always set in °C. It must be converted for Fahrenheit.
- **HA Discovery:** If this item is active, the HomeAssistant sensor tree is created.
- **Pause While WLED Active:** If WLED has many LEDs to calculate, the computing power may no longer be sufficient to calculate the LEDs and read the sensor data. The LEDs then hang for a few microseconds, which can be seen. If this point is active, no sensor data is fetched as long as WLED is running.
- **Del Calibration Hist:** If a check mark is set here, the calibration file saved in the file system is deleted when the settings are saved.
### Sensors
Applies to all sensors. The number of decimal places is set here. If the sensor is set to -1, it will no longer be published. In addition, the IAQ values can be activated here in verbal form.
It is recommended to use the Static IAQ for the IAQ values. This is recommended by Bosch for statically placed devices.
## Output
Data is published over MQTT - make sure you've enabled the MQTT sync interface.
In addition to outputting via MQTT, you can read the values from the Info Screen on the dashboard page of the device's web interface.
Methods also exist to read the read/calculated values from other WLED modules through code.
- getTemperature(); The scale °C/°F is depended to the settings
- getHumidity();
- getPressure();
- getGasResistance();
- getAbsoluteHumidity();
- getDewPoint(); The scale °C/°F is depended to the settings
- getIaq();
- getStaticIaq();
- getCo2();
- getVoc();
- getGasPerc();
- getIaqAccuracy();
- getStaticIaqAccuracy();
- getCo2Accuracy();
- getVocAccuracy();
- getGasPercAccuracy();
- getStabStatus();
- getRunInStatus();
## Compilation
To enable, compile with `BME68X` in `custom_usermods` (e.g. in `platformio_override.ini`)
- A problem with the default settings has been fixed
### Version 1.0.2
* Rebased to WELD Version 0.16
* Fixed: Solved compilation problems related to some macro naming interferences.
## Known problems
- MQTT goes online at device start. Shortly afterwards it goes offline and takes quite a while until it goes online again. The problem does not come from this user module, but from the WLED core.
- If you save the settings often, WLED can get stuck.
- If many LEDS are connected to WLED, reading the sensor can cause a small but noticeable hang. The "Pause While WLED Active" option was introduced as a workaround.
d="m 588.34,94.29 c 0,13.28 -10.77,24.04 -24.04,24.04 H 31.38 C 18.1,118.33 7.34,107.57 7.34,94.29 V 32.38 C 7.34,19.1 18.1,8.34 31.38,8.34 h 532.91 c 13.28,0 24.04,10.76 24.04,24.04 V 94.29 Z M 159.44,69.66 c 0,17.15 11.68,19.07 21.89,19.07 h 14.23 c 14.6,0 23.44,-3.2 23.44,-13.87 v -0.91 h -7.84 c -0.45,7.11 -4.47,8.39 -14.32,8.39 h -10.76 c -13.68,0 -18.79,-2.74 -18.79,-13.32 V 66.65 H 219 V 60.9 C 219,44.3 208.88,40.74 194.83,40.74 h -12.59 c -11.12,0 -22.8,1.92 -22.8,18.79 z m 51.72,-9.95 h -43.87 c 0.73,-10.58 3.65,-12.59 16.05,-12.59 h 11.49 c 12.77,0 16.33,4.74 16.33,9.49 z m 18.62,10.13 c 0,15.33 10.86,18.88 25.73,18.88 h 11.22 c 14.87,0 25.72,-3.56 25.72,-18.88 V 59.62 c 0,-15.32 -10.85,-18.88 -25.72,-18.88 h -11.22 c -14.87,0 -25.73,3.56 -25.73,18.88 z m 54.82,-0.46 c 0,10.86 -6.38,12.95 -15.51,12.95 h -15.96 c -9.12,0 -15.51,-2.09 -15.51,-12.95 v -9.31 c 0,-10.85 6.39,-12.95 15.51,-12.95 h 15.96 c 9.12,0 15.51,2.1 15.51,12.95 z m 173.79,18.61 v -31.2 c 0,-13.87 -9.85,-16.06 -24.45,-16.06 h -12.41 c -14.05,0 -19.43,3.47 -19.43,11.95 v 2.28 h 7.84 v -1.64 c 0,-3.83 1.92,-6.2 11.77,-6.2 h 11.49 c 12.04,0 17.33,1.09 17.33,9.49 v 8.76 h -0.18 c -2.74,-4.47 -6.39,-5.56 -16.6,-5.56 H 421.16 C 407.48,59.81 400,61.09 400,71.67 v 3.1 c 0,8.76 3.1,13.96 14.96,13.96 h 18.79 z m -7.84,-12.5 c 0,5.84 -5.47,6.84 -19.7,6.84 h -10.4 c -10.76,0 -12.59,-2.19 -12.59,-7.39 v -1.46 c 0,-5.84 2.83,-7.3 12.95,-7.3 h 12.04 c 12.04,0 17.7,0.82 17.7,7.2 z M 73.6,66.69 h 10.88 l 5.03,0.01 h 48.67 v 2.41 c 0,9.12 -5.47,12.23 -14.41,12.23 H 88.83 c -8.58,0 -15.51,-2.55 -15.51,-14.05 v -0.35 -0.26 z m -9.16,-0.01 c 0,0.06 0,0.14 0,0.2 0.67,14.68 6.68,21.76 23.47,21.76 h 36.85 c 16.51,0 22.35,-6.39 22.35,-24.36 V 59.4 H 89.51 L 85.39,59.39 H 73.32 v -0.01 -16.9 c 0,-11.49 6.93,-14.05 15.51,-14.05 H 112 c 22.07,0 25.81,0.91 25.81,13.23 h 8.39 v -2.37 c 0,-15.23 -12.68,-18.15 -24.54,-18.15 H 87.92 c -17.88,0 -23.53,8.03 -23.53,24.72 V 59.39 L 64.38,59.4 H 44.6 c -11.86,0 -24.54,2.92 -24.54,18.15 v 2.37 5.02 2.37 c 0,15.24 12.68,18.16 24.54,18.16 h 40.79 432.59 34.03 c 17.88,0 23.54,-8.03 23.54,-24.72 V 45.88 c 0,-16.69 -5.65,-24.72 -23.54,-24.72 l -0.16,-0.02 h -223 c -17.88,0 -23.53,8.03 -23.53,24.72 v 18.06 c 0,16.69 5.65,24.72 23.53,24.72 h 36.85 c 16.51,0 22.35,-6.39 22.35,-24.36 V 59.4 h -42.78 v 7.3 h 33.84 v 2.41 c 0,9.12 -5.47,12.23 -14.41,12.23 h -34.94 c -8.58,0 -15.5,-2.55 -15.5,-14.05 V 42.48 c 0,-11.49 6.93,-14.05 15.5,-14.05 l 142.5,0.02 v 61.24 l 24.35,0.73 h 10.95 c 14.23,0 24.18,-3.56 24.18,-19.61 V 62.6 c 0,-14.87 -5.75,-20.16 -24.63,-20.16 h -11.95 -14.88 -0.17 l -0.02,-14.01 h 71.75 l -0.75,0.02 c 8.58,0 15.51,2.55 15.51,14.04 v 41.62 c 0,11.49 -6.93,14.05 -15.51,14.05 H 518.97 86.87 54.27 c -22.08,0 -25.81,-0.91 -25.81,-13.23 v -5.02 c 0,-12.31 3.74,-13.23 25.81,-13.23 h 9.84 z m 459.45,4.04 c 0,9.03 -2.83,13.32 -15.6,13.32 h -12.77 c -11.67,0 -15.42,-4.93 -15.42,-13.41 v -8.85 c 0,-11.13 6.48,-12.95 17.06,-12.95 h 10.58 c 10.76,0 16.14,2.01 16.14,12.77 v 9.12 z"
d="m 611.07375,-48.387188 c 0,13.28 -10.77,24.039999 -24.04,24.039999 H 54.113747 c -13.27999,0 -24.04,-10.76 -24.04,-24.039999 v -61.910002 c 0,-13.28 10.76001,-24.04 24.04,-24.04 H 587.02375 c 13.28,0 24.04,10.76 24.04,24.04 v 61.910002 z"
d="M 600,103.51782 C 600,116.79902 588.8778,127.56 575.17384,127.56 H 24.826163 C 11.111876,127.56 5.1635108e-7,116.79902 5.1635108e-7,103.51782 V 41.602186 C 5.1635108e-7,28.320979 11.111876,17.560001 24.826163,17.560001 H 575.16351 c 13.71429,0 24.82616,10.760978 24.82616,24.042185 v 61.915634 z"
d="M 600,103.51782 C 600,116.79902 588.8778,127.56 575.17384,127.56 H 24.826162 C 11.111877,127.56 5.1635111e-7,116.79902 5.1635111e-7,103.51782 V 41.602187 C 5.1635111e-7,28.320977 11.111876,17.559997 24.826162,17.559997 H 575.16351 c 13.71429,0 24.82616,10.76098 24.82616,24.04219 V 103.51782 Z M 157.07401,78.885567 c 0,17.15156 12.06196,19.07173 22.60585,19.07173 h 14.69535 c 15.07745,0 24.20654,-3.20029 24.20654,-13.87125 v -0.91009 h -8.09638 c -0.46472,7.11065 -4.61618,8.39076 -14.7883,8.39076 h -11.11188 c -14.12736,0 -19.40447,-2.74024 -19.40447,-13.3212 v -2.37022 h 53.40103 v -5.75052 c 0,-16.60151 -10.45094,-20.16183 -24.96041,-20.16183 h -13.00172 c -11.48365,0 -23.54561,1.92017 -23.54561,18.79171 z m 53.41136,-9.9509 h -45.30465 c 0.75387,-10.58096 3.76936,-12.59114 16.57487,-12.59114 h 11.86575 c 13.18761,0 16.86403,4.74043 16.86403,9.49086 z m 19.22891,10.13092 c 0,15.33139 11.21515,18.88171 26.57143,18.88171 h 11.58692 c 15.35629,0 26.56111,-3.56032 26.56111,-18.88171 v -10.22093 c 0,-15.32139 -11.20482,-18.88171 -26.56111,-18.88171 h -11.58692 c -15.35628,0 -26.57143,3.56032 -26.57143,18.88171 z m 56.61275,-0.46004 c 0,10.86098 -6.58865,12.95117 -16.01722,12.95117 h -16.48193 c -9.41825,0 -16.01721,-2.09019 -16.01721,-12.95117 v -9.31085 c 0,-10.85098 6.59896,-12.95117 16.01721,-12.95117 h 16.48193 c 9.41824,0 16.01722,2.10019 16.01722,12.95117 z m 179.47332,18.61169 v -31.20283 c 0,-13.87126 -10.17212,-16.06146 -25.24957,-16.06146 h -12.81584 c -14.50946,0 -20.0654,3.47031 -20.0654,11.95108 v 2.28021 h 8.09638 v -1.64015 c 0,-3.83035 1.98279,-6.20056 12.15491,-6.20056 h 11.86575 c 12.43373,0 17.89673,1.0901 17.89673,9.49086 v 8.7608 h -0.18589 c -2.8296,-4.47041 -6.59897,-5.56051 -17.14286,-5.56051 h -13.00172 c -14.12736,0 -21.85198,1.28012 -21.85198,11.86108 v 3.10028 c 0,8.76079 3.20138,13.96126 15.44923,13.96126 h 19.40447 z m -8.09639,-12.50114 c 0,5.84053 -5.64888,6.84062 -20.34423,6.84062 h -10.74011 c -11.11187,0 -13.00172,-2.19019 -13.00172,-7.39067 v -1.46013 c 0,-5.84053 2.92255,-7.30066 13.3735,-7.30066 h 12.43373 c 12.43374,0 18.27883,0.82007 18.27883,7.20065 z m -389.27711,-8.8008 h 11.2358 l 5.194492,0.01 h 50.261618 v 2.41021 c 0,9.12083 -5.64888,12.23111 -14.88124,12.23111 H 84.154905 c -8.860585,0 -16.017212,-2.55023 -16.017212,-14.05127 v -0.35003 -0.26003 z m -9.459552,-0.01 c 0,0.06 0,0.14002 0,0.20002 0.69191,14.68133 6.898451,21.76198 24.237521,21.76198 h 38.055071 c 17.04992,0 23.0809,-6.39058 23.0809,-24.36221 v -4.88045 H 84.857142 l -4.254733,-0.01 H 68.137693 v -0.01 -16.90153 c 0,-11.49104 7.156627,-14.05129 16.017212,-14.05129 h 23.927705 c 22.79174,0 26.65405,0.91009 26.65405,13.23121 h 8.66437 v -2.37021 c 0,-15.23139 -13.09466,-18.15166 -25.34251,-18.15166 H 83.215146 c -18.464717,0 -24.299483,8.03073 -24.299483,24.72226 v 13.53122 l -0.01033,0.01 h -20.42685 c -12.247849,0 -25.342513,2.92027 -25.342513,18.15165 v 2.37022 5.02045 2.37022 c 0,15.241393 13.094664,18.161653 25.342513,18.161653 h 42.123923 446.736664 35.14286 c 18.46471,0 24.30981,-8.03073 24.30981,-24.722253 v -34.87316 c 0,-16.69153 -5.83477,-24.72226 -24.30981,-24.72226 l -0.16523,-0.02 H 332.0241 c -18.46471,0 -24.29948,8.03073 -24.29948,24.72226 v 18.06163 c 0,16.69152 5.83477,24.72225 24.29948,24.72225 h 38.05508 c 17.04991,0 23.08089,-6.39058 23.08089,-24.36221 v -4.88045 h -44.179 v 7.30067 h 34.94664 v 2.41021 c 0,9.12083 -5.64888,12.23111 -14.88123,12.23111 h -36.08262 c -8.86059,0 -16.00688,-2.55023 -16.00688,-14.05127 v -24.81225 c 0,-11.49104 7.15662,-14.05129 16.00688,-14.05129 l 147.16007,0.02 v 61.24556 l 25.14629,0.73007 h 11.30809 c 14.69536,0 24.97074,-3.56033 24.97074,-19.61178 v -8.21075 c 0,-14.87135 -5.93803,-20.16183 -25.43545,-20.16183 h -12.34079 -15.36661 -0.17556 l -0.0207,-14.01128 h 74.09639 l -0.77453,0.02 c 8.86059,0 16.01721,2.55024 16.01721,14.04128 v 41.62378 c 0,11.491053 -7.15662,14.051283 -16.01721,14.051283 H 528.36145 82.130808 48.464716 c -22.802065,0 -26.654044,-0.91008 -26.654044,-13.231213 v -5.02046 c 0,-12.31111 3.862306,-13.2312 26.654044,-13.2312 h 10.161789 z m 474.475042,4.04037 c 0,9.03082 -2.92255,13.32121 -16.11015,13.32121 h -13.18761 c -12.05164,0 -15.92427,-4.93045 -15.92427,-13.41122 v -8.8508 c 0,-11.13101 6.69191,-12.95118 17.6179,-12.95118 h 10.92599 c 11.11188,0 16.66781,2.01019 16.66781,12.77116 v 9.12083 z"
// use calibrated millivolts analogread on esp32 (150 mV ~ 2450 mV default attentuation) and divide by 1000 to get from milivolts to volts and multiply by voltage multiplier and apply calibration value
// use analog read on esp8266 ( 0V ~ 1V no attenuation options) and divide by ADC precision 1023 and multiply by voltage multiplier and apply calibration value
if(forJsonState){battery[F("type")]=cfg.type;}else{battery[F("type")]=(String)cfg.type;}// has to be a String otherwise it won't get converted to a Dropdown
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.