Skip to content

Merge upstream WLED main into GridLights SOL (test)#5481

Closed
eikerd wants to merge 25 commits into
wled:mainfrom
GridLights:test/merge-wled-latest
Closed

Merge upstream WLED main into GridLights SOL (test)#5481
eikerd wants to merge 25 commits into
wled:mainfrom
GridLights:test/merge-wled-latest

Conversation

@eikerd
Copy link
Copy Markdown

@eikerd eikerd commented Apr 6, 2026

Summary

This PR merges the latest upstream Aircoookie/WLED main branch into our GridLights SOL firmware fork for team evaluation and testing. This brings in ~2,549 upstream commits and touches 508 files (+59,599 / -53,712 lines).

Do not merge this into main until the team has validated the build and tested on hardware.


Why this merge?

Our fork diverged from WLED a long time ago. Upstream has accumulated significant improvements in areas like:

  • Particle system effects (volcano, fire, fireworks, vortex, galaxy, etc.)
  • Frame timing & service loop overhaul (frametime-based rendering, FPS unlimited mode, suspend support)
  • Memory management improvements in segment data allocation
  • Transition system (fade, fairy dust, swipe, push, circular — 18 transition types)
  • New board support (ESP32-S3, ESP32-C3, WROVER, etc.)
  • IPv6 support, mDNS improvements, network robustness
  • PlatformIO / build system modernisation

By merging now, we get all of these upstream improvements while preserving our GridLights-specific customisations.


Conflict Resolutions — Decisions Made

We encountered 5 conflicts during the merge. Here's exactly what we decided for each and why:

1. .github/workflows/wled-ci.ymlKept deleted

  • What happened: We deleted this file in our fork (GridLights has its own CI pipeline). Upstream modified it with their latest CI configuration.
  • Decision: Keep it deleted. Our CI is purpose-built for the SOL hardware target (esp32dev). Upstream's CI builds for 20+ board variants we don't ship. Pulling in their CI would break our build pipeline and add confusion.
  • Risk: None. Our CI is independent.

2. platformio.iniKept esp32dev as sole build target

  • What happened: Upstream changed default_envs from a single commented-out list to a multi-line list of ~20 CI/release environments (nodemcuv2, esp8266_2m, esp32_wrover, esp32c3dev, etc.). Our fork had default_envs = esp32dev as the active target with everything else commented out.
  • Decision: Replaced the entire conflicting block with a clean single line: default_envs = esp32dev. We only build for one board. All other upstream build environment definitions (env sections) are still present in the file — they just aren't in the default build list.
  • Risk: Low. If we ever need to build for additional boards, the env definitions from upstream are all there — we just need to add them to default_envs.

3. wled00/FX.hGridLights modes preserved, upstream particle modes renumbered

This was the most significant conflict and requires the most attention during testing.

  • What happened: Both sides added new effect modes starting in the same numeric range (187+).

    • Our fork added GridLights custom modes at 187–248: Custom Squares, Circles, Diamond Spin, Breathing Square, Spiral Wave, Novas, Black Hole variants, SimpleStar, Full, Merkabah, Hourglass, AlmostNuke, and Nuke — all at various frequency variants (3/6/9/12/15/20 Hz).
    • Upstream added a full particle system at 187–219: ParticleVolcano, ParticleFire, ParticleFireworks, ParticleVortex, ParticleGalaxy, ColorClouds, SlowTransition, plus 1D particle effects (Drip, Pinball, Sparkler, etc.).
  • Decision:

    • Keep all GridLights custom modes at their original numbers (187–248). These are baked into saved presets, the API, and any external tooling that references effects by ID. Changing them would break existing user configurations.
    • Append upstream's particle system modes starting at 249–281. These are new to our codebase so there are no existing references to preserve.
    • MODE_COUNT updated to 282.
    • Upstream's transition type defines (TRANSITION_FADE through TRANSITION_PUSH_BL, 18 total) were also included — these use separate 0x000x17 values and don't conflict with mode numbers.
  • ⚠️ CRITICAL RISK — Team must validate: Upstream's FX.cpp registers particle effects by their original mode numbers (187–219). Since we renumbered these to 249–281, any upstream code in FX.cpp that uses hardcoded mode numbers for particle effects will be pointing at the wrong slots. The team needs to verify:

    1. That effect registration in FX.cpp uses the #define constants (e.g., FX_MODE_PARTICLEVOLCANO) and not raw numbers — if so, the renumbering propagates automatically.
    2. That any switch/case or if-else chains referencing particle mode numbers compile and behave correctly.
    3. That the effect list in the web UI shows all effects in the right order.

4. wled00/FX_fcn.cppTook upstream's improvements (3 sub-conflicts)

  • Sub-conflict A: Segment::allocateData()

    • What happened: Our version had a simple "already allocated enough" check. Upstream added a len == 0 early return, and smarter logic that only clears small segment data buffers (below FAIR_DATA_PER_SEG) on re-init, reducing unnecessary memsets on large segments.
    • Decision: Took upstream's version. It's a pure improvement — better memory efficiency with no behavioural change for our effects.
  • Sub-conflict B: Segment::setPixelColor() function header

    • What happened: Our version had the old void IRAM_ATTR Segment::setPixelColor(int i, uint32_t col) signature. Upstream removed this in favour of a new void WLED_O2_ATTR Segment::setPixelColor(int i, uint32_t col) const version (further down in the file) and added a new maxMappingLength() helper for the particle system.
    • Decision: Removed our old function header (the new upstream version at line ~724 supersedes it). Kept upstream's maxMappingLength() which is needed by the particle system effects we're bringing in.
  • Sub-conflict C: WS2812FX::service() frame timing

    • What happened: Our version used a simple millis() - _lastShow < MIN_SHOW_DELAY check. Upstream completely reworked the timing to use _frametime (configurable frame duration), FPS_UNLIMITED mode, _triggered flag for on-demand rendering, and _suspend support.
    • Decision: Took upstream's version. This is a significant improvement to the rendering pipeline — it enables configurable FPS, proper suspend/resume, and more responsive effect rendering. Our GridLights effects don't depend on the old timing mechanism — they use the standard WLED effect callback model.
    • Risk: Medium. If any of our custom effects relied on the old MIN_SHOW_DELAY timing behaviour or _lastShow, they may render at a different cadence. Team should test strobe/Hz-sensitive effects (Breathing Square Hz, Spiral Wave Hz, etc.) to confirm timing is correct.

5. wled00/wled.cppKept captive portal disabled, took upstream API changes

  • What happened:

    • Captive portal: Our fork commented out dnsServer.processNextRequest() (captive portal DNS) because SOL devices connect to known networks — they don't need AP-mode captive portal. Upstream kept it active.
    • OTA define: Our fork used #ifndef WLED_DISABLE_OTA. Upstream changed this to #ifdef WLED_ENABLE_AOTA (opt-in rather than opt-out).
    • Network check: Our fork used WLED_CONNECTED. Upstream uses Network.isConnected() which is the newer, more reliable abstraction.
  • Decision:

    • Kept captive portal disabled (with comment explaining why).
    • Took upstream's #ifdef WLED_ENABLE_AOTA define — aligns with upstream's opt-in OTA model.
    • Took upstream's Network.isConnected() — it's the correct API going forward.
    • Note: Since we switched from WLED_DISABLE_OTA to WLED_ENABLE_AOTA, OTA will now be disabled by default unless WLED_ENABLE_AOTA is explicitly defined in the build flags. If OTA was previously working, we need to add -D WLED_ENABLE_AOTA to our build flags in platformio.ini or platformio_override.ini.

Test Plan

Before merging to main, the team should validate:

  • Build succeedspio run -e esp32dev compiles without errors
  • GridLights custom effects work — verify all SOL-specific effects (Custom Squares, Diamond Spin, Black Hole, Novas, SimpleStar, Merkabah, Nuke, etc.) still function correctly on hardware
  • Strobe/Hz effects timing — the upstream service loop timing rework may affect frequency-sensitive effects. Test Breathing Square Hz, Spiral Wave Hz, Pulsing Cross Hz, Moving Stripes Hz, Corner Flash Hz, and Static Hz Test
  • Effect numbering — confirm the web UI effect list is correct and that preset IDs still map to the right effects
  • Particle system effects — if desired, verify the new upstream particle effects (249–281) are accessible and functional
  • OTA behaviour — confirm whether ArduinoOTA is needed and add -D WLED_ENABLE_AOTA to build flags if so
  • Network connectivity — verify WiFi connection, API endpoints, and /json/info still work
  • No regression in SOL-29 — build version in /json/info still present

What's NOT in this merge

  • No changes to GridLights-specific effect logic (FX.cpp custom effect implementations)
  • No changes to GridLights CI/CD pipelines
  • No changes to board configuration or pin mappings
  • No changes to saved preset format or API contract (effect IDs preserved)

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added 30+ new LED animation effects, including black hole patterns, breathing shapes, spiral waves, pulsing crosses, and journey patterns
  • Improvements

    • Increased animation frame rate to 100 FPS for smoother motion
    • Added GridLights version identification to device information
    • Disabled DNS captive portal on WiFi access point
  • Chores

    • Simplified build configuration for primary device support

Michael Griffin and others added 25 commits November 26, 2024 02:44
- Add gridlights-build.yml GitHub Actions workflow that builds esp32dev
  on every push and pull request, with pip/platformio/.pio caching
- Add platformio_override.ini with GridLights hardware defaults:
  LED pin 4, 37x SK6812 RGBW, relay pin 5 (active low)
- Remove platformio_override.ini from .gitignore so board config is shared

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaced by gridlights-build.yml which uses non-deprecated action versions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Allows manual runs from the GitHub Actions tab.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The .bin lives at .pio/build/<env>/firmware.bin, not build_output/.
Also set if-no-files-found to error so a missing binary fails the build.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…bah, aHourglass, AlmostNuke, aNuke)

- Added 35 new effects in 7 families, each at 3/6/9/12/20 Hz variants
- Mode IDs 214-248, MODE_COUNT updated to 249
- Fixed Frame struct initializers from {data,60,N} to {data,37,1,60,N,255}
- Added missing aSidewaysMerkabah3 implementation
- Fixed duplicate aSidewaysMerkabah6 addEffect registration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds GRIDLIGHTS_VERSION build flag (2.2.1) to platformio_override.ini and
exposes it as gl_ver in the serializeInfo() response, distinct from the base
WLED ver field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fails any pull request targeting main where GRIDLIGHTS_VERSION in
platformio_override.ini has not been incremented relative to main.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace edge-triggered strobe toggle with wall-time computation:
  strobeState = (currentTime % cycleTime) < (cycleTime / 2)

The previous toggle approach fired at most once per FRAMETIME, capping
effective flicker frequency at ~1000/(2*FRAMETIME) Hz (~16Hz at 30fps).
The new approach derives strobe state directly from millis(), removing
the dependency on render-call frequency.

Also removes the now-unused lastStrobeTime static variable from both
mode_custom_diamond_spin and mode_black_hole_custom.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tization

SOL-2 Fix strobe frequency cap in Diamond Spin and Black Hole Custom
…ency-quantization

Revert "SOL-2 Fix strobe frequency cap in Diamond Spin and Black Hole Custom"
Merges latest Aircoookie/WLED main into test branch for team validation.
Conflict resolutions:
- platformio.ini: kept esp32dev as sole build target
- FX.h: kept GridLights custom modes (187-248), appended upstream particle modes (249-281)
- FX_fcn.cpp: took upstream improvements (allocateData, setPixelColor, service timing)
- wled.cpp: kept captive portal disabled, took upstream OTA/network changes
- wled-ci.yml: kept deleted (GridLights has own CI)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@eikerd eikerd closed this Apr 6, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a620b435-7779-4f74-ae94-00b37a291fc8

📥 Commits

Reviewing files that changed from the base of the PR and between 12f6fbc and 18bcb37.

⛔ Files ignored due to path filters (1)
  • firmware.bin is excluded by !**/*.bin
📒 Files selected for processing (10)
  • .github/workflows/gridlights-build.yml
  • .github/workflows/version-check.yml
  • .github/workflows/wled-ci.yml
  • .gitignore
  • platformio.ini
  • platformio_override.ini
  • wled00/FX.cpp
  • wled00/FX.h
  • wled00/json.cpp
  • wled00/wled.cpp

Walkthrough

The PR introduces GridLights-specific CI/build workflows, consolidates the default build environment to esp32dev, adds GridLights-specific PlatformIO configuration with hardware parameters and version, adds Frame-based pattern rendering and ~40 new LED effect modes including Hz-controlled variants, increases default FPS to 100, renumbers effect IDs and updates MODE_COUNT, exposes GridLights version in JSON output, and disables DNS captive portal functionality in the access point.

Changes

Cohort / File(s) Summary
CI and Build Configuration
.github/workflows/gridlights-build.yml, .github/workflows/version-check.yml, .github/workflows/wled-ci.yml (deleted), platformio.ini, platformio_override.ini, .gitignore
Added GridLights build workflow for esp32dev with artifact caching, added version check enforcing version bumps in PRs targeting main, removed old WLED CI workflow, consolidated default environments to esp32dev only, added GridLights configuration with LED/relay pins and version string, and untracked platformio_override.ini from version control.
LED Effect System
wled00/FX.cpp, wled00/FX.h
Implemented Frame-based pattern rendering core and ~40 new effect modes including breathing shapes, spiral waves, Hz-tested patterns, black holes, and journey-style effects; increased WLED_FPS from 42 to 100; renumbered effect ID macros, migrated particle modes to higher ID range (249–281), and updated MODE_COUNT from 220 to 282.
Version and Network
wled00/json.cpp, wled00/wled.cpp
Added gl_ver field to JSON info serialization; disabled DNS captive portal request processing and initialization in access point lifecycle.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • PacMan effect #4891: Modifies FX.cpp and FX.h to add new FX mode implementations and register them via setupEffectData(), directly overlapping code areas.
  • Adding Particle System with many new FX #4506: Modifies FX.h effect ID macros and renumbers particle-mode IDs, touching the same effect-ID namespace renumbering logic.
  • Add slow transition FX #5379: Adds and registers new FX modes in FX.cpp, updates MODE_COUNT and effect ID macros in FX.h, overlapping the effect subsystem modifications.

Suggested reviewers

  • DedeHai
  • softhack007
  • willmmiles
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants