naztronaut / dancyPi-audio-reactive-led

Real-time WS2812b LED strip music visualization using Python and the ESP8266 or Raspberry Pi.
https://www.easyprogramming.net/raspberrypi/audio_reactive_holiday_leds.php
MIT License
239 stars 87 forks source link

Support for RGBW #5

Closed NickSutton closed 4 years ago

NickSutton commented 4 years ago

Hi,

Got this up and running with a 60 pixel strip, only to find 45/60 LEDs would light. After a lot of searching I found this was because I’m running RGB code on a RGBW strip. Some alterations to the test code for neopixels confirmed all the LEDs to be working.

Is there a plan, or a way I can myself, adapt the code to support RGBW strips and not just RGB ones?

Thanks!

NickSutton commented 4 years ago

Hey, noted that the Arduino folder you include is quite dated. There’s a more recent one here: https://github.com/joeybab3/audio-reactive-led-strip

naztronaut commented 4 years ago

Hey there,

Thanks for pointing out that the repo is outdated. The NeoPixelBus that's included in the newer version looks like it can handle RGBW (https://github.com/Makuna/NeoPixelBus).

I will try to find some time to merge the new code into mine. Since I made a ton of updates, I can't do an automatic merge, so I'll need to sit down one day and go through the differences. I'll keep this issue open until I can get to it (unfortunately can't give an ETA right now).

The only issue is that I don't have an RGBW strip to test with :( so maybe after the update, I can ask you to help test ?

Thanks again :)

NickSutton commented 4 years ago

Hey, no problem in testing. I’ve installed the more recent library but still only getting 45/60 even after changing to NeoRgbwFeature... If I make any progress I’ll Post it up here. Cheers

NickSutton commented 4 years ago

Hi, looks like things are working properly now with all LEDs (60/60) working in RGBW.

The crux of the change seemed to be in the rpi_ws281x/python folder, where neopixel.py was edited so the Adafruit_NeoPixel object held the correct strip_type value (now W.S.SK6812_STRIP_RGBW)

Sudo setup.py install Followed and after that all seemed to work as required

git clone https://github.com/penfold42/rpi_ws281x.git --branch sk6812 cd rpi_ws281x scons cd python/ python setup.py install python examples/SK6812_strandtest.py

pbywater commented 4 years ago

@NickSutton Hi Nick, I'm currently also trying to get this working with an rgbw strip and am having a similar issue to you. I'm running the code on 300 pixels and only just over half of those are lighting up. I've been reading through your issues here but couldn't quite get the bottom of your solution.

Would you be able to give me any pointers at all? Where is the rpi_ws281x/python folder you mention? Any help would be hugely appreciated!!