WLED icon indicating copy to clipboard operation
WLED copied to clipboard

Support for multiple apa102 strips stopped working correctly in v0.15.x+

Open kylix-rd opened this issue 4 months ago • 13 comments

What happened?

Cannot add a 3rd strip of apa102 LEDs (option is disabled). Only the first apa102 strip works.

4-apa102 strips w/ 140 LEDs each

data/clock pins strip 0 - 15 4 strip 1 - 16 17 strip 2 - 5 18 strip 3 - 19 21

Each above line buffered through a 74HCT245 with series 100ohm resistor.

To Reproduce Bug

Attach 3+ apa102 strips to ESP32 with separate clock/data pins for each strip. Each strip contains 140 LEDs In LED settings page, you can add at most 2 apa102 strips and set the clock/data pins. Only the first strip works and lights up. Trying to add a 3rd apa102 strip fails because the apa102 option is disabled.

Expected Behavior

Up to v0.14.4, able to add 4 apa102 strips each containing 140 LEDs.

Install Method

Self-Compiled

What version of WLED?

v0.15.1+

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output


Anything else?

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

kylix-rd avatar Aug 22 '25 04:08 kylix-rd

APA102 use SPI driver. Only one HW SPI is avaiable and SW SPI has issues with recent versions (i.e. not enough CPU resources to drive glitch-free output).

blazoncek avatar Aug 22 '25 04:08 blazoncek

In version v0.14.x, it would (I presume) simulate spi on any set of pins. As stated in the bug, I was running 4 separate strips successfully. Where is this stated that only one apa102 strip is now supported? Why not leave the previous mechanisms in place and explain that it may be glitchy or run at lower frame-rates?

kylix-rd avatar Aug 22 '25 17:08 kylix-rd

I am merely stating facts. You are welcome to debug and provide hints on what to search for. APA102 code has not been modified in quite a while.

blazoncek avatar Aug 22 '25 18:08 blazoncek

In version v0.14.x, it would (I presume) simulate spi on any set of pins.

A lot has changed since then. There is always the option to keep running that version. We rather provide something stable than a somewhat stable version with glitches and having many reported issues to deal with.

DedeHai avatar Aug 22 '25 19:08 DedeHai

Given apa102 has much greater speed, why so few LEDs per pin?

netmindz avatar Aug 28 '25 05:08 netmindz

Given apa102 has much greater speed, why so few LEDs per pin?

It made running the wires a little simpler by breaking them up into separate channels. In hindsight, had I known this was the direction things were going, I might have done it a little differently. I've also looked over the changes and re-enabling the multiple bit-banged two-wire channels might be possible with a local patch.

kylix-rd avatar Aug 28 '25 21:08 kylix-rd

If someone will confirm that WLED with several APA102 strips works without issues when under heavy load (multiple web requests while having overlapping 2D segments and running computationally demanding effect like Soap), this is the line in settings_leds.htm that needs a change:

if (twopinB  >= 2)     disable(sel,'option[data-type="2P"]');

There are no restrictions in underlying code so upgrade from previous version should be unhindered until configuration is changed.

blazoncek avatar Aug 29 '25 07:08 blazoncek

If someone will confirm that WLED with several APA102 strips works without issues when under heavy load (multiple web requests while having overlapping 2D segments and running computationally demanding effect like Soap)

I wonder if the protocol is amenable to the same interrupt management logic that the WS2812 bit-banging code uses -- keep interrupts off while sending the data for one pixel, check for pending ISRs, repeat. If so, a small driver patch would clear it right up.

willmmiles avatar Aug 29 '25 13:08 willmmiles

Same problem for me.. I installed two strips on one esp32 and thought the hardware has broken. It is not easy for me to run a cable between the two strips.

sam9032 avatar Sep 04 '25 20:09 sam9032

@sam9032 there is nothing in the code that would prevent 2 APA102 outputs. You will need to help us debug the issue by installing debug build and monitoring serial output.

blazoncek avatar Sep 05 '25 05:09 blazoncek

@blazoncek i can try that.

sam9032 avatar Sep 05 '25 15:09 sam9032

I'm happy to hear I'm in good company. I had APA102s on multiple channels for cabinet lighting.

Home assistant automatically updated my device firmware. Sadly, something that has worked flawlessly for 4+ years broke with the 15.0 update.

I'd love a patch that would get me back in action.

beaubrewer avatar Oct 04 '25 03:10 beaubrewer

@blazoncek i can try that.

@sam9032 did you do any debugging on using more than one APA102 strips on multiple pins?

maxroseGIT avatar Dec 10 '25 20:12 maxroseGIT